AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [SOLVED] client_PreThink doesn't work? (https://forums.alliedmods.net/showthread.php?t=48688)

Ywa*NL 12-18-2006 11:03

[SOLVED] client_PreThink doesn't work?
 
Hello guys,

I've a problem with client_PreThink. When I aim at someone nothing happens. I have this code:

Code:
public client_PreThink(id) {         new player,body,name[256]         get_user_aiming(id,player,body)         if(is_user_alive(player) && is_user_alive(id) && !is_user_bot(id))         {             new health = get_user_health(player) // Get health             get_user_name(player,name,255) // Get player name             new weaponid = cs_get_weapon_id(player)             if (cs_get_user_team(player) == CS_TEAM_T)             { // Terrorist                 set_hudmessage(255, 0, 0, -1.0, -1.0, 0, 6.0, 12.0)                 show_hudmessage(id, "%s - Team: Terrorist - Health: %i^nWeapon holding: %s",name,health,weaponid)             } else { // Counter-Terrorist                 set_hudmessage(0, 0, 255, -1.0, -1.0, 0, 6.0, 12.0)                 show_hudmessage(id, "%s - Team: Counter-Terrorist - Health: %i^nWeapon holding: %s",name,health,weaponid)             }         } }

Thanks in advance!

Basic-Master 12-18-2006 11:49

Re: client_PreThink doesn't work?
 
did you include engine? and god, take these nasty news away, use static instead

Ywa*NL 12-18-2006 11:55

Re: client_PreThink doesn't work?
 
No, changed it now but still doesn't work :S .

mateo10 12-18-2006 13:03

Re: client_PreThink doesn't work?
 
Include fakemeta instead and do:
plugin_init()
Code:
register_forward(FM_PlayerPreThink, "PreThink")
change client_PreThink to PreThink when you've done the steps above.

Ywa*NL 12-18-2006 14:20

Re: client_PreThink doesn't work?
 
It's still not working :( .

Edit
I don't know how but it works :) . Thanks guys!


All times are GMT -4. The time now is 07:00.

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