29.10.2015, 16:40
Quote:
Try this..
Код:
CMD:kick(playerid, params[]) { new toplayerid, reason[24], string[126]; if(!Player[playerid][Admin] >= 1) return SendClientMessage(playerid, color_grey, "You are not authorized to use that command."); if (sscanf(params, "ii", toplayerid, reason)) { SendClientMessage(playerid, color_grey, "UTILIZARE:/kick <playerid/name> <motiv>"); } format(string, sizeof(string), "%s has been kicked by %s, reason: %s", toplayerid, playerid, reason); SendClientMessageToAll(color_red, string); Kick(toplayerid); return 1; } |
Quote:
Scripting for money , except Mysql and textdraws , I can script everything. |
PHP код:
sscanf(params, "ii", toplayerid, reason)
And this signature tho, You can't even use sscanf..
I wont be pussy here so..
Lemme post something to help topic owner.
PHP код:
CMD:kick(playerid, params[])
{
new id, reason[24];
if(sscanf(params, "us[24]", id, reason)) return SendClientMessage(playerid, color_grey, "UTILIZARE:/kick <playerid/name> <motive>");
else if(Player[playerid][Admin] < 1) return SendClientMessage(playerid, color_grey, "You are not authorized to use that command.");
else if(!IsPlayerConnected(id)) return SendClientMessage(playerid, color_grey, "Invalid Player.");
else
{
new tmpstr[128], pName[MAX_PLAYER_NAME], aName[MAX_PLAYER_NAME];
GetPlayerName(id, pName, sizeof(pName));
GetPlayerName(playerid, aName, sizeof(aName));
format(tmpstr, sizeof(tmpstr), "%s has been kicked by %s, reason: %s", pName, aName, reason);
SendClientMessageToAll(color_red, tmpstr);
Kick(id);
}
return 1;
}