Most of my commands come back with SERVER:Unknown command
#1

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.
Reply
#2

Your OnPlayerCommandPerformed return 1 ?
Reply
#3

What is OnPlayerCommandPerformed? And I;m using ZCMD and SSCANF1
Reply
#4

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'.
Reply
#5

Well convert OnPlayerCommandText to OnPlayerCommandPerformed(playerid, cmdtext[], success)

It's for ZCMD thing...
Reply
#6

So i'd just make it
pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
      return 1;
}
After forwading it?
Reply
#7

No, no forward, the forward is in ZCMD, On‌PlayerCommandPerformed = OnPlayerCommandText, but in ZCMD, do you understand ?
Reply
#8

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.
Reply
#9

Alright, can some one show me an example on how to use it?
Reply
#10

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).
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)