SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 27/03/2020, 08:54 AM   #1
Neeyl
Little Clucker
 
Join Date: Feb 2020
Posts: 25
Reputation: 0
Default help with invalid subscript

error 028: invalid subscript (not an array or too many subscripts): "HouseInfo"

Code:
HouseInfo[myhouseid][Houseid] = myhouseid; HouseInfo[myhouseid][Owned] = 0; strmid(HouseInfo[myhouseid][Owner], "NULL", 0, strlen("NULL"), 255);
Neeyl is online now   Reply With Quote
Old 27/03/2020, 09:13 AM   #2
ShadowMortar
Big Clucker
 
ShadowMortar's Avatar
 
Join Date: Jul 2016
Location: Croatia
Posts: 167
Reputation: 31
Default Re: help with invalid subscript

HouseInfo is the name of enumator, that's why you are getting an error, ex below:

Code:
#define MAX_HOUSES		( 1000 )
enum HouseInfo {
	Houseid,
	Owned,
	Owner[ MAX_PLAYER_NAME+1 ]
};
new hInfo[ MAX_HOUSES ] [ HouseInfo ];

HouseInfo[ myhouseid ] [ Houseid ] = myhouseid; // < returns error, because HouseInfo is the name of enumator
hInfo[ myhouseid ] [ Houseid ] = myhouseid; // < this would work because hInfo is the array that defines HouseInfo
I'm bad at explaining, however I hope you can understand what I mean..
__________________
Quote:
Originally Posted by CheezIt View Post
Follow your heart and own style.
Feel free to PM me if you need help.
ShadowMortar is offline   Reply With Quote
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Invalid Subscript Sh4d0w2 Scripting Help 3 16/10/2015 12:58 PM
invalid subscript GrandParadise Scripting Help 1 07/07/2014 08:49 AM
invalid subscript Vizi Scripting Help 10 24/08/2012 08:20 AM
Invalid subscript Makaveli93 Scripting Help 2 27/06/2012 07:03 PM
invalid subscript willsuckformoney Help Archive 7 03/07/2011 09:24 AM


All times are GMT. The time now is 08:11 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.