AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Aray must be indexed (https://forums.alliedmods.net/showthread.php?t=190015)

Artifact 07-13-2012 17:22

Aray must be indexed
 
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?

Exolent[jNr] 07-13-2012 17:39

Re: Aray must be indexed
 
"health" variable is a string, so you cannot use it for addition. You have to use str_to_num().

Artifact 07-13-2012 18:22

Re: Aray must be indexed
 
Tnx, fixed


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

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