Quote:
Originally Posted by Bugsy
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(id, get_user_health(id) + floatround(addhealths))
if(get_user_health(id) > MaxHP[id])
set_user_health(id, floatround(MaxHP[id]))
With
PHP Code:
set_user_health( id , clamp( get_user_health(id) + floatround(addhealths) , 1 , 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