Raised This Month: $ Target: $400
 0% 

remove task with get_gametime


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
MiloSx7
Member
Join Date: Oct 2011
Location: Serbia, Nish
Old 05-24-2013 , 20:03   remove task with get_gametime
Reply With Quote #1

Ok, i really don't want to make another task that will remove another task and so on.

So here is the code
PHP Code:
public MinorPot(id)
{
    
id -= 15031
    
    set_user_health
(idget_user_health(id) + 1)
    
    
set_task(0.2"MinorPot"id 15031)
    
    if(
get_gametime() >= 20)
    {
        
remove_task(id 15031)
        
client_print(idprint_chat"[Mod] Healing done. Just a test msg to know :)")
    }

Its actually a health pot I've been making for some shop menu, but since this check i did kinda checks if the 20 seconds passed since the server / map started, it doesn't really work...

This pot should actually heal for the first 20 seconds after buying (100hp if you done the math), and then stop healing, and message should pop out, which i only put for testing...

So how do i use get_gametime() correctly, and any advices about get_gametime() ??

I really appreciate your help, Thank You!
__________________
MiloS
MiloSx7 is offline
Send a message via MSN to MiloSx7
 



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 16:19.


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