

Login Issues
Forgot password?Activate Issues
Account activation email not received? Wrong account activation email used?Other Problems?
Contact Support - Help Center Get help on the UGX Discord. Join it now!![]() | Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum. |
![]() | Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community. |
//===========================================================================
// Script Name : Randomize Zombie Characters
// Author : xSanchez78( alaurenc9 )
// Notes : Read The Directions Below
//===========================================================================
//////////////Script Instructions Here//////////////
/*********************************************************************************************************************************************************
In your "mapname.gsc", call
maps\_character_randomize::init();
Underneath this:
--------------------
FUNCTION CALLS - PRE _Load
----------------------
In "_loadout.gsc", find this function: "give_model( class )"
Scroll down to where it says this:
switch(self.entity_num)
{
case 0:
character\char_zomb_player_0::main();
break;
case 1:
character\char_zomb_player_1::main();
break;
case 2:
character\char_zomb_player_2::main();
break;
case 3:
character\char_zomb_player_3::main();
break;
}
Replace that with this:
switch( maps\_zombiemode_weapons::get_player_index( self ) )
{
case 0:
character\char_zomb_player_0::main();
break;
case 1:
character\char_zomb_player_1::main();
break;
case 2:
character\char_zomb_player_2::main();
break;
case 3:
character\char_zomb_player_3::main();
break;
}
In "_zombiemode_weapons.gsc", find this function: "get_player_index(player)"
In that function, replace
return player.entity_num;
with
return level.random_character_index[player.entity_num];
In "_zombiemode.gsc", find this function: "onPlayerConnect_clientDvars()"
Underneath the "SetClientDvars" function, add this:
for( i = 0; i < 4; i++ )
{
self SetClientDvar( "cg_ScoresColor_Gamertag_" + i, level.random_character_color[ level.random_character_index[ i ] ] );
}
Make Sure you have edited each file correctly,
and that they are in your "Root/mods/mapname/maps" folder.
Call this script this:
_character_randomize.gsc
Make sure it is placed in "Root/mods/mapname/maps" aswell.
When building mod, make sure to check the following:
maps/_zombiemode.gsc
maps/_zombiemode_weapons.gsc
maps/_loadout.gsc
maps/mapname.gsc
maps/_character_randomize.gsc
Compile Map/Build Mod and enjoy!
*********************************************************************************************************************************************************/
#include common_scripts\utility;
#include maps\_utility;
#include maps\_zombiemode_utility;
init()
{
randomize_character_index();
get_player_score_colors();
}
randomize_character_index()
{
level.random_character_index = [];
for( i = 0; i < 4; i++ )
{
level.random_character_index[ i ] = i;
}
level.random_character_index = array_randomize( level.random_character_index );
}
get_player_score_colors()
{
level.random_character_color = [];
for( i = 0; i < 4; i++ )
{
level.random_character_color[ i ] = GetDvar( "cg_ScoresColor_Gamertag_" + i );
}
}
![]() | Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum. |
![]() | Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum. |
![]() | Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community. |
nice!!!
but will it work with YaPh1l Character specific viewhands script?