Author Topic: How to execute this script  (Read 2763 times)

0 Members and 1 Guest are viewing this topic.

jcmomo

  • Relentless Teamkiller
  • **
  • Posts: 93
    • View Profile
How to execute this script
« on: July 20, 2012, 06:57:19 am »
This is a script I dug into while bored in Loki's lost key, whenever I execute it in the mod app it says impact in 5 seconds but i didnt get to choose where it falls and nothing happens if i do click on map. Here's the script its called fuel air bomb.

_sPos = _this select 0;

onMapSingleClick "";

HINT format ["impact in 5 seconds..."];

_exec = true;

_round = "bo_gbu12_lgb" createVehicle [0,0];


_burstA = "G_40mm_HE" createVehicle [_sPos select 0, _sPos select 1, 3000];
_burstAd = "weaponHolder" createvehicle [_sPos select 0, _sPos select 1, 3010];


waitUntil {!(isNull _round)};
_round setPos [_sPos select 0,_sPos select 1,1000];
_round setVelocity [0,0,0];

while {_exec} do
{
_round setPos [_sPos select 0, _sPos select 1, getPos _round select 2];
_round setVelocity [0,0,-300];
sleep 0.1;
if (!(alive _round)) then {_exec = false;};
if ((getPos _round select 2) < 40) then
{
_exec = false;
deleteVehicle _round;   
{_x setPos [_sPos select 0, _sPos select 1, 20]} forEach [_burstA, _burstAd];
sleep 0.8;
deleteVehicle _burstAd;

_c = "bo_gbu12_lgb" createVehicle [_sPos select 0, _sPos select 1, 1000];   
_n = "SH_122_he" createVehicle [(_sPos select 0) + 15, _sPos select 1, 1000];
_s = "SH_122_he" createVehicle [(_sPos select 0) - 15, _sPos select 1, 1000];
_e = "SH_122_he" createVehicle [_sPos select 0, (_sPos select 1) + 15, 1000];
_w = "SH_122_he" createVehicle [_sPos select 0, (_sPos select 1) - 15, 1000];
_ne = "SH_122_he" createVehicle [(_sPos select 0) + 10, (_sPos select 1) + 10, 1000];
_nw = "SH_122_he" createVehicle [(_sPos select 0) - 10, (_sPos select 1) + 10, 1000];
_se = "SH_122_he" createVehicle [(_sPos select 0) + 10, (_sPos select 1) - 10, 1000];
_sw = "SH_122_he" createVehicle [(_sPos select 0) - 10, (_sPos select 1) - 10, 1000];
_c setPos [_sPos select 0, _sPos select 1, -0.05];
_n setPos [(_sPos select 0) + 15, _sPos select 1, -0.05];
_s setPos [(_sPos select 0) - 15, _sPos select 1, -0.05];
_e setPos [_sPos select 0, (_sPos select 1) + 15, -0.05];
_w setPos [_sPos select 0, (_sPos select 1) - 15, -0.05];
_ne setPos [(_sPos select 0) + 10, (_sPos select 1) + 10, -0.05];
_nw setPos [(_sPos select 0) - 10, (_sPos select 1) + 10, -0.05];
_se setPos [(_sPos select 0) + 10, (_sPos select 1) - 10, -0.05];
_sw setPos [(_sPos select 0) - 10, (_sPos select 1) - 10, -0.05];

compile (format ["{ _x setDammage 1 } forEach (nearestObjects [%1,[],70])", _sPos]);   
};
};



hint "fab finished.....";
Momo is a homo. Que?

stealthstick

  • Klass Klown
  • ***
  • Posts: 360
  • Computer Scientist
    • View Profile
Re: How to execute this script
« Reply #1 on: July 20, 2012, 07:11:28 am »
Code: [Select]
_sPos = _this select 0;
_sPos is using a variable passed to this script.

Either set _sPos to something else, or make the other script that sends the position of the map click.
It's been a good few years, becoming what I always wanted to be.

jcmomo

  • Relentless Teamkiller
  • **
  • Posts: 93
    • View Profile
