Since i don't know how to script how do i make it so that the ray gun replaces the weapon the player is holding
because your code just gives the player a ray gun and gives and extra slot like mulekick.
here you have
Code Snippet
Plaintext
gun_give_trig() { player = undefined; trigger = getent("gun_trig", "targetname"); trigger sethintstring("Press F to get a Ray Gun");
while(1) { trigger waittill("trigger", player);
currentweapon = player GetCurrentWeapon(); player TakeWeapon( currentweapon ); player GiveWeapon( "ray_gun" ); //change here to the name of the gun you want"the name of the weapon file" wait(1); } }
the code has a reference to change weapon
Last Edit: March 27, 2014, 11:43:39 pm by jjbradman
gun_give_trig() { player = undefined; trigger = getent("gun_trig", "targetname"); trigger sethintstring("Press F to get a Ray Gun");
while(1) { trigger waittill("trigger", player);
currentweapon = player GetCurrentWeapon(); player TakeWeapon( currentweapon ); player GiveWeapon( "ray_gun" ); //change here to the name of the gun you want"the name of the weapon file" wait(1); } }
the code has a reference to change weapon
Stop taking my thunder dammit xD
Code Snippet
Plaintext
gun_give_trig() { trigger = getent("gun_trig", "targetname"); trigger sethintstring("Press F to get a Ray Gun");
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....
Code Snippet
Plaintext
gun_give_trig() { player = undefined; trigger = getent("gun_trig", "targetname"); trigger sethintstring("Press F to get a Ray Gun");
trigger waittill("trigger", player); weapList = player GetWeaponsListPrimaries();
if( weaplist.size >= 2 ) { current_weapon = player getCurrentWeapon(); player TakeWeapon( current_weapon ); player thread give_raygun(); } else if( weaplist.size <= 1 ) { player thread give_raygun(); }
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....
Code Snippet
Plaintext
gun_give_trig() { player = undefined; trigger = getent("gun_trig", "targetname"); trigger sethintstring("Press F to get a Ray Gun");
trigger waittill("trigger", player); weapList = player GetWeaponsListPrimaries();
if( weaplist.size >= 2 ) { current_weapon = player getCurrentWeapon(); player TakeWeapon( current_weapon ); player thread give_raygun(); } else if( weaplist.size <= 1 ) { player thread give_raygun(); }
"Deleted code is debugged code." - Jeff Sickel "Mathematicians stand on each others' shoulders and computer scientists stand on each others' toes." - Richard Hamming
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.
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.
Last Edit: March 28, 2014, 07:35:38 am by daedra descent