else if(strcmp(cmd, "h", true) == 0) {
tmp = strtok(cmdtext,idx);
if(PlayerInfo[playerid][Spawned] == 0) SendClientMessage(playerid,COLOR_RED,"Error: You need to spawn first !");
else if(PlayerInfo[playerid][Logged] != 1) SendClientMessage(playerid, COLOR_RED, "Error: You need to login first!");
else if(PlayerInfo[playerid][Status] == 0) SendClientMessage(playerid, COLOR_RED, "Error: Only Humans/Infects can use the Zombie Chat !");
else if (!strlen(tmp)) SendClientMessage(playerid,COLOR_GREEN,"Error: /c h [text] !");
else {
for(new allh = 0; allh <= MAX_PLAYERS; allh++) {
if(PlayerInfo[allh][Status] == 1 || PlayerInfo[allh][Status] == 2) {
new string[256];
format(string,sizeof(string),">>Human Chat - %s : %s <<",gPlayers[playerid],cmdtext[strlen(tmp)+5]);
SendClientMessage(allh,COLOR_HUMAN,string);
}
}
}
return 1;
}
How can i made this to work ? ...
The command work , but ... (look at the picture) :
When I typed "Why this not work ?" in chat appear just "is not work ?"
When I typed "yes" in chat appear just "s"
When I typed "da" (da = yes), in chat not appear .
I know, the problem is from this: cmdtext[strlen(tmp)+5] , but i don't know how need to be exactly for can appear all reason.
I never understood this.