Forum Jump :

Author Message


Posts: 48
Rank:


Level: Member

Country: us
Location:
Occupation:
Age:
In-game name:

 
#1 Posted at 2013-01-23 02:50        
     
Awhile back I had a script that locked a addaction from being used by certain people but I lost it. Its not for vehicles its for lets say a drop bomb script. All I want to do is lock the addaction so only members can use it and I think I used this script for doing so. I just cant remember what I did to change it.

Also is there a way to change hintc to say it in direct communication. I know if you put "player commandchat" where hintc is it works but cant find out how to use direct for it.


_vehicle = _this select 0;  // i added this line.
_vehicle addEventHandler ["GetIn", 
{
private ["_veh", "_pos", "_unit", "_namesArray"];
_veh = _this select 0;
_pos = _this select 1;
_unit = _this select 2;
_namesArray = ["Diesel"];

if !(name _unit in _namesArray) then
{
_unit action ["Eject", vehicle _unit];
//waituntil {vehicle player == player};
       
       [_veh] spawn {waituntil {vehicle player == player};
    hintc "This vehicle is for Execute Gaming Members only.  Please use the other vehicles provided at the MAIN BASE."; 
      (_this select 0) engineon false};
 
};
}];


Author Message


Posts: 1484
Rank:


Level: Member

Country: uk
Location:
Occupation:
Age:
In-game name:

 
#2 Posted at 2013-01-23 03:47        
     
player addAction ["bomb","dropit.sqf", [], 0, true, true, "", "name _this in ['bill','fred','sel','Diesel']" ];

I think this is the thread where your script came from

Only name can enter


Advertisement


Author Message


Posts: 48
Rank:


Level: Member

Country: us
Location:
Occupation:
Age:
In-game name:

 
#3 Posted at 2013-01-23 04:23        
     
Wow that was easy ha thanks again. You know of any good website to learn what you have been sending me for scripts? I would really like to learn this stuff and become better at it.

And ya that's the thread I got the lock script for my a10 going to dig around on that.


Author Message


Posts: 1484
Rank:


Level: Member

Country: uk
Location:
Occupation:
Age:
In-game name:

 
#4 Posted at 2013-01-23 11:32        
     
I've been playing around since OFP since it came out so I tend not to read any stuff and just do it by trial and error (mostly error)

Here you can check out the sticky thread there is a lot of info
BIS_Forum


OLder stuff here but the forum is a good place to search for scripts and see how commands were used.
OFP lots of older stuff here

And right here at Arma-holic of course, I usually find something I'm interested in and just take it a part to find out what each thing does.
Once you get the basics and you can read most of a script it does get easier.

I use ArmaEdit and if I find a good line or two of code I add it to snippets it save a lot of time searching old scripts.


Author Message


Posts: 48
Rank:


Level: Member

Country: us
Location:
Occupation:
Age:
In-game name:

 
#5 Posted at 2013-01-23 21:05        
     
Thanks also I don't want to make a new thread for this but is there a way to spawn this with damage false?
GVAR(wcamp) = "Land_fortified_nest_big_EP1"
That spawns the camp but I want it too spawn with addEventHandler ["handleDamage", { false }]; I tried a bunch of ways to merge it. But I cant seem to find the way every time I try something camp wont spawn.


Author Message


Posts: 1484
Rank:


Level: Member

Country: uk
Location:
Occupation:
Age:
In-game name:

 
#6 Posted at 2013-01-23 23:43        
     
I need to see more of the code, what are your using to spawn it.


Author Message


Posts: 48
Rank:


Level: Member

Country: us
Location:
Occupation:
Age:
In-game name:

 
#7 Posted at 2013-01-24 06:08        
     
Its domination so its harder to find stuff but I like learning on it. So I found the script that calls the camps.
_wf addEventHandler ["HandleDamage", {0}];
I would think changing 0 to false would make it work. But I think 0 is false.
In this script below this is where I found the command for the top line.

x_createsecondary.sqf
sleep 5.234;
_d_currentcamps = [];
_nrcamps = ceil random 5;
if (_nrcamps < 3) then {_nrcamps = 3};
_ctype = GVAR(wcamp);

