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

On Player Connect/Spawn

broken avatar :(
Created 8 years ago
by MakeCents
0 Members and 1 Guest are viewing this topic.
5,474 views
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 4 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
Signature
×
MakeCents's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
   On Player Connect and Spawned has changed from WAW to BO3


  • WAW method:
Code Snippet
Plaintext
init()
{
thread onPlayerConnect();
}
onPlayerConnect()
{
for(;;)
{
level waittill("connecting", player);
player thread onPlayerSpawned();
}
}
OnPlayerSpawned()
{
//do this
}

It now uses a function in another script and calls the function passed when the player connects or spawns depending which you chose

  • BO3 method:
Code Snippet
Plaintext
//put this up top of script
#using scripts\shared\callbacks_shared;

function init(){
callback::on_connect( &on_player_connect );
callback::on_spawned( &on_player_spawned );
}
function on_player_connect(){
        //do stuff each time a player connects
}
function on_player_spawned(){
        //do stuff stuff each time player spawns
}
Last Edit: October 04, 2016, 01:50:57 pm by MakeCents
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 26 December 2014
Last active: 4 years ago
Posts
16
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
ToXxiCxMoDz's Groups
ToXxiCxMoDz's Contact & Social Links
Hey, tried putting the code both above and below the main function, neither worked. Do you know whats wrong? Thanks!
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 4 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
×
MakeCents's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
Hey, tried putting the code both above and below the main function, neither worked. Do you know whats wrong? Thanks!

Paste your code in hastebin or something and I might be able to tell.
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 26 December 2014
Last active: 4 years ago
Posts
16
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
ToXxiCxMoDz's Groups
ToXxiCxMoDz's Contact & Social Links
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 4 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
×
MakeCents's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
zm_test.gsc : http://pastebin.com/RQ4JSy1R
zm_test.csc : http://pastebin.com/uiVs5CMt

Okay, I think your problem was solved in a forum post, but for anyone that finds this, the gsc script does have the functions in it, although it was meant to put in its own script, but no other function shares the same name so you are okay with that. But you never actually call or thread the function init, that would start the whole thing, and that is why nothing is happening.


Edit: In this case, you could actually just put the on_connect lines in the main function and you don't need the init function at all.
Last Edit: October 05, 2016, 02:07:58 pm by MakeCents

 
Loading ...