UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

Disbale buying guns help

broken avatar :(
Created 12 years ago
by hiimachicken
0 Members and 1 Guest are viewing this topic.
3,108 views
broken avatar :(
×
broken avatar :(
Location: gbScotland
Date Registered: 21 August 2014
Last active: 6 years ago
Posts
59
Respect
Forum Rank
Rotting Walker
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
hi m8
×
hiimachicken's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
hiimachicken's Contact & Social Linkshiimachicken
does anyone know how to disable buying guns for 20 seconds?
i cant find it in the script reference or anywhere else

thanks if you can help
Last Edit: August 30, 2014, 07:08:30 pm by hiimachicken
Marked as best answer by hiimachicken 12 years ago
broken avatar :(
×
broken avatar :(
The King of Zombies
Location: usLouisiana
Date Registered: 24 June 2013
Last active: 6 years ago
Posts
2,148
Respect
Forum Rank
King of the Zombies
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Signature
Donate to me if you enjoy my work. https://www.paypal.me/thezombiekilla6
×
Dust's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Dust's Contact & Social Linksdust103194MrZ0mbiesFanaticMrZ0mbiesFanatic
you could get the ent of the targetname for weapon_upgrade, its found on all the weapons, go to your custom script and do


Code Snippet
Plaintext
weapon = getentarray("weapon_upgrade","targetname")
 for(i=0;i<weapon.size;i++)
{
weapon[i] disable_trigger();
}
wait 20;
{
weapon[i] enable_trigger();
}

Note this is not tested and I am still learning scripting so if this doesnt work then let me know
Last Edit: August 30, 2014, 07:28:54 pm by thezombiekilla6
broken avatar :(
×
broken avatar :(
Location: gbScotland
Date Registered: 21 August 2014
Last active: 6 years ago
Posts
59
Respect
Forum Rank
Rotting Walker
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
hi m8
×
hiimachicken's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
hiimachicken's Contact & Social Linkshiimachicken
you could get the ent of the targetname for weapon_upgrade, its found on all the weapons, go to your custom script and do


Code Snippet
Plaintext
unlimited_ammo_powerup( drop_item, player_won )
{
if(self hasWeapon("ray_gun"))
{
weapon = getentarray("weapon_upgrade","targetname");
weapon disable_trigger();

curgun = self getCurrentWeapon();
//self giveWeapon("ray_gun");
setSavedDvar("player_sustainAmmo", "1");



//switch gun
self switchToWeapon("ray_gun");
self DisableWeaponCycling();

iPrintLn ("Ray gun given");

wait( 20 );
setSavedDvar("player_sustainAmmo", "0");
self EnableWeaponCycling();
self switchToWeapon( curgun );

       weapon enable_trigger();
}

Its for a powerup and i want it so i cant buy any guns, its not working tho :(

Last Edit: August 30, 2014, 07:38:32 pm by hiimachicken
broken avatar :(
×
broken avatar :(
The King of Zombies
Location: usLouisiana
Date Registered: 24 June 2013
Last active: 6 years ago
Posts
2,148
Respect
Forum Rank
King of the Zombies
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
×
Dust's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Dust's Contact & Social Linksdust103194MrZ0mbiesFanaticMrZ0mbiesFanatic
you could get the ent of the targetname for weapon_upgrade, its found on all the weapons, go to your custom script and do


Code Snippet
Plaintext
unlimited_ammo_powerup( drop_item, player_won )
{
if(self hasWeapon("ray_gun"))
{
weapon = getentarray("weapon_upgrade","targetname");
weapon disable_trigger();

curgun = self getCurrentWeapon();
//self giveWeapon("ray_gun");
setSavedDvar("player_sustainAmmo", "1");



//switch gun
self switchToWeapon("ray_gun");
self DisableWeaponCycling();

iPrintLn ("Ray gun given");

wait( 20 );
setSavedDvar("player_sustainAmmo", "0");
self EnableWeaponCycling();
self switchToWeapon( curgun );

       weapon enable_trigger();
}

Its for a powerup and i want it so i cant buy any guns, its not working tho :(

you forgot about the for function
Code Snippet
Plaintext
 for(i=0;i<weapon.size;i++)
{
weapon[i] disable_trigger();
}

should go after the getentarray
broken avatar :(
×
broken avatar :(
Location: gbScotland
Date Registered: 21 August 2014
Last active: 6 years ago
Posts
59
Respect
Forum Rank
Rotting Walker
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
hi m8
×
hiimachicken's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
hiimachicken's Contact & Social Linkshiimachicken
im new at scripting, can you explain what the for function is so i understand whats happening?
broken avatar :(
×
broken avatar :(
The King of Zombies
Location: usLouisiana
Date Registered: 24 June 2013
Last active: 6 years ago
Posts
2,148
Respect
Forum Rank
King of the Zombies
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
×
Dust's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Dust's Contact & Social Linksdust103194MrZ0mbiesFanaticMrZ0mbiesFanatic
whenever you get an array, see if a targetname in this case weapon_upgrade is more than 1, meaning you have more than 1 wall weapon in the map you use getentarray, getent is only for 1 specific targetname. the for function is needed for the array to get a list of all the weapon in the map, ie thompson, gewvehr, type100, stuff like that. the for function has to go after the getentarray or it will only get the first weapon it comes across
Last Edit: August 30, 2014, 07:45:10 pm by thezombiekilla6
broken avatar :(
×
broken avatar :(
Location: gbScotland
Date Registered: 21 August 2014
Last active: 6 years ago
Posts
59
Respect
Forum Rank
Rotting Walker
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
hi m8
×
hiimachicken's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
hiimachicken's Contact & Social Linkshiimachicken
Well thank you you solved my problem, but one more thing, do you know how to make it so i cant switch to a bouncing betty , and how to disable the bouncing betty aswell?
broken avatar :(
×
broken avatar :(
The King of Zombies
Location: usLouisiana
Date Registered: 24 June 2013
Last active: 6 years ago
Posts
2,148
Respect
Forum Rank
King of the Zombies
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
×
Dust's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Dust's Contact & Social Linksdust103194MrZ0mbiesFanaticMrZ0mbiesFanatic
Well thank you you solved my problem, but one more thing, do you know how to make it so i cant switch to a bouncing betty , and how to disable the bouncing betty aswell?

Since betties use a different targetname and there is only 1 of them you can use getent so its easier

Code Snippet
Plaintext
bettie = getent("betty_purchase""targetname");
          bettie disable_trigger();
          wait 20;
           bettie enable_trigger();

how to disable it from switching I am not sure, will have to look it up. if you have a bowie knife you can do the same thing as bettie but where it says bettie change it to bowie and for the betty_purchase change it to bowie_upgrade
broken avatar :(
×
broken avatar :(
Location: gbScotland
Date Registered: 21 August 2014
Last active: 6 years ago
Posts
59
Respect
Forum Rank
Rotting Walker
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
hi m8
×
hiimachicken's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
hiimachicken's Contact & Social Linkshiimachicken
Since betties use a different targetname and there is only 1 of them you can use getent so its easier

Code Snippet
Plaintext
bettie = getent("betty_purchase""targetname");
          bettie disable_trigger();
          wait 20;
           bettie enable_trigger();

how to disable it from switching I am not sure, will have to look it up. if you have a bowie knife you can do the same thing as bettie but where it says bettie change it to bowie and for the betty_purchase change it to bowie_upgrade

Thanks alot for the help
broken avatar :(
×
broken avatar :(
The King of Zombies
Location: usLouisiana
Date Registered: 24 June 2013
Last active: 6 years ago
Posts
2,148
Respect
Forum Rank
King of the Zombies
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
×
Dust's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Dust's Contact & Social Linksdust103194MrZ0mbiesFanaticMrZ0mbiesFanatic
i think i found out how to do it

Code Snippet
Plaintext
self DisableOffhandWeapons();

that should allow you to make it so they cant pull out a bouncing bettie, put it right after the player picks up the ray gun and then have it enable the offhandweapons after 20 seconds when the ray gun is gone
broken avatar :(
×
broken avatar :(
Location: gbScotland
Date Registered: 21 August 2014
Last active: 6 years ago
Posts
59
Respect
Forum Rank
Rotting Walker
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
hi m8
×
hiimachicken's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
hiimachicken's Contact & Social Linkshiimachicken
i think i found out how to do it

Code Snippet
Plaintext
self DisableOffhandWeapons();

that should allow you to make it so they cant pull out a bouncing bettie, put it right after the player picks up the ray gun and then have it enable the offhandweapons after 20 seconds when the ray gun is gone

It works for grenades but thats all :/
broken avatar :(
×
broken avatar :(
The King of Zombies
Location: usLouisiana
Date Registered: 24 June 2013
Last active: 6 years ago
Posts
2,148
Respect
Forum Rank
King of the Zombies
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
×
Dust's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Dust's Contact & Social Linksdust103194MrZ0mbiesFanaticMrZ0mbiesFanatic
Hmm thought it would work for both seeing as in the weapons file the betty is listed as a grenade. I am fixing to head out so maybe someone else can help you

 
Loading ...