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

Giving the player a weapon with a for a shooting range.

broken avatar :(
Created 8 years ago
by GNT123
0 Members and 1 Guest are viewing this topic.
2,042 views
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 9 October 2014
Last active: 5 years ago
Posts
15
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
GNT123's Groups
GNT123's Contact & Social Links
So in my map I have like a shooing range EE so I was wondering can someone please help me with giving the player a argus shotgun while they shoot the target but then give them back their gun that they had before they started the shooting range. Thanks.
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 12 September 2016
Last active: 3 years ago
Posts
306
Respect
Forum Rank
Perk Hacker
Primary Group
Member
My Contact & Social Links
More
×
reckfullies's Groups
reckfullies's Contact & Social LinksReckfulliesReckfullies
So in my map I have like a shooing range EE so I was wondering can someone please help me with giving the player a argus shotgun while they shoot the target but then give them back their gun that they had before they started the shooting range. Thanks.

Well you can store their current weapon(s) in a variable then give them a new one.

Once its over you can give them the weapons from the stored variable.

I'm not going to write a script for you but since you are making your own shooting range I would expect you at least know how to script.
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 9 October 2014
Last active: 5 years ago
Posts
15
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
GNT123's Groups
GNT123's Contact & Social Links
Well you can store their current weapon(s) in a variable then give them a new one.

Once its over you can give them the weapons from the stored variable.

I'm not going to write a script for you but since you are making your own shooting range I would expect you at least know how to script.

function that gives the player there gun.


function gun(player)
{
   
    player DisableOffhandWeapons();
    player DisableWeaponCycling();
   

    player AllowLean( false );
    player AllowCrouch( false );
    player AllowSprint( false );
    player AllowProne( false );       
    player AllowMelee( false );
    player AllowJump( false );


    if ( player GetStance() == "prone, Crouch" )
    {
        player SetStance( "stand" );
    }

    primaries = player GetWeaponsListPrimaries();
   
    start_gun = player GetCurrentWeapon();
    start_ammo = player GetWeaponAmmoStock( start_gun );
    weapon = "pistol_burst";   // rk5 just because idk what the name of the argus is
    player GiveWeapon( weapon );
    player SwitchToWeapon( weapon );
   
    self waittill("done");

    player EnableOffhandWeapons();
    player EnableWeaponCycling();
    player GiveWeapon( start_gun );
    player SetWeaponAmmoStock( start_gun, start_ammo );
    player SwitchToWeapon( start_gun );
    player AllowLean( true );
    player AllowSprint( true );
    player AllowProne( true );       
    player AllowMelee( true );
    player AllowJump( true );
    return start_gun;
     
     wait .5;
     
   
}

If you can tell me what's wrong with that because everything else works beside it giving me the rk5/shootgun, and also if you tell me were to look for the names for guns that would be great because I have searched for them in the _zm_weapons.gsc  can't find them. Also what's the easiest way of not allowing a person to move because I couldn't find it in the _zm_utility.gsc just found how not to let them sprint, switch weapons ect. I hope that it's not something easy that I'm just overlooking, Thsnks.

Double Post Merge: October 21, 2016, 10:10:35 pm
nvm I got the gun list I guess it helps of you go the wiki, also found out how to give the gun as well I guess the only thing I have left for questions what the easies way to make it so players can't move forward back left right but sill spin in place?
Last Edit: October 21, 2016, 10:10:35 pm by GNT123
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 12 September 2016
Last active: 3 years ago
Posts
306
Respect
Forum Rank
Perk Hacker
Primary Group
Member
My Contact & Social Links
More
×
reckfullies's Groups
reckfullies's Contact & Social LinksReckfulliesReckfullies
function that gives the player there gun.


Spoiler: click to open...
Code Snippet
Plaintext
function gun(player)
{
   
    player DisableOffhandWeapons();
    player DisableWeaponCycling();
   

    player AllowLean( false );
    player AllowCrouch( false );
    player AllowSprint( false );
    player AllowProne( false );       
    player AllowMelee( false );
    player AllowJump( false );


    if ( player GetStance() == "prone, Crouch" )
    {
        player SetStance( "stand" );
    }

    primaries = player GetWeaponsListPrimaries();
   
    start_gun = player GetCurrentWeapon();
    start_ammo = player GetWeaponAmmoStock( start_gun );
    weapon = "pistol_burst";   // rk5 just because idk what the name of the argus is
    player GiveWeapon( weapon );
    player SwitchToWeapon( weapon );
   
    self waittill("done");

    player EnableOffhandWeapons();
    player EnableWeaponCycling();
    player GiveWeapon( start_gun );
    player SetWeaponAmmoStock( start_gun, start_ammo );
    player SwitchToWeapon( start_gun );
    player AllowLean( true );
    player AllowSprint( true );
    player AllowProne( true );       
    player AllowMelee( true );
    player AllowJump( true );
    return start_gun;
     
     wait .5;
     
   
}

If you can tell me what's wrong with that because everything else works beside it giving me the rk5/shootgun, and also if you tell me were to look for the names for guns that would be great because I have searched for them in the _zm_weapons.gsc  can't find them. Also what's the easiest way of not allowing a person to move because I couldn't find it in the _zm_utility.gsc just found how not to let them sprint, switch weapons ect. I hope that it's not something easy that I'm just overlooking, Thsnks.

Double Post Merge: October 21, 2016, 10:10:35 pm
nvm I got the gun list I guess it helps of you go the wiki, also found out how to give the gun as well I guess the only thing I have left for questions what the easies way to make it so players can't move forward back left right but sill spin in place?

The is the engine function that they use for the teleporters but doesn't allow you to look around called:
Code Snippet
Plaintext
player FreezeControls(true/false)

However they also included a convenient engine function which allows this called:
Code Snippet
Plaintext
player FreezeControlsAllowLook(true/false)
Last Edit: October 22, 2016, 02:11:50 am by reckfullies

 
Loading ...