04.02.2012, 09:30
Hi there, how to check if a reason for this /kick is given?
I mean, how to make it so that if no reason is given it will send No Reason Given
I mean, how to make it so that if no reason is given it will send No Reason Given
pawn Код:
CMD:kick(playerid, params[])
{
new id;
new reason;
if(PlayerInfo[playerid][AdminLevel] >= 1)
{
if(!sscanf(params, "uz", id, reason))
{
new string[256];
new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(id, PlayerName, sizeof(PlayerName));
format(string, sizeof(string), "Administrator %s has just kicked %s for reason %s", name, PlayerName, reason);
ProxDetector(10000000000.0, playerid, string, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF, 0xFF0000FF);
Kick(id);
return 1;
}
else return SendClientMessage(playerid, 0xD8D8D8FF, "USAGE: /kick [PlayerId/PartOfName] (Reason)");
}
else return SendClientMessage(playerid, 0xD8D8D8FF, "You are not allowed to use this command.");
}