20.06.2012, 14:33
Code:
CMD:slap(playerid, params[]) { if(PlayerInfo[playerid][AdminLevel] >= 1) { new id; if(!sscanf(params, "u", id)) { new Name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME], string[128], Float:px, Float:py, Float:pz; GetPlayerName(playerid, Name, sizeof(Name)); GetPlayerName(id, PlayerName, sizeof(PlayerName)); GetPlayerPos(id, px, py, pz); SetPlayerPos(playerid, px, py, pz+10); format(string, sizeof(string), "You have been slapped by administrator %s.", Name); SendClientMessage(id, 0xFFFFFFFF, string); format(string, sizeof(string), "You slapped %s.", PlayerName); SendClientMessage(playerid, 0xFFFFFFFF, string); return 1; } else return SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /slap [PlayerId/PartOfName]"); } else return SendClientMessage(playerid, 0xFFFFFFFF, "You are not admin of this great community.."); }