23.12.2013, 11:54
Not exactly in one line. In some cases you need to send more than 2 messages with the name to the player who typed the command or others (to all).
A better example would be:
A better example would be:
pawn Code:
CMD:kick(playerid, params[])
{
new
id,
reason[100];
if (sscanf(params, "rs[100]", id, reason)) return // syntax..
// ...
new
string[128],
ip[16];
GetPlayerIp(id, ip, 16);
format(string, sizeof (string), "You have been kicked by %s. Reason: %s", GetName(playerid), reason);
SendClientMessage(id, -1, string);
format(string, sizeof (string), "You kicked %s. Reason: %s", GetName(id), reason);
SendClientMessage(playerid, -1, string);
format(string, sizeof (string), "%s kicked %s. Reason: %s", GetName(playerid), GetName(id), reason);
SendClientMessageToAll(id, -1, string);
format(string, sizeof (string), "%s kicked %s [IP: %s]. Reason: %s", GetName(playerid), GetName(id), ip, reason);
SendMessageToAdmins(-1, string);
// kick player..
return 1;
}