22.05.2011, 18:54
pawn Код:
dcmd_kick(playerid,params[])
{
if(AccInfo[playerid][LoggedIn] == 1)
{
if(AccInfo[playerid][Level] >= 3)
{
new Index;
new tmp[256]; tmp = strtok(params,Index);
new tmp2[256]; tmp2 = strtok(params,Index);
if(!strlen(params)) return
SendClientMessage(playerid, LIGHTBLUE2, "Usage: /kick [PlayerID] [Reason]") &&
SendClientMessage(playerid, orange, "Function: Will Kick the specified player");
new player1;
new string[128];
new playername[MAX_PLAYER_NAME];
new adminname [MAX_PLAYER_NAME];
player1 = strval(tmp);
if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && player1 != playerid && (AccInfo[player1][Level] != ServerInfo[MaxAdminLevel]))
{
GetPlayerName(player1, playername, sizeof(playername));
GetPlayerName(playerid, adminname, sizeof(adminname));
SendCommandToAdmins(playerid,"Kick");
if(!strlen(tmp2))
{
format(string,sizeof(string),"|- %s has been kicked by Administrator %s | Reason: Not Specified -|",playername,adminname);
SendClientMessageToAll(grey,string);
SaveIn("KickLog",string);
print(string);
return Kick(player1);
}
else
{
format(string,sizeof(string),"|- %s has been kicked by Administrator %s | Reason: %s -|",playername,adminname,params[2]);
SendClientMessageToAll(grey,string);
SaveIn("KickLog",string); print(string);
return Kick(player1);
}
}
else return ErrorMessages(playerid, 3);
}
else return ErrorMessages(playerid, 1);
}
else return SendClientMessage(playerid,red,"ERROR: You must be logged in to use this commands");
}