Raised This Month: $ Target: $400
 0% 

[Help]Why does ppl use this and when?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-12-2011 , 15:04   Re: [Help]Why does ppl use this and when?
Reply With Quote #1

It is just a multi-dimensional array. There are many uses for them. Commonly in Pawn they are used for arrays of strings (since a string is just an array of characters).

Code:
new strings[][] = {
    "hello",
    "good bye",
    "good day"
}
__________________
fysiks is online now
2reason2kill
Senior Member
Join Date: Feb 2011
Old 06-12-2011 , 15:18   Re: [Help]Why does ppl use this and when?
Reply With Quote #2

Quote:
Originally Posted by fysiks View Post
It is just a multi-dimensional array. There are many uses for them. Commonly in Pawn they are used for arrays of strings (since a string is just an array of characters).

Code:
new strings[][] = {
    "hello",
    "good bye",
    "good day"
}
i saw somting like


PHP Code:
new g_team[33
why is it number 33?


is it same?
2reason2kill is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-12-2011 , 15:22   Re: [Help]Why does ppl use this and when?
Reply With Quote #3

Quote:
Originally Posted by 2reason2kill View Post
i saw somting like


PHP Code:
new g_team[33
why is it number 33?


is it same?
That is a single dimension array containing 33 cells. 33 is used most often when it will be index by player entity index and there are at most 32 players in a server at any given time.

So, in a function they can retrieve a number stored for that person:

PHP Code:
public saycommand(id)
{
    
client_print(idprint_chat"Your team is %d"g_team[id])

If you look at other plugins you will see that it is used often and you will see for what they use it for.
__________________
fysiks is online now
2reason2kill
Senior Member
Join Date: Feb 2011
Old 06-12-2011 , 15:27   Re: [Help]Why does ppl use this and when?
Reply With Quote #4

Tnx all
2reason2kill is offline
Reply



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 23:29.


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