14.10.2009, 12:59
Cand someone help me in my disarm .
When i use the command it only works on my or id 0
When i use the command it only works on my or id 0
Код:
if(strcmp(cmd, "/disarm", true) == 0) // Reset the player's weapons { if (PlayerInfo[playerid][pAdmin] >= 1) { new giveplayerid; new giveplayer[MAX_PLAYER_NAME]; new sendername[MAX_PLAYER_NAME]; new giveplayername[MAX_PLAYER_NAME]; tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_LIGHT_BLUE, "USAGE: /disarm [playername/id]"); SendClientMessage(playerid, COLOR_LIGHT_BLUE, "FUNCTION: Will disarm the player."); return 1; } if(giveplayerid != INVALID_PLAYER_ID) { GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername)); GetPlayerName(playerid, sendername, sizeof(sendername)); ResetPlayerWeapons(giveplayerid); format(string, sizeof(string), "-| Administrator %s disarmed %s |-",sendername, giveplayername); ABroadCast(COLOR_YELLOW,string,1); } else if(giveplayerid == INVALID_PLAYER_ID) { format(string, sizeof(string), "%d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_LIGHT_BLUE, string); } } else SendClientMessage(playerid, COLOR_LIGHT_BLUE, "You are not an admin with the required level."); return 1; }