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

[BO1] Giving Back Player's Weapons After Respawn?

broken avatar :(
Created 11 years ago
by jbird
0 Members and 1 Guest are viewing this topic.
1,222 views
broken avatar :(
×
broken avatar :(
Location: usUnited States
Date Registered: 13 May 2014
Last active: 5 days ago
Posts
167
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
×
jbird's Groups
I'm trying to give players back whatever weapons they had when they died once they respawn after a round restart. I had this working in World at War, but the function I used to give players their weapons back isn't in BO1. Here is the script:
Code Snippet
Plaintext
checkForAllDead()
{
players = get_players();
count = 0;
for( i = 0; i < players.size; i++ )
{
if( !(players[i] maps\_laststand::player_is_in_laststand()) && !(players[i].sessionstate == "spectator") )
{
count++;
}
}

if( count==0 )
{
zombs = getaispeciesarray("axis");
for(i=0;i<zombs.size;i++)
{
zombs[i] delete(); //removes all currently spawned in zombies
}

//maps\_zombiemode_powerups::powerup_round_start(); //restarts the amount of powerups you can earn this round
//array_thread( players, maps\_zombiemode_blockers_new::rebuild_barrier_reward_reset ); //restarts your barrier points this round
level thread round_restart();

players = get_players();
for(i=0;i<players.size;i++)
{
//players[i] thread maps\_laststand::laststand_disable_player_weapons();

players[i] spectator_respawn();
players[i] [[level.spawnPlayer]]();
while(1)
{
if(players[i] hasWeapon("m1911_zm"))
{
//iprintlnbold("Found the weapon"); //worked

players[i] thread maps\_laststand::laststand_enable_player_weapons();
if( isDefined( players[i].has_altmelee ) && players[i].has_altmelee )
{
players[i] SetPerk( "specialty_altmelee" );
}
level thread award_grenades_for_survivors(); //get 2 extra grenades when you spawn back in, optional
break;
}
wait(0.05);
}
}
iprintlnbold("You have been given another chance"); //message letting you know the round restarted, optional
}
}
In World at War, it was called laststand_giveback_player_weapons() and it worked to give back player's weapons. In BO1 that function doesn't exist but there is a similar function called laststand_enable_player_weapons() but this sadly isn't working for me.

 
Loading ...