Jump to content
Sign in to follow this  
J.!(r)!x

Running a script just on admin's computer?

Recommended Posts

How can I run a script in a MP game only on one machine? For example the admin's one - something like this: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">?player!=admin:exit

PS: I need to do it generally - it means not to define one player's name (for ex. "run_only_here") and condition like<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">?player!=run_only_here:exit

Share this post


Link to post
Share on other sites

It's the local command you're looking for. There's a lot of material about this at OFPEC and I'm sure there is here too.

Here's a few examples:

?local player: exit on top of a script will make the script run for players only.

?local gamelogicname: exit on top of a script will make the script run for server only, because gamelogics are local on the server and nowhere else.

?local gamelogicname: wtank1 = "Bradley" createVehicle getpos gamelogicname this line will prevent the most likely bug in old CTF and such missions, which is that the vehicle was created on all computers and resulted in as many vehicles as there were players playing the mission.

Name the gamelogic as server as a reminder that gamelogic is local to server wink_o.gif

Share this post


Link to post
Share on other sites

I wanted a script without having to edit the mission.sqm itself. Anyway I used that - better than nothing ;)

It helped me much,

thank you

Share this post


Link to post
Share on other sites
I wanted a script without having to edit the mission.sqm itself. Anyway I used that - better than nothing ;)

It helped me much,

thank you

Not exactly sure what you mean by editing the mission.sqm...but going back to your original post:

If you know the player-object of the machine which is supposed to run the script you can just use:

? local <playerObject> : <code>

In addition, triggers can be set up to execute code only on one machine...

"player" always refers to the local player.

AIs under a player's command become local to that players machine and vehicles become local to the same machine their driver is local to. Anything no local to a player is local to the server.

Share this post


Link to post
Share on other sites

By "editing the mission.sqm" I meant to change the file via editor anywise. I am trying to use scripts as much as I only can. The reason is simple: I am producing technically similar MP missions always in a different scene. All I want to achieve is, when adding another environment to have to work in editor as less as possible (to deliminate the area, add players...)

Anyway the one thing more (adding the GameLogic called "server") doesn't hurt me much ;)

Thank you, that is working fine!

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  

×