Author Topic: CityRP Hunger mod... [Solved]  (Read 1515 times)

Ok, I added this where it seems it should go:

$CityRP::hunger::name[$CityRP::hunger++] = "Starving";
$CityRP::hunger::name[$CityRP::hunger++] = "Hungry";
        $CityRP::hunger::name[$CityRP::hunger++] = "Content";
        $CityRP::hunger::name[$CityRP::hunger++] = "Satisfied";
        $CityRP::hunger::name[$CityRP::hunger++] = "Full";
        $CityRP::hunger::name[$CityRP::hunger++] = "Pukey";

And this:

CityRPData.addValue("hungerval", 5);

And... this...

            if(CityRPData.getData(%client.bl_id).valuehungerval > 1)
               {
            CityRPData.getData(%client.bl_id).valuehungerval -= 1;
               }
            if(CityRPData.getData(%client.bl_id).valuehungerval == 1)
          {
            CityRPData.getData(%client.bl_id).valuehungerval -= 1;
            messageClient(%client, '', "\c6You are starving! If you don't eat soon you will die.");
          }
            

And the Hunger part on the bottom bar, but now it says "Hunger: " and nothing. No Hungry, Full, Pukey or anything, just "Money: (money) Job: (job) Income: (pay) Hunger: (nothing) Taxes: (taxes) Owner: (owner)"

Halp meh plox
« Last Edit: February 16, 2009, 01:29:08 AM by Pew446 »

This is why we cant have nice things let newbs mod try to mod big projects.
This reminds me of myself, lol.

... So I'm new to Blockland scripting, so the forget what, I'm an advanced Lua scripter so I have experience... All I need is why it quit working after I added one extra thing... I learn more by looking :D


I really need this fixed or something...

Quote
CityRPData.getData(%client.bl_id).valuehungerval

Quote
"\c6Hunger: \c3$" @ $CityRP::hunger::name[CityRPData.getData(%this.bl_id).valuehunger] SPC ...

Please remove the page stretching code block, it's very annoying.

Sorry, it doesn't stretch on ie. Fixed it. Btw I don't get what you're saying, why did you bold it? O.o
« Last Edit: February 15, 2009, 11:59:01 PM by Pew446 »

All of it is hungerval now and still nothing.

Found it :D Didn't add a value in the data file :)
« Last Edit: February 15, 2009, 11:58:45 PM by Pew446 »

You're setting "valuehungerval", but trying to display "valuehunger".

You're setting "valuehungerval", but trying to display "valuehunger".

I know, but before you said that I changed everything to hungerval and it didn't work, I looked in the data file and saw it said "Values: (values here but no hungerval)" so I added it.