Raised This Month: $51 Target: $400
 12% 

[L4D2] Grenade Launcher Random Projectile v1.1 [30-November-2022]


Post New Thread Reply   
 
Thread Tools Display Modes
Author
NoroHime
Veteran Member
Join Date: Aug 2016
Location: bed
Plugin ID:
8272
Plugin Version:
1.1
Plugin Category:
Fun Stuff
Plugin Game:
Left 4 Dead
Plugin Dependencies:
Servers with this Plugin:
 
Plugin Description:
random the grenadelauncher make surprise.
Old 11-03-2022 , 14:55   [L4D2] Grenade Launcher Random Projectile v1.1 [30-November-2022]
Reply With Quote #1

about
  • make for funny, chance to launch variant projectile
  • the projectiles include tank rock / pipe bomb / spitter acid / vomit jar / molotov
  • you can set very small chance to launch spitter acid make surprise to your player or something else
  • can press key to make projectile anti-gravity, maybe not relevant, but i really need it


ConVar

PHP Code:
// chance to trigger random Projectiles, if not set, use *_type
grenadelauncher_random_chance "0.5"

// make projectile anti-gravity -1=always 0=never other=specifis key pressed 131072=shift 4=ctrl
grenadelauncher_random_fly "131076"

// if trigger by *_chance, which projectiles random launch by Grenade Launcher
// 1=molotov 2=pipe bomb 4=spitter 8=vomit jar 16=tank rock -1=All
// add numbers together you want.
grenadelauncher_random_rand "-1"

// time(seconds) of timeout to detonate the grenade
grenadelauncher_random_timeout "6.0"

// plugin default type if trigger
// 0=vanilla 1=molotov 2=pipe bomb 4=spitter 8=vomit jar 16=tank rock
grenadelauncher_random_type "0" 

changelog
  • v1.0 just releases; 4-November-2022
  • v1.0.1 fix issue 'some grenade doesnt have owner'; 4-November-2022(2nd time)
  • v1.0.2 doubled the double check, for safe; 4-November-2022(3rd time)
  • v1.1 for dev,
    add forward event 'void OnGLProjectileReplaced(int before, int after, int client)'
    add natives 'void DisableGLListener()', 'void EnableGLListener()'; 30-November-2022

Installation
for Developers
PHP Code:
forward void OnGLProjectileReplaced(int beforeint afterint client);

public 
void OnGLProjectileReplaced(int beforeint afterint client) {}

native void DisableGLListener();
native void EnableGLListener(); 
Related Plugins
[L4D2] Grenade Launcher Random Projectile - work together, and make random projectile has extra explosion
[L4D2] Remote Control Grenade Launcher with Random Projectile (SourceMod)
Attached Thumbnails
Click image for larger version

Name:	launching tank rock.jpg
Views:	279
Size:	90.9 KB
ID:	197757  
Attached Files
File Type: sp Get Plugin or Get Source (l4d2_grenadelauncher_random.sp - 448 views - 7.7 KB)
__________________

Last edited by NoroHime; 11-29-2022 at 12:00.
NoroHime is offline
Mr. Man
Veteran Member
Join Date: Mar 2011
Location: Huh?
Old 11-03-2022 , 16:50   Re: [L4D2] Grenade Launcher Random Projectile v1.0 [4-November-2022]
Reply With Quote #2

Does the spit and tank rock do damage to non-survivors?
__________________
Mr. Man is offline
NoroHime
Veteran Member
Join Date: Aug 2016
Location: bed
Old 11-04-2022 , 00:56   Re: [L4D2] Grenade Launcher Random Projectile v1.0 [4-November-2022]
Reply With Quote #3

Quote:
Originally Posted by Mr. Man View Post
Does the spit and tank rock do damage to non-survivors?
no doubt in the game tank rock can crash zombies.
to control spit acid damages, you should need [L4D2] Spitter Acid Damage by Silvers.
or set *_rand to 27 (this mean 31 - 4), make spit acid wont appear
__________________

Last edited by NoroHime; 11-04-2022 at 00:58.
NoroHime is offline
HarryPotter
Veteran Member
Join Date: Sep 2017
Location: Taiwan, Asia
Old 11-04-2022 , 04:01   Re: [L4D2] Grenade Launcher Random Projectile v1.0 [4-November-2022]
Reply With Quote #4

That is so funny to see rock coming from grenade launcher, great job
__________________
HarryPotter is offline
HarryPotter
Veteran Member
Join Date: Sep 2017
Location: Taiwan, Asia
Old 11-04-2022 , 06:44   Re: [L4D2] Grenade Launcher Random Projectile v1.0 [4-November-2022]
Reply With Quote #5

