02.04.2013, 16:31
hm.......... try this...
PHP код:
case DIALOG_IDLESTACKEAT:
{
new cash = GetPlayerMoney(playerid);
new price;
if(!response) return 1;
if(response)
{
switch(listitem)
{
case 0:
{
new Float:health;
GetPlayerHealth(playerid, health);
price = 5;
if(cash < price) return SCM(playerid, COLOR_RED, "You cannot afford that!");
SCM(playerid,COLOR_LIGHTBLUE, "You have purchased a small meal!");
GivePlayerMoney(playerid, -price);
PlayerInfo[playerid][pHealth] = health+15;
if(PlayerInfo[playerid][pHealth] > 100)
{
PlayerInfo[playerid][pHealth] = 100;
SetPlayerHealth(playerid, PlayerInfo[playerid][pHealth] );
}
else
{
SetPlayerHealth(playerid,PlayerInfo[playerid][pHealth]);
}
}
}
}
}