Home   Help Search Login Register  

Author Topic: Side specific boundaries  (Read 1199 times)

0 Members and 1 Guest are viewing this topic.

Offline rhodesy_77

  • Members
  • *
Side specific boundaries
« 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  ;)

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: Side specific boundaries
« Reply #1 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.
« Last Edit: 09 Oct 2008, 13:35:05 by Spooner »
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline rhodesy_77

  • Members
  • *
Re: Side specific boundaries
« Reply #2 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

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: Side specific boundaries
« Reply #3 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.
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)