OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting Multiplayer => Topic started by: rhodesy_77 on 06 Oct 2008, 05:00:25

Title: Side specific boundaries
Post by: rhodesy_77 on 06 Oct 2008, 05:00:25
G'day all this is my first post but ive been around these forums for awhile now slowly learning how to script for arma ( still very far off...)

ok well here is wat i have to do, atm i am using the out-of-bounds script by Norrin (very nice work btw). however i want it so its side specific, so instead of just all players i only want the civilian side to be affected. and this is in a large MP game also so there is many slots.

atm there are two military bases i want to be off limits to the civilian side and have them be punished after 5 seconds, by punished i would LOVE it to teleport them to a jail for 2 min, if thats to hard then killing them is good enough. also i want on the screen to flash like "you have entered a prohibited area, go back" or something along those lines..

any help would be very very very grateful

Cheers, Rhodesy  ;)
Title: Re: Side specific boundaries
Post by: Spooner on 06 Oct 2008, 13:49:13
Code: (civilianBoundary.sqf) [Select]
// run from init.sqf:
//    [] execVM "civilianBoundary.sqf";

// Don't run the script on a dedicated server.
if (isServer and (isNull player)) exitWith {};

// In MP, playerSide is west for ALL PLAYERS until the player object is created...
waitUntil { alive player };

// Only run the script for civilians.
if (playerSide == civilian) then
{
    // <== Run norrin's script here.
};

EDIT: Forgot to prevent script running on dedicated server.
Title: Re: Side specific boundaries
Post by: rhodesy_77 on 09 Oct 2008, 09:49:49
Thankyou very much for the reply, one question.

when you say "// <== Run norrin's script here." do i copy/paste the script into there or would i refer to the script? and if so how?

Cheers
Title: Re: Side specific boundaries
Post by: Spooner on 09 Oct 2008, 13:34:15
Well, I assumed since you said you were already using Norrin's script, you know already how to run it! You would just use the execVM command to run it in the way you are using it currently, but put it at the position I suggested, rather than where it is now, so that it is only run on the machine of civilian players.