Raised This Month: $ Target: $400
 0% 

Some things I wonder about.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Moody92
Veteran Member
Join Date: May 2011
Location: Oman
Old 08-23-2012 , 16:09   Re: Some things I wonder about.
Reply With Quote #7

Quote:
Originally Posted by pokemonmaster View Post
PHP Code:
new iArray[32]
// and id = 32
iArray[id] = 5
server_print
("%d"iArray[id])// And this function won't work
// WRONG ^^

// THE RIGHT ONE
new iArray[33]
iArray[id] = 5
server_print
("%d"iArray[id]) 
PHP Code:
new players[32], count
get_players
(playerscount)

/* 
if count == 5
Then players will look like this
players[0] = 1
players[1] = 2
players[2] = 3
players[3] = 4
players[4] = 5
*/ 
I got it now so to make it simple we just need to declare the array to 33 but the server will consider it as 32, and if we make it less than 33 there will be an issue.

HTML Code:
(Index out of bounds)
Correct me if I am wrong.


Last edited by Moody92; 08-23-2012 at 16:12.
Moody92 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 05:42.


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