View Single Post
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 07-30-2018 , 15:27   Re: get_user_msgid() fails to work on server startup?
Reply With Quote #9

This didn't work for me
PHP Code:
public plugin_init( )
{
    
register_forwardFM_RegUserMsg"@RegUserMsg" );
}

@
RegUserMsgszMsg[ ], iSize )
{
    
register_messageget_user_msgid"WeaponList" ), "OnMessageWeaponList" );
}

public 
OnMessageWeaponList( )
{
    new 
iAmmoIndex get_msg_arg_int);
    new 
iAmmoCount get_msg_arg_int);
    new 
iWeaponID get_msg_arg_int);
    
    
g_eAmmoIndexiWeaponID ][ AmmoIndex ] = iAmmoIndex;
    
g_eAmmoIndexiWeaponID ][ AmmoCount ] = iAmmoCount;
    
    
log_to_file"Weaponlist.txt""%d %d %d"iAmmoIndexiAmmoCountiWeaponID );

EDIT:
I forgot I had to hook FM_RegUserMsg in plugin_precache, works now.
__________________

Last edited by edon1337; 07-30-2018 at 15:31.
edon1337 is offline