Raised This Month: $ Target: $400
 0% 

why does this not work in client_PreThink?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
MALON
Member
Join Date: Jan 2008
Old 08-26-2008 , 06:03   why does this not work in client_PreThink?
Reply With Quote #1

PHP Code:
public aiming(id//maybe client prethink()
{
    new 
targetbodydistance 999999;
    
get_user_aiming(idtargetbodydistance);
    new 
tnum timer[target][TMR_CNTTME] / 10
    
if(is_user_connected(target))
    { 
        new 
ip[32];
        
get_user_ip(targetipsizeof ip 11);
        
        new 
country[32];
        
geoip_country(ipcountrysizeof country 1);
        
        new 
name[33];
        
get_user_nametargetnamesizeof name 1  );
        
        new 
Buffer[512];
        
format(Buffersizeof Buffer 1"^x03%s | CPs: %d | GCs: %d | Time : %d:%02d"nametimer[target][TMR_CNTCPS], timer[target][TMR_CNTGCS], tnum/60,tnum%60);
        
        
message_begin(MSG_ONEget_user_msgid("StatusText"), _id);
        
write_byte(0);
        
write_string(Buffer);
        
message_end();
    }else
    {
        
message_begin(MSG_ONEget_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
MALON is offline
 



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 03:10.


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