Raised This Month: $ Target: $400
 0% 

Solved Zombie Plague: Redux [rewrite version]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
zXCaptainXz
Member
Join Date: May 2017
Old 05-31-2022 , 14:39   Re: Zombie Plague: Redux [rewrite version]
Reply With Quote #1

PHP Code:
public zp_fw_core_cure_posti_Client /* , i_Attacker, i_Force */ )
{
    if( !
is_user_valid_alivei_Client ) )
    {
        return;
    }

You should not check if the user is alive in any of your plugins when calling the cure/infect forwards. Remove that check and it will solve your problem.
I didn't plan to use your version in the first place, I'm just trying to save you some time because I believe ZP 5.0.8a is perfect as it is (99% of the time). I will point out some mistakes you are making throughout your plugins though.

Ham spawn should be registered as post
PHP Code:
    RegisterHamHam_Spawn"player""fwHamSpawnPost"truetrue ); 
You should check if the user is alive, not connected in Ham_Spawn, or it will throw nefarious results

PHP Code:
public fwHamSpawnPosti_Client )
{
    if(
is_user_alive(i_Client)
    
bitsum_setg_bIsAlivei_Client );

Ham_Killed should be registered as Post
PHP Code:
RegisterHamHam_Killed"player""fwHamKilledPost"truetrue ); 
You should not check if the player is connected/alive in Ham_Killed
PHP Code:

public fwHamKilledPosti_Victimi_Attacker )
{
    
bitsum_delg_bIsAlivei_Victim );

Now in zp_game_mode_infection, apart of the fact that you are using pre not post for ham_killed
PHP Code:
public fwHamKilledPrei_Victim /* , i_Attacker */ )
{
    if( 
g_iGMPlayer == i_Victim )
    {
        
g_iGMPlayer ftGetRandomAliverandom_num1ftGetCountAlive( ) ) );
    }

This code does literally nothing, only a bunch of useless calculations.

I doubt this is all that's wrong in there, you should avoid unnecessary checks and look up how to do things the proper way, or things will be prone to fail. If you don't know where to look, then ZP50 source code is a great place to start.
zXCaptainXz 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 21:21.


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