29.01.2011, 20:36
Mean, changing the reason to a number won't do anything.
First off, this won't work with the sscanf 2.0 plugin because strings must have a length, so the command should be
First off, this won't work with the sscanf 2.0 plugin because strings must have a length, so the command should be
pawn Код:
CMD:kick(playerid, params[])
{
if(helper[playerid] == 0) return SendClientMessage(playerid, 0xAAAAAA, "You need to be helper to use this");
new giveplayerid, reason[20];
if(sscanf(params, "us[20]", giveplayerid, reason)) return SendClientMessage(playerid, 0xAAAAAA, "Usage: /kick [ID] [Reason]");
//If you want the reason to be optional, replace the "us[20]" above with "uS[20]"
new string[128];
new pName[24], aName[24];
GetPlayerName(playerid, aName, 24);
GetPlayerName(giveplayerid, pName, 24);
format(string, sizeof(string), "Admin %s has kicked %s. Reason: %s", aName, pName, reason);
//If you made the reason optional, replace the above line with this one:
//format(string, sizeof(string), "Admin %s has kicked %s. %s%s", aName, pName, reason[0] ? ("[Reason:]") : (" "), reason);
SendClientMessageToAll(0xAAAAAA, string);
Kick(giveplayerid);
return 1;
}