PDA

View Full Version : Most of my commands come back with SERVER:Unknown command


Azzeto
11/10/2011, 03:59 PM
Alot of my commands come back with SERVER:Unknown commands ever the ones with return 1; after it, for example.

CMD:help(playerid,params[]){
SendClientMessage(playerid,COLOR_WHITE,"|__Help Commands__|");
SendClientMessage(playerid,COLOR_GRAY,"/kill - /shop - /KPHelp - /me - /do - /rules");
return 1;
}
Theres an example of one.

aRoach
11/10/2011, 04:05 PM
Your OnPlayerCommandPerformed return 1 ?

Azzeto
11/10/2011, 04:08 PM
What is OnPlayerCommandPerformed? And I;m using ZCMD and SSCANF1

LetsOWN[PL]
11/10/2011, 04:09 PM
OnPlayerCommandPerformed returns the message (either your own or samp's default), when you write command that doesnt exists...

Try to find out this public, and see, if there is 'return 0'. If yes, set it to 'return 1'.

aRoach
11/10/2011, 04:10 PM
Well convert OnPlayerCommandText to OnPlayerCommandPerformed(playerid, cmdtext[], success)

It's for ZCMD thing...

Azzeto
11/10/2011, 04:19 PM
So i'd just make it public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
return 1;
}
After forwading it?

aRoach
11/10/2011, 04:22 PM
No, no forward, the forward is in ZCMD, OnPlayerCommandPerformed = OnPlayerCommandText, but in ZCMD, do you understand ?

LetsOWN[PL]
11/10/2011, 04:23 PM
No, 'forward' is not required for it.
If you click "New" in pawno.exe, this public should appears automatically.

public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
return 1;
}
Yes, it should look like this. But remamber: First try to find out, if this public is already in your .pwn. If not - paste it :P

@Edit: Oh, i wrote in same time as you, aRoach.

Azzeto
11/10/2011, 04:25 PM
Alright, can some one show me an example on how to use it?

LetsOWN[PL]
11/10/2011, 04:31 PM
How to use OnPlayerCommandPerformed?
Uh, I dunno what are you need it for..
But.

public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
new message[128];

if(!success)
{
format(message, sizeof(message), "%s ist kaputt (lol)", cmdtext);
GameTextForPlayer(playerid, message, 3000, 3);
}

return 1;
}

Now the server will return "(command you've provided) ist kaputt" when the command is incorrect and/or is not wrote in gamemode (IT could be wrote in e.g. filterscript, but server will return this message anyways - well, for me it did).