AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Zombie Plague Mod (https://forums.alliedmods.net/forumdisplay.php?f=126)
-   -   API Scripting Help ZP 5.0 Class Zombie: Cooldown (https://forums.alliedmods.net/showthread.php?t=343564)

Hn.S Xmix 08-06-2023 18:39

ZP 5.0 Class Zombie: Cooldown
 
hello 👋
I still facing some problems with cooldown in every zombie class, if I add this code down below it will not work and and just spam client_print for some reason untill it finish

I just need a little hand for this, and someone please help me and show me if iam doing something wrong

here is my codes
----->

PHP Code:

new Float:g_lastusetime[33]
new 
cvar_class_cooldown 

PHP Code:

cvar_clasd_cooldown register_cvar("zp_class_cooldown""10"

PHP Code:

if (get_gametime() - g_lastusetimeid ] < get_pcvar_float(cvar_class_cooldown))
                    {
                     
client_print(idprint_chat"Please wait for %d seconds."get_pcvar_num(cvar_class_cooldown));
                     return 
FMRES_IGNORED



Balage74 08-14-2023 16:34

Re: ZP 5.0 Class Zombie: Cooldown
 
Third code use in You r code where check player use ability.
Quote:

Originally Posted by Hn.S Xmix (Post 2808306)
hello ��
I still facing some problems with cooldown in every zombie class, if I add this code down below it will not work and and just spam client_print for some reason untill it finish

I just need a little hand for this, and someone please help me and show me if iam doing something wrong

here is my codes
----->

PHP Code:

new Float:g_lastusetime[33]
new 
cvar_class_cooldown 

PHP Code:

cvar_clasd_cooldown register_cvar("zp_class_cooldown""10"

PHP Code:

if (get_gametime() - g_lastusetimeid ] < get_pcvar_float(cvar_class_cooldown))
                    {
                     
client_print(idprint_chat"Please wait for %d seconds."get_pcvar_num(cvar_class_cooldown));
                     return 
FMRES_IGNORED




Celena Luna 08-16-2023 03:56

Re: ZP 5.0 Class Zombie: Cooldown
 
the code is correct, you just put the code at the wrong place

Hn.S Xmix 08-16-2023 06:53

Re: ZP 5.0 Class Zombie: Cooldown
 
Quote:

Originally Posted by Balage74 (Post 2808633)
Third code use in You r code where check player use ability.

im sorry i still don't get what you just say

Hn.S Xmix 08-16-2023 07:08

Re: ZP 5.0 Class Zombie: Cooldown
 
1 Attachment(s)
Quote:

Originally Posted by Celena Luna (Post 2808698)
the code is correct, you just put the code at the wrong place


are you sure?

Celena Luna 08-16-2023 21:08

Re: ZP 5.0 Class Zombie: Cooldown
 
PHP Code:

    g_lastusetime[id] = get_gametime();
    
    if (
get_gametime() - g_lastusetime[id] < get_pcvar_float(cvar_climb_cooldown))
    {
        
client_print(idprint_chat"Please wait for %d seconds."get_pcvar_num(cvar_climb_cooldown));
        return 
FMRES_IGNORED
    
}
    
g_lastusetime[id] = get_maxplayers( ) 

The problem is this whole section though

PHP Code:

    if (get_gametime() - g_lastusetime[id] < get_pcvar_float(cvar_climb_cooldown))
    {
        
client_print(idprint_chat"Please wait for %d seconds."get_pcvar_num(cvar_climb_cooldown));
        return 
FMRES_IGNORED
    
}
    
g_lastusetime[id] = get_gametime(); 

Should be just like this

Hn.S Xmix 08-19-2023 13:42

Re: ZP 5.0 Class Zombie: Cooldown
 
1 Attachment(s)
Quote:

Originally Posted by Celena Luna (Post 2808738)
PHP Code:

    g_lastusetime[id] = get_gametime();
    
    if (
get_gametime() - g_lastusetime[id] < get_pcvar_float(cvar_climb_cooldown))
    {
        
client_print(idprint_chat"Please wait for %d seconds."get_pcvar_num(cvar_climb_cooldown));
        return 
FMRES_IGNORED
    
}
    
g_lastusetime[id] = get_maxplayers( ) 

The problem is this whole section though

PHP Code:

    if (get_gametime() - g_lastusetime[id] < get_pcvar_float(cvar_climb_cooldown))
    {
        
client_print(idprint_chat"Please wait for %d seconds."get_pcvar_num(cvar_climb_cooldown));
        return 
FMRES_IGNORED
    
}
    
g_lastusetime[id] = get_gametime(); 

Should be just like this


Thats fine this plugin is fixed but there is something wrong this plugin is no longer climb when duration end only cooldown works.
do you have any idea why this happen?


All times are GMT -4. The time now is 12:59.

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