Re: How to execute this script
« Reply #2 on: July 20, 2012, 07:21:45 am »
so for ALL the _spos in the script I have to change to another variable? sheeeittttttt
Momo is a homo. Que?

jcmomo

  • Relentless Teamkiller
  • **
  • Posts: 93
    • View Profile
Re: How to execute this script
« Reply #3 on: July 20, 2012, 07:35:04 am »
Code: [Select]
_sPos = _this select 0;
_sPos is using a variable passed to this script.

Either set _sPos to something else, or make the other script that sends the position of the map click.
So will something along the lines of a second sqf called "tele coods" with the code "onMapSingleClick "_spos = _pos;[] spawn compile sCode; onMapSingleClick '';true;";" work?
Momo is a homo. Que?

stealthstick

  • Klass Klown
  • ***
  • Posts: 360
  • Computer Scientist
    • View Profile
Re: How to execute this script
« Reply #4 on: July 20, 2012, 08:04:30 am »
Tired atm, but all you need to do is change _spos to a position, or make a script that passes the onsinglemapclick's position to this script.

if you want, you could just do _spos = cursortarget

This will make it so the position the bomb(s) are spawned at will be at whatever object you are aiming at.
It's been a good few years, becoming what I always wanted to be.

jcmomo

  • Relentless Teamkiller
  • **
  • Posts: 93
    • View Profile
Re: How to execute this script
« Reply #5 on: July 20, 2012, 08:17:33 am »
okay thanks
Momo is a homo. Que?

stealthstick

  • Klass Klown
  • ***
  • Posts: 360
  • Computer Scientist
    • View Profile
Re: How to execute this script
« Reply #6 on: July 20, 2012, 08:20:28 am »
Ah didn't look at the rest of the script, you are going to have to do a lot of changes.

It's best if you just pass the variable of the onsinglemapclick position to this script.

Or you could just make your own script.

Code: [Select]
_targ = cursortarget;
_bomb = "Bo_FAB_250" createvehicle (getpos _targ);
_bomb setdamage 1;
It's been a good few years, becoming what I always wanted to be.

jcmomo

  • Relentless Teamkiller
  • **
  • Posts: 93
    • View Profile
Re: How to execute this script
« Reply #7 on: July 20, 2012, 08:22:47 am »
ah so I make a new scirpt with that code in it? I'm slightly confused though if i put that in a seperate script how will it use the fab
Momo is a homo. Que?

jcmomo

  • Relentless Teamkiller
  • **
  • Posts: 93
    • View Profile
Re: How to execute this script
« Reply #8 on: July 20, 2012, 08:24:27 am »
disregard my above. idk what i was on whew! ill try it out
Momo is a homo. Que?

MrMedic

  • MasstKer
  • ********
  • Posts: 8900
  • programmer/dev/software engineer
    • View Profile
Re: How to execute this script
« Reply #9 on: July 20, 2012, 01:01:04 pm »
_targ = getpos cursortarget;
_bomb = "Bo_FAB_250" createvehicle [ _targ select 0 , _targ select 1 , (_targ select 2 ) + 150 ];
_bomb setVelocity [ 0 , 0 , (velocity _bomb select 2) ];

will drop the bomb , but first give the targeted player god mode , you should add a plane as well in a flyover so they think its a 'real' player , switch another real player into the pilot unit if someone looks at the plane it will show them that player is flying it.

wait for the one that's targeted to get hit then switch the other player back to his original character , you will get a good laugh out of it if you make it btw its even funnier if you attach a toilet to the bomb .. :smile
« Last Edit: July 20, 2012, 01:15:42 pm by MrMedic »
EnCoded Message: i3iy9yl8kr2xf3g2Txs3pr6ye3ya7jg5ty2z

https://www.youtube.com/watch?v=62_7-AYfdkQ
you need a paypal account for the private versions.

Website:
http://bit.ly/medic101

Teamspeak 3: 85.236.101.5:10157

stealthstick

  • Klass Klown
  • ***
  • Posts: 360
  • Computer Scientist
    • View Profile
Re: How to execute this script
« Reply #10 on: July 20, 2012, 10:07:43 pm »
_targ = getpos cursortarget;
_bomb = "Bo_FAB_250" createvehicle [ _targ select 0 , _targ select 1 , (_targ select 2 ) + 150 ];
_bomb setVelocity [ 0 , 0 , (velocity _bomb select 2) ];

