Food Dialog
#1

pawn Код:
if(listitem == 3)
              {
              if(PlayerInfo[playerid][pCash] < 251) return SendClientMessage(playerid,COLOR_GREY," Not Enough Cash!");
                 new Float:Health;
                 GetPlayerHealth(playerid,Health);
         if (Health > 81) return SendClientMessage(playerid, COLOR_GREY, " You can't buy anymore You'll get fat!!");
                 SetPlayerHealth(playerid,Health+20);
         PlayerInfo[playerid][pCash] -= 250;
         GivePlayerCash(playerid,-250);
    }
It Doesn't work In-game, any suggestions?
Reply
#2

pawn Код:
if(listitem == 3)
 {
 if(PlayerInfo[playerid][pCash] < 251) return SendClientMessage(playerid,COLOR_GREY," Not Enough Cash!");
 if (Health > 81) return SendClientMessage(playerid, COLOR_GREY, " You can't buy anymore You'll get fat!!");
 new Float:Health;
 GetPlayerHealth(playerid,Health);
 SetPlayerHealth(playerid,Health+20);
 PlayerInfo[playerid][pCash] -= 250;
 GivePlayerCash(playerid,-250);
 }
Reply
#3

Quote:
Originally Posted by ViruZZzZ_ChiLLL
pawn Код:
if(listitem == 3)
 {
 if(PlayerInfo[playerid][pCash] < 251) return SendClientMessage(playerid,COLOR_GREY," Not Enough Cash!");
 if (Health > 81) return SendClientMessage(playerid, COLOR_GREY, " You can't buy anymore You'll get fat!!");
 new Float:Health;
 GetPlayerHealth(playerid,Health);
 SetPlayerHealth(playerid,Health+20);
 PlayerInfo[playerid][pCash] -= 250;
 GivePlayerCash(playerid,-250);
 }
lawl that will work?
i thought getplayerhealth had to be before if(health)

EDIT: Thanks for fast reply

BUT, I was right =/ error 017: undefined symbol "Health"
Reply
#4

Then put the new Float:Health on top of the others.
Then test it if it works
Reply
#5

Quote:
Originally Posted by ViruZZzZ_ChiLLL
Then put the new Float:Health on top of the others.
Then test it if it works
Nope, and i also putting getplayerhealth under float(On Top of others)
Reply
#6

pawn Код:
if(listitem == 3)
{
    if(PlayerInfo[playerid][pCash] < 251) return SendClientMessage(playerid,COLOR_GREY, "Not Enough Cash!");
    new Float:Health;
    GetPlayerHealth(playerid, Health);
    floatround(Health);
    if(Health > 81) return SendClientMessage(playerid, COLOR_GREY, " You can't buy anymore You'll get fat!!");
    SetPlayerHealth(playerid, Health+20);
    PlayerInfo[playerid][pCash] -= 250;
    GivePlayerCash(playerid, -250);
}
Reply
#7

Quote:
Originally Posted by PotH3Ad
pawn Код:
if(listitem == 3)
{
    if(PlayerInfo[playerid][pCash] < 251) return SendClientMessage(playerid,COLOR_GREY, "Not Enough Cash!");
    new Float:Health;
    GetPlayerHealth(playerid, Health);
    floatround(Health);
    if(Health > 81) return SendClientMessage(playerid, COLOR_GREY, " You can't buy anymore You'll get fat!!");
    SetPlayerHealth(playerid, Health+20);
    PlayerInfo[playerid][pCash] -= 250;
    GivePlayerCash(playerid, -250);
}
lawl what in the world does floatround do, anyways ill try it
Reply
#8

SA-MP Wiki: Floatround - Round a floating point number to an integer value.
Reply
#9

Quote:
Originally Posted by PotH3Ad
SA-MP Wiki: Floatround - Round a floating point number to an integer value.
It didn't work, this is weird because I've done this before

pawn Код:
if(dialogid == 3)
    {
        if(response)
        {
            if(listitem == 0)
            {
      if(PlayerInfo[playerid][pCash] > 9999)
      {
      new Float:Armour;
            GetPlayerArmour(playerid,Armour);
      if(Armour > 0) return SendClientMessage(playerid, COLOR_GREY, " You can't buy more then 100 Armor!");
        SetPlayerArmour(playerid,Armour+100);
            PlayerInfo[playerid][pCash] -= 10000;
            GivePlayerCash(playerid, -10000);
                }
                else
              {
                SendClientMessage(playerid, COLOR_GREY, " Not enough cash for that !");
              }
Reply
#10

Well, what happens when you select the health list item in-game, does it send you a message or simply not do anything at all?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)