07.10.2012, 16:53
How do i make this:
Get the players name that the admin will kick too?
"AdmCmd: %s, has kicked %s reason: %s"
pawn Code:
COMMAND:kick(playerid, params[])
{
new targetid, string[128], szName[MAX_PLAYER_NAME];
if(PlayerInfo[playerid][pAdmin] >= 1)
{
if(sscanf(params, "us[128]", targetid, string)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /kick [playerid] [reason]");
if(IsPlayerConnected(targetid))
{
new szMessage[128], szMessage2[128];
GetPlayerName(playerid, szName, sizeof szName);
format(szMessage,sizeof szMessage,"AdmCmd: %s, has kicked %s reason: %s",szName, string);
format(szMessage2,sizeof szMessage2,"Admin: %s, has has kicked you, reason: %s",szName, string);
SendAdminMessage(COLOR_YELLOW,szMessage);
SendClientMessage(targetid, COLOR_YELLOW, szMessage2);
Kick(targetid);
return 1;
}
else
return SendClientMessage(playerid, COLOR_RED, "This player is not online."), 1;
}
return 1;
}
"AdmCmd: %s, has kicked %s reason: %s"