Raised This Month: $ Target: $400
 0% 

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


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 



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 00:50.


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