AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Set Crosshair (https://forums.alliedmods.net/showthread.php?t=223681)

nato 08-16-2013 05:52

Set Crosshair
 
How to install a sight for a weapon, so he is not lost?
http://www.imageup.ru/img224/1451351/cross.jpg
I tried sets the case, but when the first shot is changed to standard
PHP Code:

engfunc(EngFunc_MessageBeginMSG_ONE_UNRELIABLE110, {0.00.00.0}, id); //Crosshair
write_byte(1);
message_end(); 

Maybe there are offsets?

guipatinador 08-16-2013 07:05

Re: Set Crosshair
 
Hook CurWeapon Event.

nato 08-16-2013 07:14

Re: Set Crosshair
 
Quote:

Originally Posted by guipatinador (Post 2014458)
Hook CurWeapon Event.

In CurWeapon the following parameters
PHP Code:

CurWeapon          
byte      IsActive 
 byte      WeaponID 
 byte      ClipAmmo 

How do they relate to the sight?

guipatinador 08-16-2013 07:22

Re: Set Crosshair
 
PHP Code:

new g_MsgCrossHair

public plugin_init( )
{
    
register_event"CurWeapon""Event_CurWeapon""be""1=1" )
    
    
g_MsgCrossHair get_user_msgid"Crosshair" )
}

public 
Event_CurWeaponid )
{
    
message_beginMSG_ONEg_MsgCrossHair_id )
    
write_byte)
    
message_end( )



nato 08-16-2013 07:27

Re: Set Crosshair
 
guipatinador Thanks


All times are GMT -4. The time now is 15:46.

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