AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Simple arrays problem (https://forums.alliedmods.net/showthread.php?t=121677)

Lure.d 03-18-2010 15:14

Simple arrays problem
 
Fixed prob.

Emp` 03-18-2010 15:31

Re: Multi dimensional arrays problems.
 
Quote:

Originally Posted by Lure.d (Post 1121626)
Error: Multi-dimensional arrays must be fully initialized on line 149

Your array is not being fully initialized. You have an array with 100 elements but you only start it with 66 elements.

Lure.d 03-18-2010 15:38

Re: Multi dimensional arrays problems.
 
I'll try, keep this post open though, reporting back in 5 minutes.

Lure.d 03-18-2010 15:49

Re: Multi dimensional arrays problems.
 
still got no idea, im confused - totally...
How can i make the "title" go up by 1 when player levels up?:

PHP Code:

    if(g_xp[killer] >= LEVELS[g_level[killer]]) {
        ++
g_level[killer];
        
//title lvl code
        
         
        
client_print(killerprint_chat"[COD] Congratulations. You have advanced to a new level. Current level: %i, rank: lawl"g_level[killer])
    } 

I really need your help :/

Edit: Tried this, but didn't work:
PHP Code:

g_title[killer] = TITLES[g_level[killer]]; 

Knowing that the title will be set to the row number of levels, and since level row number increased it would move the title up by 1 unit.
Still seems not to work :o

xPaw 03-18-2010 15:59

Re: Multi dimensional arrays problems.
 
new const TITLES[ ][ ]

Lure.d 03-18-2010 16:03

Re: Simple arrays problem
 
Did your way, but got this:

Quote:

Originally Posted by error
Error: Array sizes do not match, or destination array is too small on line 205

And the size of g_title:
PHP Code:

g_title[33][255

Size of TITLES is [][] so idk maybe thats the problem?

Seta00 03-18-2010 16:45

Re: Simple arrays problem
 
Why you copy the whole value of the title, if you can just store it's index in the TITLES array?

Use your g_level array to index the titles:
PHP Code:

// how to show title:
client_print(idprint_chat"Your new level: %s"TITLES[g_level[id]]); 


fysiks 03-18-2010 17:46

Re: Simple arrays problem
 
As Seta said, there is no reason to save the actual Title string since it is static and is index by a value that is already saved.

Lure.d 03-19-2010 07:03

Re: Simple arrays problem
 
damn, youre all right :\
How can i don't think of that o_0

Seta00 03-19-2010 07:46

Re: Simple arrays problem
 
Nice job deleting the post :roll:


All times are GMT -4. The time now is 08:42.

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