Raised This Month: $ Target: $400
 0% 

array must be indexed


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 03-16-2009 , 09:16   array must be indexed
Reply With Quote #1

PHP Code:
public fnUpdateTop_pro10idszClimbTime[] ) {
    new 
szVault[64], szMap[32];
    
get_mapnameszMap31 );
    
formatszVault63"kz_%s_pro10"szMap );
    
    new 
iVault nvault_openszVault );
    
    if( 
iVault != -) {
        new 
szKey[8];
        
        new 
szTime1[3], szTime2[3], szTime3[7];
        
parseszClimbTimeszTime12szTime22szTime3);
        
        for( new 
1<= 10i++ ) {
            new 
szReturn[128], iArg1[26], iArg2[19], szTimeArg1[3], szTimeArg2[3], szTimeArg3[7];
            
formatszKey8"%d");
            
nvault_getiVaultszKeyszReturn128 );
            
            if( 
parseszReturniArg125iArg219 ) == ) {
                
parseiArg2szTimeArg12szTimeArg22szTimeArg3);
                if( 
szTime1 <= szTimeArg1 && szTime2 <= szTimeArg2 && szTime3 szTimeArg3 ) {
                    new 
szNew[128], szName[26];
                    
get_user_name(idszName25 );
                    
                    
formatszNew128"^"%s^" ^"%s^""szNameszClimbTime );
                    
                    if( 
10 ) {
                        for( new 
10ix-- ) {
                            new 
szTemp[128], szTempKey[8];
                            
formatszTempKey8"%d"x-);
                            
nvault_getiVaultszTempKeyszTemp128 );
                            
                            if( !
equalszTemp"" ) ) {
                                
formatszTempKey8"%d");
                                
nvault_psetiVaultszTempKeyszTemp );
                            }
                        }
                    }
                    
                    
nvault_psetiVaultszKeyszNew );
                    
                    if( 
== )
                        
ColorChat(0RED"%s^x04 %s^x01 has established a new record."PREFIXszName);
                    
                    break;
                }
            }
        }
        
nvault_closeiVault );
    }

the error on line
PHP Code:
if( szTime1 <= szTimeArg1 && szTime2 <= szTimeArg2 && szTime3 szTimeArg3 ) { 
then func called like
PHP Code:
fnUpdateTop_pro10id"00:45:232347" ); 
how i can compare 2 lines like that, and also those top code a bit horrible, someone can optimize it ?
__________________

Last edited by xPaw; 03-16-2009 at 09:19.
xPaw is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 03-16-2009 , 09:19   Re: array must be indexed
Reply With Quote #2

szTime1 , szTime2, szTimeArg1, szTimeArg2 and szTimeArg3 are strings. And you want to compare directly a string like that ? ^^

Use str_to_float() before.
Arkshine is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 03-16-2009 , 09:20   Re: array must be indexed
Reply With Quote #3

do you have other idea how to compare
PHP Code:
if ( .... || szClimbTime iArg2 ) { 
__________________
xPaw is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 03-16-2009 , 09:21   Re: array must be indexed
Reply With Quote #4

Like I've said ; Use str_to_float() before.
Arkshine is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 03-16-2009 , 09:25   Re: array must be indexed
Reply With Quote #5

its compiled fine, now i need to test it in game
__________________
xPaw is offline
jim_yang
Veteran Member
Join Date: Aug 2006
Old 03-16-2009 , 09:38   Re: array must be indexed
Reply With Quote #6

strcmp
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>
jim_yang is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 03-16-2009 , 09:40   Re: array must be indexed
Reply With Quote #7

It will compare if string are the same or not, not if x value is < or > to y value.
Arkshine is offline
Old 03-16-2009, 10:01
xPaw
This message has been deleted by xPaw. Reason: nvm
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 08:49.


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