Most of my commands come back with SERVER:Unknown command -
Azzeto - 11.10.2011
Alot of my commands come back with SERVER:Unknown commands ever the ones with return 1; after it, for example.
pawn Код:
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.
Re: Most of my commands come back with SERVER:Unknown command -
aRoach - 11.10.2011
Your OnPlayerCommandPerformed return 1 ?
Re: Most of my commands come back with SERVER:Unknown command -
Azzeto - 11.10.2011
What is OnPlayerCommandPerformed? And I;m using ZCMD and SSCANF1
Re: Most of my commands come back with SERVER:Unknown command -
LetsOWN[PL] - 11.10.2011
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'.
Re: Most of my commands come back with SERVER:Unknown command -
aRoach - 11.10.2011
Well convert OnPlayerCommandText to OnPlayerCommandPerformed(playerid, cmdtext[], success)
It's for ZCMD thing...
Re: Most of my commands come back with SERVER:Unknown command -
Azzeto - 11.10.2011
So i'd just make it
pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
return 1;
}
After forwading it?
Re: Most of my commands come back with SERVER:Unknown command -
aRoach - 11.10.2011
No, no forward, the forward is in ZCMD, OnPlayerCommandPerformed = OnPlayerCommandText, but in ZCMD, do you understand ?
Re: Most of my commands come back with SERVER:Unknown command -
LetsOWN[PL] - 11.10.2011
No, 'forward' is not required for it.
If you click "New" in pawno.exe, this public should appears automatically.
pawn Код:
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.
Re: Most of my commands come back with SERVER:Unknown command -
Azzeto - 11.10.2011
Alright, can some one show me an example on how to use it?
Re: Most of my commands come back with SERVER:Unknown command -
LetsOWN[PL] - 11.10.2011
How to use OnPlayerCommandPerformed?
Uh, I dunno what are you need it for..
But.
pawn Код:
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).