Hey guys i need some help for a weapon system

hi,
i have a problem
im making a gta style game with birds view and the battle system is the same so…
the problem is if you buy a pistol and afterwards a bazooka and you want to change from pistol to bazooka(by pressing D)it goes to the next weapon thats the uzi but actually you didnt buy the uzi!
so my question is:How do you make a weapon system like in GTA?
thanks for reading
and PLZ Help
thanks

I think we are going to need a bit more information if we are going to help you… We don’t know ANYTHING about your code, so how could we possibly know why the uzi is coming up instead of the bazooka?? lets see some code!!

well actually my question is only how to do a weapon system
anyways its easier chatting
my msn messenger is coolmarco2003x@hotmail.com
thanks

That is still a pretty general question. There isn’t ONE way to make a weapon system that is just going to work for every single game. It would be almost impossible for someone to just know exactly what you want. The best way to get a response here is to show us some code that you are having trouble with, just so there is something to work with. We can’t just explain ‘how to do a weapon system’.

and I don’t use msn :wink:

okay

i just do this

[font=Courier New]if(Key.isDown([\ he](file:// he) key for the next weapon)[/font]
[font=Courier New]NextFrame()[/font]
[font=Courier New])[/font]
[font=Courier New]if(Key.isDown([\key](file://\key) for the weapon before)[/font]
[font=Courier New]PreviousFrame()[/font]
[font=Courier New])[/font]
[font=Courier New])[/font]
[font=Courier New][/font]
[font=Courier New]now could someone help?[/font]
[font=Courier New]thanks[/font]

You’re going to need to set an array of weapons you have, and scroll through the array instead.

No offense here man, but that isn’t even the correct syntax for an if statement. I don’t know that you should be trying to take on something like a game just yet. If you want help, you are actually going to have to attempt to make this and post the .fla or some REAL code from your attempt. There is really no other way for anyone to help you. Dreeft has a point, you would probably want to store an array of the weapons. Where this array would be? Who knows - we have no idea how your game is set up. All we can do is offer some very very general statements, like they should be stored in an array.

You would probably need a list of weapons (an array or object). You would need properties for each weapon (how much damage each weapon does, how much ammo each weapon holds at once, firing rate, etc…). Some firing code for each weapon (a function to fire each different weapon). You would need a graphic file for each weapon - each stored in it’s own movieclip, or a “weapons” movieclip with one frame for each weapon (it seems like this is what you were trying to do from the code above).

well
my weapon system should be like this:
A=revious Weapon,D=Next Weapon
Now thats how it works
GTA Style
just write down how to make a weapon system
thanks

just write down how to make a weapon system
no offense but noones going to do that! i’ve heard that most ppl will only help those that help themselves, but if u have no idea i’ll give u some pointers.
i’m not quite sure how u’d select them out of an array, but assuming u don’t know about an array, have array:
weaponsArray = new Array();
//initial array
weaponsArray = [“hands”, “pistol”];

and then if u pick up a weapon:
//sorry can’t remember how to add things to array of the top
//of my head, and i’m at school!

then to go forwards in the array with a key press:
//weapon is variable
/this is initial
weaponNumber = 0;
then on key press
weaponNumber += 1;
then at the end u would have:
myWeapon = weaponsArray[weaponNumber];

then at the end somewhere have
where weapon is a mc with instance weapon
and has pistol frame label pistol
if(myWeapon == "pistol){
_root.weapon.gotoAndPlay(“pistol”);
}
etc.

have this all in main timeline under a _root.onEnterFrame = function(){};

this should get u started

You’ve got to be kidding, this is ridiculous.

Is this guy a troll or what?

Well u have to assume he just learnt how to turn the on key of his computer, was surprised it started up, then discovered he had flash, and has lots of ideas but no knowledge (no offense)