AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Quick and nooby question (https://forums.alliedmods.net/showthread.php?t=281495)

Syturi0 04-13-2016 00:18

Quick and nooby question
 
A quick and nooby question:

Wich should be first, size or id?

PHP Code:

new g_IdMessage[129][33

PHP Code:

g_IdMessage[0][id

-----------------------------------
PHP Code:

new g_IdMessage[33][129

PHP Code:

g_IdMessage[id][0


siriusmd99 04-13-2016 00:47

Re: Quick and nooby question
 
id

Syturi0 04-13-2016 00:58

Re: Quick and nooby question
 
Quote:

Originally Posted by siriusmd99 (Post 2410596)
id

On new its size first and id second.
On outher stuff like:
PHP Code:

if(g_IdMessage... 

its actualy id first and size second... so strange

OciXCrom 04-13-2016 06:59

Re: Quick and nooby question
 
No, it's not.

new g_szMessage[33][128] - id is first, size is second
if(equal(g_szMessage[id], "bla bla")) - you only use id here
if(g_szMessage[id][0]) - id is first, the character is second

I don't see where they are used the other way around.

siriusmd99 04-13-2016 07:36

Re: Quick and nooby question
 
new array[33][64] means that all 32 players (33 - 1, because there shall be 1 cell free, the 33th cell) have a string with maximum length 63 characters(64-1)

for example array[1] = "hello"
array[2] = "watsup" and so on

you can't place string first and second players.

If you put array[64][33] then you will have 1 string and every value of the every cell of it will have 32 cells. I can't explain next ...

Syturi0 04-13-2016 13:36

Re: Quick and nooby question
 
I just tested this like 4 times already.

On new its size first and id second.
On outher stuff like:
PHP Code:

if(g_IdMessage... 

its actualy id first and size second.

siriusmd99 04-13-2016 14:00

Re: Quick and nooby question
 
new g_IdMessage[33][129]

32 players have one string with length 128.

klippy 04-13-2016 14:07

Re: Quick and nooby question
 
Show us your code, you are certainly doing something wrong. "On other stuff like..." isn't enough.

Syturi0 04-13-2016 14:13

Re: Quick and nooby question
 
Quote:

Originally Posted by KliPPy (Post 2410760)
Show us your code, you are certainly doing something wrong. "On other stuff like..." isn't enough.

Spoiler


Something like this ^

If i use "new g_Chat_FinalMessage" with id first and size second then the message will only have 32 characters...

Syturi0 04-13-2016 18:18

Re: Quick and nooby question
 
Quote:

Originally Posted by Depresie (Post 2410827)
I don't want to be rude, and i dont know about size and buffers.. i might not be right, but this looks wrong
PHP Code:

new szTexto[250


How come?


All times are GMT -4. The time now is 18:38.

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