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

Simple arrays problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Lure.d
BANNED
Join Date: Dec 2009
Location: Lithuania->USA
Old 03-18-2010 , 15:14   Simple arrays problem
Reply With Quote #1

Fixed prob.

Last edited by Lure.d; 03-19-2010 at 07:06.
Lure.d is offline
Send a message via Skype™ to Lure.d
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 03-18-2010 , 15:31   Re: Multi dimensional arrays problems.
Reply With Quote #2

Quote:
Originally Posted by Lure.d View Post
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.
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
Old 03-18-2010, 15:33
Arkshine
This message has been deleted by Arkshine. Reason: nvm
Lure.d
BANNED
Join Date: Dec 2009
Location: Lithuania->USA
Old 03-18-2010 , 15:38   Re: Multi dimensional arrays problems.
Reply With Quote #3

I'll try, keep this post open though, reporting back in 5 minutes.
Lure.d is offline
Send a message via Skype™ to Lure.d
Lure.d
BANNED
Join Date: Dec 2009
Location: Lithuania->USA
Old 03-18-2010 , 15:49   Re: Multi dimensional arrays problems.
Reply With Quote #4

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

Last edited by Lure.d; 03-18-2010 at 15:55.
Lure.d is offline
Send a message via Skype™ to Lure.d
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 03-18-2010 , 15:59   Re: Multi dimensional arrays problems.
Reply With Quote #5

new const TITLES[ ][ ]
__________________
xPaw is offline
Lure.d
BANNED
Join Date: Dec 2009
Location: Lithuania->USA
Old 03-18-2010 , 16:03   Re: Simple arrays problem
Reply With Quote #6

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?
Lure.d is offline
Send a message via Skype™ to Lure.d
Seta00
The Seta00 user has crashed.
Join Date: Jan 2010
Location: Berlin
Old 03-18-2010 , 16:45   Re: Simple arrays problem
Reply With Quote #7

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]]); 
Seta00 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 03-18-2010 , 17:46   Re: Simple arrays problem
Reply With Quote #8

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.
__________________
fysiks is offline
Lure.d
BANNED
Join Date: Dec 2009
Location: Lithuania->USA
Old 03-19-2010 , 07:03   Re: Simple arrays problem
Reply With Quote #9

damn, youre all right :\
How can i don't think of that o_0
Lure.d is offline
Send a message via Skype™ to Lure.d
Seta00
The Seta00 user has crashed.
Join Date: Jan 2010
Location: Berlin
Old 03-19-2010 , 07:46   Re: Simple arrays problem
Reply With Quote #10

Nice job deleting the post
Seta00 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 00:45.


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