03.09.2012, 09:13
if(strcmp(cmd, "/kick", true) == 0) {
if(PlayerInfo[playerid][Level] >= 1) {
new tmp[256];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, red, "{FF0000}Usage: {AAAAAA} /kick [playerid] [reason]");
return 1; }
new player1;
player1 = strval(tmp);
if(!IsPlayerConnected(player1) || player1 == INVALID_PLAYER_ID || (PlayerInfo[player1][Level] == ServerInfo[MaxAdminLevel]) ) {
SendClientMessage(playerid,red,"{FF0000}ERROR: {AAAAAA}: Player is not connected or is yourself");
return 1; }
tmp = strtok(cmdtext, idx);
GetPlayerName(player1, playername, sizeof(playername)); GetPlayerName(playerid, adminname, sizeof(adminname));
CMDMessageToAdmins(playerid,"KICK");
format(string,256,"{FF0000} %s has been kicked by %s reason: %s ",playername,adminname,cmdtext[7]); SendClientMessageToAll(grey,string);
SaveToFile("KickLog",string); Kick(player1);
} else {
SendClientMessage(playerid,red,NO_PERM); }
return 1; }
whats the prblem?
if(PlayerInfo[playerid][Level] >= 1) {
new tmp[256];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, red, "{FF0000}Usage: {AAAAAA} /kick [playerid] [reason]");
return 1; }
new player1;
player1 = strval(tmp);
if(!IsPlayerConnected(player1) || player1 == INVALID_PLAYER_ID || (PlayerInfo[player1][Level] == ServerInfo[MaxAdminLevel]) ) {
SendClientMessage(playerid,red,"{FF0000}ERROR: {AAAAAA}: Player is not connected or is yourself");
return 1; }
tmp = strtok(cmdtext, idx);
GetPlayerName(player1, playername, sizeof(playername)); GetPlayerName(playerid, adminname, sizeof(adminname));
CMDMessageToAdmins(playerid,"KICK");
format(string,256,"{FF0000} %s has been kicked by %s reason: %s ",playername,adminname,cmdtext[7]); SendClientMessageToAll(grey,string);
SaveToFile("KickLog",string); Kick(player1);
} else {
SendClientMessage(playerid,red,NO_PERM); }
return 1; }
whats the prblem?