05.03.2013, 19:50
Hi guys, here is my /Kick command, I want to do that if Admin kick a player, the player will become a dialog (showplayerdialog)
My kick code:
My kick code:
Код:
if(strcmp(cmd, "/kick", true) == 0) // Kicks the player from the server { new reason[128]; if (AccountInfo[playerid][AdminLevel] >= 3 || IsPlayerAdmin(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, ORANGE, "USAGE: /kick [name/id] [reason]"); return true; } new giveplayername[MAX_PLAYER_NAME]; new playername[MAX_PLAYER_NAME]; new giveplayerid = ReturnUser(tmp); if(giveplayerid != INVALID_PLAYER_ID) { GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername)); GetPlayerName(playerid, playername, sizeof(playername)); reason = bigstrtok(cmdtext, idx); if(!strlen(reason)) return SendClientMessage(playerid, ORANGE, "USAGE: /kick [name/id] [reason]"); format(string2, sizeof(string2), "ADMIN: Admin %s has kicked %s. [Grund: %s ]", playername, giveplayername, reason); SendClientMessageToAll(ABLAU, string,string2); format(string,sizeof(string), "5ADMIN: Admin %s has kicked %s. [Reason: %s ]", playername, giveplayername, reason); Kick(giveplayerid); KickLog(string); } else if(giveplayerid == INVALID_PLAYER_ID) { format(string2, sizeof(string2), "Error: %i isn't an active player.", giveplayerid); SendClientMessage(playerid, ROT, string,string2); } } else SendClientMessage(playerid, ROT, "Error: You aren't authorized to use this command!"); return true; }