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

1 weapon slot after using a

broken avatar :(
Created 11 years ago
by pcmodder
0 Members and 1 Guest are viewing this topic.
1,958 views
broken avatar :(
×
broken avatar :(
Location: gb
Date Registered: 22 September 2014
Last active: 6 years ago
Posts
360
Respect
Forum Rank
Perk Hacker
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
Here to make epic maps
×
pcmodder's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
pcmodder's Contact & Social Linksken5hir0pcmodderugx
Hi i have recently used this tutorial http://ugx-mods.com/forum/index.php?topic=4447.0 

and have it set up to give a weapon at the end. When i get the weapon reward  it takes 1 weapon slot and seems i can not get that slot back. Buying a wall gun, a box gun or using mule kick results in 1 weapon slot after taking this reward. I think it is something to do with this bit

Code Snippet
Plaintext
CheckHas4Paper() //// this block of code was written by PROxFTW /////
{
while( 1 )
{
if(level.paper == 4)
{

wait 3;
for( i = 0; i < GetPlayers().size; i++ )
{
players = GetPlayers()[i];
current_weapon = players GetCurrentWeapon();
weapon_list = players GetWeaponsListPrimaries();
if(isdefined(current_weapon) && weapon_list.size > 1)
{
players TakeWeapon( current_weapon );
}

players GiveWeapon( "zombie_tomahawk_upgraded" );
}
break;
}
wait .01;
}
}

I was originally thinking to remove the players TakeWeapon( current_weapon ); but i did not want to messing around with this scripts. I was thinking it would be good to make it so this placed the weapon in the map as a reward to take ( like the soul chest ) but i would not know where to begin that .

Thanks if any help :D
Marked as best answer by pcmodder 11 years ago
broken avatar :(
×
broken avatar :(
Location: esMadrid
Date Registered: 27 March 2015
Last active: 5 years ago
Posts
371
Respect
Forum Rank
Perk Hacker
Primary Group
Member
My Contact & Social Links
More
Personal Quote
JIGGLYPUFF used SING! YOU fell asleep!
Signature
×
Soy-Yo's Groups
Soy-Yo's Contact & Social LinksSoy-yoElCerdoRey
It seems that you don't need this:
Code Snippet
Plaintext
current_weapon = players GetCurrentWeapon();
weapon_list = players GetWeaponsListPrimaries();
if(isdefined(current_weapon) && weapon_list.size > 1)
{
players TakeWeapon( current_weapon );
}
as you are giving the tomahawk as a grenade. Not sure how tomahawk works but I think that's it.
broken avatar :(
×
broken avatar :(
Location: gb
Date Registered: 22 September 2014
Last active: 6 years ago
Posts
360
Respect
Forum Rank
Perk Hacker
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
Here to make epic maps
×
pcmodder's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
pcmodder's Contact & Social Linksken5hir0pcmodderugx
Code Snippet
Plaintext
CheckHas4Paper() //// this block of code was written by PROxFTW /////
{
while( 1 )
{
if(level.paper == 4)
{

wait 3;
for( i = 0; i < GetPlayers().size; i++ )
{
players GiveWeapon( "zombie_tomahawk" );
}
break;
}
wait .01;
}
}

Hey i tried that and it said " Uninitialized Variable" , and i aint got a clue what that is :D  :facepalm2:
broken avatar :(
×
broken avatar :(
Location: esMadrid
Date Registered: 27 March 2015
Last active: 5 years ago
Posts
371
Respect
Forum Rank
Perk Hacker
Primary Group
Member
My Contact & Social Links
More
Personal Quote
JIGGLYPUFF used SING! YOU fell asleep!
×
Soy-Yo's Groups
Soy-Yo's Contact & Social LinksSoy-yoElCerdoRey
Lol you didn't have to remove this line: :D
Code Snippet
Plaintext
players = GetPlayers()[i];
And also, does "getPlayers()" work? Shouldn't it be "get_players()"?
Last Edit: October 04, 2015, 09:59:43 pm by Soy-Yo
broken avatar :(
×
broken avatar :(
Location: gb
Date Registered: 22 September 2014
Last active: 6 years ago
Posts
360
Respect
Forum Rank
Perk Hacker
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
Here to make epic maps
×
pcmodder's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
pcmodder's Contact & Social Linksken5hir0pcmodderugx
Code Snippet
Plaintext
CheckHas4Paper() //// this block of code was written by PROxFTW /////
{
while( 1 )
{
if(level.paper == 4)
{

wait 3;
for( i = 0; i < GetPlayers().size; i++ )
{
players = GetPlayers()[i];
players GiveWeapon( "zombie_tomahawk_upgraded" );
}
break;
}
wait .01;
}
}

Cheers this gives the weapon and does not take any slots. Thanks :)
broken avatar :(
×
broken avatar :(
Location: esMadrid
Date Registered: 27 March 2015
Last active: 5 years ago
Posts
371
Respect
Forum Rank
Perk Hacker
Primary Group
Member
My Contact & Social Links
More
Personal Quote
JIGGLYPUFF used SING! YOU fell asleep!
×
Soy-Yo's Groups
Soy-Yo's Contact & Social LinksSoy-yoElCerdoRey
You're welcome. :) You can ask me any scripting question you have if you want. ;)

And I don't what it'll do, but test what happens if you have monkeys or Molotov and get the tomahawk because it's possible that you need to take them first or something. Just don't know, but it's always good to check.

 
Loading ...