SA-MP Forums Archive
Is there a limit for arrays? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Is there a limit for arrays? (/showthread.php?tid=665428)



Is there a limit for arrays? - AnthonyGates - 03.04.2019

Hello! I'd like to make my server multilanguage.

I decided to make few mysql tables for the language (Table name: xy_lang Fields: key, value), and load their data to an array in SA-MP.

Code:
enum langInfo{
	KICK_MSG[],
	BAN_MSG[],
	JOIN_MSG[],
	etc...
}; 
new Language[MAX_LANGUAGE][langInfo];
and use it like SendClientMessage(playerid, -1, Language[LANGUAGE_INDEX][KICK_MSG]);

My question is that the enumeration have a maximum limit or i can pass all the in-game texts in it? ex 3-4000 elements.

Is it possible? Is there any easy way to make this?

We have a complete list of one language right now in pawn code like:

Code:
new 
	SQL_CONNECTION_STARTED[] = "SQL Connection was successful!",	

	PLAYER_JOINED_SERVER[] = "%s has joined the server.",
	PLAYER_LEFT_SERVER[] = "%s has left the server.",
	PLAYER_KICKED_SERVER_MSG[] = "%s has been kicked from the server by %s.",
This can be reusable in any other languages? How to?

Thanks!


Re: Is there a limit for arrays? - SymonClash - 03.04.2019

Or just use y_lang and avoid complicate your life. Or this: https://sampforum.blast.hk/showthread.php?tid=468821


Re: Is there a limit for arrays? - AnthonyGates - 04.04.2019

I cant use these bc i need more features.


Re: Is there a limit for arrays? - AnthonyGates - 07.04.2019

Okay, its true.

But, could I use your y_lang include for dialogs, textdraws, etc?

I want to make my server fully multilingual.


Re: Is there a limit for arrays? - AnthonyGates - 07.04.2019

Thank you.