Raised This Month: $ Target: $400
 0% 

For statement


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
JProReTaRD
Member
Join Date: May 2009
Location: Denmark, KBH
Old 05-09-2009 , 17:14   For statement
Reply With Quote #1

Hi, I am building building an xp mod with some classes, but I can't seem to get it working.

It should be loading xp and lvl from each class, and it's this sentence that is wrong:
PHP Code:
format(vaultkey,63,"Jumper-%s-%i-xp",authid,CLASSES[sum]); 
and it's the %i and the CLASSES[sum].

I really hope someone can help me

When I compile it doesn't point out any errors, but when I run it on debug it says:

Code:
L 05/09/2009 - 20:53:35: [AMXX] Displaying debug trace (plugin "xp-mod.amxx")
L 05/09/2009 - 20:53:35: [AMXX] Run time error 4: index out of bounds 
L 05/09/2009 - 20:53:35: [AMXX]    [0] xp-mod.sma::LoadXP (line 103)
L 05/09/2009 - 20:53:35: [AMXX]    [1] xp-mod.sma::client_connect (line 120)
L 05/09/2009 - 20:53:35: [admin.amxx] Login: "[JPro] ReTaRD [ToY]<14><>" became an admin (account "STEAM_0:0:22688377") (access "abcdefghijklmnopqrstu") (address "217.60.224.194")
L 05/09/2009 - 20:53:43: [AMXX] Displaying debug trace (plugin "xp-mod.amxx")
L 05/09/2009 - 20:53:43: [AMXX] Run time error 4: index out of bounds 
L 05/09/2009 - 20:53:43: [AMXX]    [0] xp-mod.sma::LoadXP (line 103)
L 05/09/2009 - 20:53:43: [AMXX]    [1] xp-mod.sma::ChooseJumper (line 147)
PHP Code:
#define MAXCLASSES 5

new const CLASSES[MAXCLASSES][] = {
     
"None",
     
"Jumper",
     
"BHopper",
     
"CHopper",
     
"Noob" 

PHP Code:
public LoadXP(id)
{
    new 
authid[32]; 
    
get_user_authid(id,authid,31);

    new 
vaultkey[64], vaultdata[64]; 
    
    new 
i
    
new sum;
 
    for (
i=1i<=MAXCLASSESi++)
    {
               
//Load their XP
               
format(vaultkey,63,"Jumper-%s-%i-xp",authid,CLASSES[sum]); 
               
get_vaultdata(vaultkey,vaultdata,63); 
               
PlayerXP[id] = str_to_num(vaultdata);   

               
//Load their level
               
format(vaultkey,63,"Jumper-%s-%i-level",authid,CLASSES[sum]); 
               
get_vaultdata(vaultkey,vaultdata,63);
               
PlayerLevel[id] = str_to_num(vaultdata);
               
sum += i;
    }

Regards
[JPro] ReTaRD [ToY]

Last edited by JProReTaRD; 05-09-2009 at 17:18.
JProReTaRD is offline
 



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 01:33.


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