UGX-Mods

Call of Duty: Black Ops 3 => Help Desk => Scripting => Topic started by: ToXxiCxMoDz on October 04, 2016, 01:39:00 am

Title: On Player Spawn will not work
Post by: ToXxiCxMoDz on October 04, 2016, 01:39:00 am
I saw a tutorial on Forums user MakeCent's website on how to do something when the player connects and/or spawns, which can be found here:
https://sites.google.com/site/makecentsgaming/home/bo3-tutorials/on-player-connect-spawn (https://sites.google.com/site/makecentsgaming/home/bo3-tutorials/on-player-connect-spawn)

I can't get it to work. I tried using IPrintLnBold and giving a weapon, but neither worked.

This is the code I used.
Code Snippet
Plaintext
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(){
iPrintLnBold("hi");
}
I tried putting the code above and below the main function, neither worked. Help is greatly appreciated!
Title: Re: On Player Spawn will not work
Post by: MakeCents on October 04, 2016, 05:05:03 pm
Show your whole script, not just this part. Also, I am not sure you will see this in zm as the screen may be black, try adding these lines.

Code Snippet
Plaintext
#using scripts\shared\flag_shared;//add to the top of the gsc you are using the line below in


level flag::wait_till( "initial_blackscreen_passed" );//add before print


did you call or thread the init function at all from main?
Title: Re: On Player Spawn will not work
Post by: ToXxiCxMoDz on October 05, 2016, 01:01:06 am
That worked, thank you so much!
Title: Re: On Player Spawn will not work
Post by: ToXxiCxMoDz on October 05, 2016, 01:05:05 am
Also if you don't mind me asking, where do you get all of the level flags from? (intial_blackscreen_passed, etc.)
Title: Re: On Player Spawn will not work
Post by: DidUknowiPwn on October 05, 2016, 02:46:47 pm
Also if you don't mind me asking, where do you get all of the level flags from? (intial_blackscreen_passed, etc.)
There is no appropriate list all you can do is search for the flags within the scripts.