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

API Scripting Help ZP 5.0 Class Zombie: Cooldown


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Hn.S Xmix
Member
Join Date: May 2021
Old 08-06-2023 , 18:39   ZP 5.0 Class Zombie: Cooldown
Reply With Quote #1

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

Hn.S Xmix is online now
Balage74
Member
Join Date: Dec 2006
Old 08-14-2023 , 16:34   Re: ZP 5.0 Class Zombie: Cooldown
Reply With Quote #2

Third code use in You r code where check player use ability.
Quote:
Originally Posted by Hn.S Xmix View Post
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

__________________

Last edited by Balage74; 08-14-2023 at 16:35.
Balage74 is offline
Send a message via MSN to Balage74 Send a message via Skype™ to Balage74
Celena Luna
Veteran Member
Join Date: Aug 2013
Location: Nagazora
Old 08-16-2023 , 03:56   Re: ZP 5.0 Class Zombie: Cooldown
Reply With Quote #3

the code is correct, you just put the code at the wrong place
__________________
My plugin:
Celena Luna is offline
Hn.S Xmix
Member
Join Date: May 2021
Old 08-16-2023 , 06:53   Re: ZP 5.0 Class Zombie: Cooldown
Reply With Quote #4

Quote:
Originally Posted by Balage74 View Post
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 is online now
Hn.S Xmix
Member
Join Date: May 2021
Old 08-16-2023 , 07:08   Re: ZP 5.0 Class Zombie: Cooldown
Reply With Quote #5

Quote:
Originally Posted by Celena Luna View Post
the code is correct, you just put the code at the wrong place

are you sure?
Attached Files
File Type: sma Get Plugin or Get Source (zp_class_climb.sma - 51 views - 4.2 KB)
Hn.S Xmix is online now
Celena Luna
Veteran Member
Join Date: Aug 2013
Location: Nagazora
Old 08-16-2023 , 21:08   Re: ZP 5.0 Class Zombie: Cooldown
Reply With Quote #6

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
__________________
My plugin:
Celena Luna is offline
Hn.S Xmix
Member
Join Date: May 2021
Old 08-19-2023 , 13:42   Re: ZP 5.0 Class Zombie: Cooldown
Reply With Quote #7

Quote:
Originally Posted by Celena Luna View Post
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?
Attached Files
File Type: sma Get Plugin or Get Source (zp_class_climb.sma - 59 views - 5.8 KB)
Hn.S Xmix is online now
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 09:28.


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