noup :3 haha. hey dd what is the point of checking for if the player current weapon is defined? xD lol i htink that in this context the current weapon will obviosly be difined, you should have made that the "if" checks if the player weapons.size is == to 2 , cause if he has 1 weap this code will leave the player with just one weapon. also the get players is uneeded. so....
Title: Re: Give player gun trigger
Post by: daedra descent on March 28, 2014, 04:24:41 am
noup :3 haha. hey dd what is the point of checking for if the player current weapon is defined? xD lol i htink that in this context the current weapon will obviosly be difined, you should have made that the "if" checks if the player weapons.size is == to 2 , cause if he has 1 weap this code will leave the player with just one weapon. also the get players is uneeded. so....
Shh... go home JJ, your drunk.
Title: Re: Give player gun trigger
Post by: jjbradman on March 28, 2014, 04:53:00 am
haha i actually am (/u\) but you dont have to say it (/n\) lol but im sure the code has to work this way xD
Title: Re: Give player gun trigger
Post by: daedra descent on March 28, 2014, 04:55:32 am
Just wondering, why are you doing players = getplayers(); if the next line sets players to whichever player triggers it? Also, I would change the F in the hintstring to &&1.
Title: Re: Give player gun trigger
Post by: daedra descent on March 28, 2014, 07:34:53 am
Just wondering, why are you doing players = getplayers(); if the next line sets players to whichever player triggers it? Also, I would change the F in the hintstring to &&1.
For #YOLO reasons.
Title: Re: Give player gun trigger
Post by: pashan on March 28, 2014, 05:38:41 pm
I am a bit new to coding but i added a new line (because i want it to be a hidden easter egg)
Post Merge: March 28, 2014, 05:42:03 pmThe player would always have 2 weapons:
you start out with colt = 1 weapon
the player then buys a second weapon because the colt sucks = 2 weapons
then the player will get the ray gun which will replace his current weapon he is holding = 2 weapons
do you get what i am trying to say.
and also the trigger is in the 3rd room and the player wouldn't be able to get their with only the colt.
- Pashan
anyways the code leaves option for leaving a player qith 1 weap. so the code might work for you but, in a more open environment the code must be as i said....also you didnt mentioned your map set up so one makes code which works in every stage not just your map. besides the if statement was completly useless and the players = get_players(); was just there for "yolo" reasons lol
Title: Re: Give player gun trigger
Post by: ProGamerzFTW on March 29, 2014, 09:19:19 am
If you don't want your weapon replaced when having a single gun like jj had earlier.
Untested.
Title: Re: Give player gun trigger
Post by: SadBoyPro on July 11, 2014, 11:23:45 am
Hey guys this may have been answered here but i am a bit new so here's with the question.
Am I right in thinking this will allow one to only let a specific player activate the trigger?
The reason I ask is that I am looking for some help in creating a piece of code which says that;
If player = "player name" trigger = false
so essentially the play cannot purchase the gun unless the player name is one i have defined.
Title: Re: Give player gun trigger
Post by: Alerion on July 11, 2014, 11:33:02 am
Please create a new topic next time where you say which topic you are referring to.
Title: Re: Give player gun trigger
Post by: SadBoyPro on July 11, 2014, 03:00:07 pm
Oh I have :) I was just inquiring in this thread to get clarification that the code that was posted performed that function. I'm clearly new and don't quite understand it hence my question was directed actually at this post :)
Title: Re: Give player gun trigger
Post by: epicduck97 on July 12, 2014, 04:24:16 am
quick question, which script can we add the code to? I've done this stuff in non UGX maps, and they go in youmapname.gsc in root raw map folder. With ugx we dont have that, in that folder.. We have it in yourmapname.iwd in the root mods folder. I've tried it there and it doesnt work. The ugx install wiki says to put code "within ugx_mod.iwd and ugxm_guns.iwd" I did it in zombiemode.gsc, in ugx_mod.iwd, and It didnt work.. Where can I put it? sorry im a noob lol
Title: Re: Give player gun trigger
Post by: djobdam on September 06, 2014, 06:34:19 pm
one question, if u want to get the raygun without pressing a trigger what kind of code do I need? Double Post Merge: September 06, 2014, 07:39:40 pmI've got this script
and instead of a door that opens I want to get a gun, how do I do that?