PHP Code:
L 11/04/2022 16:16:16: [SMException reportedNULL not allowed
L 11
/04/2022 16:16:16: [SMBlamingleft4dhooks.smx
L 11
/04/2022 16:16:16: [SMCall stack trace:
L 11/04/2022 16:16:16: [SM]   [0SDKCall
L 11
/04/2022 16:16:16: [SM]   [1Line 1355l4dd\l4dd_natives.sp::Native_CMolotovProjectile_Create
L 11
/04/2022 16:16:16: [SM]   [3L4D_MolotovPrj
L 11
/04/2022 16:16:16: [SM]   [4Line 141l4d2_grenadelauncher_random.sp::ReplaceProjectile
L 11
/04/2022 16:16:16: [SM]   [5Line 121l4d2_grenadelauncher_random.sp::ReplaceProjectileVVel
L 11
/04/2022 16:16:19: [SMException reportedEntity -(-1is invalid
L 11
/04/2022 16:16:19: [SMBlamingl4d2_grenadelauncher_random.smx
L 11
/04/2022 16:16:19: [SMCall stack trace:
L 11/04/2022 16:16:19: [SM]   [0GetEntProp
L 11
/04/2022 16:16:19: [SM]   [1Line 593entity_prop_stocks::GetClientButtons
L 11
/04/2022 16:16:19: [SM]   [2Line 158l4d2_grenadelauncher_random.sp::SetProjectileMoveType
L 11
/04/2022 16:16:19: [SM]   [3Line 129l4d2_grenadelauncher_random.sp::ReplaceProjectile
L 11
/04/2022 16:16:19: [SM]   [4Line 116l4d2_grenadelauncher_random.sp::OnProjectileCreated
L 11
/04/2022 16:16:21: [SMException reportedEntity -(-1is invalid
L 11
/04/2022 16:16:21: [SMBlamingl4d2_grenadelauncher_random.smx
L 11
/04/2022 16:16:21: [SMCall stack trace:
L 11/04/2022 16:16:21: [SM]   [0GetEntProp
L 11
/04/2022 16:16:21: [SM]   [1Line 593entity_prop_stocks::GetClientButtons
L 11
/04/2022 16:16:21: [SM]   [2Line 158l4d2_grenadelauncher_random.sp::SetProjectileMoveType
L 11
/04/2022 16:16:21: [SM]   [3Line 129l4d2_grenadelauncher_random.sp::ReplaceProjectile
L 11
/04/2022 16:16:21: [SM]   [4Line 116l4d2_grenadelauncher_random.sp::OnProjectileCreated
L 11
/04/2022 16:16:24: [SMException reportedEntity -(-1is invalid
L 11
/04/2022 16:16:24: [SMBlamingl4d2_grenadelauncher_random.smx
L 11
/04/2022 16:16:24: [SMCall stack trace:
L 11/04/2022 16:16:24: [SM]   [0GetEntProp
L 11
/04/2022 16:16:24: [SM]   [1Line 593entity_prop_stocks::GetClientButtons
L 11
/04/2022 16:16:24: [SM]   [2Line 158l4d2_grenadelauncher_random.sp::SetProjectileMoveType
L 11
/04/2022 16:16:24: [SM]   [3Line 129l4d2_grenadelauncher_random.sp::ReplaceProjectile
L 11
/04/2022 16:16:24: [SM]   [4Line 116l4d2_grenadelauncher_random.sp::OnProjectileCreated 

PHP Code:
void OnProjectileCreated(int entity) {

    if ( 
entity <= MaxClients || !IsValidEntity(entity) ) return;

    ...

__________________

Last edited by HarryPotter; 11-04-2022 at 06:47.
HarryPotter is offline
NoroHime
Veteran Member
Join Date: Aug 2016
Location: bed
Old 11-04-2022 , 07:40   Re: [L4D2] Grenade Launcher Random Projectile v1.0 [4-November-2022]
Reply With Quote #6

thanks report, looks some grenade_launcher_projectile didnt have owner, anyway double check it

update v1.0.1
Quote:
v1.0.1 fix issue 'some grenade doesnt have owner'; 4-November-2022(2nd time)
__________________

Last edited by NoroHime; 11-04-2022 at 07:45.
NoroHime is offline
HarryPotter
Veteran Member
Join Date: Sep 2017
Location: Taiwan, Asia
Old 11-04-2022 , 08:59   Re: [L4D2] Grenade Launcher Random Projectile v1.0 [4-November-2022]
Reply With Quote #7

Quote:
Originally Posted by NoroHime View Post
thanks report, looks some grenade_launcher_projectile didnt have owner, anyway double check it
You still have to check if entity is valid in SDKHook_SpawnPost.


PHP Code:

SDKHook
(entitySDKHook_SpawnPostOnProjectileCreated);

void OnProjectileCreated(int entity) {

    if ( 
entity <= MaxClients || !IsValidEntity(entity) ) return;

    ...

Better use EntIndexToEntRef if using RequestFrame, entity could be removed or invalid on next frame.

PHP Code:
RequestFrame(ReplaceProjectileVVelEntIndexToEntRef(entity));

void ReplaceProjectileVVel(int entity)
{
    if( (
entity EntRefToEntIndex(entity)) != INVALID_ENT_REFERENCE )
    {
        .....
    }

__________________

Last edited by HarryPotter; 11-04-2022 at 09:02.
HarryPotter is offline
NoroHime
Veteran Member
Join Date: Aug 2016
Location: bed
Old 11-04-2022 , 11:31   Re: [L4D2] Grenade Launcher Random Projectile v1.0 [4-November-2022]
Reply With Quote #8

alright, but why we need check projectile isnt client?
anyway patched it, just in case if someone kill the projectile entity on OnEntityCreated()

update
Quote:
  • v1.0.2 doubled the double check, for safe; 4-November-2022(3rd time)
__________________

Last edited by NoroHime; 11-04-2022 at 11:47.
NoroHime is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 11:20.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode