17.11.2013, 06:57
pawn Код:
#define CMDLEVEL(%0) if(PlayerInfo[playerid][pAdmin] < %0) SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
CMD:aslap(playerid, params[])
{
CMDLEVEL(2);
if(!PlayerInfo[playerid][pAdminDuty]) return SendClientMessageEx(playerid, COLOR_GRAD2, "You can't do this whilst your off Duty!");
new giveplayerid;
if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /aslap [player]");
if(IsPlayerConnected(giveplayerid))
{
new string[128], Float:shealth, Float:slx, Float:sly, Float:slz;
GetPlayerHealth(giveplayerid, shealth);
SetPlayerHealth(giveplayerid, shealth-5);
GetPlayerPos(giveplayerid, slx, sly, slz);
SetPlayerPos(giveplayerid, slx, sly, slz+5);
PlayerPlaySound(giveplayerid, 1130, slx, sly, slz+5);
format(string, sizeof(string), "AdmCmd: %s was slapped by %s",GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid));
ABroadCast(COLOR_LIGHTRED,string,2);
}
return 1;
}