25.09.2011, 14:43
Hello, I am confused, Could someone help me change this /slap command so that it also shows the Reason
Example: %s was slapped by %s, Reason: %s
Example: %s was slapped by %s, Reason: %s
pawn Код:
if(strcmp(cmd, "/slap", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /slap [PlayerID/PartOfName]");
return 1;
}
new playa;
new Float:slx, Float:sly, Float:slz;
playa = ReturnUser(tmp);
if(PlayerInfo[playerid][pAdmin] >=2)
{
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if(PlayerInfo[playa][pAdmin] > PlayerInfo[playerid][pAdmin])
{
format(string, sizeof(string), "Server: %s was {FFAF00}Slapped {C77D87}by Mr_Dick, reason: Attempting to slap a higher admin.", sendername);
ABroadCast(COLOR_LIGHTRED, string, 1);
GetPlayerPos(playerid, slx, sly, slz);
SetPlayerPos(playerid, slx, sly, slz+5);
PlayerPlaySound(playerid, 1130, slx, sly, slz+5);
return 1;
}
GetPlayerPos(playa, slx, sly, slz);
SetPlayerPos(playa, slx, sly, slz+5);
PlayerPlaySound(playa, 1130, slx, sly, slz+5);
format(string, sizeof(string), "Server: %s was {FFAF00}Slapped {C77D87}by %s.",giveplayer ,sendername);
ABroadCast(COLOR_LIGHTRED,string,1);
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
}
}
return 1;
}