11.08.2016, 12:41
Код:
CMD:healplayer(playerid,params[]) { if(GetPlayerSkin(playerid) != 275) return SendClientMessage(playerid, -1, "You are not a medic"); new id,Float:x,Float:y,Float:z,Float:Health,string[200],string2[200],string3[200],name[MAX_PLAYER_NAME],name2[MAX_PLAYER_NAME]; if(sscanf(params,"u",id)) return SendClientMessage(playerid,-1,"USAGE: /heal [ID]"); else if(gTeam[playerid] != gTeam[id]) return SendClientMessage(playerid,-1,"Why would you heal your enemies?"); else if(id == playerid) return SendClientMessage(playerid,-1,"You can't heal yourself."); else if(medic[playerid] == 0) return SendClientMessage(playerid,-1,"You are not medic"); else { GetPlayerPos(id,x,y,z); if(!IsPlayerInRangeOfPoint(id,2.0,x,y,z)) return SendClientMessage(playerid,-1,"The player is too far away from you."); GetPlayerHealth(id,Health); if(Health == 100) return SendClientMessage(playerid,-1,"This player's health is too high."); SetPlayerHealth(id,100); F_GivePlayerMoney(playerid,1500); SetPlayerScore(playerid,GetPlayerScore(playerid) +2); GetPlayerName(playerid,name,sizeof(name)); GetPlayerName(id,name2,sizeof(name2)); format(string,sizeof(string),"%s (%d) healed you.",name,playerid); format(string2,sizeof(string2),"You have healed %s (%d).",name2,id); format(string3,sizeof(string3),"%s (%d) has healed %s (%d) and recieved 1500$.",name,playerid,name2,id); SendClientMessage(id,-1,string); SendClientMessage(playerid,-1,string2); SendClientMessageToAll(-1,string3); } return 1; }