Page 1 of 1

HELP! about use of ammo

PostPosted: Thu Apr 03, 2008 10:30 am
by PooAs
hey,
i am making this game and i have an ammo count
i want to make it so when it reaches 00 you cant shoot, until you pick up ammo.
any ideas?? lol

Re: HELP! about use of ammo

PostPosted: Thu Apr 03, 2008 10:51 am
by Caaz Games
um let me think...

Put this in script editor of your shoot button.
Code: Select all
if(Ammo.textNumber==00)
{
         //nothing happens here
}
else if(Ammo.textNumber=<00)    //Credit to fredopedia
{
         Put your shoot Script here
}

replace Ammo with your ammo count actor name

Re: HELP! about use of ammo

PostPosted: Fri Apr 04, 2008 9:04 am
by PooAs
thanks heaps man

my code is this, and doesnt work lol

if(pistol_ammonumber.textNumber==00)
{
//nothing happens here
}
else if(pistol_ammonumber.textNumber=<00)
{
CreateActor("pistol_bullet_right", "bullet pistol right", "(none)", "(none)", 75, -5, false);

CreateActor("gun_bang", "explod2_00000", "(none)", "(none)", 80, -15, false);
}

it says:
error line 5: unknown type in binhconst

please help

Re: HELP! about use of ammo

PostPosted: Fri Apr 04, 2008 9:42 am
by Bee-Ant
PooAs wrote:else if(pistol_ammonumber.textNumber=<00)

how about
Code: Select all
if(pistol_ammonumber.textNumber>0)
{
    CreateActor("pistol_bullet_right", "bullet pistol right", "(none)", "(none)", 75, -5, false);
    CreateActor("gun_bang", "explod2_00000", "(none)", "(none)", 80, -15, false);
    pistol_ammonumber.textNumber-=1;
}

Re: HELP! about use of ammo

PostPosted: Fri Apr 04, 2008 9:55 am
by PooAs
thanks heaps :)
works real good