Jump to content
Sign in to follow this  
=Odin=

Initplayer script works but it dos'ent?

Recommended Posts

G'day,

I have a test map where all three sides are playable and use a diferent version of a dialog dependent on your chosen side. for my initplayer I have this;

Quote[/b] ]if (!isServer && (player != player)) then

{

 waitUntil {player == player};

 waitUntil {time > 10};

};

if (side player == east) then

{

nul=[] execVM "eastinit.sqf";

};

if (side player == west) then

{

nul=[] execVM "westinit.sqf";

};

if (side player == resistance) then

{

nul=[] execVM "indiiinit.sqf";

};

This works in asmuch that it goes to the required sideinit and what is executed from them works for only that side, but the

Quote[/b] ]if (!isServer && (player != player)) then

{

 waitUntil {player == player};

 waitUntil {time > 10};

};

Dos'ent seem to fire as everthing executed via the sideinit scripts works immediatly with no wait period. So should I add the server/player check to the sideinit scripts or is this allright the way it is?

thanx

Odin

Share this post


Link to post
Share on other sites

Optimized and Commented on why and what

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">if (!isServer && (player != player)) then

{

  // This only executes on a JIP player's computer, because that's the only place where !isServer && (player != player) during init.sqf

  waitUntil { player == player };

  waitUntil { time > 10 };

};

switch playerSide do

{

  case east: { execVM "eastinit.sqf" };

  case west: { execVM "westinit.sqf" };

  case resistance: { execVM "indiiinit.sqf" };

};

[*] You don't need nil =   (or alike)   if you use execVM in scripts

[*] You don't need to supply an empty array  ([]) or other type if you don't need any parameters.

[*] Switch / Case   over  if if if if if if smile_o.gif

[*] Your !isServer && (player != player) Condition is only valid on a JIP player's computer, not on any other.

Share this post


Link to post
Share on other sites

LOL I spent near on a day waiting for the wait to kick in rofl.gif

heehe I was never a JIP. Thankx alot for that Sickboy and the easy reading script works great notworthy.gif

<S>

Odin

Share this post


Link to post
Share on other sites
LOL I spent near on a day waiting for the wait to kick in rofl.gif

heehe I was never a JIP. Thankx alot for that Sickboy and the easy reading script works great notworthy.gif

<S>

Odin

Np mate, just use some player sideChat "debug message"; etc. etc if something doesn't seem to work as you intended biggrin_o.gif

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×