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(ent, id)
{
new target[32]
pev(ent, pev_target, target, 31)
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(id, GREEN, "^x04[Timer] ^x01Timer has start")
}
public cmd_end_timer(id)
{
new time[32] = get_gametime() - timer_time[id]
cmd_finish(id, time)
ColorChat(id, GREEN, "^x04[Timer] ^x01Timer has end")
}
public cmd_finish(id, Float:time)
{
new name[32]
new user[32]
get_user_name(id, name, 31)
get_user_authid(id, user, 31)
new iminute = floatround(time / 60.0, floatround_floor)
new isecond = floatround(time - iminute * 60.0, floatround_floor)
new imilisecond = floatround((time - (iminute * 60.0 + isecond)) * 100.0, floatround_floor)
ColorChat(id, GREEN, "^x04[Timer] %s (%s) finish in %i:%i.%i", name, user, iminute, isecond, imilisecond)
}