GVAR(sum_camps) = _nrcamps;
_posarx = _trg_center;
for "_i" from 1 to _nrcamps do {
	__getPos;
	_wf = createVehicle [_ctype, _poss, [], 0, "NONE"];
	_wf setDir floor random 360;
	_svec = sizeOf _ctype;
	_xcountx = 0;
	_isFlat = [];
	while {_xcountx < 99} do {
		_isFlat = (position _wf) isFlatEmpty [_svec / 2, 150, 0.7, _svec, 0, false, _wf];
		if (count _isFlat > 0) then {
			_isFlat set [2, 0];
			if (!isOnRoad _isFlat) then {
				_poss = _isFlat;
			} else {
				_isFlat = [];
			};
		};
		if (count _isFlat > 0) exitWith {};
		__INC(_xcountx);
	};
	_poss set [2, 0];
	_wf setPos _poss;
	_d_currentcamps set [count _d_currentcamps, _wf];
	_wf setVariable [QGVAR(SIDE), GVAR(enemy_side), true];
	_wf setVariable [QGVAR(INDEX), _i, true];
	_wf setVariable [QGVAR(CAPTIME), 40 + (floor random 10), true];
	_wf setVariable [QGVAR(CURCAPTIME), 0, true];
	#ifndef __TT__
	_wf setVariable [QGVAR(CURCAPTURER), GVAR(own_side_trigger)];
	#else
	_wf setVariable [QGVAR(CURCAPTURER), ""];
	#endif
	_wf setVariable [QGVAR(STALL), false, true];
	_wf setVariable [QGVAR(TARGET_MID_POS), _trg_center];
	_flagPole = createVehicle [(call FUNC(GetEnemyFlagType)), position _wf, [], 0, "NONE"];
	_flagPole setPos (position _wf);
	_wf setVariable [QGVAR(FLAG), _flagPole];
	_maname = format[QGVAR(camp%1),_i];
	_wf setVariable [QGVAR(markername), _maname];
	[_maname, _poss,"ICON","ColorBlack",[0.5,0.5],"",0,"Strongpoint"] call FUNC(CreateMarkerGlobal);
	
	_wf addEventHandler ["HandleDamage", {0}];
	#ifndef __TT__
	[_wf, _flagPole] execFSM "fsms\HandleCamps2.fsm";
	#else
	[_wf, _flagPole] execFSM "fsms\HandleCampsTT2.fsm";
	#endif
	sleep 0.5;
};
[QGVAR(currentcamps),_d_currentcamps] call FUNC(NetSetJIP);
__XJIPSetVar [QGVAR(campscaptured), 0, true];
//__XJIPSetVar [QGVAR(numcamps), _nrcamps];
#ifndef __TT__
GVAR(kb_logic1) kbTell [GVAR(kb_logic2),GVAR(kb_topic_side),"CampAnnounce",["1","",str(_nrcamps),[]],true];
#else
GVAR(hq_logic_en1) kbTell [GVAR(hq_logic_en2),"HQ_W","CampAnnounce",["1","",str(_nrcamps),[]],true];
GVAR(hq_logic_ru1) kbTell [GVAR(hq_logic_ru2),"HQ_E","CampAnnounce",["1","",str(_nrcamps),[]],true];
#endif

sleep 5.213;
GVAR(main_target_ready) = true;

This post was edited by Diesol (2013-01-24 06:55, ago)


Author Message


Posts: 1484
Rank:


Level: Member

Country: uk
Location:
Occupation:
Age:
In-game name:

 
#8 Posted at 2013-01-24 10:33        
     
I see domination isn't something I've used and too complicated to understand for me.

That leaves a guessing.

false or zero it doesn't matter neither have any effect as all you need is {}, but thet won't stop it working either.
_wf addEventHandler ["HandleDamage", {}];

GVAR(wcamp) = "Land_fortified_nest_big_EP1"
do you pass that object to this code?

maybe change this section of script to -

for "_i" from 1 to _nrcamps do {
	__getPos;
	_wf = createVehicle [_ctype, _poss, [], 0, "NONE"];
	_wf setDir floor random 360;
         if (typeof _wf == "Land_fortified_nest_big_EP1") then {_wf addEventHandler ["HandleDamage", {}];};



Author Message


Posts: 48
Rank:


Level: Member

Country: us
Location:
Occupation:
Age:
In-game name:

 
#9 Posted at 2013-01-24 20:27        
     
I tested it to see if I can blow up the camp again and nothing happens so must be the other script I am using that destroys it.
Guess I wont be using that script its just for me anyways so no big deal. If it was worth putting in I would work on it but its pointless.
Thanks for your help again going to start learning how to do this on my own.


Author Message


Posts: 48
Rank:


Level: Member

Country: us
Location:
Occupation:
Age:
In-game name:

 
#10 Posted at 2013-01-29 07:33        
     
For the player addAction ["bomb","dropit.sqf", [], 0, true, true, "", "name _this in ['bill','fred','sel','Diesel']" ]; is there a way too set it in vehicle. I know its _this in target but seeing you have the names there idk how to do this.


Author Message


Posts: 1484
Rank:


Level: Member

Country: uk
Location:
Occupation:
Age:
In-game name:

 
#11 Posted at 2013-01-29 16:21        
     
add the action to the vehicle. you need to be in the array and in the vehicle.

this  addAction ["bomb","dropit.sqf", [], 0, true, true, "", "name _this in ['bill','fred','sel','Diesel'] and _this in _target"]


Author Message


Posts: 48
Rank:


Level: Member

Country: us
Location:
Occupation:
Age:
In-game name:

 
#12 Posted at 2013-01-29 22:19        
     
I had it there but I didn't have the and thanks.