COMMAND:kick(playerid, params[])
{
new targetid[MAX_PLAYER_NAME], string[128];
if(PlayerInfo[playerid][pAdmin] >= 1)
if(sscanf(params, "ui", targetid)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /kick [playerid] [reason]");
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_RED, "This player is not online.");
{
GetPlayerName(playerid, targetid, sizeof targetid);
format(string,sizeof string,"[OOC] %s: %s",targetid, string);
SendAdminMessage(COLOR_YELLOW,string);
Kick(targetid);
return 1;
}
}
//
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];
GetPlayerName(playerid, szName, sizeof szName);
format(szMessage,sizeof szMessage,"[OOC] %s: %s",szName, string);
SendAdminMessage(COLOR_YELLOW,szMessage);
Kick(targetid);
return 1;
}
else
return SendClientMessage(playerid, COLOR_RED, "This player is not online."), 1;
}
return 1;
}
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;
}
How do i make this:
pawn Code:
"AdmCmd: %s, has kicked %s reason: %s" |
GetPlayerName(playerid, admin, reason); format(szMessage,sizeof szMessage,"AdmCmd: %s, has kicked %s reason: %s",admin, string, reason);
COMMAND:kick(playerid, params[])
{
new targetid, admin, reason, 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, admin, string, reason);
format(szMessage,sizeof szMessage,"AdmCmd: %s, has kicked %s reason: %s",admin, string, reason);
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;
}
}
COMMAND:kick(playerid, params[])
{
new targetid, admin, reason, 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, admin, string, reason);
format(szMessage,sizeof szMessage,"AdmCmd: %s, has kicked %s reason: %s",admin, string, reason);
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;
}
}
CMD:kick(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 1) { new P; new reason[64]; new str[128]; new Playername[MAX_PLAYER_NAME], Adminname[MAX_PLAYER_NAME]; GetPlayerName(playerid, Adminname, sizeof(Adminname)); //defines the function with the adminname we wanna get GetPlayerName(P, Playername, sizeof(Playername)); if(sscanf(params, "us[64]", P,reason)) return SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /kick [playerid] [reason]"); if(!IsPlayerConnected(P)) return SendClientMessage(playerid, COLOR_GREY, "Player is not connected!"); format(str, sizeof(str), "'%s' has been kicked by administrator '%s'. Reason: %s ", Playername, Adminname, reason); SendClientMessageToAll(COLOR_RED, str); Kick(P); } else { SendClientMessage(playerid, COLOR_GREY, "You have to be level 1 to use that command!"); } return 1; }