Post: Run a function when you connect
08-22-2015, 01:45 AM #1
(adsbygoogle = window.adsbygoogle || []).push({}); Is there any way you can run a function when you connect/join the game as host?
(adsbygoogle = window.adsbygoogle || []).push({});
08-22-2015, 07:13 AM #11
ByteSource
League Champion
Originally posted by Daniel41550 View Post
OK, so if I wanted to run a one of the mod menu's functions, for example, endgame() I would just put endgame() where "you_calling_function()" is?


You dont want to run a function when connecting, you want to run when the game already knows you spawned in and knows your Host. but if you want to connect to a function that ends the game is legendary!

but heres how you do it

onPlayerSpawned()
{
self endon("disconnect");
level endon("game_ended");
for(;
{
self waittill("spawned_player");

/(self isHost())
self iprintln("welcome to legendary gangsta! v32");
self thread Function_name();

}
}


anywhere else in thread....


Function_name()
{
//HERES WHERE YOUR FUNCTION GOES
}
08-22-2015, 06:35 PM #12
yes thats right
08-22-2015, 06:37 PM #13
i didnt say to start when your connecting Facepalm thats why i said when player_spawned
08-22-2015, 08:41 PM #14
itsSorrow
In my man cave
Originally posted by AGKxCOLEADER View Post
i didnt say to start when your connecting Facepalm thats why i said when player_spawned


you shouldn't facepalm shit..
08-22-2015, 09:01 PM #15
Originally posted by TehK9
You dont want to run a function when connecting, you want to run when the game already knows you spawned in and knows your Host. but if you want to connect to a function that ends the game is legendary!

but heres how you do it

onPlayerSpawned()
{
self endon("disconnect");
level endon("game_ended");
for(;
{
self waittill("spawned_player");

/(self isHost())
self iprintln("welcome to legendary gangsta! v32");
self thread Function_name();

}
}


anywhere else in thread....


Function_name()
{
//HERES WHERE YOUR FUNCTION GOES
}


Thank you! I got it to work.
08-22-2015, 11:29 PM #16
ByteSource
League Champion
Originally posted by Daniel41550 View Post
Thank you! I got it to work.


WELCOME m8, skype me if you have any other questions. iHc-XD

please dont message me to do your mod menu

The following user thanked ByteSource for this useful post:

FRINZ
08-23-2015, 01:17 AM #17
itsSorrow
In my man cave
Originally posted by TehK9
WELCOME m8, skype me if you have any other questions. iHc-XD

please dont message me to do your mod menu


to late >Smile
08-25-2015, 12:36 AM #18
Originally posted by Daniel41550 View Post
Thank you! I got it to work.


your kidding right? thats exactly what I said to do, all he did was add in some random shit.

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo