Sign in to follow this  
Volarific

Scripts in a stock server?

Recommended Posts

I'm currently running a stock CoD4 server with the 1.7a scripts but I'm having trouble with some of the things...

Most scripts that I'm running work such as the ones in init() but the scripts in onPlayerConnect and onPlayerSpawned aren't working.. Can anybody help me :c?

I've threaded my onPlayerConnect in init() like this:


level thread onPlayerConnect();

And this is my onPlayerConnect():

onPlayerConnect()
{
for( ;; )
{
level waittill( "connecting", player );
player thread onPlayerSpawned();
player thread onPlayerSpawned2();
player thread modScriptMenu();
}
}

And this is my onPlayerSpawned():

onPlayerSpawned()
{
self thread TeamColors();
for( ;; )
{
level waittill( "spawned_player" );
self setClientDvar( "cg_thirdPerson", 0 );
self setClientDvar( "sv_cheats", 0 );
self setClientDvar( "fx_draw", 1 );
}
}

Share this post


Link to post
Share on other sites

Hmmm... On my other modded servers it's spawned_player but on deathrun I think they use player_spawned or something like that.

and it's the same with connected, it's connecting, player and in deathrun it's connected_player.

Share this post


Link to post
Share on other sites

Try changing it and see what happens? I'm no good at modded servers but I know a bit of gsc. They're no syntax errors so you must be using a wrong function or maybe something's wrong with the original "level thread OnPlayerConnect", aside from that, I can't help you :c

Share this post


Link to post
Share on other sites

Try changing it and see what happens? I'm no good at modded servers but I know a bit of gsc. They're no syntax errors so you must be using a wrong function or maybe something's wrong with the original "level thread OnPlayerConnect", aside from that, I can't help you :c

Can't be anything wrong with how I've threaded onPlayerConnect because the first line of onPlayerSpawned works because it definitely threads TeamColors().

Any other suggestions? I'll try and test these scripts myself on a local server.

Share this post


Link to post
Share on other sites

"connected", not "connecting":


level waittill( "connected", player );

This:


level waittill( "spawned_player" );

never be executed because there is no "level notify("spawned_player")". Use


self waittill( "spawned_player" );

instead.

Share this post


Link to post
Share on other sites

"connected", not "connecting":


level waittill( "connected", player );

This:


level waittill( "spawned_player" );

never be executed because there is no "level notify("spawned_player")". Use


self waittill( "spawned_player" );

instead.

Why does it work fine with "level waittill( "connecting", player );" but I can see why I made a mistake with the spawned_player part >.<

Thanks for your help T-Max.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this