Raised This Month: $ Target: $400
 0% 

[SOLVED] stop nvg when is deactivated


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
tuty
Veteran Member
Join Date: Jul 2008
Location: UK
Old 02-24-2009 , 12:17   [SOLVED] stop nvg when is deactivated
Reply With Quote #1

Hi, i need a help.
I have a plugin, and, that plugin remove all players nvg's.
But! if nvg is enabled(ON), and nvg is removed the player can't stop(turn off) nvg.
Some examples please?

EDIT: arkshine, connor, v3x, ghw ?? ):
__________________

Last edited by tuty; 02-25-2009 at 07:12.
tuty is offline
Send a message via ICQ to tuty Send a message via AIM to tuty
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 02-24-2009 , 13:38   Re: stop nvg when is deactivated
Reply With Quote #2

I made some tests and haven't found a better way (aka make the game send the message itself)

PHP Code:
#include <amxmodx>
#include <fakemeta>

#define OFFSET_NVGOGGLES    129
#define HAS_NVGS (1<<0)
#define USES_NVGS (1<<8)

new gmsgNVGToggle

public plugin_init()
{
    
gmsgNVGToggle get_user_msgid("NVGToggle")
}

Remove_User_Nvgsid )
{
    new 
iNvgs get_pdata_int(idOFFSET_NVGOGGLES5)
    if( !
iNvgs )
    {
        return
    }
    if( 
iNvgs USES_NVGS )
    {
        
emit_sound(idCHAN_ITEM"items/nvg_off.wav"VOL_NORMATTN_NORM0PITCH_NORM)

        
emessage_begin(MSG_ONEgmsgNVGToggle_id)
        
ewrite_byte(0)
        
emessage_end()
    }
    
set_pdata_int(idOFFSET_NVGOGGLES05)

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
tuty
Veteran Member
Join Date: Jul 2008
Location: UK
Old 02-24-2009 , 13:54   Re: stop nvg when is deactivated
Reply With Quote #3

wow connor works great

Thank you !

+K
__________________
tuty is offline
Send a message via ICQ to tuty Send a message via AIM to tuty
Reply



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 16:51.


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