Forum Jump :

Author Message


Posts: 123
Rank:


Level: Member

Country: us
Location: Ga.
Occupation: Disabled
Age: 54
In-game name: SpectrumWarrior

 
#1 Posted at 2011-05-20 15:44        
     
Hi: Looking for a little help on a triger. I am trying to make a restricted area via triger. Triger is set around the area, activation west, repeating, condition = this, on act = if (score player < BIS_EVO_rankX) exitwith {handle = [player,BIS_EVO_rankX] execVM "Punish.sqf";. The triger works fine for what ever rank I put in and does what the punish.sqf tells it to do. My problem is that it does not just move the player in the triger to the punish area, BUT moves all human players on the map / in the server to the punish area. My question is what do I need to change player to, to only move the player in the triger to the punish area and not everyone else in the server as well when a player enters the triger area? Or what do I need to add to my punish.sqf
disableUserInput true;
removeallweapons player;
player setpos position jail;
player setdir 0;
bancount = bancount+1;
_pos = [(position player select 0),(position player select 1)+2.6,(position player select 2)+2];


_phonehint = createTrigger ["EmptyDetector", [8158.4819,470.67847,9121.6494]];
_phonehint setTriggerActivation ["WEST", "PRESENT", false];
_phonehint setSoundEffect ["Maggot","you","",""];
_phonehint setTriggerStatements ["true", "", ""];

hint "hint: You have been punished for ENTERING A RANK RESTRICTED AREA WITH OUT HAVING THE PROPER RANK. You will regain control after you have served your sentence of 60 seconds";

_i = -60;

while {_i != 0} do 
{
	titleText [format ["%1",_i],"plain down"];
	_i = _i + 3;
	playSound "Maggot";
	sleep 5.0;
	playSound "you";
	sleep 11.0;
};




deletevehicle _phonehint;

_phonehint2 = createTrigger ["EmptyDetector", [8158.4819,470.67847,9121.6494]];
_phonehint2 setTriggerActivation ["NONE", "PRESENT", false];
_phonehint2 setSoundEffect ["none","","",""];
_phonehint2 setTriggerStatements ["true", "", ""];
sleep 1.0;
deletevehicle _phonehint2;
player setdammage 1;
disableUserInput false;
to only grab the player in the triger area's ID and only move him? I am also having this problem in arma. arma on act = if (score player < rankX) exitwith {handle = [player,rankX] execVM "Punish.sqf";. Any help at all here thanks, Robert.

This post was edited by SpectrumWarrior (2011-05-20 16:29, ago)


Author Message

palyarmerc  

I live inside the editor


Posts: 752
Rank:


Level: Member PFS

Country: 00
Location:
Occupation: *Retired*
Age:
In-game name: *Retired*

 
#2 Posted at 2011-05-21 00:49        
     
Condition: this && Player in thislist

Also, I've not seen the command before (I like it) but I assume you have a ranking limitation to the trigger.
I'm assuming it'd be something like

if (score player < rankMAJOR) exitwith {handle = [player,rankMAJOR] execVM "Punish.sqf"};

But also the Punish.sqf seems a little wrong, you need to call the object [player,RankX] becomes
this select 0; and this select 1; in the first part of the sqf
So, ideally, handle=[this] execVM "Punish.sqf" would start out in the sqf as

_unit = _this select 0;
_unit disableUserInput true;
removeallweapons _unit;
_unit setpos position jail;
_unit setdir 0;
bancount = bancount+1;
_pos = [(position _unit select 0),(position _unit select 1)+2.6,(position _unit select 2)+2];

....that's all folks....!

Advertisement


Author Message


Posts: 123
Rank:


Level: Member

Country: us
Location: Ga.
Occupation: Disabled
Age: 54
In-game name: SpectrumWarrior

 
#3 Posted at 2011-05-21 02:53        
     
OK, I changed the on act = if (score player < BIS_EVO_rankX) exitwith {handle = [player,BIS_EVO_rankX] execVM "Punish.sqf"; to on act = if (score player < BIS_EVO_rank4) exitwith {handle = [this] execVM "Punish.sqf"; Now rankX is any rank such as ranks are 1,2,3,4,5 and 6 so lets say rank 4. Then I changed the sqf to this
_unit = _this select 0;
_unit disableUserInput true;
removeallweapons _unit;
_unit setpos position jail;
_unit setdir 0;
bancount = bancount+1;
_pos = [(position _unit select 0),(position _unit select 1)+2.6,(position _unit select 2)+2];


_phonehint = createTrigger ["EmptyDetector", [8158.4819,470.67847,9121.6494]];
_phonehint setTriggerActivation ["WEST", "PRESENT", false];
_phonehint setSoundEffect ["Maggot","you","",""];
_phonehint setTriggerStatements ["true", "", ""];

hint "hint: You have been punished for ENTERING A RANK RESTRICTED AREA WITH OUT HAVING THE PROPER RANK. You will regain control after you have served your sentence of 60 seconds";

_i = -60;

while {_i != 0} do 
{
	titleText [format ["%1",_i],"plain down"];
	_i = _i + 3;
	playSound "Maggot";
	sleep 5.0;
	playSound "you";
	sleep 11.0;
};




deletevehicle _phonehint;

_phonehint2 = createTrigger ["EmptyDetector", [8158.4819,470.67847,9121.6494]];
_phonehint2 setTriggerActivation ["NONE", "PRESENT", false];
_phonehint2 setSoundEffect ["none","","",""];
_phonehint2 setTriggerStatements ["true", "", ""];
sleep 1.0;
deletevehicle _phonehint2;
player setdammage 1;
disableUserInput false;
as you said and now nothing happens when I enter the triger area. This is the way I understood you to tell me to do.


Author Message

palyarmerc  

I live inside the editor


Posts: 752
Rank:


Level: Member PFS

Country: 00
Location:
Occupation: *Retired*
Age:
In-game name: *Retired*

 
#4 Posted at 2011-05-21 07:41        
     
Well I don't understand the script - where did you get it from?
I've always understood the array to be called by the script, but the array parameters [player,BIS_EVO_rankX] are not used in the Punish.sqf anywhere
Trigger should be somethng more like
Condition: (Player score < BIS_EVO_rank4) and Player in Thislist
OnAct: Punsihed = thislist; {_x execVM "punish.sqf"} foreach Punished

..I'm just not sure

Alternatively, if you've not too many playableunits you could group the players to the trigger and use the drop down option in the trigger of Activation by Vehicle - you'll need a seperate trigger for each playableunit
then, in On Act:null= [this] execVM "punish.sqf"

This post was edited by palyarmerc (2011-05-21 07:48, ago)

....that's all folks....!

Author Message


Posts: 123
Rank:


Level: Member

Country: us
Location: Ga.
Occupation: Disabled
Age: 54
In-game name: SpectrumWarrior

 
#5 Posted at 2011-05-21 16:00        
     
Unfortunately I have 32 human playable slots and a base and 3 farps full of ranked vehicles to group the triggers lol. Here is what I am trying to accomplish. I am running a ranked Evolution map, I am tired of coming in the server and my base is blown to heck and back because of babies that get mad because they can not just jump vehicles and take off with out having to have ranked up to earn that vehicle, and so they jump into the gunners seat and start blowing up the base. Now again unfortunately the vecinit.sqf only stops players from getting into the drivers seat and not the gunners seat. Sample of the code
BIS_EVO_VecInit = 
{
	_unit = _this select 0;
	_vec = _this select 1;
	_Vehicle = typeOf _vec;
	_rank1 = BIS_EVO_rank1;
	_rank2 = BIS_EVO_rank2;
	_rank3 = BIS_EVO_rank3;
	_rank4 = BIS_EVO_rank4;
	_rank5 = BIS_EVO_rank5;
	_rank6 = BIS_EVO_rank6;
	_dunit = _unit;
	_warning = 0;
	
	if (not (local _unit)) exitwith {};
	if(_unit == player) then {disableUserInput true};

	BIS_EVO_Eject = 
	{
		_unit = _this select 0;
		_unit action ["ENGINEOFF", _vec];
		_unit action ["Eject",_vec];
		_vec setVelocity [0, 0, 0];
		sleep 1.0;
		_unit action ["ENGINEOFF", _vec];
		_unit action ["Eject",_vec];
		_vec setVelocity [0, 0, 0];		
		if(_unit == player) then {disableUserInput false};
	};


	if (getdammage _vec == 0) then
	{
		_vec setdammage 0.01;
	};
	if (not (isPlayer _unit)) then
	{
		_dunit = (leader _unit);
	};
	switch (_Vehicle) do
	{
	    case "M1A2_TUSK_MG":
	    {
		if (score _dunit < _rank6) then {[_dunit,_rank6] call BIS_EVO_RankReq;[_unit] call BIS_EVO_Eject};
	    };
};
Now rank 6 in this case is Col. but any rank can get into the gunners seat and start shooting on base. So if you can make this script prevent them from getting into the gunner seat then I will not need any triggers teleporting them to an area when they get too close to the vehicle with out proper rank. The script you are asking about where I got it from, is the jail script for having a neg score for T/K's etc. I am just teleporting them to the jail area witch is not the real concern that script is not where the problem is, the problem is the triger teleports all human players in the server not just the player in the triger area. I just need the triger to teleport the player away from the vehicle to anywhere to keep them out of the gunners seat with out telporting every player on the server that does not have the rank of the vehicle they are trying to get into, witch is what the very first post I posted stated the triger I made works perfect except it teleports all human players on the server that does not have the rank in question of the vehicle the ( lets say bad player ) is trying to get into the gunners seat of. In the mean time I will try the latest you sujested and see how that works. I am very thankful for any and all of your help here and baring with me here to keep trying for me. Some scripts I am learning to figure out and some like the vecinit.sqf I jave no clue how to make that eject the player from the gunners seat also with out having the proper rank.

This post was edited by SpectrumWarrior (2011-05-21 16:18, ago)


Author Message

palyarmerc  

I live inside the editor


Posts: 752
Rank:


Level: Member PFS

Country: 00
Location:
Occupation: *Retired*
Age:
In-game name: *Retired*

 
#6 Posted at 2011-05-21 16:21        
     
Ah, OK, now we're getting somewhere...
Well, it might be easier to just lock the seat by rank system then

Checks if Player is Pilot Before Unlocking Plane Prob

Why don't you just remove the 6th rank from the vehinit.sqf if it is ok to let Colonels get in the gunner position

case "M1A2_TUSK_MG":
{
if (score _dunit < _rank5) then {[_dunit,_rank5] call BIS_EVO_RankReq;[_unit] call BIS_EVO_Eject};
};

....that's all folks....!

Author Message


Posts: 123
Rank:


Level: Member

Country: us
Location: Ga.
Occupation: Disabled
Age: 54
In-game name: SpectrumWarrior

 
#7 Posted at 2011-05-21 16:28        
     
Just reducing the rank still lets a rank 0 private ( someone that just entered the server and has no score at all yet ) get in the gunners seat and blow up the base. once they have rank to use the vehicle I could care-less if they get in because they have played long enough now that they are not mad and start blowing up the base lol. I will study the pilot unlock script and see if I can use it for what I want.
Unlock method is not working.

This post was edited by SpectrumWarrior (2011-05-21 17:35, ago)


Author Message

palyarmerc  

I live inside the editor


Posts: 752
Rank:


Level: Member PFS

Country: 00
Location:
Occupation: *Retired*
Age:
In-game name: *Retired*

 
#8 Posted at 2011-05-21 18:46        
     
Ok, here we go...*cracks knuckles*

VehLock.sqs
;place the next line in your vehicle init
;this addEventHandler ["getin",{_this exec "VehLock.sqs"}]
;notes - could maybe include use of:  ? player in (gunner vehiclename)


_veh = _this select 0
_seat = _this select 1
_unit = _this select 2

? rank (_unit) == "COLONEL" : goto "getin" 
? rank (_unit) != "COLONEL" : goto "getout"

#getin
hint "Welcome Aboard Colonel"
goto "exit"

#getout

_unit action ["EJECT", vehicle _unit]
[_unit] allowgetin false
_veh setVelocity [0, 0, 0]
hint "You aren't a pilot"
	
#exit

; for testing - remove these 2 lines
_unit setUnitRank "MAJOR"

exit

:-)

This post was edited by palyarmerc (2011-05-21 18:53, ago)

....that's all folks....!

Author Message


Posts: 123
Rank:


Level: Member

Country: us
Location: Ga.
Occupation: Disabled
Age: 54
In-game name: SpectrumWarrior

 
#9 Posted at 2011-05-21 20:12        
     
Works like a charm hehe. Thank you EVER so much. Like I said I can some times edit other peoples scripts to work the way I want, but I can't write my own scripts. I would of never came up with this. I put it on the vehicle set as colonel and could not get in any seat, I changed it to private and got right in every seat. Absolutely perfect for what I want and needed, this way also keeps players from begging ( let me gun for you to rank up ), where the triger system I was trying to use, once the person with proper rank left the triger area anyone could get in the gunners seat. Again thank you ever so much. Robert.



P.S. One last question. Does any part of the script need to be different for arma armed assault ( the first arma ) engine core or will this work as is for it also? Looking at it, it looks like it will work there too, to me as is.

This post was edited by SpectrumWarrior (2011-05-21 20:21, ago)


Author Message

palyarmerc  

I live inside the editor


Posts: 752
Rank:


Level: Member PFS

Country: 00
Location:
Occupation: *Retired*
Age:
In-game name: *Retired*

 
#10 Posted at 2011-05-21 21:03        
     
Yep, it should do. The one you were trying to manipulate was advanced stuff even for me, and although I should use SQF, I'm finding SQS easier to work with for looping stuff
Glad I could help..
:-)

P.S - next time, keep your questions brief and to the more specific need; we went round the houses to get to what you actually required here ;-)

....that's all folks....!

Author Message


Posts: 123
Rank:


Level: Member

Country: us
Location: Ga.
Occupation: Disabled
Age: 54
In-game name: SpectrumWarrior

 
#11 Posted at 2011-05-22 16:38        
     
Ooooops: Found one major problem with this scrpit palyarmerc.
;place the next line in your vehicle init
;this addEventHandler ["getin",{_this exec "COLONEL.sqs"}]
;notes - could maybe include use of:  ? player in (gunner vehiclename)


_veh = _this select 0
_seat = _this select 1
_unit = _this select 2

? rank (_unit) == "Colonel" : goto "getin" 
? rank (_unit) != "Colonel" : goto "getout"

#getin
hint "Welcome Aboard Colonel"
goto "exit"

#getout

_unit action ["EJECT", vehicle _unit]
[_unit] allowgetin false
_veh setVelocity [0, 0, 0]
	
#exit
;place the next line in your vehicle init
;this addEventHandler ["getin",{_this exec "MAJOR.sqs"}]
;notes - could maybe include use of:  ? player in (gunner vehiclename)


_veh = _this select 0
_seat = _this select 1
_unit = _this select 2

? rank (_unit) == "Major" : goto "getin" 
? rank (_unit) != "Major" : goto "getout"

#getin
hint "Welcome Aboard Major"
goto "exit"

#getout

_unit action ["EJECT", vehicle _unit]
[_unit] allowgetin false
_veh setVelocity [0, 0, 0]
	
#exit
If I am not a major yet I can not get into the vehicle requiring major, if I am not a colonel I can not get into the vehicle requiring colonel, witch is perfect. BUT, If I am a colonel I can get into the vehicle requiring colonel but I can no longer get into the vehicles requiring major, captain, lieutenant, sergeant, or corporal. So would I make it something like this
;place the next line in your vehicle init
;this addEventHandler ["getin",{_this exec "SERGEANT.sqs"}]
;notes - could maybe include use of:  ? player in (gunner vehiclename)


_veh = _this select 0
_seat = _this select 1
_unit = _this select 2

? rank (_unit) == "Sergeant","Captain","Major","Colonel" : goto "getin" 
? rank (_unit) != "Sergeant","Captain","Major","Colonel" : goto "getout"

#getin
hint "Welcome Aboard Soldier"
goto "exit"

#getout

_unit action ["EJECT", vehicle _unit]
[_unit] allowgetin false
_veh setVelocity [0, 0, 0]
	
#exit
So that anyone with the ranks of Private, Corporal can not get in but any higher rank Sergeant, Lieutenant, Captain, Major, or Colonel can get in? ok that did not work, trying this now
;place the next line in your vehicle init
;this addEventHandler ["getin",{_this exec "SERGEANT.sqs"}]
;notes - could maybe include use of:  ? player in (gunner vehiclename)


_veh = _this select 0
_seat = _this select 1
_unit = _this select 2

? rank (_unit) == "Sergeant" || "Captain" || "Major" || "Colonel" : goto "getin" 
? rank (_unit) != "Sergeant" || "Captain" || "Major" || "Colonel" : goto "getout"

#getin
hint "Welcome Aboard Soldier"
goto "exit"

#getout

_unit action ["EJECT", vehicle _unit]
[_unit] allowgetin false
_veh setVelocity [0, 0, 0]
	
#exit
That did not work, it totally disabled the script all together.

This post was edited by SpectrumWarrior (2011-05-22 19:13, ago)


Author Message

palyarmerc  

I live inside the editor


Posts: 752
Rank:


Level: Member PFS

Country: 00
Location:
Occupation: *Retired*
Age:
In-game name: *Retired*

 
#12 Posted at 2011-05-22 19:20        
     
_getrank = rankID(_unit)
? _getrank <= 4 : goto "getout"
? _getrank => 5 : goto "getin"

....that's all folks....!

Author Message


Posts: 123
Rank:


Level: Member

Country: us
Location: Ga.
Occupation: Disabled
Age: 54
In-game name: SpectrumWarrior

 
#13 Posted at 2011-05-22 19:34        
     
Once again thanks, you can't say I did not try on my own lol. I had just ask ben ( a friend on my server ) what about the <= => commandes when I saw you had replied. but we still had the wrong idea using the <= command.We were going to try it thisd way

? rank (_unit) == => "Major" : goto "getin" 
? rank (_unit) != <= "Captain" : goto "getout"


Author Message

palyarmerc  

I live inside the editor


Posts: 752
Rank:


Level: Member PFS

Country: 00
Location:
Occupation: *Retired*
Age:
In-game name: *Retired*

 
#14 Posted at 2011-05-22 19:47        
     
Well, I confess I did that too, and discovered it only returns a number. I then remembered I'd seen numbers relating to ranks - it took me a few minutes to locate it, but it helps when you know where to look - - Two sites of interest for you then...

Scripting commands Arma2
I spend a lot of time looking for solutions here

If that fails I look here...

OFPEC Comref
Link to comref at foot of homepage, click on # to get to symbols list

*DRINK*

....that's all folks....!

Author Message


Posts: 123
Rank:


Level: Member

Country: us
Location: Ga.
Occupation: Disabled
Age: 54
In-game name: SpectrumWarrior

 
#15 Posted at 2011-05-22 22:33        
     
I need to ask for help on another triger I found a flaw in. Well acttually 2 flaws
activation: west
repeating
name: PainInMyZone
con: this
on act: PainInMylist = thislist; {PainInMy = [] execVM "PainInMy.sqf"} foreach PainInMylist
PainInMy.sqf
if (player in list PainInMyZone) then {
 for [{_loop=0}, {_loop<1}, {_loop=_loop}] do
{

removeallweapons player;

};
};
Everything works perfect except one thing.
You walk into the triger you lose your weapons, you teleport into the triger you lose your weapons, you parachute into the triger you lose your weapons, you drive into the triger you DO NOT lose your weapons??
Have already tried


PainInMy = [Vehicle _x] execVM "PainInMy.sqf" and PainInMy = [_x] execVM "PainInMy.sqf"


to no luck.
Second flaw is if one player is in the triger area while another player enters the triger the second player does not lose his weapons. Not sure if there is a fix for that.



RESOLVED:
if (vehicle player in list PainInMyZone) then {
 for [{_loop=0}, {_loop<1}, {_loop=_loop}] do
{

removeallweapons player;

};
};

This post was edited by SpectrumWarrior (2011-05-24 19:53, ago)