Raised This Month: $ Target: $400
 0% 

Error printing something in chat


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 03-02-2020 , 11:23   Error printing something in chat
Reply With Quote #1

Okay that's really weird because an hour ago it worked for me and I just changed CMD and then suddenly I do / level it doesn't show me my data = if (! ITarget)
* But shows the data
Quote:
else {
new szName [MAX_NAME_LENGTH];
PHP Code:
    else if(equali(szArgs[0], "/lvl") || equali(szArgs[0], "/level") || equali(szArgs[0], "/exp") || equali(szArgs[0], "/xp"))
    {
        if ( 
szArgs][ ] )
        {
            if ( !( 
iTarget cmd_targetid szArgs] , CMDTARGET_ALLOW_SELF ) ) )
            {
                
client_print_colorid id "%s ^3%s^1 was not found!"PREFIX szArgs] );
                return 
PLUGIN_HANDLED;
            }
        }
        
        new 
iTarget;
        
iTarget cmd_target(idszArgs[1], CMDTARGET_ALLOW_SELF);
            
        if(!
iTarget)
            
client_print_color(idid"%s Level: ^4%d ^1| XP: ^4%d^3/^4%d %s"
                
PREFIX
                
g_iUserLevel[id], g_iUserExp[id], g_iUserLevel[id] == MAX_LEVEL g_iExp[g_iUserLevel[id]],
                
g_iUserLevel[id] == MAX_LEVEL "(max level)" ""
            
);
        else {
            new 
szName[MAX_NAME_LENGTH];
            
get_user_name(iTargetszNamecharsmax(szName));
            
client_print_color(idid"%s ^3^"%s^3^" ^1level status:"PREFIXszName);
            
client_print_color(idid"%s Level: ^4%d ^1| XP: ^4%d^1/^4%d %s"
                
PREFIX
                
g_iUserLevel[iTarget], g_iUserExp[iTarget], g_iUserLevel[iTarget] == MAX_LEVEL g_iExp[g_iUserLevel[iTarget]],
                
g_iUserLevel[iTarget] == MAX_LEVEL "(max level)" ""
            
);
        }
        return 
PLUGIN_HANDLED;
    } 
I tried to do a backup and it still happens to me .. for some reason I write /lvl
That should show it to me
Code:
client_print_color(id, id, "%s Level: ^4%d ^1 | XP: ^4%d ^3/^4%d%s",
And not the second option

Last edited by Fuck For Fun; 03-02-2020 at 14:11.
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 03-02-2020 , 13:36   Re: Error printing something in chat
Reply With Quote #2

How is szArgs defined?
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 03-02-2020 , 14:10   Re: Error printing something in chat
Reply With Quote #3

Quote:
Originally Posted by OciXCrom View Post
How is szArgs defined?
PHP Code:
    new szMsg[256], szArgs[3][128], iTargetszNameMAX_NAME_LENGTH ];
    
read_args(szMsgcharsmax(szMsg));
    
remove_quotes(szMsg);
    
parse(szMsgszArgs[0], charsmax(szArgs[]), szArgs[1], charsmax(szArgs[]), szArgs[2], charsmax(szArgs[])); 
EDIT: Now it is fixed alone (but once there are players in server /lvl working properly)

Last edited by Fuck For Fun; 03-02-2020 at 15:01.
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
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:10.


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