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

Spawning with no weapon help

broken avatar :(
Created 11 years ago
by Z-W-A-Y
0 Members and 1 Guest are viewing this topic.
9,663 views
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 21 March 2015
Last active: 11 years ago
Posts
2
Respect
Forum Rank
Fresh Corpse
Primary Group
Member
×
Z-W-A-Y's Groups
Z-W-A-Y's Contact & Social Links
So I made this map and wanted to test it out so far and I have 2 problems. I spawn with no weapon, not even a knife, and the mystery box says it is undefined. When I spin the box it only shows the raygun and I cannot take it. Any help?
broken avatar :(
×
broken avatar :(
Face to Face
Location: chSomwhere
Date Registered: 6 October 2013
Last active: 3 years ago
Posts
947
Respect
Forum Rank
The Decider
Primary Group
Member
My Contact & Social Links
More
Signature
Maya <3

Let's Play some osu!
×
MrDunlop4's Groups
MrDunlop4's Contact & Social LinksMrDunlop4Nelielexy0Nelielexy0Nelielexy0Nelielexy0CSNelieley
For the weapon problem. Go to raw/maps/ and copy there _loadout.gsc and put them in MAPNAME/maps/. Rebuild the Mod. It should work.

For the Mystery Box problem. There is a file in raw/english/localizedstrings/ named zombie.str open the file with notepad and there is a line with the name of the Mystery Box.



Code Snippet
Plaintext
REFERENCE           RANDOM_WEAPON_950
LANG_ENGLISH        "Press &&1 for a Random Weapon [Cost: 950]"


I hope it helped you :)
Last Edit: May 25, 2015, 06:05:47 pm by MrDunlop4
broken avatar :(
×
broken avatar :(
Location: gb
Date Registered: 19 May 2015
Last active: 5 years ago
Posts
4
Respect
Forum Rank
Fresh Corpse
Primary Group
Member
×
khaki's Groups
khaki's Contact & Social Links
So I made this map and wanted to test it out so far and I have 2 problems. I spawn with no weapon, not even a knife, and the mystery box says it is undefined. When I spin the box it only shows the raygun and I cannot take it. Any help?
i have the same problem, i tried out what MrDunlop4 said but i still spawn with no gun and box is messed up
broken avatar :(
×
broken avatar :(
Location: ca
Date Registered: 23 July 2013
Last active: 9 years ago
Posts
33
Respect
Forum Rank
Legless Crawler
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
×
OPL's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
OPL's Contact & Social Links1Percentlgtalex_oplALEXOFOPLOPLRazor1Percentlegit
Having the same problem at the moment, after a fresh install, didnt have this problem before   :'(
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 6 years ago
Posts
6,875
Respect
Forum Rank
Immortal
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
Signature
If you want scripts / features made for you, then contact me by PM or email / skype etc
it will cost you tho so if you have no intention of reciprocating don't even waste my time ;)
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social LinksHarryBo000[email protected]HarryBo21
try replacing that _loadout.gsc with this

Code Snippet
Plaintext
#include maps\_utility;

init_loadout()
{
// MikeD (7/30/2007): New method of precaching/giving weapons.
// Set the level variables.
if( !IsDefined( level.player_loadout ) )
{
level.player_loadout = [];
}

// CODER MOD
// With the player joining later now we need to precache all weapons for the level
init_models_and_variables_loadout();

players = get_players();
for ( i = 0; i < players.size; i++ )
{
players[i] give_loadout();
players[i].pers["class"] = "closequarters";
}
level.loadoutComplete = true;
level notify("loadout complete");


// these precaches should only happen per level and campaign

if (level.campaign == "russian")
{
if (level.script == "ber2")
{
mptype\player_rus_guard_wet::precache();
}
else if (level.script == "sniper")
{
// nothing!
}
else
{
mptype\player_rus_guard::precache();
}
}
else if (level.campaign == "american")
{
if (level.script == "pel1")
{
mptype\player_usa_marine::precache();
}
else if (level.script == "pel1a" || level.script == "pel2")
{
mptype\player_usa_marine::precache();
}
else if (level.script == "oki2")
{
mptype\player_usa_marine_wet::precache();
}
else if( level.script == "mak")
{
mptype\player_usa_raider::precache();
}
else if ( level.script == "pby_fly")
{
//nothing
}
else if( isDefined( level.use_zombie_heroes ) && level.use_zombie_heroes )
{

mptype\nazi_zombie_heroes::precache();

}
else
{
mptype\player_usa_marine::precache();
}
}
else
{
mptype\player_usa_marine::precache();
}
}

init_models_and_variables_loadout()
{

// SCRIPTER_MOD
// MikeD (3/16/2007): Testmap for Coop
if( level.script == "coop_test1" )
{
add_weapon( "m1garand" );
add_weapon( "thompson" );
add_weapon( "fraggrenade" );
set_switch_weapon( "m1garand" );

set_player_viewmodel( "viewmodel_usa_marine_arms");

level.campaign = "american";
return;
}
else if( level.script == "mak" ) // MikeD
{
add_weapon( "nambu" );
set_switch_weapon( "nambu" );
set_laststand_pistol( "nambu" );

set_player_viewmodel( "viewmodel_usa_raider_arms" );
set_player_interactive_hands( "viewmodel_usa_raider_player" );

level.campaign = "american";
return;
}
else if( level.script == "pel1" ) // Jesse
{
add_weapon( "colt");
add_weapon( "m1garand_bayonet" );
add_weapon( "fraggrenade" );
add_weapon( "m8_white_smoke" );
add_weapon( "rocket_barrage" );
set_action_slot( 4, "weapon", "rocket_barrage" );
set_secondary_offhand( "smoke" );

set_laststand_pistol( "colt" );

set_player_viewmodel( "viewmodel_usa_marine_arms");
set_player_interactive_hands( "viewmodel_usa_marine_player" );

// CODER MOD (Austin & Sumeet 11/3/07)
// Fix bugs #1056 & #1057 with co-op players having no weapon selected
set_switch_weapon( "m1garand_bayonet" );

level.campaign = "american";
return;
}
else if( level.script == "pel1a" ) // MikeD
{
add_weapon( "m1garand" );
PrecacheItem( "m2_flamethrower" );
//add_weapon( "m2_flamethrower" );
add_weapon( "thompson" );
//TFLAME - Bug about 3 weapons
//add_weapon( "colt" );
add_weapon( "fraggrenade" );
add_weapon( "m8_white_smoke" );
set_secondary_offhand( "smoke" );
// set_switch_weapon( "m2_flamethrower" );
set_switch_weapon( "m1garand" );

set_laststand_pistol( "colt" );

set_player_viewmodel( "viewmodel_usa_marine_arms");
set_player_interactive_hands( "viewmodel_usa_marine_player" );

level.campaign = "american";
return;
}
else if( level.script == "pel1b" )
{
// TODO add level-specific weapons
add_weapon( "shotgun" );
add_weapon( "30cal_bipod" );
//add_weapon( "colt");
add_weapon( "fraggrenade" );
add_weapon( "m8_white_smoke" );
set_secondary_offhand( "smoke" );
set_switch_weapon( "30cal_bipod" );

set_laststand_pistol( "colt" );

set_player_viewmodel( "viewmodel_usa_marine_arms");
set_player_interactive_hands( "viewmodel_usa_marine_player");

level.campaign = "american";
return;
}
else if (level.script == "pby_fly" ) // Gavin
{
//add_weapon( "pby_backgun" );
//add_weapon( "pby_frontgun" );
//add_weapon( "pby_rightgun" );
//add_weapon( "pby_leftgun" );
//set_action_slot( 1, "weapon", "pby_frontgun" );
//set_action_slot( 4, "weapon", "pby_rightgun" );
//set_action_slot( 2, "weapon", "pby_backgun" );
//set_action_slot( 3, "weapon", "pby_leftgun" );

set_laststand_pistol( "colt" ); // No revive while in the air!

set_player_viewmodel( "viewmodel_usa_pbycrew_arms");

level.campaign = "american";
return;
}
else if( level.script == "pel2" ) // DPG (7/9/2007): Peleliu 2
{
add_weapon( "colt" );

add_weapon( "bar" );
add_weapon( "fraggrenade" );
add_weapon( "m8_white_smoke" );
set_secondary_offhand( "smoke" );

set_switch_weapon( "bar" );

set_laststand_pistol( "colt" );

set_player_viewmodel( "viewmodel_usa_marine_arms");
set_player_interactive_hands( "viewmodel_usa_marine_player" );

level.campaign = "american";
return;
}
else if( level.script == "see1" ) // Alex Liu
{
add_weapon( "mosin_rifle" );
add_weapon( "tokarev" );
// CODER_MOD: Austin (7/31/08): added stick grenade for russian campaign to replace smoke (BUG 17665)
add_weapon( "stick_grenade" );
add_weapon( "molotov" );
PrecacheItem( "napalmblob" );
PrecacheItem( "napalmbloblight" );
set_secondary_offhand( "smoke" );
set_switch_weapon( "mosin_rifle" );

set_laststand_pistol( "tokarev" );

set_player_viewmodel( "viewmodel_rus_guard_arms");

level.campaign = "russian";
return;
}
else if( level.script == "see2" ) // DPG (7/9/2007): Seelow 2
{
//add_weapon( "mosin_rifle" );
add_weapon( "m2_flamethrower" );
add_weapon( "ppsh" );
add_weapon( "stick_grenade" );
set_secondary_offhand( "smoke" );
set_switch_weapon( "m2_flamethrower" );

set_laststand_pistol( "none" ); // Players are in a tank

// SRS 6/24/2008: don't need visible viewarms because you're in a tank

level.campaign = "russian";
return;
}
else if( level.script == "ber1" ) // Bloodlust (7/06/2007): Berlin 1
{
add_weapon( "tokarev" );
add_weapon( "mosin_rifle" );
add_weapon( "stick_grenade" );
//add_weapon( "m8_white_smoke" );
add_weapon( "molotov" );
set_secondary_offhand( "molotov" );
set_switch_weapon( "mosin_rifle" );

set_laststand_pistol( "tokarev" );

set_player_viewmodel( "viewmodel_rus_guard_arms");

level.campaign = "russian";
return;
}
else if( level.script == "ber1_geo" ) // Bloodlust (10/22/2007): Berlin 1 Geo (for Brandon)
{
add_weapon( "mosin_rifle" );
add_weapon( "ppsh" );
add_weapon( "stick_grenade" );
add_weapon( "molotov" );
set_secondary_offhand( "smoke" );
set_switch_weapon( "mosin_rifle" );

set_laststand_pistol( "tokarev" );

set_player_viewmodel( "viewmodel_rus_guard_arms");

level.campaign = "russian";
return;
}
else if( level.script == "ber2" ) // SS
{
add_weapon( "ppsh" );
add_weapon( "tokarev" );
//add_weapon( "mosin_rifle" );  // SRS 5/9/2008: need to pick either the rifle or the SMG to start
// CODER_MOD: Austin (7/31/08): added stick grenade for russian campaign to replace smoke (BUG 17665)
add_weapon( "stick_grenade" );
add_weapon( "molotov" );
set_secondary_offhand( "smoke" );
set_switch_weapon( "ppsh" );

set_laststand_pistol( "tokarev" );

set_player_viewmodel( "viewmodel_rus_guard_arms");

level.campaign = "russian";
return;
}
else if( level.script == "sniper" ) // TFlame 2/12/08 - only weapon player should have is a scoped rifle
{
add_weapon( "mosin_rifle_scoped" );
add_weapon( "stick_grenade" );
set_switch_weapon("mosin_rifle_scoped");

set_laststand_pistol( "tokarev" );

set_player_viewmodel( "viewmodel_rus_guard_arms");
set_player_interactive_hands( "viewmodel_rus_guard_player" );

level.campaign = "russian";
return;
}
else if( level.script == "ber3" ) // Joyal
{
add_weapon( "svt40" );
add_weapon( "ppsh" );
// CODER_MOD: Austin (7/31/08): added stick grenade for russian campaign to replace smoke (BUG 17665)
add_weapon( "stick_grenade" );
add_weapon( "molotov" );
PrecacheItem( "napalmblob" );
PrecacheItem( "napalmbloblight" );
set_secondary_offhand( "smoke" );
set_switch_weapon( "ppsh" );

set_laststand_pistol( "tokarev" );

set_player_viewmodel("viewmodel_rus_guard_arms");
level.campaign = "russian";
return;
}
else if( level.script == "ber3b" ) // SS
{
add_weapon( "tokarev" );
add_weapon( "svt40" );
// CODER_MOD: Austin (7/31/08): added stick grenade for russian campaign to replace smoke (BUG 17665)
add_weapon( "stick_grenade" );
add_weapon( "molotov" );
set_secondary_offhand( "smoke" );
set_switch_weapon( "svt40" );

set_laststand_pistol( "tokarev" );

set_player_viewmodel( "viewmodel_rus_guard_arms");

level.campaign = "russian";
return;
}
else if( level.script == "oki2" ) // JeremyS
{
add_weapon( "30cal_wet" );
//add_weapon( "m2_flamethrower_wet" );
PrecacheItem( "m2_flamethrower_wet" );
add_weapon( "thompson_wet" );
add_weapon( "fraggrenade" );
add_weapon( "m8_white_smoke" );
//add_weapon( "satchel_charge" );
set_secondary_offhand( "smoke" );
// set_switch_weapon( "m2_flamethrower_wet" );
set_switch_weapon( "thompson_wet" );


set_laststand_pistol( "colt_wet" );

set_player_viewmodel( "viewmodel_usa_marinewet_rolledup_arms");
set_player_interactive_hands( "viewmodel_usa_marinewet_rolledup_player" ); // Uncomment this if you want "interactive" hands for Banzai

level.campaign = "american";
return;
}
else if( level.script == "prologue" ) // Lucas (03/14/2008)
{
add_weapon( "m1garand" );
add_weapon( "colt" );
set_switch_weapon( "colt" );

set_laststand_pistol( "colt" );

set_player_viewmodel( "viewmodel_usa_marine_arms");

level.campaign = "american";
return;
}
else if( level.script == "oki3" ) // ChrisP
{
add_weapon( "m1garand" );
add_weapon( "thompson" );
add_weapon( "fraggrenade" );
add_weapon( "m8_white_smoke" );
add_weapon("air_support");
set_action_slot( 4, "weapon", "air_support" );
set_secondary_offhand( "smoke" );
set_switch_weapon( "m1garand" );
set_laststand_pistol( "colt" );

set_player_viewmodel( "viewmodel_usa_marine_arms");
set_player_interactive_hands( "viewmodel_usa_marine_player" );

level.campaign = "american";
return;
}
else if( level.script == "living_battlefield" )
{
add_weapon( "m1garand_bayonet" );
add_weapon( "thompson" );
add_weapon( "molotov" );
PrecacheItem( "napalmblob" );
PrecacheItem( "napalmbloblight" );
add_weapon( "fraggrenade" );
set_secondary_offhand( "flash" );
set_switch_weapon( "m1garand_bayonet" );

set_laststand_pistol( "colt" );

set_player_viewmodel( "viewmodel_usa_marine_arms");

level.campaign = "american";
return;
}
else if( GetDvar( "zombiemode" ) == "1" || IsSubStr( level.script, "nazi_zombie_" ) || level.script == "zombie_test_map" ) // CODER_MOD (Austin 5/4/08): zombiemode loadout setup
{
add_weapon( "zombie_colt" );
// PrecacheItem( "napalmblob" );
// PrecacheItem( "napalmbloblight" );
set_switch_weapon( "zombie_colt" );

set_laststand_pistol( "zombie_colt" );

        // CHANGE HERE WHICH VIEWMODELS THE PLAYERS GET - Phil
        set_player_specific_viewmodel(0, "dempsey_viewhands");
        set_player_specific_viewmodel(1, "nikolai_viewhands");
        set_player_specific_viewmodel(2, "takeo_viewhands");
        set_player_specific_viewmodel(3, "richtofen_viewhands");
        // END - Don't change anything past this line
       
set_player_viewmodel( "viewmodel_usa_marine_arms");
set_player_interactive_hands( "viewmodel_usa_marine_player");

level.campaign = "american";
return;
}
else if( IsSubStr( level.script, "intro_" ) ) // Support for the intro movies for the campaigns
{
return;
}
else if( level.script == "credits" )
{
set_player_viewmodel( "viewmodel_usa_marine_arms");
set_player_interactive_hands( "viewmodel_usa_marine_player");
level.campaign = "american";
return;
}


//------------------------------------
// level.script is not a single player level. give default weapons.
println ("loadout.gsc:     No level listing in _loadout.gsc, giving default guns!!!! =======================");

// default weapons
add_weapon( "colt" );
add_weapon( "m1garand" );
add_weapon( "fraggrenade" );
add_weapon( "m8_white_smoke" );
set_secondary_offhand( "smoke" );

set_laststand_pistol( "colt" );
set_switch_weapon( "m1garand" );

// SRS 6/29/2008: updated to allow defaulted maps to have different level.campaign default viewarms
if( IsDefined( level.campaign ) && level.campaign == "russian" )
{
set_player_viewmodel( "viewmodel_rus_guard_arms");
}
else
{
set_player_viewmodel( "viewmodel_usa_marine_arms");
level.campaign = "american";
}
}

// This will precache and set the loadout rather than duplicating work.
add_weapon( weapon_name )
{
PrecacheItem( weapon_name );
level.player_loadout[level.player_loadout.size] = weapon_name;
}

// This sets the secondary offhand type when the player spawns in
set_secondary_offhand( weapon_name )
{
level.player_secondaryoffhand = weapon_name;
}

// This sets the the switchtoweapon when the player spawns in
set_switch_weapon( weapon_name )
{
level.player_switchweapon = weapon_name;
}

// This sets the the action slot for when the player spawns in
set_action_slot( num, option1, option2 )
{

if( num < 2 || num > 4)
{
if(level.script != "pby_fly")  // GLocke 11/15/2007 - The flying level uses all 4 dpad slots
{
// Not using 1, since it's defaulted to grenade launcher.
assertmsg( "_loadout.gsc: set_action_slot must be set with a number greater than 1 and less than 5" );
}
}

// Glocke 12/03/07 - added precaching of weapon type for action slot
if(IsDefined(option1))
{
if(option1 == "weapon")
{
PrecacheItem(option2);
level.player_loadout[level.player_loadout.size] = option2;
}
}

if( !IsDefined( level.player_actionslots ) )
{
level.player_actionslots = [];
}

action_slot = SpawnStruct();
action_slot.num = num;
action_slot.option1 = option1;

if( IsDefined( option2 ) )
{
action_slot.option2 = option2;
}

level.player_actionslots[level.player_actionslots.size] = action_slot;
}

// Sets the player's viewmodel
set_player_viewmodel( viewmodel )
{
PrecacheModel( viewmodel );
level.player_viewmodel = viewmodel;
}

// Sets the player's handmodel used for "interactive" hands and banzai attacks
set_player_interactive_hands( model )
{
level.player_interactive_hands = model;
PrecacheModel( level.player_interactive_hands );
}

// Sets the player's laststand pistol
set_laststand_pistol( weapon )
{
level.laststandpistol = weapon;
}

give_loadout(wait_for_switch_weapon)
{
if( !IsDefined( game["gaveweapons"] ) )
{
game["gaveweapons"] = 0;
}

if( !IsDefined( game["expectedlevel"] ) )
{
game["expectedlevel"] = "";
}

if( game["expectedlevel"] != level.script )
{
game["gaveweapons"] = 0;
}

if( game["gaveweapons"] == 0 )
{
game["gaveweapons"] = 1;
}

// MikeD (4/18/2008): In order to be able to throw a grenade back, the player first needs to at
// least have a grenade in his inventory before doing so. So let's try to find out and give it to him
// then take it away.
gave_grenade = false;

// First check to see if we are giving him a grenade, if so, skip this process.
for( i = 0; i < level.player_loadout.size; i++ )
{
if( WeaponType( level.player_loadout[i] ) == "grenade" )
{
gave_grenade = true;
break;
}
}

// If we do not have a grenade then try to automatically assign one
// If we can't automatically do this, then the scripter needs to do by hand in the level
if( !gave_grenade )
{
if( IsDefined( level.player_grenade ) )
{
grenade = level.player_grenade;
self GiveWeapon( grenade );
self SetWeaponAmmoStock( grenade, 0 );
gave_grenade = true;
}

if( !gave_grenade )
{
// Get all of the AI and assign any grenade to the player
ai = GetAiArray( "allies" );

if( IsDefined( ai ) )
{
for( i = 0; i < ai.size; i++ )
{
if( IsDefined( ai[i].grenadeWeapon ) )
{
grenade = ai[i].grenadeWeapon;
self GiveWeapon( grenade );
self SetWeaponAmmoStock( grenade, 0 );
break;
}
}
}

println( "^3LOADOUT ISSUE: Unable to give a grenade, the player need to be given a grenade and then take it away in order for the player to throw back grenades, but not have any grenades in his inventory." );
}
}

for( i = 0; i < level.player_loadout.size; i++ )
{
self GiveWeapon( level.player_loadout[i] );
}

self SetActionSlot( 1, "" );
self SetActionSlot( 2, "" );
self SetActionSlot( 3, "altMode" ); // toggles between attached grenade launcher
self SetActionSlot( 4, "" );

if( IsDefined( level.player_actionslots ) )
{
for( i = 0; i < level.player_actionslots.size; i++ )
{
num = level.player_actionslots[i].num;
option1 = level.player_actionslots[i].option1;

if( IsDefined( level.player_actionslots[i].option2 ) )
{
option2 = level.player_actionslots[i].option2;
self SetActionSlot( num, option1, option2 );
}
else
{
self SetActionSlot( num, option1 );
}
}
}

if( IsDefined( level.player_switchweapon ) )
{
// the wait was added to fix a revive issue with the host
// for some reson the SwitchToWeapon message gets lost
// this can be removed if that is ever resolved
if ( isdefined(wait_for_switch_weapon) && wait_for_switch_weapon == true )
{
wait(0.5);
}
self SwitchToWeapon( level.player_switchweapon );
}

wait(0.5);

self player_flag_set("loadout_given");
}

give_model( class )
{
// switch ( level.campaign )
// {
// case "russian":
// self mptype\player_rus_guard::main();
// break;
// case "american":
// default:
// self mptype\player_usa_marine::main();
// break;

if (level.campaign == "russian")
{
if (level.script == "ber2")
{
self mptype\player_rus_guard_wet::main();
}
else if (level.script == "sniper")
{
// nothing!
}
else
{
self mptype\player_rus_guard::main();
}
}
else if (level.campaign == "american")
{
if (level.script == "pel1")
{
self mptype\player_usa_marine::main();
}
else if (level.script == "pel1a" || level.script == "pel2")
{
self mptype\player_usa_marine::main();
}
else if (level.script == "oki2")
{
self mptype\player_usa_marine_wet::main();
}
else if (level.script == "mak")
{
self mptype\player_usa_raider::main();
}
else if ( level.script == "pby_fly")
{
//nothing
}
else if( isDefined( level.use_zombie_heroes ) && level.use_zombie_heroes )
{

players = get_players();

if(players.size > 1)
{

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;
}
}
else
{
self.body_select = randomint(4);

if(self.body_select == 0)
{
character\char_zomb_player_0::main();
self.entity_num_randomized = 0;
}

if(self.body_select == 1)
{
character\char_zomb_player_1::main();
self.entity_num_randomized = 1;
}

if(self.body_select == 2)
{
character\char_zomb_player_2::main();
self.entity_num_randomized = 2;
}

if(self.body_select == 3)
{
character\char_zomb_player_3::main();
self.entity_num_randomized = 3;
}

}
           
            // Gives the every player a specific viewmodel - Phil
            self give_player_specific_viewmodel();
            return;

}
else
{
self mptype\player_usa_marine::main();
}
}
else
{
self mptype\player_usa_marine::main();
}

// }
   
// MikeD (3/28/2008): If specified, give the player his hands
if( IsDefined( level.player_viewmodel ) )
{
self SetViewModel( level.player_viewmodel );
}
}

///////////////////////////////////////////////
// SavePlayerWeaponStatePersistent
//
// Saves the player's weapons and ammo state persistently( in the game variable )
// so that it can be restored in a different map.
// You can use strings for the slot:
//
// SavePlayerWeaponStatePersistent( "russianCampaign" );
//
// Or you can just use numbers:
//
// SavePlayerWeaponStatePersistent( 0 );
// SavePlayerWeaponStatePersistent( 1 ); etc.
//
// In a different map, you can restore using RestorePlayerWeaponStatePersistent( slot );
// Make sure that you always persist the data between map changes.

SavePlayerWeaponStatePersistent( slot )
{
current = level.player getCurrentWeapon();
if ( ( !isdefined( current ) ) || ( current == "none" ) )
assertmsg( "Player's current weapon is 'none' or undefined. Make sure 'disableWeapons()' has not been called on the player when trying to save weapon states." );
game[ "weaponstates" ][ slot ][ "current" ] = current;

offhand = level.player getcurrentoffhand();
game[ "weaponstates" ][ slot ][ "offhand" ] = offhand;

game[ "weaponstates" ][ slot ][ "list" ] = [];
weapList = level.player GetWeaponsList();
for ( weapIdx = 0; weapIdx < weapList.size; weapIdx++ )
{
game[ "weaponstates" ][ slot ][ "list" ][ weapIdx ][ "name" ] = weapList[ weapIdx ];

// below is only used if we want to NOT give max ammo
// game[ "weaponstates" ][ slot ][ "list" ][ weapIdx ][ "clip" ] = level.player GetWeaponAmmoClip( weapList[ weapIdx ] );
// game[ "weaponstates" ][ slot ][ "list" ][ weapIdx ][ "stock" ] = level.player GetWeaponAmmoStock( weapList[ weapIdx ] );
}
}

RestorePlayerWeaponStatePersistent( slot )
{
if ( !isDefined( game[ "weaponstates" ] ) )
return false;
if ( !isDefined( game[ "weaponstates" ][ slot ] ) )
return false;

level.player takeallweapons();

for ( weapIdx = 0; weapIdx < game[ "weaponstates" ][ slot ][ "list" ].size; weapIdx++ )
{
weapName = game[ "weaponstates" ][ slot ][ "list" ][ weapIdx ][ "name" ];

if ( isdefined( level.legit_weapons ) )
{
// weapon doesn't exist in this level
if ( !isdefined( level.legit_weapons[ weapName ] ) )
continue;
}

// don't carry over C4 or claymores
if ( weapName == "c4" )
continue;
if ( weapName == "claymore" )
continue;
level.player GiveWeapon( weapName );
level.player GiveMaxAmmo( weapName );

// below is only used if we want to NOT give max ammo
// level.player SetWeaponAmmoClip( weapName, game[ "weaponstates" ][ slot ][ "list" ][ weapIdx ][ "clip" ] );
// level.player SetWeaponAmmoStock( weapName, game[ "weaponstates" ][ slot ][ "list" ][ weapIdx ][ "stock" ] );
}

if ( isdefined( level.legit_weapons ) )
{
weapname = game[ "weaponstates" ][ slot ][ "offhand" ];
if ( isdefined( level.legit_weapons[ weapName ] ) )
level.player switchtooffhand( weapname );

weapname = game[ "weaponstates" ][ slot ][ "current" ];
if ( isdefined( level.legit_weapons[ weapName ] ) )
level.player SwitchToWeapon( weapname );
}
else
{
level.player switchtooffhand( game[ "weaponstates" ][ slot ][ "offhand" ] );
level.player SwitchToWeapon( game[ "weaponstates" ][ slot ][ "current" ] );
}

return true;
}

set_player_specific_viewmodel(num, name)
{
    if(!IsDefined(level.player_specific_viewmodels))
        level.player_specific_viewmodels = [];
    level.player_specific_viewmodels[num] = name;
    PrecacheModel(name);
}

give_player_specific_viewmodel()
{
    num = self.entity_num;
    if(IsDefined(self.entity_num_randomized))
        num = self.entity_num_randomized;
   
    if(IsDefined(level.player_specific_viewmodels) && IsDefined(level.player_specific_viewmodels[num]))
    {
        self SetViewModel(level.player_specific_viewmodels[num]);
    }
    else if(IsDefined(level.player_viewmodel))
    {
        self SetViewModel(level.player_viewmodel);
    }
}

The above is stock and works fine. If your still having issues after, then something else is wrong
broken avatar :(
×
broken avatar :(
Location: gb
Date Registered: 19 May 2015
Last active: 5 years ago
Posts
4
Respect
Forum Rank
Fresh Corpse
Primary Group
Member
×
khaki's Groups
khaki's Contact & Social Links
Didnt work :/ it only happens when i use the ugx script placer when its a non ugx mod map
broken avatar :(
×
broken avatar :(
Location: ca
Date Registered: 23 July 2013
Last active: 9 years ago
Posts
33
Respect
Forum Rank
Legless Crawler
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
×
OPL's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
OPL's Contact & Social Links1Percentlgtalex_oplALEXOFOPLOPLRazor1Percentlegit
I had to reinstall again and iam not having issues (with non ugx ) <-- i had problems with both.  Ill try ugx mod maps tonight it maybe a bug with the scripter cause it happened on two outa three fresh waw installs?  :poker:
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 6 years ago
Posts
6,875
Respect
Forum Rank
Immortal
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social LinksHarryBo000[email protected]HarryBo21
the SP has been around for years, it works correctly
broken avatar :(
×
broken avatar :(
Location: gb
Date Registered: 19 May 2015
Last active: 5 years ago
Posts
4
Respect
Forum Rank
Fresh Corpse
Primary Group
Member
×
khaki's Groups
khaki's Contact & Social Links
the SP has been around for years, it works correctly
yh i did a fresh install of tools and its working fine now i must of just messed the files up somehow  :P
broken avatar :(
×
broken avatar :(
Face to Face
Location: chSomwhere
Date Registered: 6 October 2013
Last active: 3 years ago
Posts
947
Respect
Forum Rank
The Decider
Primary Group
Member
My Contact & Social Links
More
×
MrDunlop4's Groups
MrDunlop4's Contact & Social LinksMrDunlop4Nelielexy0Nelielexy0Nelielexy0Nelielexy0CSNelieley
Didnt work :/ it only happens when i use the ugx script placer when its a non ugx mod map

Maybe there is a problem with the UGX Script placer for you :/
Last Edit: June 06, 2015, 02:31:19 pm by MrDunlop4
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 6 years ago
Posts
6,875
Respect
Forum Rank
Immortal
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social LinksHarryBo000[email protected]HarryBo21
yh i did a fresh install of tools and its working fine now i must of just messed the files up somehow  :P
do you even read what your responding to dunlop...
broken avatar :(
×
broken avatar :(
Face to Face
Location: chSomwhere
Date Registered: 6 October 2013
Last active: 3 years ago
Posts
947
Respect
Forum Rank
The Decider
Primary Group
Member
My Contact & Social Links
More
×
MrDunlop4's Groups
MrDunlop4's Contact & Social LinksMrDunlop4Nelielexy0Nelielexy0Nelielexy0Nelielexy0CSNelieley
do you even read what your responding to dunlop...

hmm....

when i see this..... not really  :-\

 
Loading ...