some questions
Hello all,
As i said in another theme i'm learning scripting, and i need help from you. So my questions are: 1.) what does the number in new variables means ? For example: new guns[33], new grenades[33], new maxplayers[33] and etc.. 2.) What does cid means ? Thats all for now, if i have more questions i will post them in to this theme. Thank you for answers! |
Re: some questions
1- the size of the cells, in that variables the size is 33 because it have to contain all the player`s index, start from 1 until 32 and you have to left a cell i dont know why
|
Re: some questions
|
Re: some questions
Quote:
|
Re: some questions
Quote:
|
Re: some questions
Quote:
The size of a cell is 4-bytes which cannot be changed, it would be better to say 33 is the size of the array. I know what you meant to say but its best to try and not confuse people. "and you have to left a cell i dont know why" See below, though you are correct, a cell is wasted which is index 0 since 0 is not a valid player index, only 1-32 is. @KillLikoe & Tomusaki The most common reason for seeing arrays sized at 33 (or MAXPLAYERS+1) is for storing data for each individual player using the player-index as the array index. When you need to index an array you start at 0 and go up to size-1, so if an array is sized at var[33] you can do var[0] up to var[32] to access each item; index 0 counts as an item in the array so index 32 is the 33rd cell. Player indexes in HL\CS range from 1 to 32 so you need an array sized at 33 (or larger) to make it possible to store/retrieve player info like var[ player-id ]. |
| All times are GMT -4. The time now is 14:25. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.