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

How to spawn with All Or atleast 4 perks in a Mod (not a ZM Map)

broken avatar :(
Created 10 years ago
by dbzfun2
0 Members and 1 Guest are viewing this topic.
2,593 views
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 18 April 2016
Last active: 9 years ago
Posts
10
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
dbzfun2's Groups
dbzfun2's Contact & Social Links
So I'm asking my friends for help for a script that works in a Mod Not a map, Basically right when you spawn you will receive 4 perks and they will be random. I'll post atleast one script I want to put it in. If you can reply to me with the Perks in the script Than thanks so much for helping!
-dbzfun2

Code Snippet
Plaintext
#using scripts\codescripts\struct;

#using scripts\shared\callbacks_shared;
#using scripts\shared\system_shared;

#insert scripts\shared\shared.gsh;

#namespace clientids;

REGISTER_SYSTEM( "clientids", &__init__, undefined )
 
function __init__()
{
    callback::on_start_gametype( &init );
    callback::on_connect( &on_player_connect );
    callback::on_spawned( &on_player_spawned );
    level.player_out_of_playable_area_monitor = false;

}

function init()
{
    level.clientid = 0;
    level.player_out_of_playable_area_monitor = false;
 
}

function on_player_connect()
{
    self.clientid = matchRecordNewPlayer( self );
    if ( !isdefined( self.clientid ) || self.clientid == -1 )
IPrintln("Test!");
self thread newMovment();
    {
        self.clientid = level.clientid;
        level.clientid++;
    }
}

function on_player_spawned() // For when people spawn.
{
    IPrintln("^1Another person!? Woah!");
    self thread newMovment();
}
function newMovment()
{
    SetDvar( "doublejump_enabled", 1 );
    SetDvar( "juke_enabled", 1 );
    SetDvar( "wallrun_enabled", 1 );
    SetDvar( "sprintLeap_enabled", 1 );
    SetDvar( "traverse_mode", 1 );
    SetDvar( "sv_cheats", 1 );
}

Double Post Merge: November 06, 2016, 02:24:08 pm
I didn't want it to be named How to give, I wanted it to be How do I spawn with all or atleast 4 random perks!

Rip me....
Last Edit: November 06, 2016, 02:40:04 pm by Sidzzz
broken avatar :(
×
broken avatar :(
Pragmatist
Location: us
Date Registered: 9 May 2015
Last active: 1 year ago
Posts
451
Respect
Forum Rank
Perk Hacker
Primary Group
UGX Site Moderator
My Groups
More
My Contact & Social Links
More
Personal Quote
Fish. That is all
Signature
×
Sidzzz's Groups
UGX Site Moderator Has the ability to issue warnings to users, edit and remove posts from the forum and to move topics to other boards. Upholds the rules of the forum. Moderates Chat Rooms.
Sidzzz's Contact & Social LinksSidzzzsidzzzsidzzzTheSidzzzTheSidzzz@TheSidzzz
Keep in mind that you need to use the Code tags if you wish to include bits of code or scripts in your post. This is explicitly a forum rule mentioned here - http://ugx-mods.com/forum/index.php?topic=3.0

I took care of it for you this time, but be cautious in the future :)
Last Edit: November 06, 2016, 02:45:23 pm by Sidzzz
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 18 April 2016
Last active: 9 years ago
Posts
10
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
dbzfun2's Groups
dbzfun2's Contact & Social Links
Keep in mind that you need to use the Code tags if you wish to include bits of code or scripts in your post. This is explicitly a forum rule mentioned here - http://ugx-mods.com/forum/index.php?topic=3.0

I took care of it for you this time, but be cautious in the future :)

Thanks so much man! I'm actually New to forums, In general As in Never have been on a site like this Lol.
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 12 September 2016
Last active: 9 months ago
Posts
305
Respect
Forum Rank
Perk Hacker
Primary Group
Member
My Contact & Social Links
More
×
reckfullies's Groups
reckfullies's Contact & Social LinksReckfulliesReckfullies
So I'm asking my friends for help for a script that works in a Mod Not a map, Basically right when you spawn you will receive 4 perks and they will be random. I'll post atleast one script I want to put it in. If you can reply to me with the Perks in the script Than thanks so much for helping!
-dbzfun2

Spoiler: click to open...
Code Snippet
Plaintext
#using scripts\codescripts\struct;

#using scripts\shared\callbacks_shared;
#using scripts\shared\system_shared;

#insert scripts\shared\shared.gsh;

#namespace clientids;

REGISTER_SYSTEM( "clientids", &__init__, undefined )
 
function __init__()
{
    callback::on_start_gametype( &init );
    callback::on_connect( &on_player_connect );
    callback::on_spawned( &on_player_spawned );
    level.player_out_of_playable_area_monitor = false;

}

function init()
{
    level.clientid = 0;
    level.player_out_of_playable_area_monitor = false;
 
}

function on_player_connect()
{
    self.clientid = matchRecordNewPlayer( self );
    if ( !isdefined( self.clientid ) || self.clientid == -1 )
IPrintln("Test!");
self thread newMovment();
    {
        self.clientid = level.clientid;
        level.clientid++;
    }
}

function on_player_spawned() // For when people spawn.
{
    IPrintln("^1Another person!? Woah!");
    self thread newMovment();
}
function newMovment()
{
    SetDvar( "doublejump_enabled", 1 );
    SetDvar( "juke_enabled", 1 );
    SetDvar( "wallrun_enabled", 1 );
    SetDvar( "sprintLeap_enabled", 1 );
    SetDvar( "traverse_mode", 1 );
    SetDvar( "sv_cheats", 1 );
}

Double Post Merge: November 06, 2016, 02:24:08 pm
I didn't want it to be named How to give, I wanted it to be How do I spawn with all or atleast 4 random perks!

Rip me....

I've never made a mod before but I would assume it is the same as scripting for a map. Considering this is a mod for zombies you can use _zm scripts so just do this:
Code Snippet
Plaintext
#using scripts\codescripts\struct;

#using scripts\shared\callbacks_shared;
#using scripts\shared\system_shared;

#using scripts\zm\_zm_perks;

#insert scripts\shared\shared.gsh;

#namespace clientids;

REGISTER_SYSTEM( "clientids", &__init__, undefined )
 
function __init__()
{
    callback::on_start_gametype( &init );
    callback::on_connect( &on_player_connect );
    callback::on_spawned( &on_player_spawned );
    level.player_out_of_playable_area_monitor = false;

}

function init()
{
    level.clientid = 0;
    level.player_out_of_playable_area_monitor = false;
 
}

function on_player_connect()
{
    self.clientid = matchRecordNewPlayer( self );
    if ( !isdefined( self.clientid ) || self.clientid == -1 )
IPrintln("Test!");
self thread newMovment();
    {
        self.clientid = level.clientid;
        level.clientid++;
    }
}

function on_player_spawned() // For when people spawn.
{
    IPrintln("^1Another person!? Woah!");
    self thread newMovment();
    self thread givePerks();
}
function newMovment()
{
    SetDvar( "doublejump_enabled", 1 );
    SetDvar( "juke_enabled", 1 );
    SetDvar( "wallrun_enabled", 1 );
    SetDvar( "sprintLeap_enabled", 1 );
    SetDvar( "traverse_mode", 1 );
    SetDvar( "sv_cheats", 1 );
}

function givePerks()
{
    self zm_perks::give_random_perk();
    self zm_perks::give_random_perk();
    self zm_perks::give_random_perk();
    self zm_perks::give_random_perk();
}

Since this is using a _zm script enabling this mod on multiplayer wouldn't work right.
Last Edit: November 06, 2016, 04:41:47 pm by reckfullies
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 18 April 2016
Last active: 9 years ago
Posts
10
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
dbzfun2's Groups
dbzfun2's Contact & Social Links
I've never made a mod before but I would assume it is the same as scripting for a map. Considering this is a mod for zombies you can use _zm scripts so just do this:
Code Snippet
Plaintext
#using scripts\codescripts\struct;

#using scripts\shared\callbacks_shared;
#using scripts\shared\system_shared;

#using scripts\zm\_zm_perks;

#insert scripts\shared\shared.gsh;

#namespace clientids;

REGISTER_SYSTEM( "clientids", &__init__, undefined )
 
function __init__()
{
    callback::on_start_gametype( &init );
    callback::on_connect( &on_player_connect );
    callback::on_spawned( &on_player_spawned );
    level.player_out_of_playable_area_monitor = false;

}

function init()
{
    level.clientid = 0;
    level.player_out_of_playable_area_monitor = false;
 
}

function on_player_connect()
{
    self.clientid = matchRecordNewPlayer( self );
    if ( !isdefined( self.clientid ) || self.clientid == -1 )
IPrintln("Test!");
self thread newMovment();
    {
        self.clientid = level.clientid;
        level.clientid++;
    }
}

function on_player_spawned() // For when people spawn.
{
    IPrintln("^1Another person!? Woah!");
    self thread newMovment();
    self thread givePerks();
}
function newMovment()
{
    SetDvar( "doublejump_enabled", 1 );
    SetDvar( "juke_enabled", 1 );
    SetDvar( "wallrun_enabled", 1 );
    SetDvar( "sprintLeap_enabled", 1 );
    SetDvar( "traverse_mode", 1 );
    SetDvar( "sv_cheats", 1 );
}

function givePerks()
{
    self zm_perks::give_random_perk();
    self zm_perks::give_random_perk();
    self zm_perks::give_random_perk();
    self zm_perks::give_random_perk();
}

Since this is using a _zm script enabling this mod on multiplayer wouldn't work right.
Thanks so much! It works! :D 

 
Loading ...