AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Please delete this post (https://forums.alliedmods.net/showthread.php?t=25537)

SubStream 03-15-2006 19:56

Please delete this post
 
--Edited--

Xanimos 03-15-2006 20:00

Thats true. They are two dimensional arrays. Strings in Pawn ARE arrays and can be treated as such.

SubStream 03-15-2006 20:08

--Edited--

Xanimos 03-15-2006 20:11

if you do not index an array and you try and call it. (new myArr[3][2]) and you try and call myArr[4] it will give you an error.

SubStream 03-15-2006 20:25

--Edited--

Xanimos 03-15-2006 20:26

that is exactly how it is except for it has pName[0][7] = '^0' //string terminator.

SubStream 03-15-2006 20:29

--Edited--

Xanimos 03-15-2006 20:39

No because it wouldnt work. You need to have the other deminsion.

And the ^ (carot) is the escape character in Pawn, much like the \ character for other languages. examples:
^n == \n
^0 == \0 == NULL
^" == \"
^' == \'
^^ == \\

SubStream 03-15-2006 20:51

--Edited--

Xanimos 03-15-2006 22:39

well, it does just use that. The reason for pName[33][32] is it uses one name for each player.

so if there were three people in the server with ids 1 , 2 , and 3 with names Jeff , Bob , and Jack it would be set up as follows

pName[1][0] = 'J'
pName[1][1] = 'e'
pName[1][2] = 'f'
pName[1][3] = 'f'
pName[1][4] = '^0'


pName[2][0] = 'B'
pName[2][1] = 'o'
pName[2][2] = 'b'
pName[2][3] = '^0'


pName[3][0] = 'J'
pName[3][1] = 'a'
pName[3][2] = 'c'
pName[3][3] = 'k'
pName[3][4] = '^0'


If you were just storing one name it would be pName[32] and would store as you are asking

pName[0] = 'J'
pName[1] = 'e'
pName[2] = 'f'
pName[3] = 'f'
pName[4] = '^0'


Oh and cmd_target() returns a players id (a number) by using a name or authid or #userid


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

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