Reason
#6

pawn Код:
CMD:kick(playerid, params[])
{
if(GetPVarInt(playerid, "Admin") != 1) return 0;
{
new string[128];
format(string, sizeof(string), "You cant use that command you are not that level");
SendClientMessage(playerid, COLOR_ORANGE, string);
}
else
{
new tmp[256], tmp2[256], index, id;
tmp = strtok(params, index);
tmp2 = strtok(params, index);

if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_ORANGE, "[KICK] Usage: /kick [ID] [REASON]");
}
else if(!strlen(tmp2))
{
SendClientMessage(playerid, COLOR_ORANGE, "[KICK] Usage: /kick [ID] [REASON]");
}
else
{
id = strval(tmp);
if(!IsPlayerConnected(id))
{
SendClientMessage(playerid, COLOR_ORANGE, "[KICK] That player is not connected.");
}
else if(id == playerid)
{
SendClientMessage(playerid, COLOR_ORANGE, "[KICK] You can't kick yourself.");
}
else if(gPlayerInfo[id][PLAYER_LEVEL] > gPlayerInfo[playerid][PLAYER_LEVEL])
{
SendClientMessage(playerid, COLOR_ORANGE, "[KICK] That player has a higher level than you.");
}
else
{
new string[256], name[MAX_PLAYER_NAME];
GetPlayerName(id, name, sizeof(name));
if(id >= 0 && id <= 9)
{
format(string, sizeof(string), "[KICK] You have been kicked. Reason: %s.", params[2]);
SendClientMessage(id, COLOR_ORANGE, string);
Kick(id);
format(string, sizeof(string), "[KICK] Player %s has been kicked. Reason: %s.", name, params[2]);
SendClientMessageToAll(COLOR_ORANGE, string);
}
else if(id >= 10 && id <= 99)
{
format(string, sizeof(string), "[KICK] You have been kicked. Reason: %s.", params[3]);
SendClientMessage(id, COLOR_ORANGE, string);
Kick(id);
format(string, sizeof(string), "[KICK] Player %s has been kicked. Reason: %s.", name, params[3]);
SendClientMessageToAll(COLOR_ORANGE, string);
}
}
}
}
return 1;
}
NOT TESTED
Reply


Messages In This Thread
Reason - by Tomer!.$ - 28.04.2012, 06:54
Re: Reason - by Twisted_Insane - 28.04.2012, 06:58
Re: Reason - by Tomer!.$ - 28.04.2012, 07:04
Re: Reason - by James Coral - 28.04.2012, 07:06
Re: Reason - by Tomer!.$ - 28.04.2012, 07:11
Re: Reason - by James Coral - 28.04.2012, 07:12
Re: Reason - by Tomer!.$ - 28.04.2012, 07:17
Re: Reason - by James Coral - 28.04.2012, 07:18

Forum Jump:


Users browsing this thread: 3 Guest(s)