will drop the bomb , but first give the targeted player god mode , you should add a plane as well in a flyover so they think its a 'real' player , switch another real player into the pilot unit if someone looks at the plane it will show them that player is flying it.

wait for the one that's targeted to get hit then switch the other player back to his original character , you will get a good laugh out of it if you make it btw its even funnier if you attach a toilet to the bomb .. :smile


Oh you...  :icon_sly
It's been a good few years, becoming what I always wanted to be.

leebeasley

  • Online Villain
  • ***
  • Posts: 115
  • Nyaaa!
    • View Profile
Re: How to execute this script
« Reply #11 on: July 20, 2012, 10:21:44 pm »
_targ = getpos cursortarget;
_bomb = "Bo_FAB_250" createvehicle [ _targ select 0 , _targ select 1 , (_targ select 2 ) + 150 ];
_bomb setVelocity [ 0 , 0 , (velocity _bomb select 2) ];

will drop the bomb , but first give the targeted player god mode , you should add a plane as well in a flyover so they think its a 'real' player , switch another real player into the pilot unit if someone looks at the plane it will show them that player is flying it.

wait for the one that's targeted to get hit then switch the other player back to his original character , you will get a good laugh out of it if you make it btw its even funnier if you attach a toilet to the bomb .. :smile


Deliciously devious!
I cut corners while running laps in gym class because I'm a fearless bastard.

MrMedic

  • MasstKer
  • ********
  • Posts: 8900
  • programmer/dev/software engineer
    • View Profile
Re: How to execute this script
« Reply #12 on: July 20, 2012, 11:42:31 pm »
_targ = getpos cursortarget;
_bomb = "Bo_FAB_250" createvehicle [ _targ select 0 , _targ select 1 , (_targ select 2 ) + 150 ];
_bomb setVelocity [ 0 , 0 , (velocity _bomb select 2) ];

will drop the bomb , but first give the targeted player god mode , you should add a plane as well in a flyover so they think its a 'real' player , switch another real player into the pilot unit if someone looks at the plane it will show them that player is flying it.

wait for the one that's targeted to get hit then switch the other player back to his original character , you will get a good laugh out of it if you make it btw its even funnier if you attach a toilet to the bomb .. :smile


Deliciously devious!

best way to do it  :smile
EnCoded Message: i3iy9yl8kr2xf3g2Txs3pr6ye3ya7jg5ty2z

https://www.youtube.com/watch?v=62_7-AYfdkQ
you need a paypal account for the private versions.

Website:
http://bit.ly/medic101

Teamspeak 3: 85.236.101.5:10157

stealthstick

  • Klass Klown
  • ***
  • Posts: 360
  • Computer Scientist
    • View Profile
Re: How to execute this script
« Reply #13 on: July 21, 2012, 12:08:31 am »
_targ = getpos cursortarget;
_bomb = "Bo_FAB_250" createvehicle [ _targ select 0 , _targ select 1 , (_targ select 2 ) + 150 ];
_bomb setVelocity [ 0 , 0 , (velocity _bomb select 2) ];

will drop the bomb , but first give the targeted player god mode , you should add a plane as well in a flyover so they think its a 'real' player , switch another real player into the pilot unit if someone looks at the plane it will show them that player is flying it.

wait for the one that's targeted to get hit then switch the other player back to his original character , you will get a good laugh out of it if you make it btw its even funnier if you attach a toilet to the bomb .. :smile


Deliciously devious!

best way to do it  :smile

Screw that, just spawn a port-a-potty and make it invincible, then make a small explosion go off at the port-a-potty while giving a hint msg to everyone that someone just took a major shit.
It's been a good few years, becoming what I always wanted to be.

jcmomo

  • Relentless Teamkiller
  • **
  • Posts: 93
    • View Profile
Re: How to execute this script
« Reply #14 on: July 21, 2012, 08:49:02 am »
LOL stealth that would be a pretty nice troll. Although, the "force-open gps" thread still seems to take the cake imo.
Momo is a homo. Que?