Raised This Month: $ Target: $400
 0% 

Please delete this post


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SubStream
Veteran Member
Join Date: Aug 2005
Location: USA
Old 03-15-2006 , 19:56   Please delete this post
Reply With Quote #1

--Edited--
SubStream is offline
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 03-15-2006 , 20:00  
Reply With Quote #2

Thats true. They are two dimensional arrays. Strings in Pawn ARE arrays and can be treated as such.
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
SubStream
Veteran Member
Join Date: Aug 2005
Location: USA
Old 03-15-2006 , 20:08  
Reply With Quote #3

--Edited--
SubStream is offline
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 03-15-2006 , 20:11  
Reply With Quote #4

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.
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
SubStream
Veteran Member
Join Date: Aug 2005
Location: USA
Old 03-15-2006 , 20:25  
Reply With Quote #5

--Edited--
SubStream is offline
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 03-15-2006 , 20:26  
Reply With Quote #6

that is exactly how it is except for it has pName[0][7] = '^0' //string terminator.
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
SubStream
Veteran Member
Join Date: Aug 2005
Location: USA
Old 03-15-2006 , 20:29  
Reply With Quote #7

--Edited--
SubStream is offline
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 03-15-2006 , 20:39  
Reply With Quote #8

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
^" == \"
^' == \'
^^ == \\
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
SubStream
Veteran Member
Join Date: Aug 2005
Location: USA
Old 03-15-2006 , 20:51  
Reply With Quote #9

--Edited--
SubStream is offline
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 03-15-2006 , 22:39  
Reply With Quote #10

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
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
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 16:38.


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