19.10.2013, 18:11
If you download sscanf plugin by ******, you can do this which is a lot easier:
And here's a proper kick command that you might like too, made this in the 240 seconds of waiting between posts .
pawn Код:
CMD:kick(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, -1, "Admins only.");
new targetid;
if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, -1, "Syntax: /kick [playerid/name]");
Kick(targetid);
return 1;
}
pawn Код:
CMD:kick(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, -1, "Admins only.");
new targetid, reason[50];
if(sscanf(params, "us[50]", targetid, reason)) return SendClientMessage(playerid, -1, "Syntax: /kick [playerid/name] [reason]");
if(targetid == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "Error: Player not connected.");
new string[100], sendername[MAX_PLAYER_NAME], receivername[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(targetid, receivername, sizeof(receivername));
format(string, sizeof(string), "%s has been kicked by %s, reason: %s", receivername, sendername, reason);
SendClientMessageToAll(COLOR_WHITE, string);
return 1;
}