Raised This Month: $ Target: $400
 0% 

Timer


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
RuRuRu612754
Senior Member
Join Date: Sep 2011
Old 06-21-2012 , 21:16   Timer
Reply With Quote #1

Hello

i create the timer referring to the other scripts or manual
compile fail ...
where is problem?

best regards,

PHP Code:
#include <amxmodx>
#include <colorchat>
#include <hamsandwich>
#include <fakemeta>

new timer_time[33]

public 
plugin_init()
{
    
RegisterHam(Ham_Use"func_button""function_button"0)
}

public 
function_button(entid)
{
    new 
target[32]
    
pev(entpev_targettarget31)

    if(
equali(target"counter_start"))
    {
        
cmd_start_timer(id)
    }
    if(
equali(target"counter_off"))
    {
        
cmd_end_timer(id)
    }
}

public 
cmd_start_timer(id)
{
    
timer_time[id] = get_gametime()

    
ColorChat(idGREEN"^x04[Timer] ^x01Timer has start")
}

public 
cmd_end_timer(id)
{
    new 
time[32] = get_gametime() - timer_time[id]

    
cmd_finish(idtime)

    
ColorChat(idGREEN"^x04[Timer] ^x01Timer has end")
}

public 
cmd_finish(idFloat:time)
{
    new 
name[32]
    new 
user[32]

    
get_user_name(idname31)
    
get_user_authid(iduser31)

    new 
iminute floatround(time 60.0floatround_floor)
    new 
isecond floatround(time iminute 60.0floatround_floor)
    new 
imilisecond floatround((time - (iminute 60.0 isecond)) * 100.0floatround_floor)

    
ColorChat(idGREEN"^x04[Timer] %s (%s) finish in %i:%i.%i"nameuseriminuteisecondimilisecond)

RuRuRu612754 is offline
 


Thread Tools
Display Modes

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


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