19.09.2011, 15:13
pawn Код:
if(strcmp(cmd, "/Kick", true) == 0)
{
new string[128];
new tmp[256];
new player[MAX_PLAYER_NAME], kickplayer[MAX_PLAYER_NAME];
new kickplayerid;
tmp = strtok(cmdtext, idx);
kickplayerid = strval(tmp);
if(PlayerInfo[playerid][AdminLevel] == 1)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, ORANGE, "USAGE: /kick [playerid].");
SendClientMessage(playerid, ORANGE, "FUNCTION: Kick a player.");
}
tmp = strtok(cmdtext, idx);
GetPlayerName(kickplayerid, kickplayer, sizeof(kickplayer));
GetPlayerName(playerid, player, sizeof(player));
printf("Admin %s Has Kicked %s.", player, kickplayer);
format(string, sizeof(string), "You Have Been Kicked By %s.", player);
SendClientMessage(kickplayerid, 0x00c2ecff, string);
format(string, sizeof(string), "You Have Kicked %s.", kickplayer);
SendClientMessage(playerid, 0x00c2ecff, string);
Kick(kickplayerid);
}
else // <----------- wtf
{
format(string, sizeof(string), "%i is not online right now, Sorry.", kickplayerid);
SendClientMessage(playerid, 0x00c2ecff, string);
}
}
else // <------------ wtf
{
SendClientMessage(playerid, 0xE6000FF, "You Are Not A Moderator!");
}