Gamestudio Links
Zorro Links
Newest Posts
Executing Trades on Next Bar Open
by vicknick. 06/13/24 08:51
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, RealSerious3D, BrainSailor), 1,265 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19059 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Ammo System #261146
04/16/09 00:31
04/16/09 00:31
Joined: Dec 2008
Posts: 56
B
binsky33333 Offline OP
Junior Member
binsky33333  Offline OP
Junior Member
B

Joined: Dec 2008
Posts: 56
Hi everyone, How can i create some code that will do exactly this. There is a max of 150 ammo and when you pick up a ammo pack it adds 50 ammo to your amount of ammo. How can i make it so that the amount of ammo wont go over 150? And if you have max ammo of 150 then you cant pick up the packs anymore.

Im guessing all of this is just greater than and equal too stuff.

Thanks!

Re: Ammo System [Re: binsky33333] #261192
04/16/09 09:27
04/16/09 09:27
Joined: Jul 2008
Posts: 170
Germany, near Mainz
Nicotin Offline
Member
Nicotin  Offline
Member

Joined: Jul 2008
Posts: 170
Germany, near Mainz
yeah. Your Ammo pack must have an Impact event so it starts if the Player touches it and the code would be like.
In this code the skill1 from the player is his Ammo

Code:
function ammo_event()
{
  if(event_type == EVENT_IMPACT)
   {
     if (you == Player)
     {
      if(you.skill1 < 150)
      {
        you.skill1 += 50;
        you.skill1 = min(you.skill1,150);//The maximum is 150
      }
     } 
   }
}





Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1