11.06.2016, 02:11
Help me in kick command there is a message but he/she didnt kicked in server
Sorry for my english
Sorry for my english
if(strcmp(cmd, "/kick", true) == 0) { if(IsPlayerConnected(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "USAGE: /kick [playerid/PartOfName] [reason]"); return 1; } giveplayerid = ReturnUser(tmp); if(IsPlayerNPC(giveplayerid)) return 1; if(PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pHelper] >= 4) { if(IsPlayerConnected(giveplayerid)) { if(giveplayerid != INVALID_PLAYER_ID) { GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); new length = strlen(cmdtext); while ((idx < length) && (cmdtext[idx] <= ' ')) { idx++; } new offset = idx; new result[96]; while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) { result[idx - offset] = cmdtext[idx]; idx++; } result[idx - offset] = EOS; if(!strlen(result)) { SendClientMessage(playerid, COLOR_WHITE, "USAGE: /kick [playerid/PartOfName] [reason]"); return 1; } new logstring[256]; new year, month, day; getdate(year, month, day); if(PlayerInfo[giveplayerid][pAdmin] > PlayerInfo[playerid][pAdmin]) { format(logstring, sizeof(logstring), "{AA3333}AdmCmd{FFFF00}: %s was kicked, reason: Attempting to kick admin %s (%d-%d-%d).", sendername, giveplayer,month,day,year); KickLog(logstring); format(string, sizeof(string), "{AA3333}AdmCmd{FFFF00}: %s was kicked, reason: Attempting to kick a higher admin.", sendername); SendClientMessageToAll(COLOR_LIGHTRED, string); SetTimerEx("GettingKicked", 2000, false, "i", giveplayer); return 1; } format(logstring, sizeof(logstring), "{AA3333}AdmCmd{FFFF00}: %s was kicked by %s, reason: %s (%d-%d-%d).", giveplayer, sendername, (result),month,day,year); KickLog(logstring); format(string, sizeof(string), "{AA3333}AdmCmd{FFFF00}: %s was kicked by %s, reason: %s", giveplayer, sendername, (result)); SendClientMessageToAll(COLOR_LIGHTRED, string); SetTimerEx("GettingKicked", 2000, false, "i", giveplayer); return 1; }
public GettingKicked(playerid) { Kick(playerid); }