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

Storing the players to an array?

broken avatar :(
Created 7 years ago
by HyperFirez
0 Members and 1 Guest are viewing this topic.
2,092 views
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 6 July 2015
Last active: 4 years ago
Posts
114
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
Signature
Maps:
Standoff Zombies [WIP]
Der Blitzdrache [WIP] (Maybe Canceled)
FNAF 1-4 [WIP] (Maybe Canceled)
×
HyperFirez's Groups
HyperFirez's Contact & Social LinksHyperFirezHyperFirezHyperFirezHyperFirezHyperFirezHyperFirezHyperFirez
I have something that I think might work:
Code Snippet
Plaintext
cache_back()
{
for ( i = 0; i < level.zombie_powerup_array.size; i++ )
{
if ( level.zombie_powerup_array[i] == "full_ammo" )
{
level.zombie_powerup_index = i;
break;
}
}
level.zombie_vars["zombie_drop_item"] = 1;
level.powerup_drop_count = 0;

// Player Handling
players = get_players();
for (i = 0; i < players.size; i++)
{
if( players == GetPlayers()[0] )
{
wait( 1 );
level thread maps\_zombiemode_powerups::powerup_drop(self.origin + (100, 0, 10));
}
else if( players == GetPlayers()[1] )
{
wait( 1 );
level thread maps\_zombiemode_powerups::powerup_drop(self.origin + (100, 0, 10));
}
else if( players == GetPlayers()[2] )
{
wait( 1 );
level thread maps\_zombiemode_powerups::powerup_drop(self.origin + (100, 0, 10));
}
else if( players == GetPlayers()[3] )
{
wait( 1 );
level thread maps\_zombiemode_powerups::powerup_drop(self.origin + (100, 0, 10));
}
}
}

If I am doing something wrong, can someone please correct my script? Thanks.
This topic contains a post which is marked as the Best Answer. Click here to view it.
broken avatar :(
×
broken avatar :(
Location: aupotato
Date Registered: 27 September 2013
Last active: 3 years ago
Posts
588
Respect
Forum Rank
Zombie Enslaver
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Signature
respect the dead

donates greatly appreciated :) paypal.me/F3ARxReaper666
discord server:
https://discord.gg/tsGHW99
×
death_reaper0's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
did you want it to spawn a powerup at all players? if so id do this

Code Snippet
Plaintext
cache_back()
{
for ( i = 0; i < level.zombie_powerup_array.size; i++ )
{
if ( level.zombie_powerup_array[i] == "full_ammo" )
{
level.zombie_powerup_index = i;
break;
}
}
level.zombie_vars["zombie_drop_item"] = 1;
level.powerup_drop_count = 0;

// Player Handling
players = get_players();
for (i = 0; i < players.size; i++)
{
wait( 1 );
level thread maps\_zombiemode_powerups::powerup_drop(players[i].origin + (100, 0, 10));
}
}

although im not sure if that would be messed up by the drop count stuff
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 6 July 2015
Last active: 4 years ago
Posts
114
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
×
HyperFirez's Groups
HyperFirez's Contact & Social LinksHyperFirezHyperFirezHyperFirezHyperFirezHyperFirezHyperFirezHyperFirez
did you want it to spawn a powerup at all players? if so id do this

Code Snippet
Plaintext
cache_back()
{
for ( i = 0; i < level.zombie_powerup_array.size; i++ )
{
if ( level.zombie_powerup_array[i] == "full_ammo" )
{
level.zombie_powerup_index = i;
break;
}
}
level.zombie_vars["zombie_drop_item"] = 1;
level.powerup_drop_count = 0;

// Player Handling
players = get_players();
for (i = 0; i < players.size; i++)
{
wait( 1 );
level thread maps\_zombiemode_powerups::powerup_drop(players[i].origin + (100, 0, 10));
}
}

although im not sure if that would be messed up by the drop count stuff
No. I wanted to do it only or the player that uses the gobblegum.
Marked as best answer by HyperFirez 7 years ago
broken avatar :(
×
broken avatar :(
Location: aupotato
Date Registered: 27 September 2013
Last active: 3 years ago
Posts
588
Respect
Forum Rank
Zombie Enslaver
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
×
death_reaper0's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
then something like this should  be fine

Code Snippet
Plaintext
cache_back()
{
for ( i = 0; i < level.zombie_powerup_array.size; i++ )
{
if ( level.zombie_powerup_array[i] == "full_ammo" )
{
level.zombie_powerup_index = i;
break;
}
}
level.zombie_vars["zombie_drop_item"] = 1;
level.powerup_drop_count = 0;

// Player Handling
wait( 1 );
level thread maps\_zombiemode_powerups::powerup_drop(self.origin + (100, 0, 10));
}
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 6 July 2015
Last active: 4 years ago
Posts
114
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
×
HyperFirez's Groups
HyperFirez's Contact & Social LinksHyperFirezHyperFirezHyperFirezHyperFirezHyperFirezHyperFirezHyperFirez
How would you store them to an array though? (In case I need to use it for the future).
broken avatar :(
×
broken avatar :(
Location: nlApeldoorn
Date Registered: 17 December 2013
Last active: 1 year ago
Posts
1,187
Respect
1,404Add +1
Forum Rank
Zombie Colossus
Primary Group
Community Scripter Elite
My Groups
More
My Contact & Social Links
More
Personal Quote
It aint much, if it aint Dutch
Signature
×
BluntStuffy's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
Oil Rig Beta Access
Oil Rig Beta Access
BluntStuffy's Contact & Social LinksBluntstuffy@BluntZombieBluntStuffyStuffyZombie
Code Snippet
Plaintext
players = get_players();

broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 6 July 2015
Last active: 4 years ago
Posts
114
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
×
HyperFirez's Groups
HyperFirez's Contact & Social LinksHyperFirezHyperFirezHyperFirezHyperFirezHyperFirezHyperFirezHyperFirez
Code Snippet
Plaintext
players = get_players();
lol okay. I alread knew that.  :P
Thanks again guys.
Last Edit: January 06, 2017, 12:04:04 am by HyperFirez

 
Loading ...