PHP Code:
public aiming(id) //maybe client prethink()
{
new target, body, distance = 999999;
get_user_aiming(id, target, body, distance);
new tnum = timer[target][TMR_CNTTME] / 10
if(is_user_connected(target))
{
new ip[32];
get_user_ip(target, ip, sizeof ip - 1, 1);
new country[32];
geoip_country(ip, country, sizeof country - 1);
new name[33];
get_user_name( target, name, sizeof name - 1 );
new Buffer[512];
format(Buffer, sizeof Buffer - 1, "^x03%s | CPs: %d | GCs: %d | Time : %d:%02d", name, timer[target][TMR_CNTCPS], timer[target][TMR_CNTGCS], tnum/60,tnum%60);
message_begin(MSG_ONE, get_user_msgid("StatusText"), _, id);
write_byte(0);
write_string(Buffer);
message_end();
}else
{
message_begin(MSG_ONE, get_user_msgid("StatusText"), _, id);
write_byte(0);
write_string("");
message_end();
}
return PLUGIN_CONTINUE
}
if i put the above code into a client prethink it doesn't work (mins the return PLUGIN_HANDLED of course). It works just fine if i keep it as a regular function with a "set_task 0.1 b" on it, which is a terrible way to do it. i'd prefer it in a client_prethink, but it stops working and i don't get any runtime errors.
Any ideas?
--MALON