SAMPHP enum
#1

Hello, i'm coding gamemode with SAMPHP (https://sampforum.blast.hk/showthread.php?tid=442302), but i don't know how to create enum:

Код:
#define max_vehicles 9999
enum vInfo
{
	model,
	Float:x,
	Float:y,
	Float:z,
 	Float:a,
 	color_1,
 	color_2,
 	owner
};
new VehicleInfo[max_vehicles][vInfo];
Reply
#2

Just create a PHP class and assign values to its properties? If you want to use PHP, make sure to know the language you're using!
Reply
#3

I'm developing sites and i know php, but I thought maybe there any other way on samphp. Thanks for help
Reply
#4

There is no (native) enum in PHP, you can use either class with constants or some associative array
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)