Raised This Month: $ Target: $400
 0% 

Solved read data from events and hook 2 things


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 06-09-2019 , 19:08   Re: read data from events and hook 2 things
Reply With Quote #1

Not sure if the % is or isn't causing an issue here. Try checking only the part of the string with the team name:
PHP Code:
#include <amxmodx>

public plugin_init( ) 
    
register_event"SendAudio""win""a""2=%!MRAD_terwin""2=%!MRAD_ctwin" );
    
public 
win( )
{
    new 
sz16 ];
    
read_data2szcharsmaxsz ) );
    
    if ( 
equalsz], "ter" ) , )
        
client_print0print_chat"T" );
    else
        
client_print0print_chat"CT" );

__________________

Last edited by Bugsy; 06-09-2019 at 20:08.
Bugsy is offline
nacknic
Senior Member
Join Date: Mar 2019
Old 06-09-2019 , 23:35   Re: read data from events and hook 2 things
Reply With Quote #2

Quote:
Originally Posted by Bugsy View Post
Not sure if the % is or isn't causing an issue here. Try checking only the part of the string with the team name:
PHP Code:
#include <amxmodx>

public plugin_init( ) 
    
register_event"SendAudio""win""a""2=%!MRAD_terwin""2=%!MRAD_ctwin" );
    
public 
win( )
{
    new 
sz16 ];
    
read_data2szcharsmaxsz ) );
    
    if ( 
equalsz], "ter" ) , )
        
client_print0print_chat"T" );
    else
        
client_print0print_chat"CT" );

hi, i learn from you that i can sub-string in equal operator, i did this, and work 100% [thank you] i write my code:
Code:
#include <amxmodx>

public plugin_init( ) 
    register_event( "SendAudio", "win", "a", "2=%!MRAD_terwin", "2=%!MRAD_ctwin" );
    
public win( )
{
    new sz[ 16 ];
    read_data( 2, sz, charsmax( sz ) );
    
    if ( equal( sz[ 1 ], "!MRAD_terwin" ) )
        client_print( 0, print_chat, "T" );
    else if ( equal( sz[ 1 ], "!MRAD_ctwin" ) )
        client_print( 0, print_chat, "CT" );
}
when i start sz[ 1 ], its skipping the all '%' problem

Last edited by nacknic; 06-09-2019 at 23:37.
nacknic is offline
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 17:26.


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