17.01.2013, 22:43
I have two problems with this command that I made..
When I do /kick to a player's ID that isn't my own, it still kicks me from the server.
Also, when I do kick myself, it doesn't tell the reason of why the person was kicked and would just appear as..
"Administrator Noles2197 kicked Noles2197 for"
Help please!
When I do /kick to a player's ID that isn't my own, it still kicks me from the server.
Also, when I do kick myself, it doesn't tell the reason of why the person was kicked and would just appear as..
"Administrator Noles2197 kicked Noles2197 for"
Help please!
pawn Код:
#include <zcmd>
#include <sscanf2>
pawn Код:
CMD:kick(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] > 0)
{
new Name[MAX_PLAYER_NAME], KickMessage[128];
new Name2[MAX_PLAYER_NAME], id, reason[128];
GetPlayerName(playerid,Name, sizeof(Name));
GetPlayerName(id,Name2, sizeof(Name2));
if(sscanf(params,"u",playerid)) return SendClientMessage(playerid, COL_RED,"/kick ID reason");
format(KickMessage, sizeof(KickMessage), "Administrator %s kicked %s for %s", Name, Name2, reason);
SendClientMessageToAll(COL_WHITE, KickMessage);
Kick(id);
}
return 1;
}