AlliedModders

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

Sn!ff3r 06-28-2009 14:59

Array must be indexed ?!
 
PHP Code:

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Nowy Plugin"
#define VERSION "1.0"
#define AUTHOR "Sn!ff3r"

#define SIZE 5
new Float:values[SIZE][] = { 0.010.020.030.040.05 }

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
// Add your code here...
}

public 
test()
{
    new 
Float:dummy values[random_num(0SIZE 1)]    


Code:

Welcome to the AMX Mod X 1.76-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

Error: Array must be indexed (variable "-unknown-") on line 21

1 Error.
Could not locate output file C:\Documents and Settings\pc\Moje dokumenty\Moja muzyka\Untitled.amx (compile failed).

Why ?

xPaw 06-28-2009 15:00

Re: Array must be indexed ?!
 
remove [] its not string

Sn!ff3r 06-28-2009 15:04

Re: Array must be indexed ?!
 
Oh, ugly bad... :/

Thanks.

Arkshine 06-28-2009 17:50

Re: Array must be indexed ?!
 
As side note, you don't need to harcode the array size. Juste leave without value and use sizeof values.


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

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