Make your AI drop cash after death

  • Offline CREAMPIE
  • Armaholic
  • Veteran
  • ******
  • Posts: 1077
  • ^_^;;

Make your AI drop cash after death

« posted: Jun 28, 2015, 12:42 PM »
Thanks for Beefaloaf for pointing me in the right direction ...

If you want your NPCS to drop cash - add this at the end of your serverPlayerDied.sqf. Adjust the amount there to your liking.


https://github.com/CRE4MPIE/ArmA3_Wasteland_1.1e.Stratis/blob/master/server/functions/serverPlayerDied.sqf#L83-L94


- from the grassy knoll -

Re: Make your AI drop cash after death

« Reply #1 posted: Jun 28, 2015, 02:46 PM »
Thanks for Beefaloaf for pointing me in the right direction ...

If you want your NPCS to drop cash - add this at the end of your serverPlayerDied.sqf. Adjust the amount there to your liking.


https://github.com/CRE4MPIE/ArmA3_Wasteland_1.1e.Stratis/blob/master/server/functions/serverPlayerDied.sqf#L83-L93

Code: [Select]
// Make NPCs drop Cash
if (!isPlayer _unit) then
{
_itemtype = ["Item","Land_Money_F"];
_item = createVehicle [_itemtype select 1, getpos _unit, [], 5, "None"];
_item setPos ([_lastPos, [[2 + random 3,0,0], random 360] call BIS_fnc_rotateVector2D] call BIS_fnc_vectorAdd);
_item setDir random 360;
_item setVariable ["cmoney", 2500 , true];
_item setVariable ["owner", "world", true];

};

Awesome! Thanks.

Btw i'm not able to get on your server, it says i'm banned. I was able to get on it a while ago.
  • Offline CREAMPIE
  • Armaholic
  • Veteran
  • ******
  • Posts: 1077
  • ^_^;;

Re: Make your AI drop cash after death

« Reply #2 posted: Jun 28, 2015, 02:56 PM »
Awesome! Thanks.

Btw i'm not able to get on your server, it says i'm banned. I was able to get on it a while ago.

What's the reason state ? This you ?

Code: [Select]
2:01:28 PM | Player #5 Jack (ea94f7316cc0889d497035fc55e6xxxx) has been kicked by BattlEye: Admin Ban (Hacker - scriptLog - Dispute on Teamspeak)

- from the grassy knoll -

Re: Make your AI drop cash after death

« Reply #3 posted: Jun 28, 2015, 03:16 PM »
What's the reason state ? This you ?

Code: [Select]
2:01:28 PM | Player #5 Jack (ea94f7316cc0889d497035fc55e6xxxx) has been kicked by BattlEye: Admin Ban (Hacker - scriptLog - Dispute on Teamspeak)

Nope, my in-game name is Macauley (8f28d1ad4f969d8f0a7195f39d4exxxx)

It doesn't say why.
  • Offline CREAMPIE
  • Armaholic
  • Veteran
  • ******
  • Posts: 1077
  • ^_^;;

Re: Make your AI drop cash after death

« Reply #4 posted: Jun 28, 2015, 03:41 PM »
Nope, my in-game name is Macauley (8f28d1ad4f969d8f0a7195f39d4exxxx)

It doesn't say why.

Ah here you are .. seems BE picked you up for trying to execute a TP script of sorts.

Code: [Select]
onMapSingleClick "vehicle player setPos _pos; onMapSingleClick '';true;";

- from the grassy knoll -

Re: Make your AI drop cash after death

« Reply #5 posted: Jun 28, 2015, 03:43 PM »
Ah here you are .. seems BE picked you up for trying to execute a TP script of sorts.

Code: [Select]
onMapSingleClick "vehicle player setPos _pos; onMapSingleClick '';true;";

TP script?

How the hell could i of teleported? I don't hack!
  • Offline CREAMPIE
  • Armaholic
  • Veteran
  • ******
  • Posts: 1077
  • ^_^;;

Re: Make your AI drop cash after death

« Reply #6 posted: Jun 28, 2015, 03:46 PM »
TP script?

How the hell could i of teleported? I don't hack!

Magix ...

I'll lift the ban on UK#1, the other servers will take a day or so  - may the odds be ever in your favour !


- from the grassy knoll -

Re: Make your AI drop cash after death

« Reply #7 posted: Jun 28, 2015, 03:54 PM »
Magix ...

I'll lift the ban on UK#1, the other servers will take a day or so  - may the odds be ever in your favour !

Okay, thanks!

Re: Make your AI drop cash after death

« Reply #8 posted: Jun 28, 2015, 07:31 PM »
How do you get the vehicles to spawn locked when purchasing one?

I have the addon for it.

Re: Make your AI drop cash after death

« Reply #10 posted: Jun 28, 2015, 10:32 PM »
Magix ...

I'll lift the ban on UK#1, the other servers will take a day or so  - may the odds be ever in your favour !

I think you've lifted my ban on the EU server only.
  • Offline CREAMPIE
  • Armaholic
  • Veteran
  • ******
  • Posts: 1077
  • ^_^;;

Re: Make your AI drop cash after death

« Reply #12 posted: Jun 29, 2015, 09:04 AM »
I think you've lifted my ban on the EU server only.

Ye sorry ! Fixed tat - was on the wrong rcon xD

- from the grassy knoll -

Re: Make your AI drop cash after death

« Reply #13 posted: Jun 29, 2015, 08:23 PM »
Thanks for Beefaloaf for pointing me in the right direction ...

If you want your NPCS to drop cash - add this at the end of your serverPlayerDied.sqf. Adjust the amount there to your liking.


https://github.com/CRE4MPIE/ArmA3_Wasteland_1.1e.Stratis/blob/master/server/functions/serverPlayerDied.sqf#L83-L93

Code: [Select]
// Make NPCs drop Cash
if (!isPlayer _unit) then
{
_itemtype = ["Item","Land_Money_F"];
_item = createVehicle [_itemtype select 1, getpos _unit, [], 5, "None"];
_item setPos ([_lastPos, [[2 + random 3,0,0], random 360] call BIS_fnc_rotateVector2D] call BIS_fnc_vectorAdd);
_item setDir random 360;
_item setVariable ["cmoney", 2500 , true];
_item setVariable ["owner", "world", true];

};

How can i make them drop different amounts each?
  • Offline CREAMPIE
  • Armaholic
  • Veteran
  • ******
  • Posts: 1077
  • ^_^;;

Re: Make your AI drop cash after death

« Reply #14 posted: Jun 29, 2015, 10:37 PM »
How can i make them drop different amounts each?

Code in a Radom for the cash amount and just pass that as the value

- from the grassy knoll -