Raised This Month: $32 Target: $400
 8% 

if equal problem!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
proffs
Senior Member
Join Date: Jul 2013
Old 06-19-2014 , 05:45   if equal problem!
Reply With Quote #1

Alright so I have 2 plugins on a server which conflicts with each other..

I have a command /donate and another command /donatexp
Whenever i use a command both of the plugin is called.

PHP Code:
public ClCmd_Sayid )
{
    new 
szArgs64 ]
    
    
read_argsszArgscharsmaxszArgs ) )
    
remove_quotesszArgs )
    
    
    
    new 
arg1[16]
    new 
arg2[32]
    
    
strbreak(szArgsarg1charsmax(arg1), arg2charsmax(arg2))
    if (
equali(arg1,"/donate"7))
        
donate(idarg2)


PHP Code:
public ClCmd_Sayid )
{
    new 
szArgs64 ];
    
    
read_argsszArgscharsmaxszArgs ) );
    
remove_quotesszArgs );
    
    
    new 
arg1[16];
    new 
arg2[32];
    
    
strbreak(szArgsarg1charsmax(arg1), arg2charsmax(arg2));
    if (
equali(arg1,"/donatexp"7))
        
donate(idarg2);

Any Idea how to fix this`?
proffs is offline
Bladell
Senior Member
Join Date: Jun 2012
Old 06-19-2014 , 05:49   Re: if equal problem!
Reply With Quote #2

Edit:
PHP Code:
public ClCmd_Sayid 

    new 
szArgs64 
     
    
read_argsszArgscharsmaxszArgs ) ) 
    
remove_quotesszArgs 
     
     
     
    new 
arg1[16
    new 
arg2[32
     
    
strbreak(szArgsarg1charsmax(arg1), arg2charsmax(arg2)) 
    if (
equali(arg1,"/donate")) 
        
donate(idarg2

PHP Code:
public ClCmd_Sayid 

    new 
szArgs64 ]; 
     
    
read_argsszArgscharsmaxszArgs ) ); 
    
remove_quotesszArgs ); 
     
     
    new 
arg1[16]; 
    new 
arg2[32]; 
     
    
strbreak(szArgsarg1charsmax(arg1), arg2charsmax(arg2)); 
    if (
equali(arg1,"/donatexp")) 
        
donate(idarg2); 

You should read the description of this native before using it... http://www.amxmodx.org/doc/index.htm...re%2Fequal.htm
</span></span>

Last edited by Bladell; 06-19-2014 at 05:51.
Bladell is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 06-19-2014 , 08:12   Re: if equal problem!
Reply With Quote #3

Because both comands contain donate and you are using equal wrong. You are comparing only first 7 characters.

Last edited by HamletEagle; 06-19-2014 at 08:13.
HamletEagle is offline
Reply


Thread Tools
Display Modes

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 21:05.


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