
Untitled
By: a guest on
Mar 24th, 2012 | syntax:
None | size: 0.89 KB | hits: 57 | expires: Never
CMD:slap(playerid, params[])
{
new idx,tmp[32];
new giveplayerid, string[256];
tmp = strtok(params, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GREY, "USAGE: /slap [playerid]");
return 1;
}
giveplayerid = strval(tmp);
new Float:x, Float:y, Float:z;
GetPlayerPos(giveplayerid, x, y, z);
new Float:giveplayerhealth;
GetPlayerHealth(giveplayerid, giveplayerhealth);
if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 101)
{
SetPlayerPos(giveplayerid, x, y, z+10.0);
SetPlayerHealth(giveplayerid, giveplayerhealth-5.0);
format(string, sizeof(string), "[OperServ] %s Has been slapped by admin %s", PlayerName[giveplayerid], PlayerName[playerid]);
SendClientMessageToAll(COLOR_RED, string);
}
else
{
SendClientMessage(playerid, COLOR_GREY, "You are not allowed to use this command.");
}
return 1;
}