15.05.2012, 12:37
Try This
Код:
CMD:slapid(playerid, params[]) { if (PlayerInfo[playerid][pAdmin] >=4) { new string[128], giveplayerid; if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /slapid [playerid]"); new Float:shealth; new Float:slx, Float:sly, Float:slz; if(IsPlayerConnected(giveplayerid)) { 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); } } else { SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!"); } return 1; }