mirror of
https://github.com/Resxt/Plutonium-IW5-Scripts.git
synced 2025-04-20 13:05:43 +00:00
launchers_weapons_rewards 1.0.1
- Add WeaponIsValid to only start the reward loop if the spawn weapon is a launcher - Update README
This commit is contained in:
parent
6110607465
commit
899431bed2
@ -5,6 +5,7 @@ Scripts that give the players different weapons or perks depending on their curr
|
|||||||
## launchers_weapons_rewards.gsc
|
## launchers_weapons_rewards.gsc
|
||||||
|
|
||||||
Gives the player a new weapon every time he reaches a new tier.
|
Gives the player a new weapon every time he reaches a new tier.
|
||||||
|
`WeaponIsValid()` ensures that the rewards are only given if the player's spawn weapon is a launcher.
|
||||||
If the player reaches the last tier the loop restarts allowing players to get tiers several time per life if they ever get enough kills.
|
If the player reaches the last tier the loop restarts allowing players to get tiers several time per life if they ever get enough kills.
|
||||||
For example with this script if you get 50 kills in a row you would get the AC130 105mm two times.
|
For example with this script if you get 50 kills in a row you would get the AC130 105mm two times.
|
||||||
This is how the script is configured
|
This is how the script is configured
|
||||||
|
@ -34,8 +34,6 @@ OnPlayerSpawned()
|
|||||||
{
|
{
|
||||||
self waittill("spawned_player");
|
self waittill("spawned_player");
|
||||||
|
|
||||||
print(self.name);
|
|
||||||
|
|
||||||
if (isDefined(self.pers["isBot"]))
|
if (isDefined(self.pers["isBot"]))
|
||||||
{
|
{
|
||||||
if (self.pers["isBot"])
|
if (self.pers["isBot"])
|
||||||
@ -48,15 +46,6 @@ OnPlayerSpawned()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ReplaceWeapon(new_weapon)
|
|
||||||
{
|
|
||||||
self TakeAllWeapons();
|
|
||||||
self GiveWeapon(new_weapon);
|
|
||||||
self GiveWeapon("semtex_mp"); // Found in dsr files
|
|
||||||
self GiveWeapon("flare_mp"); // Tactical insertion - found in common_mp.ff
|
|
||||||
self SetSpawnWeapon(new_weapon); // This gives the weapon without playing the animation
|
|
||||||
}
|
|
||||||
|
|
||||||
WeaponReward()
|
WeaponReward()
|
||||||
{
|
{
|
||||||
self endon ("disconnect");
|
self endon ("disconnect");
|
||||||
@ -64,12 +53,15 @@ WeaponReward()
|
|||||||
|
|
||||||
spawn_weapon = self GetCurrentWeapon();
|
spawn_weapon = self GetCurrentWeapon();
|
||||||
|
|
||||||
|
if (WeaponIsValid(spawn_weapon))
|
||||||
|
{
|
||||||
while(true)
|
while(true)
|
||||||
{
|
{
|
||||||
weapon_rewards = [[5, "m320_mp"], [10, "rpg_mp"], [15, "ac130_40mm_mp"], [25, "ac130_105mm_mp"], [35, spawn_weapon]]; // [kills_required, weapon_reward]
|
weapon_rewards = [[5, "m320_mp"], [10, "rpg_mp"], [15, "ac130_40mm_mp"], [25, "ac130_105mm_mp"], [35, spawn_weapon]]; // [kills_required, weapon_reward]
|
||||||
CheckWeaponReward(weapon_rewards);
|
CheckWeaponReward(weapon_rewards);
|
||||||
wait 0.01;
|
wait 0.01;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CheckWeaponReward(weapon_rewards)
|
CheckWeaponReward(weapon_rewards)
|
||||||
@ -95,6 +87,34 @@ CheckWeaponReward(weapon_rewards)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ReplaceWeapon(new_weapon)
|
||||||
|
{
|
||||||
|
self TakeAllWeapons();
|
||||||
|
self GiveWeapon(new_weapon);
|
||||||
|
self GiveWeapon("semtex_mp"); // Found in dsr files
|
||||||
|
self GiveWeapon("flare_mp"); // Tactical insertion - found in common_mp.ff
|
||||||
|
self SetSpawnWeapon(new_weapon); // This gives the weapon without playing the animation
|
||||||
|
}
|
||||||
|
|
||||||
|
WeaponIsValid(weapon)
|
||||||
|
{
|
||||||
|
switch (weapon)
|
||||||
|
{
|
||||||
|
case "iw5_smaw_mp":
|
||||||
|
return true;
|
||||||
|
case "rpg_mp":
|
||||||
|
return true;
|
||||||
|
case "m320_mp":
|
||||||
|
return true;
|
||||||
|
case "xm25_mp":
|
||||||
|
return true;
|
||||||
|
case "javelin_mp":
|
||||||
|
return true;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Allow the AC-130 kills to be counted in player.pers["cur_kill_streak"]
|
// Allow the AC-130 kills to be counted in player.pers["cur_kill_streak"]
|
||||||
WhitelistKillstreaksInKillsCount( weapon )
|
WhitelistKillstreaksInKillsCount( weapon )
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user