21.03.2010, 12:18
Hello. I have wrote 3 commands. But then i write (in game) the reason (in /ban and /kick commands) it display incorrectl. Ex. /ban id God Mode. Then SendClientMessageToAll that NickName banned by Energy_Club,reason: God. And in third command then i write text, after space there will be nothing.Ex. /say Hello world. Players will see only Hello. may be you understand that after space in commands, text will not show for players.
Commands
Commands
Код:
if (strcmp("/kick", cmd, true) == 0) { if(pAdmin[playerid]<1)return 1; new pname[24],tname[24]; tmp=strtok(cmdtext,idx); if(!strlen(tmp))return SendClientMessage(playerid,0xffffff,"-/ /kick [id] [reason] \\-"; id=strval(tmp); tmp=strtok(cmdtext,idx); if(!strlen(tmp))return SendClientMessage(playerid,0xffffff,"-/ /kick [id] [reason] \\-"; if(IsPlayerConnected(id)) { GetPlayerName(playerid,pname,sizeof(pname)); GetPlayerName(id,tname,sizeof(tname)); format(string,sizeof(string),"-/ You was kicked by [%s] reason [%s] \\-",pname,tmp); SendClientMessage(playerid,COLOR_YELLOW,string); format(string,sizeof(string),"-/ Player [%s(ID:%i)] kicked by [%s] reason [%s] \\-",tname,id,pname,tmp); SendClientMessageToAll(COLOR_YELLOW,string); Kick(id); return 1; } else { SendClientMessage(playerid,0xffffff,"-/ iao aai \\-"; } } if(strcmp(cmd,"/say",true)==0) { if(pAdmin[playerid]>=1) { tmp = strtok(cmdtext,idx); if(!strlen(tmp)) { SendClientMessage(playerid,COLOR_GRAD1," Usage: /say [text]"; return 1; } format(string,sizeof(string),"say %s",tmp); SendRconCommand(string); } return 1; } if (strcmp("/ban", cmd, true) == 0) { if(pAdmin[playerid]<1)return 1; new pname[24],tname[24]; tmp=strtok(cmdtext,idx); if(!strlen(tmp))return SendClientMessage(playerid,0xffffff,"-/ /ban [id] [rs] \\-"; id=strval(tmp); tmp=strtok(cmdtext,idx); if(!strlen(tmp))return SendClientMessage(playerid,0xffffff,"-/ /ban [id] [rs] \\-"; if(IsPlayerConnected(id)) { GetPlayerName(playerid,pname,sizeof(pname)); GetPlayerName(id,tname,sizeof(tname)); format(string,sizeof(string),"-/ You was banned by [%s] reason [%s] \\-",pname,tmp); SendClientMessage(playerid,COLOR_YELLOW,string); format(string,sizeof(string),"-/ Player [%s(ID:%i)] banned by [%s] reason [%s] \\-",tname,id,pname,tmp); SendClientMessageToAll(COLOR_YELLOW,string); format(string,sizeof(string),"%s",tmp); BanEx(id,string); return 1; } else { SendClientMessage(playerid,0xffffff,"-/ iao aai \\-"; } }