peacefull Nation 6 Posted October 22, 2017 how do i execute this code globally { if(!isPlayer _x && side _x != playerSide) then { _x setCaptive true; removeAllWeapons _x; doStop _x; } }forEach allUnits; i have this peace of code only inside test.sqf and now i have a custom menu list when i click on a option it executes this test.sqf but enemy ai guns dont get removed. but if i paste this code in another persons nss mod menu and execute this globally it works. Share this post Link to post Share on other sites
HazJ 1289 Posted October 23, 2017 I personally put them in my own functions. { // code here... } remoteExec ["spawn", 0, false]; https://community.bistudio.com/wiki/remoteExec Share this post Link to post Share on other sites
peacefull Nation 6 Posted October 23, 2017 in multiplayer i added { { if(!isPlayer _x && side _x != playerSide) then { _x setCaptive true; removeAllWeapons _x; doStop _x; } }forEach allUnits; } remoteExec ["spawn", 0, false]; its not doing it please help Share this post Link to post Share on other sites
pierremgi 4944 Posted October 23, 2017 18 minutes ago, peacefull Nation said: in multiplayer i added { { if(!isPlayer _x && side _x != playerSide) then { _x setCaptive true; removeAllWeapons _x; doStop _x; } }forEach allUnits; } remoteExec ["spawn", 0, false]; its not doing it please help Why I'm not surprised? You multiplied threads, applied former working scripts thru a nns mod or own console without any idea of how it works (or fails). You don't want to read or understand how commands work.. and people kindly attempt to answer you, threads after threads with more or less skill and clear understanding on what you are wanting to do. So at least the message is totally jammed. As already said twice (Tajin and I) playerSide doesn't mean anything if applied only on dedicated server (not sure how your server is configured); This kind of code doesn't need to be remoteExec at all , as far as your AIs already belong to the server (enemies and not player), and you are using EG commands: setCaptive AL EG removeAllWeapons AL EG doStop AG AG but... do you use headless clients? So, if you want to progress, you should verify your server, the mod(s) you are using and the way you call your codes. 2 1 Share this post Link to post Share on other sites
das attorney 858 Posted October 23, 2017 Hanna21 (peacefull Nation) should go back to Unknown Cheats and ask his scripting buddies there how to make a "hack" menu imo. Google "unknowncheats teleport all enemy ai to me" Also "unknowncheats Un-ban your self from host arma3 working" I can't link to UC on this forum, but he's same person. 4 2 Share this post Link to post Share on other sites
peacefull Nation 6 Posted October 23, 2017 pierremgi thanks for your reply. the host allows any mods ,scripts to be run and also battle-eye is disabled on all host. back to the code so this code if(!isPlayer _x && side _x != playerSide) is thier anything i can do to tweak it so , it should be something like , if enemy ai thn execute the code ignoring human players. so in arma3 wiki it says player side = Returns the player's side isplayer = Checks if given person is player. Returns true for headless clients as well. will anything like this work if (side player == sideEnemy) then { my code here hint "We've got a renegade!"; }; or maybe if(!isPlayer _x && side _x != side player) then { } else { my enemy ai code here }; i am sorry for making them threads and i do apologise sincerly. 1 Share this post Link to post Share on other sites
das attorney 858 Posted October 23, 2017 24 minutes ago, peacefull Nation said: the host allows any mods ,scripts to be run and also battle-eye is disabled on all host. Quote tunngle servers only.i have 5 mod menu installed and trolled all host. what u need to do is get your user id uid. how i get mine is by starting up arma3server.exe using tadst joined my server and then pressed ctrl + shift and copied thee uid from host log. then exit game keep that uid. now go to tunggle lan find any host even that ban u dont join yet.open cheat engine and search for string text enter your uid string search , it will come with alot of results drag all them to the bottom select all and change the value. do same with username search string text username and find and replace all value.join banned host it will work troll them. am sure steam uses the same thing. i dont thnk steam banns players using ip i have anyalyzed alot of dll ,files and it dont ban by ip it banns using game uid and usernamemost of the tunggle users as am typing now added password cause of damaged i caused. i teleported all enemies on map to me then drilled all enemy with bullets mission complete xd Your words, not mine. Sounds like those hosts don't want you there to me. Share this post Link to post Share on other sites
peacefull Nation 6 Posted October 23, 2017 ? what is this ? this is not post by me Share this post Link to post Share on other sites
pierremgi 4944 Posted October 23, 2017 Depending on where and what you want to do. if(!isPlayer _x && side _x != playerSide) will return something for SP or MP hosted, because playerSide needs to be checked on a player's PC. Not on dedicated. it makes sense in initPlayerLocal.sqf for example. Most of BI examples are for SP! sideEnemy is renegade, for units (players generally, who else??) who killed as much friendly units as to get a rating less than -2000. player is not significant on dedicated server. Here, you can use allPlayers array, playableUnits array but not player or playerSide. Now, I suggest you mind what das attorney wrote. 1 Share this post Link to post Share on other sites
peacefull Nation 6 Posted October 23, 2017 pierremgi thanks alot for the kind reply really appreciate the effort you put in to make me understand. i am looking to use the code on mp game only and not sp , so am want an if statement to check IF AI THEN execute the code to affect all ai players and civilians , ignoring human players this is my goal. Share this post Link to post Share on other sites
pierremgi 4944 Posted October 23, 2017 20 minutes ago, peacefull Nation said: pierremgi thanks alot for the kind reply really appreciate the effort you put in to make me understand. i am looking to use the code on mp game only and not sp , so am want an if statement to check IF AI THEN execute the code to affect all ai players and civilians , ignoring human players this is my goal. Ai players? (playableUnits not already JIP?) As far as you want to apply on AIs and enemies, I suggest you, instead of: { if(!isPlayer _x && side _x != playerSide) then { _x setCaptive true; removeAllWeapons _x; doStop _x; } }forEach allUnits; replace by: {_x setCaptive true; removeAllWeapons _x; doStop _x} forEach (units grp1 + units grp2); where grp1 and grp2 (example) are the groups of units concerned by that. To be run where grp1 and grp2 are defined, of course (generally on server for such AIs). 1 Share this post Link to post Share on other sites
peacefull Nation 6 Posted October 23, 2017 thanks for the reply sir. just to let you know i tested only this { removeAllWeapons _x; _x playMove "AmovPercMstpSnonWnonDnon_exerciseKata"; } forEach allUnits; and this worked but only my solder was affected by it and not enemy ai so this tells me the code execution does work on friends host , how ever i need to tweak this so that all enemy ai is affected by it and not my solder or my team. maybe i should add some if statement to this but not sure how to add it kindly if u can assist me on this will appreciate it alot sir. i will test your code out now thanks alot boss. Share this post Link to post Share on other sites
Tajin 349 Posted October 24, 2017 *sigh*, alright: _allAI = allUnits - allPlayers; _enemyAI = _allAI select { [side player, side _x] call BIS_fnc_sideIsEnemy }; _cnt = count _enemyAI; { [_x,"PATH"] remoteExec ["disableAI",_x]; _x setDir (_forEachIndex / _cnt * 360); cameraOn setAnimSpeedCoef 0.05; _x setPos (player getPos [10, 180 - (_forEachIndex / _cnt * 360)]); _x spawn {sleep (random 10) max 5; _this remoteExec ["removeAllWeapons",_this]; [_this,"AmovPercMstpSnonWnonDnon_exerciseKata"] remoteExec ["playMove",_this];}; } forEach _enemyAI; this should work fine when executed locally from the console. 1 Share this post Link to post Share on other sites
peacefull Nation 6 Posted October 24, 2017 3 hours ago, Tajin said: *sigh*, alright: _allAI = allUnits - allPlayers; _enemyAI = _allAI select { [side player, side _x] call BIS_fnc_sideIsEnemy }; _cnt = count _enemyAI; { [_x,"PATH"] remoteExec ["disableAI",_x]; _x setDir (_forEachIndex / _cnt * 360); cameraOn setAnimSpeedCoef 0.05; _x setPos (player getPos [10, 180 - (_forEachIndex / _cnt * 360)]); _x spawn {sleep (random 10) max 5; _this remoteExec ["removeAllWeapons",_this]; [_this,"AmovPercMstpSnonWnonDnon_exerciseKata"] remoteExec ["playMove",_this];}; } forEach _enemyAI; this should work fine when executed locally from the console. very nice , small issue with it boss , this is what it does. 1: when i click it , it teleports all enemy ai to me and puts all ai around me they all form a circle with me in the middle and they all do karate without the loop but yes karate works on all ai. 2: second issue is my player gets little frozen so i am unable to run or walk as normal it makes it like slow mothing for my player only. 3: will be ok to have animation loop so it goes on forever apart from that everything is ok other human players are not affected and that is good. if you can or if possible can we affect all ai without teleporting them to me ? cheers and off course without freezing my playing . i really dont know how to thank you but thank you so much , your code is master piece. , in years to come i hope i can learn the way you code , all it is the coding and strutcure of the game algo i need to get use to , will take little time but am trying , thank u so much and hope u can help me with an update fix for this boss. Share this post Link to post Share on other sites
Tajin 349 Posted October 24, 2017 Oh i thought you wanted them to be teleported to you. Well, that makes it even easier: { [_x,{ _this disableAI "PATH"; removeAllWeapons _this; while { alive _this } do { sleep 5; // ideally change this sleep to be just as long as the animation _this playMove "AmovPercMstpSnonWnonDnon_exerciseKata"; }; }] remoteExec ["spawn",_x]; } count ((allUnits - allPlayers) select { [side player, side _x] call BIS_fnc_sideIsEnemy }); 2 Share this post Link to post Share on other sites
peacefull Nation 6 Posted October 24, 2017 1 hour ago, Tajin said: Oh i thought you wanted them to be teleported to you. Well, that makes it even easier: { [_x,{ _this disableAI "PATH"; removeAllWeapons _this; while { alive _this } do { sleep 5; // ideally change this sleep to be just as long as the animation _this playMove "AmovPercMstpSnonWnonDnon_exerciseKata"; }; }] remoteExec ["spawn",_x]; } count ((allUnits - allPlayers) select { [side player, side _x] call BIS_fnc_sideIsEnemy }); tested like this nothing happens sir. _allAI = allUnits - allPlayers; _enemyAI = _allAI select { [side player, side _x] call BIS_fnc_sideIsEnemy }; _cnt = count _enemyAI; { [_x,{ _this disableAI "PATH"; removeAllWeapons _this; while { alive _this } do { sleep 5; // ideally change this sleep to be just as long as the animation _this playMove "AmovPercMstpSnonWnonDnon_exerciseKata"; }; }] remoteExec ["spawn",_x]; } count ((allUnits - allPlayers) select { [side player, side _x] call BIS_fnc_sideIsEnemy }); also just like you typed tested this nothing happening to ai. 1 hour ago, Tajin said: { [_x,{ _this disableAI "PATH"; removeAllWeapons _this; while { alive _this } do { sleep 5; // ideally change this sleep to be just as long as the animation _this playMove "AmovPercMstpSnonWnonDnon_exerciseKata"; }; }] remoteExec ["spawn",_x]; } count ((allUnits - allPlayers) select { [side player, side _x] call BIS_fnc_sideIsEnemy }); i tried like this nothing happens to ai. your very first code worked that teleported all ai to me then they all did karated , i added your new code and tested it , nothing is happening am not sure why , like i tested your first code it worked with no problems. Share this post Link to post Share on other sites
pierremgi 4944 Posted October 24, 2017 2 hours ago, Tajin said: Oh i thought you wanted them to be teleported to you. Well, that makes it even easier: { [_x,{ _this disableAI "PATH"; removeAllWeapons _this; while { alive _this } do { sleep 5; // ideally change this sleep to be just as long as the animation _this playMove "AmovPercMstpSnonWnonDnon_exerciseKata"; }; }] remoteExec ["spawn",_x]; } count ((allUnits - allPlayers) select { [side player, side _x] call BIS_fnc_sideIsEnemy }); Why remoteExec this code supposed to be applied on AI enemy units, then on server ? 1 Share this post Link to post Share on other sites
peacefull Nation 6 Posted October 24, 2017 this code is working fine _allAI = allUnits - allPlayers; _enemyAI = _allAI select { [side player, side _x] call BIS_fnc_sideIsEnemy }; _cnt = count _enemyAI; { [_x,"PATH"] remoteExec ["disableAI",_x]; _x setDir (_forEachIndex / _cnt * 360); cameraOn setAnimSpeedCoef 0.05; _x setPos (player getPos [10, 180 - (_forEachIndex / _cnt * 360)]); _x spawn {sleep (random 10) max 5; _this remoteExec ["removeAllWeapons",_this]; [_this,"AmovPercMstpSnonWnonDnon_exerciseKata"] remoteExec ["playMove",_this];}; } forEach _enemyAI; how ever all ai is getting teleported to me + my player gets frozen and cant walk or run fast moves slow motion . it dont affect other human players thats good. now am wondering why this is not working in same host. _allAI = allUnits - allPlayers; _enemyAI = _allAI select { [side player, side _x] call BIS_fnc_sideIsEnemy }; _cnt = count _enemyAI; { [_x,{ _this disableAI "PATH"; removeAllWeapons _this; while { alive _this } do { sleep 5; // ideally change this sleep to be just as long as the animation _this playMove "AmovPercMstpSnonWnonDnon_exerciseKata"; }; }] remoteExec ["spawn",_x]; } count ((allUnits - allPlayers) select { [side player, side _x] call BIS_fnc_sideIsEnemy }); 1 Share this post Link to post Share on other sites
peacefull Nation 6 Posted October 24, 2017 ok update. working _allAI = allUnits - allPlayers; _enemyAI = _allAI select { [side player, side _x] call BIS_fnc_sideIsEnemy }; _cnt = count _enemyAI; { [_x,"PATH"] remoteExec ["disableAI",_x]; _x spawn {sleep (random 10) max 5; _this remoteExec ["removeAllWeapons",_this]; [_this,"AmovPercMstpSnonWnonDnon_exerciseKata"] remoteExec ["playMove",_this];}; } forEach _enemyAI; how can i make this loop. _allAI = allUnits - allPlayers; _enemyAI = _allAI select { [side player, side _x] call BIS_fnc_sideIsEnemy }; _cnt = count _enemyAI; { [_x,"PATH"] remoteExec ["disableAI",_x]; _x spawn {sleep (random 10) max 5; _this remoteExec ["removeAllWeapons",_this]; [_this,"AmovPercMstpSnonWnonDnon_exerciseKata"] remoteExec ["playMove",_this];}; } forEach _enemyAI; how do i add this code too this while {true} do { }; Share this post Link to post Share on other sites
Tajin 349 Posted October 25, 2017 - why copypaste new code into old code? Don't mix them ! - why not enable showScriptErrors ? - remove comments before you paste into debugconsole ! 13 hours ago, peacefull Nation said: how can i make this loop. while { alive Tajin } do { }; 14 hours ago, pierremgi said: Why remoteExec this code supposed to be applied on AI enemy units, then on server ? Just making sure the code is run where the unit is local, that is not always the server. 1 Share this post Link to post Share on other sites
peacefull Nation 6 Posted October 25, 2017 as i am new but still getting their , i was able to make it work now and here is what i made. _allAI = allUnits - allPlayers; _enemyAI = _allAI select { [side player, side _x] call BIS_fnc_sideIsEnemy }; _cnt = count _enemyAI; { [_x,"PATH"] remoteExec ["disableAI",_x]; _x spawn {sleep (random 20) max 5; _this remoteExec ["removeAllWeapons",_this]; _animation = ["AmovPercMstpSnonWnonDnon_exerciseKata","Acts_A_M01_briefing", "Acts_A_M02_briefing", "Acts_A_M03_briefing", "Acts_A_M04_briefing"] call BIS_fnc_selectRandom; [_this, _animation] remoteExec ["playMove",_this];}; } forEach _enemyAI; so each ai wil do random animation , now i am looking to make this loop just stuck here. not sure where to put the do while code Share this post Link to post Share on other sites
Tajin 349 Posted October 25, 2017 7 hours ago, Tajin said: while { alive Tajin } do { }; ↑ replace facepalm with code and "alive Tajin" with any other sensible condition. 2 Share this post Link to post Share on other sites