Unknown command help
#1

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

return true at the end of the cmds and at the end of the callback onplayercommandtext return false
Reply
#3

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

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;
    }
Reply
#5

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
Reply
#6

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


Forum Jump:


Users browsing this thread: 1 Guest(s)