11.10.2012, 23:38
Код:
CMD:heal(playerid, params[]) { new giveplayerid,Float:heal,Float:X, Float:Y, Float:Z; new pname[MAX_PLAYER_NAME]; GetPlayerName(playerid,pname,sizeof(pname)); if(sscanf(params, "uf", giveplayerid, heal))return SendClientMessage(playerid, COLOR_YELLOW, "Usage: /heal (playerid) (health 1-90)"); if(heal > 90) return SendClientMessage(playerid,0xFF0000FF, "You can't offer at this player health more than 90 hp."); if(!IsPlayerConnected(giveplayerid) || giveplayerid == playerid) return SendClientMessage(playerid, red, "Invalid player id."); GetPlayerPos(playerid, X, Y, Z); if(!IsPlayerInRangeOfPoint(giveplayerid, 5.0, X, Y, Z)) return SendClientMessage(playerid, red, "This player is too far from you, you can't offer him health."); new string[128]; format(string, sizeof(string), "You've received an offer to heal you by %s (%d) of %2.1f hp.", pname,playerid,heal); SendClientMessage(giveplayerid, -1, string); SendClientMessage(giveplayerid, -1, "Type in the chat \"Yes\" or \"No\" to reply the offer."); pOffersHeal[giveplayerid] = true; HealthAmount = heal; return true; }