27.01.2010, 21:39
It should work like that
Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { if(newkeys == KEY_FIRE) { if(IsPlayerInRangeOfPoint(playerid, RANGE, CORDX, CORDY, CORDZ)) { new Float:health; GetPlayerHealth(playerid, health); if(health <=95) { SetPlayerHealth(playerid, health + 5); GivePlayerMoney(playerid, -2); SendClientMessage(playerid, COLOR_LIGHTBLUE, "You've bought a drink for $2"); } else { SendClientMessage(playerid, COLOR_RED, "You still have plenty of health left"); } return 1; } } return 1; }