31.01.2016, 12:06
Код:
CMD:slap(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 1) { new id,Float:x,Float:y,Float:z,name[MAX_PLAYER_NAME],msg[128], reason[64], string[128], idname[MAX_PLAYER_NAME]; if(sscanf(params,"us[32]",id, reason)) return SendClientMessage(playerid,-1,"Usage: /slap [id] [reason]"); else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid,-1,"Player is not connected anymore!"); else { GetPlayerName(id, name, MAX_PLAYER_NAME); format(string, sizeof(string), "AdmCmd: You have successfully slapped %s, reason: %s", name, reason); SendClientMessage(playerid,-1,string); GetPlayerPos(id,x,y,z); SetPlayerPos(id,x,y,z+10); GetPlayerName(playerid,name,sizeof(name)); format(msg,sizeof(msg),"AdmCmd: You have been slapped by Admin %s, reason: %s",name, reason); SendClientMessage(id,-1,msg); / GetPlayerName(id, idname, MAX_PLAYER_NAME); format(string, sizeof(string), "AdmCmd: Admin %s has slapped %s, reason: %s", name, idname, reason); SendMessageToAdmins(0xFF6347FF, string, 1); } } else { SendClientMessage(playerid,0x800000FF,"You are not authorized to use this command!"); } return 1; }