SA-MP Forums Archive
Unknown command help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Unknown command help (/showthread.php?tid=92978)



Unknown command help - string227 - 22.08.2009

Well there are 2 things wrong here.

Every someone types in a command, it sends the text in the sendclientmessage like normal, but then it also sends in the /job commands and the Server: Unknown command too. For example:

1. You type in /help
2. The server sends you the help commands i put in with SendClientMessage();
3. After that it says: ==== (job description) === for some odd reason
4. Then at the end it says: Server: Unknown Command.


Please help me out here, it gets annoying as it cludders the players screen with all of it.

Also would it be too much to ask on if a player dies, how to force the player to a zombie class when it gets killed by a zombie team member and to disable team killing.


Re: Unknown command help - agusfn20 - 22.08.2009

return true at the end of the cmds and at the end of the callback onplayercommandtext return false


Re: Unknown command help - ronyx69 - 22.08.2009

All commands should return 1 and at the end of the OnPlayerCommandText it should return 0


Re: Unknown command help - Memoryz - 22.08.2009

Lolz, i had the same problem.

At the end of each command, add
pawn Код:
return 1;
Here, i'll do the first one for ya:

pawn Код:
if(strcmp(cmdtext, "/help", true) == 0)
    {
    SendClientMessage(playerid,COLOR_GREY,"Your commands: /animlist, /kill, /menu, /colors, /rules, /job");
    return 1;
    }



Re: Unknown command help - dice7 - 22.08.2009

Also, learn to nest. Your script is currenlty like, when you type /help or /job, it will send the message.
Then It will compare gTeam[playerid] to other teams and send messages around


Re: Unknown command help - string227 - 22.08.2009

Quote:
Originally Posted by Memoryz
Lolz, i had the same problem.

At the end of each command, add
pawn Код:
return 1;
Here, i'll do the first one for ya:

pawn Код:
if(strcmp(cmdtext, "/help", true) == 0)
    {
    SendClientMessage(playerid,COLOR_GREY,"Your commands: /animlist, /kill, /menu, /colors, /rules, /job");
    return 1;
    }
thanks. Well the return 1; issue solved all of the problems.