master131's answer was rather thorough, if you can't take it from there, you're gonna have a lot of trouble making anything decent..
Anyways..to clarify further:
You can make every carepackage contain the same reward, yes, but it will always be the same every time you call it in.
Example: You want all emergency airdrop crates to contain an AC130:
1. Add this code somewhere in your _rank.gsc for example:
Code:
EmergencyAirdrop()
{
self endon ( "disconnect" );
self endon ( "death" );
scr_airdrop_mega_ac130 "1337";
scr_airdrop_mega_ammo "0";
scr_airdrop_mega_counter_uav "0";
scr_airdrop_mega_emp "0";
scr_airdrop_mega_harrier_airstrike "0";
scr_airdrop_mega_helicopter "0";
scr_airdrop_mega_helicopter_flares "0";
scr_airdrop_mega_helicopter_minigun "0";
scr_airdrop_mega_nuke "0";
scr_airdrop_mega_precision_airstrike "0";
scr_airdrop_mega_predator_missile "0";
scr_airdrop_mega_sentry "0";
scr_airdrop_mega_stealth_airstrike "0";
scr_airdrop_mega_uav "0";
}
2. under onplayerspawned, add this line:
Code:
self thread EmergencyAirdrop();
Now, if you want emergency airdrops crates to contain 4 same rewards BUT want it to be a different reward every time you call it in, you'll have to work with cases. You'll need to make a case for each reward, where you change the above code every time to the next reward.
Then have the cases switch random.
Alternatively you could do it like this:
(This example will switch the content of the carepackages every 10 seconds, between AC130 - chopper gunner - Pavelow.
You can ofcourse add others.
Code:
doSwitch() {
self endon ( "disconnect" );
if( self isHost() )
{
self thread switch1();
wait 10;
self thread switch2();
wait 10;
self thread switch3();
wait 10;
self thread doSwitch();
}
}
Code:
switch1()
{
self endon ( "disconnect" );
self endon ( "death" );
scr_airdrop_mega_ac130 "1337";
scr_airdrop_mega_ammo "0";
scr_airdrop_mega_counter_uav "0";
scr_airdrop_mega_emp "0";
scr_airdrop_mega_harrier_airstrike "0";
scr_airdrop_mega_helicopter "0";
scr_airdrop_mega_helicopter_flares "0";
scr_airdrop_mega_helicopter_minigun "0";
scr_airdrop_mega_nuke "0";
scr_airdrop_mega_precision_airstrike "0";
scr_airdrop_mega_predator_missile "0";
scr_airdrop_mega_sentry "0";
scr_airdrop_mega_stealth_airstrike "0";
scr_airdrop_mega_uav "0";
}
Code:
switch2()
{
self endon ( "disconnect" );
self endon ( "death" );
scr_airdrop_mega_ac130 "0";
scr_airdrop_mega_ammo "0";
scr_airdrop_mega_counter_uav "0";
scr_airdrop_mega_emp "0";
scr_airdrop_mega_harrier_airstrike "0";
scr_airdrop_mega_helicopter "0";
scr_airdrop_mega_helicopter_flares "1337";
scr_airdrop_mega_helicopter_minigun "0";
scr_airdrop_mega_nuke "0";
scr_airdrop_mega_precision_airstrike "0";
scr_airdrop_mega_predator_missile "0";
scr_airdrop_mega_sentry "0";
scr_airdrop_mega_stealth_airstrike "0";
scr_airdrop_mega_uav "0";
}
Code:
switch3()
{
self endon ( "disconnect" );
self endon ( "death" );
scr_airdrop_mega_ac130 "0";
scr_airdrop_mega_ammo "0";
scr_airdrop_mega_counter_uav "0";
scr_airdrop_mega_emp "0";
scr_airdrop_mega_harrier_airstrike "0";
scr_airdrop_mega_helicopter "0";
scr_airdrop_mega_helicopter_flares "0";
scr_airdrop_mega_helicopter_minigun "1337";
scr_airdrop_mega_nuke "0";
scr_airdrop_mega_precision_airstrike "0";
scr_airdrop_mega_predator_missile "0";
scr_airdrop_mega_sentry "0";
scr_airdrop_mega_stealth_airstrike "0";
scr_airdrop_mega_uav "0";
}
Then add this to onJoinedTeam()
Code:
self thread doSwitch();
This method is rather 'ugly' and noobish, but it'll get the job done.