Raised This Month: $ Target: $400
 0% 

Array must be indexed ?!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Sn!ff3r
Veteran Member
Join Date: Aug 2007
Location: Poland
Old 06-28-2009 , 14:59   Array must be indexed ?!
Reply With Quote #1

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 ?
__________________
Join US - custom Zombie Server - Custom Addons:



Sn!ff3r is offline
Send a message via Skype™ to Sn!ff3r
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 06-28-2009 , 15:00   Re: Array must be indexed ?!
Reply With Quote #2

remove [] its not string
__________________
xPaw is offline
Sn!ff3r
Veteran Member
Join Date: Aug 2007
Location: Poland
Old 06-28-2009 , 15:04   Re: Array must be indexed ?!
Reply With Quote #3

Oh, ugly bad... :/

Thanks.
__________________
Join US - custom Zombie Server - Custom Addons:



Sn!ff3r is offline
Send a message via Skype™ to Sn!ff3r
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 06-28-2009 , 17:50   Re: Array must be indexed ?!
Reply With Quote #4

As side note, you don't need to harcode the array size. Juste leave without value and use sizeof values.
__________________
Arkshine 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:31.


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