Raised This Month: $ Target: $400
 0% 

Aray must be indexed


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Artifact
Veteran Member
Join Date: Jul 2010
Old 07-13-2012 , 17:22   Aray must be indexed
Reply With Quote #1

PHP Code:
    new health[10]
    
read_argv(2healthcharsmax(health))
    
set_user_health(idget_user_health(id) + health
Code:
Error: Array must be indexed (variable "health") on line 39
How can I do this?
__________________
Artifact is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 07-13-2012 , 17:39   Re: Aray must be indexed
Reply With Quote #2

"health" variable is a string, so you cannot use it for addition. You have to use str_to_num().
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Artifact
Veteran Member
Join Date: Jul 2010
Old 07-13-2012 , 18:22   Re: Aray must be indexed
Reply With Quote #3

Tnx, fixed
__________________
Artifact is offline
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 15:16.


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