mirror of
https://github.com/Resxt/Plutonium-IW5-Scripts.git
synced 2025-04-19 20:52:54 +00:00
Added replace_weapon_on_spawn
This commit is contained in:
parent
bd0b0072b8
commit
1d8dbaf732
10
replace_weapon_on_spawn/README.md
Normal file
10
replace_weapon_on_spawn/README.md
Normal file
@ -0,0 +1,10 @@
|
||||
# Replace Weapon On Spawn
|
||||
|
||||
A script to replace players weapon when they spawn.
|
||||
This can easily be modified to always give a certain weapon or only give it when the player has a certain weapon etc.
|
||||
This is useful to add ported weapons like the Intervention to your default classes until Plutonium adds the possibility to do it directly in dsr files.
|
||||
|
||||
## replace_rsass_with_intervention.gsc
|
||||
Replace the RSASS with an Intervention (ACOG sight)
|
||||
Replace the RSASS silencer with an Intervention (ACOG sight + silencer)
|
||||
Gives a throwing knife and a tactical insertion in both cases
|
65
replace_weapon_on_spawn/replace_rsass_with_intervention.gsc
Normal file
65
replace_weapon_on_spawn/replace_rsass_with_intervention.gsc
Normal file
@ -0,0 +1,65 @@
|
||||
Init()
|
||||
{
|
||||
level thread OnPlayerConnect();
|
||||
}
|
||||
|
||||
OnPlayerConnect()
|
||||
{
|
||||
for(;;)
|
||||
{
|
||||
level waittill("connected", player);
|
||||
player thread OnPlayerSpawned();
|
||||
}
|
||||
}
|
||||
|
||||
OnPlayerSpawned()
|
||||
{
|
||||
self endon("disconnect");
|
||||
for(;;)
|
||||
{
|
||||
self waittill("spawned_player");
|
||||
current_weapon = self GetCurrentWeapon();
|
||||
self thread DoWeaponCheck(current_weapon);
|
||||
}
|
||||
}
|
||||
|
||||
DoWeaponCheck(current_weapon)
|
||||
{
|
||||
self endon("death");
|
||||
self endon("disconnect");
|
||||
level endon("game_ended");
|
||||
|
||||
//Debug(current_weapon);
|
||||
|
||||
if (current_weapon == "iw5_rsass_mp_rsassscope")
|
||||
{
|
||||
ReplaceWeapon("iw5_cheytac_mp_acog");
|
||||
GiveLethalAndTactical();
|
||||
|
||||
}
|
||||
else if (current_weapon == "iw5_rsass_mp_rsassscope_silencer03")
|
||||
{
|
||||
ReplaceWeapon("iw5_cheytac_mp_acog_silencer03");
|
||||
GiveLethalAndTactical();
|
||||
}
|
||||
}
|
||||
|
||||
ReplaceWeapon(new_weapon)
|
||||
{
|
||||
self TakeAllWeapons();
|
||||
self GiveWeapon(new_weapon);
|
||||
self SetSpawnWeapon(new_weapon); // This gives the weapon without playing the animation
|
||||
}
|
||||
|
||||
// TakeAllWeapons() removes lethal and tactical as well so we give default items after calling it
|
||||
GiveLethalAndTactical()
|
||||
{
|
||||
self GiveWeapon("throwingknife_mp"); // Found in dsr files
|
||||
self GiveWeapon("flare_mp"); // Tactical insertion - found in common_mp.ff
|
||||
}
|
||||
|
||||
// Prints text in the bootstrapper
|
||||
Debug(text)
|
||||
{
|
||||
Print(text);
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user