Sign in to follow this  
Followers 0
massasster

Random Reward

4 posts in this topic


Needed a reward script for a "mission" area (I created a bandit island and wanted to reward players for taking over the island) so I crapped together a fast script to fit my purpose using an old domination mission script I had. I wanted vehicles that were not available at traders and were considered too "over powered" to remain on the map, so all vehicles/objects are deleted on server reboot.

 

Requirements:  trigger area

10saeco.jpg

(quick note: there is a ; before the [], that shouldn't be there, I wasn't paying attention when i deleted code for this screen shot)

 

 

reward marker:  (visible or non)

2wqcpeb.jpg

 

 

 

and the reward script.  

 

//////////////////////////////////////////////////////////////////////////////////////////
/////				Random Reward By: MassAsster                       ///////
/////					Es-Gamers.com				   ///////
//////////////////////////////////////////////////////////////////////////////////////////

private["_targetrewardsText","_thereward","_thegift","_vehicle","_pos"];	


_thereward = ["B_Heli_Light_01_armed_F","B_Heli_Attack_01_F","B_MBT_01_cannon_F","B_MBT_01_arty_F","B_MBT_01_mlrs_F","B_APC_Wheeled_01_cannon_F","I_MRAP_03_hmg_F","I_Heli_light_03_F","B_Plane_CAS_01_F"];
_thegift = _thereward call BIS_fnc_selectRandom;

_pos = getMarkerPos "rewardzone";
_vehicle = [_thegift, _pos, 190, true] call ExileServer_object_vehicle_createNonPersistentVehicle;
				
				_vehicle allowDamage false;
				_vehicle setPosATL _pos;
				_vehicle setDamage 0;
				_vehicle allowDamage true;


_targetrewardsText = format ["<t align='center' size='2.2'>BANDIT ISLAND</t><br/><t size='1.5' align='center' color='#00FF80'>REWARD!</t><br/>____________________<br/><t align='left'>Convicts have claimed the prize at Bandit Island</t>",currentAO];
GlobalHint = _targetrewardsText; publicVariable "GlobalHint"; hint parseText GlobalHint;

 

Edited by massasster
make a note
3 people like this

Share this post


Link to post
Share on other sites

Very nice script. I'll probably adapt it for my server. Maybe a random reward that selects a vehicle or box with stuff in it.

Share this post


Link to post
Share on other sites
Advertisement

Finally got around to checking this out. Apparently I need to define the location in mission.sqm? Couldn't the position just be defined in the script?

Share this post


Link to post
Share on other sites
2 hours ago, BetterDeadThanZed said:

Finally got around to checking this out. Apparently I need to define the location in mission.sqm? Couldn't the position just be defined in the script?

_pos = getMarkerPos "rewardzone";

_pos = [10080,7850,0];

 

or you could use the script like a function for missions etc and call it, passing the position making it universal..

_position = [1000,2000,0];

_position call Fnc_Random_Reward;

 

then in random reward..

_pos = _this select 0;

 

You get the idea :)

 

Hope that helps somewhat!

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.