View Single Post
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 01-20-2009 , 16:20   Re: Weapon Lights (Beta) * Updated v0.2
Reply With Quote #8

Quote:
I dunno what you mean with this, sorry my english is very bad, if you can explaind me please.
Do you understand that you parse each time the cvar, when you need to do one time at least ? Just cache the value.

If you want to keep the use of cvars :

- Hook NewRound event ( or others, like RoundStart or RoundEnd )
- Retrieve cvar value, and parse it
- Save in global vars.

You can create a command acting as cvar, too. When someone change the value, it will save immediately one time in the global vars. Using Cvars, you will have to wait the next event.

Do you see what I was meant now ?

Quote:
I prefer MSG_BROADCAST, if a player is around a corner you still can view the light, it's the point. Thanks anyway.
If player is around a corner, he should see the light. PVS means potentially. If player is enough near, it will works in such situation. Try it and you will see.
It will be better to not send a lot of messages when the player is not around.

Quote:
I try this but get some strange error, it works fine with 27.
Try again, no way that it generates an error ; write_byte ( TE_DLIGHT ); works perfectly fine and more readable.

Quote:
Done, it works fine, thanks.
Btw, if interested, to keep the same "design", I'm using a macro, like that :

Code:
#define message_begin_f(%1,%2,%3) ( engfunc ( EngFunc_MessageBegin, %1, %2, %3 ) ) #define write_coord_f(%1)         ( engfunc ( EngFunc_WriteCoord, %1 ) )
Code:
write_coord_f( light_origin[0] ); write_coord_f( light_origin[1] ); write_coord_f( light_origin[2] );

Quote:
I still trying to find the way how to detected if a weapon is silenced and make a cvar to turn on/off, żany suggestions?
See cs_get_weapon_silen() ; if you don't want to use cstrike, use the offset 88. ( see cstrike.cpp + cstrike.h for more details )


And Mini_Midget is right, you should use the VEN's method.

Last edited by Arkshine; 01-21-2009 at 06:38.
Arkshine is offline