Raised This Month: $ Target: $400
 0% 

Array Not Indexed


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
gabuch2
AlliedModders Donor
Join Date: Mar 2011
Location: Chile
Old 04-13-2016 , 13:51   Array Not Indexed
Reply With Quote #1

PHP Code:
new szName[32], origin[3]
get_user_name(idszNamecharsmax(szName))
get_user_origin(idorigin0)

[...]

DispatchKeyValue(monster[id], "origin"origin[0]+" "+origin[1]+" "+origin[2])
[...]
DispatchKeyValue(monster[id], "displayname"szName+"'s Bodyguard"
Code:
(43) error 033: array must be indexed (variable "-unknown-")
(47) error 033: array must be indexed (variable "szName")
43 and 47 are the both DispatchKeyValue lines.

Am I missing something here?
__________________

Last edited by gabuch2; 04-13-2016 at 13:52.
gabuch2 is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 04-13-2016 , 14:05   Re: Array Not Indexed
Reply With Quote #2

You can't just add(concatenate) strings like that, Pawn isn't JavaScript or such. Use formatex() to format your strings.
klippy is offline
gabuch2
AlliedModders Donor
Join Date: Mar 2011
Location: Chile
Old 04-13-2016 , 14:12   Re: Array Not Indexed
Reply With Quote #3

Didn't know that! (Also I'm used to C# )

Thank you, it compiles correctly now!
__________________

Last edited by gabuch2; 04-13-2016 at 14:14.
gabuch2 is offline
Reply


Thread Tools
Display Modes

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 18:37.


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