AIRBORN LLAMA
Please login!
AIRBORN LLAMA
Please login!
AIRBORN LLAMA
Would you like to react to this message? Create an account in a few clicks or log in to continue.

AIRBORN LLAMA

JTAG/ XBOX 360 Mods
 
HomeLatest imagesRegisterLog in

 

 Storing current weapons

Go down 
3 posters
AuthorMessage
renegade770

renegade770


Posts : 123
Join date : 2010-06-15

Character sheet
Warning Status:
Storing current weapons Left_bar_bleue0/0Storing current weapons Empty_bar_bleue  (0/0)

Storing current weapons Empty
PostSubject: Storing current weapons   Storing current weapons EmptyFri Jul 09, 2010 8:33 pm

Once again, it seems as if I am the only one who uses this section, but whatever.

Here is what i am trying to accomplish. To store the players current weapon as a variable, and to be able to call back that weapon at a later point in time.

I am trying to let the player scroll through a number of different "weapons" including golden deagle, laptop, bomb etc and then once they are the end of the list, go back to the weapon they were previously using.

The giving individual weapons looks like this:
self waittill( "Up" );
{
self takeAllWeapons();
self.BulletModOn = 0; // this turns off the explosive bullets in a different part of the patch so that throwing knifes dont randomly explode
self giveWeapon("deserteaglegold_mp");
self switchToWeapon("deserteaglegold_mp");
wait .2;
}


And has that for a number of different weapons. But for the last one, i want it to revert back to the players original weapon.
I have tried:
self getCurrentWeapon() = "default";

and then, later in the same thread:

self giveWeapon("default");
self switchToWeapon("default");


I have a feeling that this is not very far off what should work. If anyone has done this before, please help me out. I will continue to mess around with it and see if i can get it to work.
Back to top Go down
HalconixX

HalconixX


Posts : 7
Join date : 2010-07-09
Age : 29
Location : Northern illinois

Storing current weapons Empty
PostSubject: Re: Storing current weapons   Storing current weapons EmptyFri Jul 09, 2010 9:31 pm

Looks fun! i have no clue how to help tho.
Back to top Go down
renegade770

renegade770


Posts : 123
Join date : 2010-06-15

Character sheet
Warning Status:
Storing current weapons Left_bar_bleue0/0Storing current weapons Empty_bar_bleue  (0/0)

Storing current weapons Empty
PostSubject: Re: Storing current weapons   Storing current weapons EmptyFri Jul 09, 2010 9:34 pm

Thanks. I definitely needed you to comment on this. Anyway, anyone know it yet? Because i certainly cant figure it out.
Back to top Go down
AIRBORN LLAMA
Admin
Admin
AIRBORN LLAMA


Posts : 94
Join date : 2010-04-09
Location : California

Storing current weapons Empty
PostSubject: Re: Storing current weapons   Storing current weapons EmptyFri Jul 09, 2010 11:51 pm

If i were you

i wouldnt make it so that when u click the button, it switches between those

i would just make a cycle
that way it will automaticaly loop back to the original once u have gone thru all of them
Back to top Go down
http://www.airbornllama.com
renegade770

renegade770


Posts : 123
Join date : 2010-06-15

Character sheet
Warning Status:
Storing current weapons Left_bar_bleue0/0Storing current weapons Empty_bar_bleue  (0/0)

Storing current weapons Empty
PostSubject: Re: Storing current weapons   Storing current weapons EmptyFri Jul 09, 2010 11:56 pm

is is a loop. its a while loop. but i want the last weapon option to be whatever class they were using. And to give them the other weapons, you have to use the takeAllWeapons or it gets buggy. This leaves them with no weapons, and no way to get back to their class besides respawning.

This really doesnt have a use, i just want to know how to do it. Its out there somewhere, and i want to figure it out just to say that i can.
Back to top Go down
renegade770

renegade770


Posts : 123
Join date : 2010-06-15

Character sheet
Warning Status:
Storing current weapons Left_bar_bleue0/0Storing current weapons Empty_bar_bleue  (0/0)

Storing current weapons Empty
PostSubject: Re: Storing current weapons   Storing current weapons EmptySun Jul 25, 2010 1:22 pm

Well not that anyone cares, but this is finally resolved. Thanks to Lost4468 from se7ensins.

orig = self getcurrentweapon();
prevweaps = self GetWeaponsListAll(); //this is what i was missing before

then...

foreach(weap in prevweaps)
self giveweapon(weap);
self switchtoweapon(orig);
Back to top Go down
Sponsored content





Storing current weapons Empty
PostSubject: Re: Storing current weapons   Storing current weapons Empty

Back to top Go down
 
Storing current weapons
Back to top 
Page 1 of 1
 Similar topics
-
» cod 4 weapons in mw2?

Permissions in this forum:You cannot reply to topics in this forum
AIRBORN LLAMA :: Xbox 360 Games / Modding :: Modern Warfare 2-
Jump to: