Jump to content
Sign in to follow this  
Midhaven

.sqs problems

Recommended Posts

Sometimes when a player executes a script on the server some actions doesn't update for all the players, I was hoping someone might have an explaination do this.

Say I have a trigger set up like this.

Condition:

Player distance tower < 10

On act.:

ID_tower = Player addAction ["Execute script","tower.sqs",(hideOnuse)]

On dea.:

Player removeAction ID_radiotower

Lets say tower.sqs is fairly simple, like this:

"towermarker" setMarkerColor "ColorGreen"

exit

After a player (anyone on the server) executes the script, shouldn't the "towermaker" color update to ColorGreen for everyone on the server?

First time I ran a script like this everyone on the server got the update. Now it seems only the player executing the script can see the change and for new players joining "towermarker" is still set to the default color.

Share this post


Link to post
Share on other sites

you need to use onplayerconnected for changes to markers to show up for jips. in this case you would need to do:

onplayerconnected '
_color = getMarkerColor "towermarker";
"towermarker" setMarkerColor _color;
';

basically this means that when a player connects to the server, the above code will be run server side, meaning all clients connected will get an update on the color of the marker. since the server was there for when you set the color to green (obviously), getmarkercolor will return green and the new jip players will receive the update.

Share this post


Link to post
Share on other sites

I still prefer using vehicle init for this.

Init lines of vehicles are always broadcast to all clients.

Something like this would be in your .sqs:

_cone = createVehicle  ["RoadCone",[0,0,0], [], 0, "FLY"];
_cone setVehicleInit "Player removeAction ID_tower; 'towermarker' setMarkerColor 'ColorGreen';"
processInitCommands;
deleteVehicle _cone;

And if I recall it right, this also shouldn't be a problem with JIP, since the markercolor is also set on the server.

Edited by Tajin

Share this post


Link to post
Share on other sites

Thanks for all the help.. pogoman979 and Tajin thanks, will try them both..

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  

×