Raised This Month: $ Target: $400
 0% 

Help set_task


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
tolpecek
Member
Join Date: Dec 2018
Old 12-26-2018 , 18:08   Re: Help set_task
Reply With Quote #3

Quote:
Originally Posted by Bugsy View Post
1. set_task() expects a float for the interval, use 2.0 instead of 2.
2. What is the value of g_item_sti[]?
3. Add an is_user_alive() check before executing the set_task() calls in zaciatok_kola().
4. You can reduce code (which also fixes a player potentially getting over MaxHP[] in the first if-statement if a player has MaxHP[]-1 hp and then it adds [addhealths]):

Replace
PHP Code:
if(!(get_user_health(id) >= MaxHP[id]))
    
set_user_health(idget_user_health(id) + floatround(addhealths))
        
if(
get_user_health(id) > MaxHP[id]) 
    
set_user_health(idfloatround(MaxHP[id])) 
With
PHP Code:
set_user_healthid clampget_user_health(id) + floatround(addhealths) , MaxHP[id] ) ); 

g_item_sti[id] is bool, item in game from shop and it checks if it is bought or not
Thanks for reply, gonna test it
tolpecek 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 07:34.


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