24.03.2010, 17:42
Hi i cant get this cmd to work it just keeps sending a message /explode [id] [reason] any ideas
Код:
if(strcmp(cmd, "/explode", true) == 0) { if(logged[playerid] == 1) { if(adminlevel[playerid] >= 3) { new tmp1[256], tmp2[256]; tmp1 = strtok(cmdtext, idx), tmp2 = strtok(cmdtext, idx); if(!strlen(tmp)) return SendClientMessage(playerid, red, "USAGE: /explode [playerid] [reason]"); new player1, adminname[MAX_PLAYER_NAME]; player1 = strval(tmp); if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && adminlevel[player1] != 4 ) { GetPlayerName(player1, playername, sizeof(playername)); GetPlayerName(playerid, adminname, sizeof(adminname)); new Float:burnx, Float:burny, Float:burnz; GetPlayerPos(player1,burnx, burny, burnz); CreateExplosion(burnx, burny , burnz, 7,10.0); if(strlen(tmp2)) { format(string,sizeof(string),"You have been exploded by Administrator %s [reason: %s]",adminname,tmp2); SendClientMessage(player1,blue,string); format(string,sizeof(string),"You have exploded %s [reason: %s]", playername,tmp2); return SendClientMessage(playerid,blue,string); } else { format(string,sizeof(string),"You have been exploded by Administrator %s",adminname); SendClientMessage(player1,blue,string); format(string,sizeof(string),"You have exploded %s", playername); return SendClientMessage(playerid,blue,string); } } else return SendClientMessage(playerid, red, "Player is not connected or is the highest level admin"); } else return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command"); } else return SendClientMessage(playerid,red,"ERROR: You must be logged in to use this commands"); }