Jump to content

mikie boy

Member
  • Content Count

    664
  • Joined

  • Last visited

  • Medals

Everything posted by mikie boy

  1. Forgot to say... You can also use score instead of the money - just addscore to the player on kill. this would be local to the player. use the score to minus/plus when you buy things... makes things easier
  2. Without testing, here is a starting point - if several eventhandlers for the killing of zombies does not work - you could make one eventhandler and call one script that then calls the required part.. e.g if (unit == _killer) then { [] spawn playerkiller;}; this is just a stab in the dark and again hasn't been tested. playerkiller = { hint "player has killed someone"; MYmoneyunit1 = MYmoneyunit1 + 250; MYmoney2unit1 = MYmoney2unit1 + 250; }; playerkiller1 = { hint "player 2 has killed someone"; MYmoneyunit2 = MYmoneyunit2 + 250; MYmoney2unit2 = MYmoney2unit2 + 250; }; ///start of script.... ///if unit1 kills zombie {_x addEventHandler["killed", { if ((_this select 1) == unit1) then { [unit1] spawn Playerkiller;}; }]; }foreach thislist ; ///if unit2 kills zombie { _x addEventHandler["killed", { if ((_this select 1) == unit2) then { [] spawn Playerkiller;}; }]; }foreach thislist; changed - the unitsmoney - to distinguish between the different player amounts plus you can then use publicvariables to assist with JIP. - however as each script needs to be local to that player - leaving it as it is should be fine. hopefully this is not too confusing and i have not waffled too much rubbish.
  3. had a similar script - could use comp = [getMarkerPos "test", 0, "AntiAir1_TK_EP1"] call (compile (preprocessFileLineNumbers "ca\modules\dyno\data\scripts\objectMapper.sqf")); and then comp addEventHandler["killed", { (_this select 0) spawn artytakenout; }];
  4. if this is of any use - http://forums.bistudio.com/showthread.php?t=123821 without using CBA. i set onplayerconnected - ensuring the marker gets moved perhaps you could use that for marker colour for when tsk complete - change colour of marker. just a thought. oh and dont use tsk1 publicvariable in init.sqf - as every time someone joins the server - the tsk will alway be whatever you set the public variable to be in the init.sqf - wiping whatever the current tsk state.
  5. If you want to check it without using a trigger - say distance from object named tent... could try something like - _list = ((position tent) nearEntities [["Man"],5]); _num = EAST countside _list; player sidechat format ["Number of enemy units is %1", _num];
  6. as simple as this - requestedplayer= player; desiredrank = "PRIVATE"; player setUnitRank desiredrank ; publicVariable "requestedplayer"; publicVariable "desiredrank ";
  7. just to let you know - found that AI opfur don't attack, as you have described, if you use the first aid modules in multiplayer.
  8. jut to clarify - do you want rank related restriction or player related restriction, if player restriction pelhams way is quick and easy. only problem - if you use a global cargo fully loaded, your player (if he does not meet the said requirements) will quickly remove and drop the said weapon, which becomes annoying. you may need to ammend a weapons crate to highlight - if said player then show said weapons - need to create weapons crate local if this is the case. hope this helps - if rank related i can post this for you.
  9. dude, saw the link on armaholics - great original work!! impressive
  10. http://forums.bistudio.com/showthread.php?t=123821 had a similar problem - updates marker for all clients and server without CBA if you have any problems with it not showing - found that i needed a sleep timer to active onplayerconnected - setmarkerpos etc... hope this helps if not using CBA
  11. mikie boy

    Enemy Waves?

    not sure if this is of any use to you... Attacking an FOB (object) script i made a while back, bit rough but i never finished it. used the below code to spawn several opfors random distance from the FOB, seems to work. They all seem to run towards the FOB, whilst still attacking. Created a trigger that creates an explosion at one of the opfors if entered (suicide bomber). waveattack.sqf _d = [80,90,100] call BIS_fnc_selectRandom; _r = random 360; _WaveSpawnLocation = [((getpos FOB) select 0) + sin _r *_d, ((getpos FOB) select 1) + cos _r *_d, 0]; wavegroup1 = [_WaveSpawnLocation, EAST, ["TK_INS_Bonesetter_EP1", "TK_INS_Soldier_2_EP1", "TK_INS_Bonesetter_EP1", "TK_INS_Soldier_2_EP1"],[],[],[],[],[],180] call BIS_fnc_spawnGroup; { _x doMove position FOB; _x setBehaviour "COMBAT"; } foreach units wavegroup1; trigger created _trg = createTrigger["EmptyDetector",getPos FOB]; _trg setTriggerArea[17,17,0,false]; _trg setTriggerActivation["EAST", "PRESENT", true]; _trg setTriggerStatements["this", "[] spawn suicideexplosion", ""]; //_trg setTriggerStatements["this", "hint 'working trigger'", ""]; [] spawn Suiciderunner; Suiciderunner code - same as for the wave spawn, but added the following... { removeallweapons _x; _x doMove position FOB; _x setBehaviour "SAFE"; } foreach units suicideman; suicideexplosion suicideexplosion = { [nil,nil,rHint, "BREACH of perimeter!!!"] call RE; sleep 2; _bombtype = ["Sh_105_HE", "Sh_85_AP"] call BIS_fnc_selectRandom; // "BO_GBU12_LGB" { _shell = _bombtype createVehicle position _x; } foreach units suicideman; }; if this is of any use to anyone (apologise for the lame scritping) can post the whole code - not that much longer.
  12. not sure if this is been answered else where - but no joy finding the correct answer. Long story short - created a JIP driving licence/pilot licence, basically you gain points whilst you are moving. Once you have a certain amount of points this allows you to drive/fly a better type of plane or car etc. my problem is - how would i create a points system (not using score as ive used that) that would be saved for each person and then recalled when rejoining. Pretty much an exact copy of score but calling it driving licence. quick example of gaining points for the initial driving licence. works on single player if anyone want the code.... while {true} do { // _licence = pilotlicence; _vehchoice = vehicle player; if (driver _vehchoice == player) then { if (_vehchoice iskindof "car") then { while {speed _vehchoice > 2} do { pilotlicence = pilotlicence + 1; publicvariable "pilotlicence"; sleep 1; _vehicle hintsilent format ["driving licence :%1", pilotlicence]; }; }; }; }; scoring system if ! isdedicated then { [] spawn { waituntil {!isnull player}; for [{_loop=0}, {_loop<1}, {_loop=_loop}] do { switch (true) do { _myguy = name player; _licence = pilotlicence; _permit = pilotpermit; case ((_licence < rankup2) and (_licence >= rankup1) and (_permit != "CLASS2")): { hintsilent format["Your Driving licence is Now %2",_myguy,"CLASS2"]; Sleep 2; pilotpermit = "CLASS2"; publicVariable "pilotpermit"; }; case ((_licence < rankup3) and (_licence >= rankup2) and (_permit != "CLASS3")): { hintsilent format["Your driving licence is %2",_myguy,"CLASS 3"]; pilotpermit = "CLASS3"; publicVariable "pilotpermit"; }; }; sleep 1.03; }; }; }; init.sqf if (isNil "pilotlicence") then { pilotlicence = 0; }; if (isNil "pilotpermit") then { pilotpermit = "CLASS1"; }; execvm "pilotlicence.sqf"; execvm "pilotpermit.sqf"; multiplayer - this works for everyone - with all participants connected adding to the total score. Sorry if this is a bit of a stupid question but, need a point on the right direction. mike
  13. mikie boy

    pilots licence

    anyone? is this even possible?
  14. I know some people don't suggest using the Multiplayer framework - but it seems to work ok for me - and i too had the same problems with all seeing actions. other methods are to use CBA as mentioned.. or add PublicVariableEventHandler and use publicvariable - i also had that working. init.sqf if (isServer) then { "suspectsurrender" addPublicVariableEventHandler { ((_this select 1) select 0) playActionNow ((_this select 1) select 1); }; }; place this in you code that activates ///add this to make surrender movement global/// _movement = "Surrender"; if (isServer) then { _suspect playActionNow _movement; // for hosted environment } else { terrorsurrender = [_suspect , _movement]; publicVariable "suspectsurrender"; }; sleep 2; Mp framework - http://community.bistudio.com/wiki/Multiplayer_framework is as below... waituntil { !isNil "BIS_fnc_init" }; //must have function module on map. // to remove the action [nil, _suspect, "per", rREMOVEACTION, _id] call RE; //add action [nil, _suspect, "per", rADDACTION, "whateverthescript.sqf"] call RE; //to play action for everyone [nil,_suspect,rplayActionnow,"UnaErc_UnaErcPoslechVelitele"] call RE; hope this helps
  15. Sorry chaps for the below waffle, but spent the last week going round in circles, just cant figure this out... Problem im having is that the server (tried on Dedi and Host) creates an object with an addaction - this is a task which when complete creates 8 terrorits at a marker. These 8 terrorists have an addaction created - which when interrorgated - they perfom the surrender action/animation and then they are deleted. when i join the server and initiate the creation of the 8 terrorists and then interrorgate the terrorists - they do carryout the surrender action. However, if i leave say 6 of the 8 alone (amount left does not have any bearing on this), then leave my server and then join again, when i go to interrorgate them this time they do not play the surrender action, but the interrogation is complete and the hint appears as it would if they performed the animation. The actions i can see or cannot see are the same for any client who is stood next to me... code is as below.... Init.sqf if (isServer) then { "terrorsurrender" addPublicVariableEventHandler { ((_this select 1) select 0) playActionNow ((_this select 1) select 1); }; }; execvm "tasks\waterinit.sqf"; Init.sqf calls the below waterinit.sqf if (isserver) then { //creates a load of wells and give them all addactions using the MP RE... cant think of any otherway other than using CBA. _watercomplete = [nil, _waterfill, "per", rADDACTION, "Assist Locals - Fill reservoir","tasks\watertask.sqf","Land_Barrel_water",1,false,true,"","(_target distance _this) < 3"] call RE; //possible desync probs }; watertask.sqf... //(isserver commands not used here) //once watertask is complete spawn the terrorists []spawn terrorists; //terrorists.sqf terrorists.sqf createterrorsuspects = { sleep 2; for "_i" from 0 to 7 do { _terrormantype = ["TK_CIV_Takistani01_EP1", "TK_CIV_Takistani02_EP1", "TK_CIV_Takistani03_EP1", "TK_CIV_Takistani04_EP1", "TK_CIV_Takistani05_EP1", "TK_CIV_Takistani06_EP1"] call BIS_fnc_selectRandom; _distances = [10,20,30] call BIS_fnc_selectRandom; _ang = random 360; _dis = _distances; _dx = sin(_ang)*_dis; _dy = cos(_ang)*_dis; _loc = [((getmarkerpos "terrorHelpers") select 0) + _dx, ((getmarkerpos "terrorHelpers") select 1) + _dy, 0]; terrorsuspects = createAgent [_terrormantype, _loc, [], 0, "FORM"]; _terrorprobability = [false, true] call BIS_fnc_selectRandom; _terrorsearch = [nil, terrorsuspects, "per", rADDACTION, "Interrogate","interror.sqf",[_terrorprobability],6,false,true,"","(_target distance _this) < 3"] call RE; //using MP RE - terrorarraycontrol = terrorarraycontrol + 1; publicVariable "terrorarraycontrol"; }; }; if (isServer) then { [nil,nil,rHINT,"1-Location of believed Terrorist supporters updated - Check Map!"] call RE; _marker = createMarker [_markname, position _preplacedmkr]; "terrorHelpers" setMarkerShape "ELLIPSE"; "terrorHelpers" setMarkerType "DOT"; "terrorHelpers" setMarkerSize [75, 75]; } else { [nil,nil,rHINT,"2-Location of believed Terrorist supporters updated - Check Map!"] call RE; objmkr = [_markname, _preplacedmkr]; publicVariable "objmkr"; }; [] spawn createterrorsuspects; Above script creates 8 terrorists with addaction to call interror.sqf. interror.sqf //if conditions meet that of terrorist then do below... _movement = "Surrender"; if (isServer) then { terrorsurrender = [_civil, _movement]; publicVariable "terrorsurrender"; // _civil playActionNow _movement; // for hosted environment } else { _civil playActionNow _movement; // terrorsurrender = [_civil, _movement]; publicVariable "terrorsurrender"; }; Ive swapped the above interror.sqf arround - when im first on the server and initially call the terrorists to spawn there is no surrender action. when i leave and then join, there is a surrender action. anyone know why this is happening - mix of isservers and locality? (bane of my life lol)
  16. Anyone have any idea - The animation works one initial join and then rejoin if i use MP Remote execution [nil,_civil,rplayActionnow,"Surrender"] call RE;
  17. not sure if this helps any, script i made to add 20 randon civs using the call BIS_fnc_selectRandom command, and then adding an addaction (local) to them. for "_i" from 0 to 20 do { _terrormantype = ["TK_CIV_Takistani01_EP1", "TK_CIV_Takistani02_EP1", "TK_CIV_Takistani03_EP1", "TK_CIV_Takistani04_EP1", "TK_CIV_Takistani05_EP1", "TK_CIV_Takistani06_EP1"] call BIS_fnc_selectRandom; _distances = [10,20,30,40,50,60,70,80,90,100] call BIS_fnc_selectRandom; _ang = random 360; _dis = _distances; _dx = sin(_ang)*_dis; _dy = cos(_ang)*_dis; _terrorsuspects = [[((getmarkerpos "terrorHelpers") select 0) + _dx, ((getmarkerpos "terrorHelpers") select 1) + _dy, 0], Civilian, [_terrormantype],[],[],[],[],[1,0.5],180] call BIS_fnc_spawnGroup; _terrorprobability = [false, true] call BIS_fnc_selectRandom; { _interroraction = _x addAction ["Interrogate","interror.sqf", [_terrorprobability],1,false,true,"","(_target distance _this) < 3"]; } foreach units _terrorsuspects; };
  18. Having problems with JIP and multiplayer in relation to globalvariables. In short I have the globalvariable of terrorcontrol that I wish to add to and subtract from in order for certain things to happen. I want to have the same value for everyone in game and JIP. This is set in init.sqf to terrorcontrol = o; So on joining mp game – this is set to 0. I then carry out an action which spawns (using addPublicVariableEventHandler) a marker and creates 8 civs. During the spawning of the 8 civs I add 1 to the terrorcontrol globalvariable. this is done by terrorcontrol = terrorcontrol + 1; Thus at this point terrorcontrol = 8; When I leave the game and come back in obviously the init.sqf is executed and terrorcontrol is set back to 0. And when I call the action to spawn the 8 civs it should say they are already spawned, but instead it spawns 8 more – most likely due to init setting it to 0. Ive looked at http://community.bistudio.com/wiki/publicVariable but not sure how this works with variables as above. If changed init to… If (isserver) then { terrorcontrol = 0; }; But this will not activate the script – as the script cant find a value for terrorcontrol. And ive tried adding 1 to terrorcontrol within the script via the if isserver line again doesn’t work My question therefore is how do I get terrorcontrol to stay the same across the board for everyone. Ive tried using addPublicVariableEventHandler for adding 1 to the globalvariable, but to behonest I couldn’t work it out. I looked at http://forums.bistudio.com/showthread.php?t=119114&highlight=globalvariable and the last comment is useful but again not sure how to go about that. That’s it im stuck – any help would be appreciated – any further explanation of my waffling i will be happy to update.
  19. yeah worked well - cheers for that chaps - appears the below code works well terrorcontrol = terrorcontrol + 1; publicVariable "terrorcontrol"; handy tool to understand in MP - found several other things that require its assistance.
  20. right - sort of got my head round it, thanks chaps for the help - ill test it in the morning
  21. How would i broadcast terrorcontrol = terrorcontrol + 1; or terrorcontrol = terrorcontrol - 1; when i tried it - it was calling an array. - shown below - which seems right for an array - not sure how i would call it for the variable addition and subtraction. this is the initial script i ran to create the 8 civs and this is what i added. loop creates 8 civs and each time adding 1 to terrorcontrol as shown below. _addterrorcontrol = "terrorcontrol"; if (isServer) then { terrorcontrol = terrorcontrol + 1; } else { terrorcontrol = [_addterrorcontrol, 1];publicVariable "terrorcontrol"; }; init.sqf if (isServer) then { "terrorcontrol" addPublicVariableEventHandler { ((_this select 1) select 0) + ((_this select 1) select 1); }; }; if this doesnt help i can post the scripts cheers
  22. Sorry for this topic - but on searching im struggling to find the answer and its getting frustrating. When creating a single marker (local or global) via a script it is obviously created - however on leaving and rejoining or simply joining (another player) it is not shown. Ive tried various methods to get it working - ive used remote execution but that executes the marker again on joining and all that is created when the marker appears- doubling the amount. latest effort as a last hope is using addPublicVariableEventHandler - but im not over familiar with this other than adding points. init if (isServer) then { "objmkr" addPublicVariableEventHandler { createMarker [((_this select 1) select 0), position ((_this select 1) select 1)]; }; }; script trying to create the marker _preplacedmkr = [terrorhelper_1, terrorhelper_2] call BIS_fnc_selectRandom; _markname = "terrorHelpers"; if (isServer) then { hint "1-Location of believed Terrorist supporters updated - Check Map!"; createMarker [_markname, position _preplacedmkr]; "terrorHelpers" setMarkerShape "ELLIPSE"; "terrorHelpers" setMarkerType "DOT"; "terrorHelpers" setMarkerSize [75, 75]; } else { hint "2-Location of believed Terrorist supporters updated - Check Map!"; objmkr = [_markname, _preplacedmkr]; publicVariable "objmkr"; "terrorHelpers" setMarkerShape "ELLIPSE"; "terrorHelpers" setMarkerType "DOT"; "terrorHelpers" setMarkerSize [75, 75]; }; ive searched through domination and insurgency maps and im struggling to identify the JIP part. anyone point me in a better direction - any help would be greatly appreciated - sorry if ive overlooked something that may have been already discussed.
  23. mikie boy

    JIP and createmarkers

    sorry forgot to add - in the init - add the following line - replace "terrorhelpers" with the name of your marker onPlayerConnected {"terrorHelpers" setMarkerPos (getMarkerPos "terrorHelpers")};
  24. mikie boy

    JIP and createmarkers

    right ive managed to solve it - and without using CBA - but thanks for that Muzzleflash - in the init - add the rest of the marker properties - if (isServer) then { "objmkr" addPublicVariableEventHandler { createMarker [((_this select 1) select 0), position ((_this select 1) select 1)]; "terrorHelpers" setMarkerShape "ELLIPSE"; //added - "terrorHelpers" setMarkerType "DOT"; "terrorHelpers" setMarkerSize [75, 75]; }; };
  25. cheers Demonized - turns out using create agent is more of a pain in the butt than its worth. but that did the trick nicely thanks again
×