[FilterScript] Evo Vehicle Ownership™ | IX.1 Essentials Released
#41

Quote:
Originally Posted by Facerafter
Посмотреть сообщение
I already removed it and translated to english. (With help of a friend.)
Also when i tune a vehicle and park it after and than restart the server all the tunings are gone?
And it did save the rest so.
Thanks for bug reports. I will solve them with IX.3 Essentials and today i can release IX.3 Essentials MySQL Version.
Reply
#42

The system looks great and clean! I really like the way it all looks.
Reply
#43

Quote:
Originally Posted by Edix
Посмотреть сообщение
The system looks great and clean! I really like the way it all looks.
Thanks for comments


Evo Vehicle Ownership IX.3 Essentials released and some problems were solved by me:
-Some of the script was Turkish, I translated there.
-Problem that vehicle tunings were not saving solved.
-In Manual_Park mode, now the vehicles' that don't have owner pos will saved by system.

To download Click It!

I will release MySQL Version soon.
Reply
#44

Awesome... rep+
Reply
#45

for some reason when i make a showroom the pickup appears but if i restart server the pickup is gone why?]

figured it out its because :


search for
pawn Код:
Galeri
and replace with

pawn Код:
Showroom
Reply
#46

why isnt the money being taken from the player?
Reply
#47

@DonValley

You mean, if the player buys the car, the cash will be taken off and directly being stored back?

If yes, this is the solution.

Don't use GivePlayerMoney, use the PlayerInfo[playerid][pCash] or whatever you use in your account saving enum.
Reply
#48

Quote:
Originally Posted by Mariooo
Посмотреть сообщение
@DonValley

You mean, if the player buys the car, the cash will be taken off and directly being stored back?

If yes, this is the solution.

Don't use GivePlayerMoney, use the PlayerInfo[playerid][pCash] or whatever you use in your account saving enum.
pawn Код:
C:\Users\HP\Documents\Life Like Roleplay\Gamemode\VEH SYSTEM\LLRP-VEH.pwn(349) : error 017: undefined symbol "PlayerInfo"
C:\Users\HP\Documents\Life Like Roleplay\Gamemode\VEH SYSTEM\LLRP-VEH.pwn(349) : warning 215: expression has no effect
C:\Users\HP\Documents\Life Like Roleplay\Gamemode\VEH SYSTEM\LLRP-VEH.pwn(349) : error 001: expected token: ";", but found "]"
C:\Users\HP\Documents\Life Like Roleplay\Gamemode\VEH SYSTEM\LLRP-VEH.pwn(349) : error 029: invalid expression, assumed zero
C:\Users\HP\Documents\Life Like Roleplay\Gamemode\VEH SYSTEM\LLRP-VEH.pwn(349) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.



also another problem:

when you create a showroom it works fine then if you restart the server it reappears which is good. however if you create another showroom the id's go back to 0
Reply
#49

am having lots of trouble with the showroom system if someone could take a look please:

https://sampforum.blast.hk/showthread.php?tid=458921
Reply
#50

Very good! Nice + Rep!
Reply
#51

why when server restart the showroom ids go back to 0 ? cant figure it out
Reply
#52

Remove
Reply
#53

Great system very Good
Reply
#54

What is this?
E:\My server\filterscripts\EvoVehicleIX.3_Essentials.pwn (21) : fatal error 100: cannot read from file: "EvoVehicle"

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#55

Nice !
Reply
#56

How to get permision ROOT X( ?
Enter password and nothin.
Reply
#57

ILikeThis <3
Reply
#58

Hello,
I just downloaded Evo Vehicle Manage and i modified just 3 values:
#define AUTOMATIC_PARK false
#define MAX_EVO_VEHICLE 5000
#define MAX_PLAYER_EVO_VEHICLE 30

I receive a lot of errors (10). Please compile it for me.. thanks!

Код:
/*
================================================================================

                          Evo Vehicle Ownership
                                  IX.3
                               Essentials
                      By Exertion ( A.K.A "EvoturK" )

                            Copyright © 2011

================================================================================

						 	  EvoENGINE 3.0
                     Performanced Evo Script Engine

================================================================================
*/

// =============================[INCLUDES]=================================== //
#include <a_samp>               // SA:MP    Include By SA:MP Team
#include <EvoVehicle>           // I-Sync   Include By Exertion
#include <zcmd>                 // ZCMD     Include By ZeeX
#include <YSI\y_ini>            // Y_INI    Include By ******
#include <YSI\y_timers>         // Y_TIMERS Include By ******
#include <foreach>              // Foreach  Include By ******

// =============================[DEFINES]==================================== //
// Defining it as Filter Script
#define FILTERSCRIPT

// System Version Number
#define VERSION                                           "9.3"

// System Options
#define MAX_EVO_VEHICLE                                   200
#define MAX_PLAYER_EVO_VEHICLE                            10

#define MAX_SHOWROOM                                      20

#define AUTOMATIC_PARK                                    true

// System Dirs
#define EVOVEHICLE_MAIN_DIR                               "EVO"
#define EVOVEHICLE_VEHICLE_DIR                            "EVO/Vehicles"
#define EVOVEHICLE_SHOWROOM_DIR                           "EVO/Showrooms"

// System Dialogs
// - Normal Vehicle Buying
#define DIALOG_BUY_VEHICLE                                1600

// - EVO Admin Panel
#define DIALOG_EVO_PANELPASS                              1601
#define DIALOG_EVO_PANELHOME                              1602
#define DIALOG_EVO_PANELVEHID                             1603
#define DIALOG_EVO_PANELCPASS                             1604
#define DIALOG_EVO_PANELABOUT                             1605

// - Vehicle Management in Admin Panel
#define DIALOG_EVO_PANELVEH                               1606
#define DIALOG_EVO_PANELVEH_MODEL                         1607
#define DIALOG_EVO_PANELVEH_OWNER                         1608
#define DIALOG_EVO_PANELVEH_COL1                          1609
#define DIALOG_EVO_PANELVEH_COL2                          1610
#define DIALOG_EVO_PANELVEH_PRICE                         1611
#define DIALOG_EVO_PANELVEH_SEC                           1612
#define DIALOG_EVO_PANELVEH_LOCK                          1613
#define DIALOG_EVO_PANELVEH_PLATE                         1614
#define DIALOG_EVO_PANELVEH_PJ                            1615

// - Add Evo Vehicle in Admin Panel
#define DIALOG_EVO_PANELNEW_MODEL                         1616
#define DIALOG_EVO_PANELNEW_PRICE                         1617
#define DIALOG_EVO_PANELNEW_COL1                          1618
#define DIALOG_EVO_PANELNEW_COL2                          1619

// - Add Showroom in Admin Panel
#define DIALOG_EVO_PANELNSR_NAME                          1620

// - Showroom Management in Admin Panel
#define DIALOG_EVO_PANELSRID                              1621
#define DIALOG_EVO_PANELSR                                1622
#define DIALOG_EVO_PANELSR_NAME                           1623

// - Player Evo Vehicle Management
#define DIALOG_A_HOME                                     1624
#define DIALOG_A_VEHLIST                                  1625
#define DIALOG_A_PLATE                                    1626

// - Buying Vehicle from Showroom
#define DIALOG_SRVEH                                      1627
#define DIALOG_SRVEH_COLOR                                1628

// ============================[FORWARDS]==================================== //
// For System
forward LoadEVO(name[], value[]);
forward SaveEVO();

// For Evo Script Version Controller
forward EvoVehicle_Init(index, response_code, data[]);
forward EvoVehicle_InGame(index, response_code, data[]);

// For Vehicle
forward CreateEvoVehicle(Modelid, Owner[], Float:X, Float:Y, Float:Z, Float:Rot, Col1, Col2, Price);
forward DeleteEvoVehicle(vehicleid);
forward LoadEvoVehicles();
forward LoadEvoVehicle_evo(EvoVehicleID, name[], value[]);
forward SaveEvoVehicles(last);

// For Showroom
forward CreateShowroom(Name[], Float:X, Float:Y, Float:Z);
forward DeleteShowroom(showroomid);
forward LoadShowrooms();
forward LoadShowroom_evo(ShowroomID, name[], value[]);
forward SaveShowrooms(last);

// ===========================[VARIABLES]==================================== //
// For System
new EVOPanelPass[150];

new Unloading;

new LastEvoVehicleID,
	LastSaved,
	LastLoaded;

new LastShowroomID,
	LastSavedSR,
	LastLoadedSR;
	
// For Players
enum pInfos
{
pRoot
};

new pInfo[MAX_PLAYERS][pInfos];

new SelectedEV[MAX_PLAYERS];

new SelectedModel[MAX_PLAYERS];
new SelectedPrice[MAX_PLAYERS];
new SelectedCol1[MAX_PLAYERS];
new SelectedCol2[MAX_PLAYERS];

new SelectedSR[MAX_PLAYERS];
new SelectedName[MAX_PLAYERS][100];

// For Vehicles
new Iterator:EVs<MAX_EVO_VEHICLE>;

enum EvoVehicleInfos
{
	EVModel,
	EVOwner[40],
	Float:EVX,
	Float:EVY,
	Float:EVZ,
	Float:EVRot,
	EVCol1,
	EVCol2,
	EVPrice,
	EVSecurity,
	EVLock,
	EVPlate[30],
	EVPJ,
	EVVehID,
	EVExist,
	EVNeedSave
};

new EvoVehicles[MAX_EVO_VEHICLE][EvoVehicleInfos];

new EvoVehicleComponent[MAX_EVO_VEHICLE][14];

new VehEVID[MAX_VEHICLES];
new VehInSystem[MAX_VEHICLES];

// For Showrooms
new Iterator:SRs<MAX_SHOWROOM>;

enum ShowroomInfos
{
	SRName[100],
	Float:SRX,
	Float:SRY,
	Float:SRZ,
	SRExist,
	SRNeedSave,
	SRPick,
	Text3D:SR3D
};

new Showrooms[MAX_SHOWROOM][ShowroomInfos];

// Vehicle Colors
enum VehColorInfos
{
	VCName[40],
	VCColor
};

new VehColors[13][VehColorInfos]={
{"White", 1},
{"Gray", 157},
{"Black", 0},
{"Red", 3},
{"Green Yellow", 145},
{"Green", 154},
{"Yellow", 194},
{"Dodger Blue", 152},
{"Dark Blue", 223},
{"Light Blue", 166},
{"Turquoise", 163},
{"Orange", 158},
{"Purple", 211}
};

// Vehicle Names
new VehNames[][] =
{
    "Landstalker", "Bravura", "Buffalo", "Linerunner", "Perrenial", "Sentinel",
	"Dumper", "Firetruck", "Trashmaster", "Stretch", "Manana", "Infernus",
	"Voodoo", "Pony", "Mule", "Cheetah", "Ambulance", "Leviathan", "Moonbeam",
    "Esperanto", "Taxi", "Washington", "Bobcat", "Whoopee", "BFInjection",
	"Hunter", "Premier", "Enforcer", "Securicar", "Banshee", "Predator", "Bus",
	"Rhino", "Barracks", "Hotknife", "Trailer", "Previon", "Coach", "Cabbie",
	"Stallion", "Rumpo", "RC Bandit", "Romero", "Packer", "Monster", "Admiral",
	"Squalo", "Seasparrow", "Pizzaboy", "Tram", "Trailer", "Turismo", "Speeder",
	"Reefer", "Tropic", "Flatbed", "Yankee", "Caddy", "Solair", "BerkleysRCVan",
	"Skimmer", "PCJ-600", "Faggio", "Freeway", "RCBaron", "RCRaider", "Glendale",
	"Oceanic","Sanchez", "Sparrow", "Patriot", "Quad", "Coastguard", "Dinghy",
	"Hermes", "Sabre", "Rustler", "ZR-350", "Walton", "Regina", "Comet", "BMX",
	"Burrito", "Camper", "Marquis", "Baggage", "Dozer", "Maverick", "NewsChopper",
	"Rancher", "FBI Rancher", "Virgo", "Greenwood", "Jetmax", "Hotring", "Sandking",
	"BlistaCompact", "PoliceMaverick", "Boxvillde", "Benson", "Mesa", "RCGoblin",
	"HotringRacerA", "HotringRacerB", "BloodringBanger", "Rancher", "SuperGT",
	"Elegant", "Journey", "Bike", "MountainBike", "Beagle", "Cropduster", "Stunt",
 	"Tanker", "Roadtrain", "Nebula", "Majestic", "Buccaneer", "Shamal", "Hydra",
 	"FCR-900", "NRG-500", "HPV1000", "CementTruck", "TowTruck", "Fortune",
 	"Cadrona", "FBITruck", "Willard", "Forklift", "Tractor", "Combine", "Feltzer",
 	"Remington", "Slamvan", "Blade", "Freight", "Streak", "Vortex", "Vincent",
    "Bullet", "Clover", "Sadler", "Firetruck", "Hustler", "Intruder", "Primo",
	"Cargobob", "Tampa", "Sunrise", "Merit", "Utility", "Nevada", "Yosemite",
	"Windsor", "Monster", "Monster", "Uranus", "Jester", "Sultan", "Stratium",
	"Elegy", "Raindance", "RCTiger", "Flash", "Tahoma", "Savanna", "Bandito",
    "FreightFlat", "StreakCarriage", "Kart", "Mower", "Dune", "Sweeper",
	"Broadway", "Tornado", "AT-400", "DFT-30", "Huntley", "Stafford", "BF-400",
	"News Van", "Tug", "Trailer", "Emperor", "Wayfarer", "Euros", "Hotdog", "Club",
	"FreightBox", "Trailer", "Andromada", "Dodo", "RC Cam", "Launch", "LSPD",
 	"SFPD", "LVPD", "PoliceRanger", "Picador", "S.W.A.T", "Alpha",
 	"Phoenix", "Glendale", "Sadler", "Luggage", "Luggage", "Stairs", "Boxville",
 	"Tiller", "UtilityTrailer"
};

// Vehicle State Names
new LockInfos[2][30]={"Unlocked", "Locked"};
new SecurityInfos[3][40]={"None", "Killing", "Slapping"};

// Connection Errors
new ConnectionErrors[6][40]=
{
"Wrong Website",
"No Socket",
"Couldn't Connect",
"Couldn't Write",
"String Too Long",
"Wait Some Seconds"
};

// ================================[TIMERS]================================== //
task SaveEvoVehicleSystem[150000]()
{
	SaveEVO();
	SaveEvoVehicles(0);
	SaveShowrooms(0);
}

// ==============================[FUNCTIONS]================================= //
// Message Functions
// - Info
INFO(playerid, msg[])
{
	new msg2[512];
	format(msg2, 512, "{ADFF2F}« ! » {FFFFFF}%s", msg);
	return SendClientMessage(playerid, -1, msg2);
}

// - Error
ERROR(playerid, msg[])
{
	new msg2[512];
	format(msg2, 512, "{FF3030}« ! » {FFFFFF}%s", msg);
	return SendClientMessage(playerid, -1, msg2);
}

// - Usage
USAGE(playerid, msg[])
{
	new msg2[512];
	format(msg2, 512, "{FFFFFF}« USAGE » %s", msg);
	return SendClientMessage(playerid, -1, msg2);
}

// Essential Functions
// - GetName
GetName(playerid)
{
	new Name[40];
	GetPlayerName(playerid, Name, 40);
	return Name;
}

// - IsNumeric
IsNumeric(string[])
{
	for (new i = 0, j = strlen(string);
	i < j; i++)
	{
	if (string[i] > '9' || string[i] < '0')
	return 0;
	}
	return 1;
}

// - Strtok
strtok(const string[], &index)
{
	new length = strlen(string);
	while ((index < length) && (string[index] <= ' '))
	{
		index++;
	}

	new offset = index;
	new result[20];
	while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
	{
		result[index - offset] = string[index];
		index++;
	}
	result[index - offset] = EOS;
	return result;
}

// - Strrest
strrest(const string[], &index)
{
	new length = strlen(string);
	while ((index < length) && (string[index] <= ' '))
	{
		index++;
	}
	new offset = index;
	new result[128];
	while ((index < length) && ((index - offset) < (sizeof(result) - 1)))
	{
		result[index - offset] = string[index];
		index++;
	}
	result[index - offset] = EOS;
	return result;
}

// - SSCANF
stock sscanf(string[], format[], {Float,_}:...)
{
	#if defined isnull
		if (isnull(string))
	#else
		if (string[0] == 0 || (string[0] == 1 && string[1] == 0))
	#endif
		{
			return format[0];
		}
	#pragma tabsize 4
	new
		formatPos = 0,
		stringPos = 0,
		paramPos = 2,
		paramCount = numargs(),
		delim = ' ';
	while (string[stringPos] && string[stringPos] <= ' ')
	{
		stringPos++;
	}
	while (paramPos < paramCount && string[stringPos])
	{
		switch (format[formatPos++])
		{
			case '\0':
			{
				return 0;
			}
			case 'i', 'd':
			{
				new
					neg = 1,
					num = 0,
					ch = string[stringPos];
				if (ch == '-')
				{
					neg = -1;
					ch = string[++stringPos];
				}
				do
				{
					stringPos++;
					if ('0' <= ch <= '9')
					{
						num = (num * 10) + (ch - '0');
					}
					else
					{
						return -1;
					}
				}
				while ((ch = string[stringPos]) > ' ' && ch != delim);
				setarg(paramPos, 0, num * neg);
			}
			case 'h', 'x':
			{
				new
					num = 0,
					ch = string[stringPos];
				do
				{
					stringPos++;
					switch (ch)
					{
						case 'x', 'X':
						{
							num = 0;
							continue;
						}
						case '0' .. '9':
						{
							num = (num << 4) | (ch - '0');
						}
						case 'a' .. 'f':
						{
							num = (num << 4) | (ch - ('a' - 10));
						}
						case 'A' .. 'F':
						{
							num = (num << 4) | (ch - ('A' - 10));
						}
						default:
						{
							return -1;
						}
					}
				}
				while ((ch = string[stringPos]) > ' ' && ch != delim);
				setarg(paramPos, 0, num);
			}
			case 'c':
			{
				setarg(paramPos, 0, string[stringPos++]);
			}
			case 'f':
			{

				new changestr[16], changepos = 0, strpos = stringPos;
				while(changepos < 16 && string[strpos] && string[strpos] != delim)
				{
					changestr[changepos++] = string[strpos++];
    				}
				changestr[changepos] = '\0';
				setarg(paramPos,0,_:floatstr(changestr));
			}
			case 'p':
			{
				delim = format[formatPos++];
				continue;
			}
			case '\'':
			{
				new
					end = formatPos - 1,
					ch;
				while ((ch = format[++end]) && ch != '\'') {}
				if (!ch)
				{
					return -1;
				}
				format[end] = '\0';
				if ((ch = strfind(string, format[formatPos], false, stringPos)) == -1)
				{
					if (format[end + 1])
					{
						return -1;
					}
					return 0;
				}
				format[end] = '\'';
				stringPos = ch + (end - formatPos);
				formatPos = end + 1;
			}
			case 'u':
			{
				new
					end = stringPos - 1,
					id = 0,
					bool:num = true,
					ch;
				while ((ch = string[++end]) && ch != delim)
				{
					if (num)
					{
						if ('0' <= ch <= '9')
						{
							id = (id * 10) + (ch - '0');
						}
						else
						{
							num = false;
						}
					}
				}
				if (num && IsPlayerConnected(id))
				{
					setarg(paramPos, 0, id);
				}
				else
				{
					#if !defined foreach
						#define foreach(%1,%2) for (new %2 = 0; %2 < MAX_PLAYERS; %2++) if (IsPlayerConnected(%2))
						#define __SSCANF_FOREACH__
					#endif
					string[end] = '\0';
					num = false;
					new
						name[MAX_PLAYER_NAME];
					id = end - stringPos;
					foreach (Player, playerid)
					{
						GetPlayerName(playerid, name, sizeof (name));
						if (!strcmp(name, string[stringPos], true, id))
						{
							setarg(paramPos, 0, playerid);
							num = true;
							break;
						}
					}
					if (!num)
					{
						setarg(paramPos, 0, INVALID_PLAYER_ID);
					}
					string[end] = ch;
					#if defined __SSCANF_FOREACH__
						#undef foreach
						#undef __SSCANF_FOREACH__
					#endif
				}
				stringPos = end;
			}
			case 's', 'z':
			{
				new
					i = 0,
					ch;
				if (format[formatPos])
				{
					while ((ch = string[stringPos++]) && ch != delim)
					{
						setarg(paramPos, i++, ch);
					}
					if (!i)
					{
						return -1;
					}
				}
				else
				{
					while ((ch = string[stringPos++]))
					{
						setarg(paramPos, i++, ch);
					}
				}
				stringPos--;
				setarg(paramPos, i, '\0');
			}
			default:
			{
				continue;
			}
		}
		while (string[stringPos] && string[stringPos] != delim && string[stringPos] > ' ')
		{
			stringPos++;
		}
		while (string[stringPos] && (string[stringPos] == delim || string[stringPos] <= ' '))
		{
			stringPos++;
		}
		paramPos++;
	}
	do
	{
		if ((delim = format[formatPos++]) > ' ')
		{
			if (delim == '\'')
			{
				while ((delim = format[formatPos++]) && delim != '\'') {}
			}
			else if (delim != 'z')
			{
				return delim;
			}
		}
	}
	while (delim > ' ');
	return 0;
}

// Vehicle Functions
// - GetVehicleModelIDFromName
GetVehicleModelIDFromName(vehname[])
{
	new Result = -1;

	for(new BModel; BModel < 211; BModel++)
	{
	    if(!strfind(VehNames[BModel],vehname,true))
	    {
	        Result = BModel+400;
	        break;
		}
	}

	return Result;
}

// - GetEmptyEvoVehicleID
GetEmptyEvoVehicleID()
{
	return Iter_Free(EVs);
}

// - LockEvoVehicle
LockEvoVehicle(vehicleid, lockinfo)
{
	for(new i; i < GetMaxPlayers(); i++)
	{
	    if(!IsPlayerConnected(i)) continue;
	    SetVehicleParamsForPlayer(EvoVehicles[vehicleid][EVVehID], i, 0, lockinfo);
	}
}

// - SaveAllVehicleComponentsToFile
SaveAllVehicleComponentsToFile(INI:File, EVID)
{
	new ComponentKey[10];

	for(new i; i < 14; i++)
	{
		format(ComponentKey, 10, "COMPONENT%d", i+1);
		EvoVehicleComponent[EVID][i] = GetVehicleComponentInSlot(EvoVehicles[EVID][EVVehID], i);
	    INI_WriteInt(File, ComponentKey, EvoVehicleComponent[EVID][i]);
	}
}

// - LoadAllVehicleComponents
LoadAllVehicleComponents(EVID, name[], value[])
{
	new ComponentKey[10];

 	for(new i; i < 14; i++)
 	{
        format(ComponentKey, 10, "COMPONENT%d", i+1);
        INI_Int(ComponentKey, EvoVehicleComponent[ EVID ][i]);
	}
	return 1;
}

// - LoadVehicleMod
LoadVehicleMod(EVID)
{
	if(EvoVehicles[ EVID ][EVPJ] != -1)
	{
		ChangeVehiclePaintjob(EvoVehicles[ EVID ][EVVehID], EvoVehicles[ EVID ][EVPJ]);
	}

	for(new i; i < 14; i++)
	{
	    AddVehicleComponent(EvoVehicles[ EVID ][EVVehID], EvoVehicleComponent[ EVID ][i]);
	}
}

// - GetVehicleMod
GetVehicleMod(EVID)
{
	for(new i; i < 14; i++)
	{
	    EvoVehicleComponent[ EVID ][i] = GetVehicleComponentInSlot(EvoVehicles[ EVID ][EVVehID], i);
	}
}


// For Showrooms
// -GetEmptyShowroomID
GetEmptyShowroomID()
{
	return Iter_Free(SRs);
}

// For Admins
// - ShowAdminEVPanel
ShowAdminEvPanel(playerid, vehicleid)
{
	new DiaString[1024], String[128];

	format(DiaString, 1024, "{FFFFFF}Model \t{ADFF2F}%s\n", VehNames[ EvoVehicles[vehicleid][EVModel]-400 ]);
	format(DiaString, 1024, "%s{FFFFFF}Owner \t{ADFF2F}%s\n", DiaString, EvoVehicles[vehicleid][EVOwner]);
	format(DiaString, 1024, "%s{FFFFFF}Color1 \t{ADFF2F}%d\n", DiaString, EvoVehicles[vehicleid][EVCol1]);
	format(DiaString, 1024, "%s{FFFFFF}Color2 \t{ADFF2F}%d\n", DiaString, EvoVehicles[vehicleid][EVCol2]);
	format(DiaString, 1024, "%s{FFFFFF}Price \t{ADFF2F}%d$\n", DiaString, EvoVehicles[vehicleid][EVPrice]);
	format(DiaString, 1024, "%s{FFFFFF}Security \t{ADFF2F}%s\n", DiaString, SecurityInfos[ EvoVehicles[vehicleid][EVSecurity] ]);
	format(DiaString, 1024, "%s{FFFFFF}Lock \t{ADFF2F}%s\n", DiaString, LockInfos[ EvoVehicles[vehicleid][EVLock] ]);
	format(DiaString, 1024, "%s{FFFFFF}Plate \t{ADFF2F}%s\n", DiaString, EvoVehicles[vehicleid][EVPlate]);
	format(DiaString, 1024, "%s{FFFFFF}Paintjob \t{ADFF2F}%d\n", DiaString, EvoVehicles[vehicleid][EVPJ]);
	format(DiaString, 1024, "%s{FFFFFF}Get Vehicle\n{FFFFFF}Delete Vehicle", DiaString);

	format(String, 128, "{FFFFFF}Evo Vehicle ID {ADFF2F}%d", vehicleid);

	ShowPlayerDialog(playerid, DIALOG_EVO_PANELVEH, DIALOG_STYLE_LIST, String, DiaString, "Edit", "Back");

}

// For Players
// - ShowPlayerEVPanel
ShowPlayerEVPanel(playerid, vehicleid)
{
	new DiaString[1024], String[128];

	format(DiaString, 1024, "{FFFFFF}Get Vehicle\n{FFFFFF}Sell Vehicle\n");
	format(DiaString, 1024, "%s{FFFFFF}Doors \t{ADFF2F}%s\n", DiaString, LockInfos[ EvoVehicles[vehicleid][EVLock] ]);
    format(DiaString, 1024, "%s{FFFFFF}Security \t{ADFF2F}%s\n", DiaString, SecurityInfos[ EvoVehicles[vehicleid][EVSecurity] ]);
    format(DiaString, 1024, "%s{FFFFFF}Plate \t{ADFF2F}%s\n", DiaString, EvoVehicles[vehicleid][EVPlate]);

	#if AUTOMATIC_PARK == false
	format(DiaString, 1024, "%s{FFFFFF}Park Vehicle\n", DiaString);
	#endif
	
	format(String, 128, "{FFFFFF}Vehicle {ADFF2F}%s", VehNames[ EvoVehicles[vehicleid][EVModel]-400 ]);

	ShowPlayerDialog(playerid, DIALOG_A_HOME, DIALOG_STYLE_LIST, String, DiaString, "Edit", "Close");
}

// - LoadLockedEvoVehiclesForPlayer
LoadLockedEvoVehiclesForPlayer(playerid)
{
	foreach(new i : EVs)
	{
	    if(EvoVehicles[i][EVExist] == 0) continue;
		SetVehicleParamsForPlayer(EvoVehicles[i][EVVehID], playerid, 0, EvoVehicles[i][EVLock]);
	}
}

// - GetPlayerVehicleCount
GetPlayerVehicleCount(playerid)
{
	new Result;
	
	foreach(new i : EVs)
	{
	    if(EvoVehicles[i][EVExist] == 0) continue;
	    if(!strcmp(GetName(playerid), EvoVehicles[i][EVOwner], true)) Result++;
	}
	
	return Result;
}

// - GetPlayerVehicleInSlot
GetPlayerVehicleInSlot(playerid, slotid)
{
	new Count, Result;
	
	foreach(new i : EVs)
	{
	    if(EvoVehicles[i][EVExist] == 0) continue;
	    if(!strcmp(GetName(playerid), EvoVehicles[i][EVOwner], true)) Count++;
	    if(Count == slotid) { Result = i; break; }
	}
	
	return Result;
}


// For I-Sync

// - _GetVehicleOwner
stock _GetVehicleOwner(vehicleid)
{
	return EvoVehicles[vehicleid][EVOwner];
}

// - _SetVehicleOwner
stock _SetVehicleOwner(vehicleid, owner[])
{
	return format(EvoVehicles[vehicleid][EVOwner], 40, owner);
}

// - _GetVehiclePrice
stock _GetVehiclePrice(vehicleid)
{
	return EvoVehicles[vehicleid][EVPrice];
}

// - _SetVehiclePrice
stock _SetVehiclePrice(vehicleid, price)
{
	return EvoVehicles[vehicleid][EVPrice] = price;
}

// - _GetSystemIDFromVehicleID
stock _GetSystemIDFromVehicleID(vehicleid)
{
	if(VehInSystem[vehicleid] == 1) return VehEVID[vehicleID];
	return -1;
}

// - _IsVehicleInSystem
stock _IsVehicleInSystem(vehicleid)
{
	return VehInSystem[vehicleid];
}

// - _CreateEvoVehicle
stock _CreateEvoVehicle(Modelid, Owner[], Float:X, Float:Y, Float:Z, Float:Rot, Col1, Col2, Price)
{
	return CreateEvoVehicle(Modelid, Owner, X, Y, Z, Rot, Col1, Col2, Price);
}

// - _DeleteEvoVehicle
stock _DeleteEvoVehicle(vehicleid)
{
	return DeleteEvoVehicle(vehicleid);
}

// ================================[COMMANDS]================================ //
// Evo Vehicle Administrating & Help

// - /evovehicle
COMMAND:evovehicle(playerid, params[])
{
	new parameter[20];
	
	if(!sscanf(params, "s", parameter))
	{
	    if(!strcmp("help", parameter, true))
	    {

	        ShowPlayerDialog(playerid, 9999, DIALOG_STYLE_MSGBOX, "{ADFF2F}Evo Vehicle Ownership Help", "{FFFFFF}You can get in a vehicle on road for buy it.\n{FFFFFF}When you got in vehicle, a dialog asks u : \"Do you want to buy it?\".\n{FFFFFF}If you select \"Yes\", you can buy it.\n \n{FFFFFF}And you can manage your vehicles with {ADFF2F}/myveh {FFFFFF}command", "Close", "");

		}else if(!strcmp("manage", parameter, true))
	    {

	        if(pInfo[playerid][pRoot] == 1) return ShowPlayerDialog(playerid, DIALOG_EVO_PANELHOME, DIALOG_STYLE_LIST, "{ADFF2F}Evo Vehicle Ownership Administrating Panel",
								 									"{ADFF2F}» {FFFFFF}Manage a Vehicle\n{ADFF2F}» {FFFFFF}Add a Vehicle \t{ADFF2F}/addev\n{ADFF2F}» {FFFFFF}Delete All Vehicles\n{ADFF2F}» {FFFFFF}Manage a Showroom\n{ADFF2F}» {FFFFFF}Add a Showroom \t{ADFF2F}/addsr\n{ADFF2F}» {FFFFFF}Delete All Showrooms\n{ADFF2F}» {FFFFFF}Change Panel Password\n{ADFF2F}» {FFFFFF}Get ROOT Permission\n{ADFF2F}» {FFFFFF}About Evo Vehicle Ownership", "Select", "Close");

			if(!strcmp(EVOPanelPass, "default", true))
	        {
                ShowPlayerDialog(playerid, DIALOG_EVO_PANELPASS, DIALOG_STYLE_PASSWORD, "{ADFF2F}Evo Vehicle Ownership Administrating Panel Login", "{FFFFFF}You didn't set a password for {ADFF2F}Evo Vehicle Ownership Administrating Panel {FFFFFF}before.\n{FFFFFF}Please select a password for EVO Administrating Panel to finish setup.", "Select", "Cancel");
			}else{
				ShowPlayerDialog(playerid, DIALOG_EVO_PANELPASS, DIALOG_STYLE_PASSWORD, "{ADFF2F}Evo Vehicle Ownership Administrating Panel Login", "{FFFFFF}Enter the password for login {ADFF2F}Evo Vehicle Ownership Administrating Panel", "Login", "Cancel");
			}
		}else if(!strcmp("versioncontrol", parameter, true))
		{

            HTTP(playerid, HTTP_GET, "evoturk.p.ht/versions/evoaraba-essentials-en.txt", "", "EvoVehicle_InGame");
		
		}else return ERROR(playerid, "Wrong parameter!");
	}else return USAGE(playerid, "/evovehicle {ADFF2F}[help/manage/versioncontrol]");
	return 1;
}

// - /addev
COMMAND:addev(playerid, params[])
{
	if(pInfo[playerid][pRoot] == 0) return ERROR(playerid, "You cannot add vehicle in system without ROOT Permission");
	new tmp[60], idx;
	tmp = strtok(params, idx);
	if(!strlen(tmp)) return USAGE(playerid, "/addev {ADFF2F}[model][price][color1][color2][owner]"), USAGE(playerid, "If you want to add vehicle without owner, set vehicle owner's name as: -");
	new omodel;

	if(IsNumeric(tmp))
	{
	    omodel = strval(tmp);
	}else{
	    omodel = GetVehicleModelIDFromName(tmp);
	}

	if(omodel < 400 || omodel > 600) return ERROR(playerid, "Wrong vehicle model");

	tmp = strtok(params, idx);
	if(!strlen(tmp)) return USAGE(playerid, "/addev {ADFF2F}[model][price][color1][color2][owner]"), USAGE(playerid, "If you want to add vehicle without owner, set vehicle owner's name as: -");
	new oprice = strval(tmp);

	tmp = strtok(params, idx);
	if(!strlen(tmp)) return USAGE(playerid, "/addev {ADFF2F}[model][price][color1][color2][owner]"), USAGE(playerid, "If you want to add vehicle without owner, set vehicle owner's name as: -");
	new ocolor1 = strval(tmp);

	tmp = strtok(params, idx);
	if(!strlen(tmp)) return USAGE(playerid, "/addev {ADFF2F}[model][price][color1][color2][owner]"), USAGE(playerid, "If you want to add vehicle without owner, set vehicle owner's name as: -");
	new ocolor2 = strval(tmp);

	tmp = strtok(params, idx);
	if(!strlen(tmp)) return USAGE(playerid, "/addev {ADFF2F}[model][price][color1][color2][owner]"), USAGE(playerid, "If you want to add vehicle without owner, set vehicle owner's name as: -");

	new Float:pX, Float:pY, Float:pZ, Float:pRot;
	GetPlayerPos(playerid, pX, pY, pZ);
	GetPlayerFacingAngle(playerid, pRot);

	pX += 5.0 * floatcos(pRot + 90, degrees);
	pY += 5.0 * floatsin(pRot + 90, degrees);

	new CreatedID =	CreateEvoVehicle(omodel, tmp, pX, pY, pZ, pRot+90, ocolor1, ocolor2, oprice);

	INFO(playerid, "You added a vehicle in system");

	new String[64];

	format(String, 64, "ID of the vehicle that you added : {ADFF2F}%d", CreatedID);
	INFO(playerid, String);

	INFO(playerid, "You can manage the vehicle that you add in Evo Vehicle Ownership panel.");

	return 1;
}

// - /addsr
COMMAND:addsr(playerid, params[])
{
	if(pInfo[playerid][pRoot] == 0) return ERROR(playerid, "You cannot add showroom in system without ROOT Permission");
	new tmp[256], idx;
	tmp = strrest(params, idx);
	if(!strlen(tmp)) return USAGE(playerid, "/addsr {ADFF2F}[name]");

	new CreatedID, String[128], Float:pX, Float:pY, Float:pZ;
	GetPlayerPos(playerid, pX, pY, pZ);

	CreatedID = CreateShowroom(tmp, pX, pY, pZ);

	INFO(playerid, "You added a showroom in system");

	format(String, 128, "ID of the showroom that you added : %d", CreatedID);
	INFO(playerid, String);

	INFO(playerid, "You can add vehicle in this showroom like that adding vehicle in system");

	format(String, 128, "Additional you must make vehicle's owner Showroom%d", CreatedID);
	INFO(playerid, String);

	return 1;
}


// Player Evo Vehicle Management

// - /myveh
COMMAND:myveh(playerid, params[])
{
	new PEVCount = GetPlayerVehicleCount(playerid);
	
	if(PEVCount == 0) return ERROR(playerid, "You don't have a vehicle!");
	
	new DiaString[512], PEVID;

	for(new i; i < PEVCount; i++)
	{
		PEVID = GetPlayerVehicleInSlot(playerid, i+1);
		
		format(DiaString, 512, "%s{ADFF2F}%d# {FFFFFF}%s\n", DiaString, i+1, VehNames[ EvoVehicles[PEVID][EVModel]-400]);
	}
	
	ShowPlayerDialog(playerid, DIALOG_A_VEHLIST, DIALOG_STYLE_LIST, "{ADFF2F}My Vehicles", DiaString, "Manage", "Close");
	return 1;
}

// ================================[PUBLICS]================================= //
public OnFilterScriptInit()
{
	// Evo Scripts Loader Text
	printf("<=================================================>");
	printf("<                                                 >");
	printf("<               Evo Vehicle Ownership             >");
	printf("<                       IX.3                      >");
	printf("<                    Essentials                   >");
	printf("<           By Exertion ( A.K.A EvoturK )         >");
	printf("<                                                 >");
	printf("<=================================================>");
	printf("<                                                 >");
	
	
	
	// Loading System
	new EVFileName[35];
	format(EVFileName, 35, "%s/options.ini", EVOVEHICLE_MAIN_DIR);
	
    INI_ParseFile(EVFileName, "LoadEVO");
    
    printf("<            System Information Loaded            >");
    
    
	// Loading System Vehicles
	LoadEvoVehicles();
	
	printf("<                Vehicles Loaded                  >");
	
	
	// Loading Vehicle Showrooms
	LoadShowrooms();
	
	printf("<               Showrooms Loaded                  >");
	
	

	printf("<                                                 >");
	printf("<=================================================>");
	
	
	// Evo Scripts Version Controller
    HTTP(0, HTTP_GET, "evoturk.p.ht/versions/evoaraba-essentials-en.txt", "", "EvoVehicle_Init");
    
	return 1;
}


public OnFilterScriptExit()
{
	// Unloading Signal
	Unloading = 1;

	// Evo Scripts Unloader Text
	printf("<=================================================>");
	printf("<                                                 >");
	printf("<               Evo Vehicle Ownership             >");
	printf("<                       IX.3                      >");
	printf("<                    Essentials                   >");
	printf("<           By Exertion ( A.K.A EvoturK )         >");
	printf("<                                                 >");
	printf("<=================================================>");
	printf("<                                                 >");



	// Saving System
	SaveEVO();
	
	printf("<              System Information Saved           >");
	
	
	// Saving System Vehicles
	SaveEvoVehicles(1);
	
	printf("<                   Vehicles Saved                >");


	// Saving Vehicle Showrooms
	SaveShowrooms(1);
	
	printf("<                  Showrooms Saved                >");


	// Delete System Waste
	// Deleting System Waste
	foreach(new i : EVs)
	{
	    DestroyVehicle(EvoVehicles[i][EVVehID]);
	}

	foreach(new i : SRs)
	{
	    DestroyPickup(Showrooms[i][SRPick]);
	    Delete3DTextLabel(Showrooms[i][SR3D]);
	}

	printf("<             System Waste was Deleted            >");
	


	printf("<                                                 >");
	printf("<=================================================>");
	return 1;
}

public OnPlayerConnect(playerid)
{
	pInfo[playerid][pRoot] = 0;
	return 1;
}

public OnPlayerSpawn(playerid)
{
    LoadLockedEvoVehiclesForPlayer(playerid);
	return 1;
}

public OnPlayerEnterVehicle(playerid, vehicleid)
{
	if(VehInSystem[vehicleid] == 1)
	{
	    new String[128];

	   	new EVSystemID = VehEVID[vehicleid];

   		format(String, 128, "System ID : %d {ADFF2F}| {FFFFFF}Model : %s", EVSystemID, VehNames[ EvoVehicles[ EVSystemID ][EVModel]-400 ]);
		INFO(playerid, String);
		
		if(!strfind(EvoVehicles[ EVSystemID ][EVOwner], "Showroom", true))
		{
		    INFO(playerid, "This vehicle is for sale in Showroom.");
		}else{
		    if(!strfind("-", EvoVehicles[ EVSystemID ][EVOwner], true)) return INFO(playerid, "This vehicle doesn't have any owner and it is for sale.");

			if(!strfind(GetName(playerid), EvoVehicles[ EVSystemID ][EVOwner], true))
			{
				INFO(playerid, "Welcome to Your Vehicle");
			}else{
			    format(String, 128, "This vehicles owner is {ADFF2F}%s", EvoVehicles[ EVSystemID ][EVOwner]);
			    INFO(playerid, String);
			}
		}
	}
	return 1;
}

public OnVehicleSpawn(vehicleid)
{
	if(VehInSystem[vehicleid] == 1)
	{
		ChangeVehicleColor(vehicleid, EvoVehicles[ VehEVID[vehicleid] ][EVCol1], EvoVehicles[ VehEVID[vehicleid] ][EVCol2]);
		LoadVehicleMod(VehEVID[vehicleid]);
		
		SetVehiclePos(vehicleid, EvoVehicles[ VehEVID[vehicleid] ][EVX], EvoVehicles[ VehEVID[vehicleid] ][EVY], EvoVehicles[ VehEVID[vehicleid] ][EVZ]);
		SetVehicleZAngle(vehicleid, EvoVehicles[ VehEVID[vehicleid] ][EVRot]);
	}
	return 1;
}

public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
	if(VehInSystem[vehicleid] == 1)
	{
	    EvoVehicles[ VehEVID[vehicleid] ][EVPJ] = paintjobid;
	    EvoVehicles[ VehEVID[vehicleid] ][EVNeedSave] = 1;
	}
	return 1;
}

public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
	if(VehInSystem[vehicleid] == 1)
	{
	    EvoVehicles[ VehEVID[vehicleid] ][EVCol1] = color1;
	    EvoVehicles[ VehEVID[vehicleid] ][EVCol2] = color2;
 	    EvoVehicles[ VehEVID[vehicleid] ][EVNeedSave] = 1;
	}
	return 1;
}

public OnVehicleMod(playerid, vehicleid, componentid)
{
	if(VehInSystem[vehicleid] == 1)
	{
	    GetVehicleMod( VehEVID[vehicleid] );
 	    EvoVehicles[ VehEVID[vehicleid] ][EVNeedSave] = 1;
	}
	return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
	if(newstate == PLAYER_STATE_DRIVER)
	{
	    if(VehInSystem[ GetPlayerVehicleID(playerid) ] == 1)
	    {
	        new EVSystemID = VehEVID[ GetPlayerVehicleID(playerid) ];
		    
	        if(!strfind(EvoVehicles[ EVSystemID ][EVOwner], "Showroom", true))
	        {
			    new SRN[30];
				strmid(SRN, EvoVehicles[ EVSystemID ][EVOwner], 8, strlen(EvoVehicles[ EVSystemID ][EVOwner]), 30);
	            SelectedSR[playerid] = strval(SRN);
	            
				new DiaString[512];
				format(DiaString, 512, "{FFFFFF}Model\t{ADFF2F}%s\n", VehNames[ EvoVehicles[ EVSystemID ][EVModel]-400 ]);
				format(DiaString, 512, "%s{FFFFFF}Price\t{ADFF2F}%d$\n", DiaString, EvoVehicles[ EVSystemID ][EVPrice]);
				format(DiaString, 512, "%s{FFFFFF}Do you want buy this vehicle?", DiaString);
				
				ShowPlayerDialog(playerid, DIALOG_SRVEH, DIALOG_STYLE_MSGBOX, "{ADFF2F}Showroom", DiaString, "Yes", "No");
	        }else{
	            if(!strcmp(EvoVehicles[ EVSystemID ][EVOwner], "-", true))
	            {
					new DiaString[512];
					format(DiaString, 512, "{FFFFFF}Model\t{ADFF2F}%s\n", VehNames[ EvoVehicles[ EVSystemID ][EVModel]-400 ]);
					format(DiaString, 512, "%s{FFFFFF}Price\t{ADFF2F}%d$\n", DiaString, EvoVehicles[ EVSystemID ][EVPrice]);
					format(DiaString, 512, "%s{FFFFFF}Do you want buy this vehicle?", DiaString);

					ShowPlayerDialog(playerid, DIALOG_BUY_VEHICLE, DIALOG_STYLE_MSGBOX, "{ADFF2F}Vehicle for Sale", DiaString, "Yes", "No");
	            }else{
	            	if(!strcmp(EvoVehicles[ EVSystemID ][EVOwner], GetName(playerid), true))
	            	{
						INFO(playerid, "You can manage your vehicle with /myveh command.");
	            	}else{
						switch(EvoVehicles[ EVSystemID ][EVSecurity])
						{
					    	case 1:
					    	{
								INFO(playerid, "Sorry, This vehicle's owner has started Killing Security System");
								SetPlayerHealth(playerid, 0.0);
							}

					    	case 2:
					    	{
								INFO(playerid, "Sorry, This vehicle's owner has started Slapping Security System");

								new Float:pX, Float:pY, Float:pZ;
								GetPlayerPos(playerid, pX, pY, pZ);
								SetPlayerPos(playerid, pX, pY, pZ+10);
					    	}
						}
	            	}
				}
	        }
	    }
	}
	return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	// Evo Vehicle Ownership Administrating
	if(dialogid == DIALOG_EVO_PANELPASS)
	{
	    if(response)
		{
		    if(!strlen(inputtext)) return ERROR(playerid, "You don't enter panel password");
		    if(!strcmp("default", EVOPanelPass, true)) return format(EVOPanelPass, 150, inputtext), INFO(playerid, "You selected panel password. Login panel again.");
			if(!strcmp(EVOPanelPass, inputtext, true))
			{
			    ShowPlayerDialog(playerid, DIALOG_EVO_PANELHOME, DIALOG_STYLE_LIST, "{ADFF2F}Evo Vehicle Ownership Administrating Panel",
							     "{ADFF2F}» {FFFFFF}Manage a Vehicle\n{ADFF2F}» {FFFFFF}Add a Vehicle \t{ADFF2F}/addev\n{ADFF2F}» {FFFFFF}Delete All Vehicles\n{ADFF2F}» {FFFFFF}Manage a Showroom\n{ADFF2F}» {FFFFFF}Add a Showroom \t{ADFF2F}/addsr\n{ADFF2F}» {FFFFFF}Delete All Showrooms\n{ADFF2F}» {FFFFFF}Change Panel Password\n{ADFF2F}» {FFFFFF}Get ROOT Permission\n{ADFF2F}» {FFFFFF}About Evo Vehicle Ownership", "Select", "Close");
			}else return ERROR(playerid, "Wrong panel password");
		}
	}
	
	if(dialogid == DIALOG_EVO_PANELHOME)
	{
		if(response)
		{
			switch(listitem)
			{
			    case 0: // Manage Vehicle
			    {
			        ShowPlayerDialog(playerid, DIALOG_EVO_PANELVEHID, DIALOG_STYLE_INPUT, "{ADFF2F}Manage a Vehicle", "{FFFFFF}Enter the vehicle's id that you want to manage in system:", "Manage", "Back");
			    }

				case 1: // Add Vehicle
				{
				    ShowPlayerDialog(playerid, DIALOG_EVO_PANELNEW_MODEL, DIALOG_STYLE_INPUT, "{ADFF2F}New Vehicle", "{FFFFFF}Enter the vehicle's model id or name that you want to add:", "Next", "Cancel");
				}
				
				case 2: // Delete All Vehicles
				{
				    new FileName[35];
				    
				    foreach(new i: EVs)
				    {
       					EvoVehicles[i][EVExist] = 0;
						DestroyVehicle(EvoVehicles[i][EVVehID]);
						VehInSystem[ EvoVehicles[i][EVVehID] ] = 0;

						format(FileName, 35, "%s/Vehicle_%d.ini", EVOVEHICLE_VEHICLE_DIR, i);
						fremove(FileName);

    					new next;
    					Iter_SafeRemove(EVs, i, next);
    					i = next;
				    }

				    INFO(playerid, "You deleted all vehicles in system.");
				    
				    ShowPlayerDialog(playerid, DIALOG_EVO_PANELHOME, DIALOG_STYLE_LIST, "{ADFF2F}Evo Vehicle Ownership Administrating Panel",
							     	 "{ADFF2F}» {FFFFFF}Manage a Vehicle\n{ADFF2F}» {FFFFFF}Add a Vehicle \t{ADFF2F}/addev\n{ADFF2F}» {FFFFFF}Delete All Vehicles\n{ADFF2F}» {FFFFFF}Manage a Showroom\n{ADFF2F}» {FFFFFF}Add a Showroom \t{ADFF2F}/addsr\n{ADFF2F}» {FFFFFF}Delete All Showrooms\n{ADFF2F}» {FFFFFF}Change Panel Password\n{ADFF2F}» {FFFFFF}Get ROOT Permission\n{ADFF2F}» {FFFFFF}About Evo Vehicle Ownership", "Select", "Close");
				}
				
				case 3: // Manage Showroom
				{
				    ShowPlayerDialog(playerid, DIALOG_EVO_PANELSRID, DIALOG_STYLE_INPUT, "{ADFF2F}Manage a Showroom", "{FFFFFF}Enter the showroom's id that you want to manage in system:", "Manage", "Back");
				}
				
				case 4: // Add Showroom
				{
				    ShowPlayerDialog(playerid, DIALOG_EVO_PANELNSR_NAME, DIALOG_STYLE_INPUT, "{ADFF2F}New Showroom", "{FFFFFF}Notice : You must be in the place where you want to add showroom at.\n{FFFFFF}{FFFFFF}Enter the vehicle's name that you want to add:", "Next", "Cancel");
				}
				
				case 5: // Delete All Showrooms
				{
				    new FileName[35];
				    
				    foreach(new i: SRs)
				    {
						Showrooms[i][SRExist] = 0;
						DestroyPickup(Showrooms[i][SRPick]);
						Delete3DTextLabel(Showrooms[i][SR3D]);

						format(FileName, 35, "%s/Showroom_%d.ini", EVOVEHICLE_SHOWROOM_DIR, i);
						fremove(FileName);

    					new next;
    					Iter_SafeRemove(SRs, i, next);
    					i = next;
				    }

				    INFO(playerid, "You deleted all showrooms in system.");
				    
				    ShowPlayerDialog(playerid, DIALOG_EVO_PANELHOME, DIALOG_STYLE_LIST, "{ADFF2F}Evo Vehicle Ownership Administrating Panel",
							     	 "{ADFF2F}» {FFFFFF}Manage a Vehicle\n{ADFF2F}» {FFFFFF}Add a Vehicle \t{ADFF2F}/addev\n{ADFF2F}» {FFFFFF}Delete All Vehicles\n{ADFF2F}» {FFFFFF}Manage a Showroom\n{ADFF2F}» {FFFFFF}Add a Showroom \t{ADFF2F}/addsr\n{ADFF2F}» {FFFFFF}Delete All Showrooms\n{ADFF2F}» {FFFFFF}Change Panel Password\n{ADFF2F}» {FFFFFF}Get ROOT Permission\n{ADFF2F}» {FFFFFF}About Evo Vehicle Ownership", "Select", "Close");
				}
				
				case 6: // Change Password
				{
				    ShowPlayerDialog(playerid, DIALOG_EVO_PANELCPASS, DIALOG_STYLE_INPUT, "{ADFF2F}Change Panel Password", "{FFFFFF}Enter a new password for panel:", "Change", "Back");
				}
				
				case 7: // Get ROOT Permission
				{
				    pInfo[playerid][pRoot] = 1;
					INFO(playerid, "You got ROOT Permission in Evo Vehicle System.");
					INFO(playerid, "You can enter EVO Administrating Panel without enter password.");
			    	ShowPlayerDialog(playerid, DIALOG_EVO_PANELHOME, DIALOG_STYLE_LIST, "{ADFF2F}Evo Vehicle Ownership Administrating Panel",
							     	 "{ADFF2F}» {FFFFFF}Manage a Vehicle\n{ADFF2F}» {FFFFFF}Add a Vehicle \t{ADFF2F}/addev\n{ADFF2F}» {FFFFFF}Delete All Vehicles\n{ADFF2F}» {FFFFFF}Manage a Showroom\n{ADFF2F}» {FFFFFF}Add a Showroom \t{ADFF2F}/addsr\n{ADFF2F}» {FFFFFF}Delete All Showrooms\n{ADFF2F}» {FFFFFF}Change Panel Password\n{ADFF2F}» {FFFFFF}Get ROOT Permission\n{ADFF2F}» {FFFFFF}About Evo Vehicle Ownership", "Select", "Close");
				}
				
				case 8: // About EVO
				{
				    ShowPlayerDialog(playerid, DIALOG_EVO_PANELABOUT, DIALOG_STYLE_MSGBOX, "{ADFF2F}About Evo Vehicle Ownership", "{FFFFFF}Coder \t{ADFF2F}Exertion. ( aKa EvoturK )\n{FFFFFF}Version \t{ADFF2F}IX.3 Essentials\n{FFFFFF}Version Date \t{ADFF2F}07.08.2013\n{FFFFFF}EvoENGINE \t{ADFF2F}3.0\n \n{FFFFFF}Web Site \t{ADFF2F}evoturk.p.ht", "Back", "");
				}
			}
		}
	}

	if(dialogid == DIALOG_EVO_PANELNSR_NAME)
	{
	    if(response)
	    {
	        if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_EVO_PANELNSR_NAME, DIALOG_STYLE_INPUT, "{ADFF2F}New Showroom", "{FFFFFF}Notice : You must be in the place where you want to add showroom at.\n{FFFFFF}{FFFFFF}Enter the vehicle's name that you want to add:", "Next", "Cancel");
	        format(SelectedName[playerid], 100, inputtext);
	        
			new CreatedID, String[128], Float:pX, Float:pY, Float:pZ;
			GetPlayerPos(playerid, pX, pY, pZ);

			CreatedID = CreateShowroom(SelectedName[playerid], pX, pY, pZ);
			
			INFO(playerid, "You add a new showroom in system");
			
			format(String, 128, "Showroom's ID in system is %d", CreatedID);
			INFO(playerid, String);
			
			INFO(playerid, "You can add vehicle to galery like adding vehicle in system");
			
			format(String, 128, "Additional, you must set vehicle's owner Showroom%d", CreatedID);
			INFO(playerid, String);
			
            ShowPlayerDialog(playerid, DIALOG_EVO_PANELHOME, DIALOG_STYLE_LIST, "{ADFF2F}Evo Vehicle Ownership Administrating Panel",
							 "{ADFF2F}» {FFFFFF}Manage a Vehicle\n{ADFF2F}» {FFFFFF}Add a Vehicle \t{ADFF2F}/addev\n{ADFF2F}» {FFFFFF}Delete All Vehicles\n{ADFF2F}» {FFFFFF}Manage a Showroom\n{ADFF2F}» {FFFFFF}Add a Showroom \t{ADFF2F}/addsr\n{ADFF2F}» {FFFFFF}Delete All Showrooms\n{ADFF2F}» {FFFFFF}Change Panel Password\n{ADFF2F}» {FFFFFF}Get ROOT Permission\n{ADFF2F}» {FFFFFF}About Evo Vehicle Ownership", "Select", "Close");
	    }else{
	        ShowPlayerDialog(playerid, DIALOG_EVO_PANELHOME, DIALOG_STYLE_LIST, "{ADFF2F}Evo Vehicle Ownership Administrating Panel",
							 "{ADFF2F}» {FFFFFF}Manage a Vehicle\n{ADFF2F}» {FFFFFF}Add a Vehicle \t{ADFF2F}/addev\n{ADFF2F}» {FFFFFF}Delete All Vehicles\n{ADFF2F}» {FFFFFF}Manage a Showroom\n{ADFF2F}» {FFFFFF}Add a Showroom \t{ADFF2F}/addsr\n{ADFF2F}» {FFFFFF}Delete All Showrooms\n{ADFF2F}» {FFFFFF}Change Panel Password\n{ADFF2F}» {FFFFFF}Get ROOT Permission\n{ADFF2F}» {FFFFFF}About Evo Vehicle Ownership", "Select", "Close");
	    }
	}
	
	if(dialogid == DIALOG_EVO_PANELSRID)
	{
	    if(response)
	    {
	        if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_EVO_PANELSRID, DIALOG_STYLE_INPUT, "{ADFF2F}Manage a Showroom", "{FFFFFF}Enter the showroom's id that you want to manage in system:", "Manage", "Back");
			new id = strval(inputtext);
			SelectedSR[playerid] = id;
			
			if(Showrooms[id][SRExist] == 0) return ERROR(playerid, "Wrong Showroom ID'i"), ShowPlayerDialog(playerid, DIALOG_EVO_PANELSRID, DIALOG_STYLE_INPUT, "{ADFF2F}Manage a Showroom", "{FFFFFF}Enter the showroom's id that you want to manage in system:", "Manage", "Back");
			
			new DiaString[256], String[80];

			format(DiaString, 256, "{FFFFFF}Showroom Name \t{ADFF2F}%s\n{FFFFFF}Get Showroom Here\n{FFFFFF}Delete Showroom", Showrooms[ SelectedSR[playerid] ][SRName]);
			
			format(String, 80, "{FFFFFF}Showroom ID {ADFF2F}%d", SelectedSR[playerid]);
			
			ShowPlayerDialog(playerid, DIALOG_EVO_PANELSR, DIALOG_STYLE_LIST, String, DiaString, "Select", "Close");
	    }else{
	        ShowPlayerDialog(playerid, DIALOG_EVO_PANELHOME, DIALOG_STYLE_LIST, "{ADFF2F}Evo Vehicle Ownership Administrating Panel",
							 "{ADFF2F}» {FFFFFF}Manage a Vehicle\n{ADFF2F}» {FFFFFF}Add a Vehicle \t{ADFF2F}/addev\n{ADFF2F}» {FFFFFF}Delete All Vehicles\n{ADFF2F}» {FFFFFF}Manage a Showroom\n{ADFF2F}» {FFFFFF}Add a Showroom \t{ADFF2F}/addsr\n{ADFF2F}» {FFFFFF}Delete All Showrooms\n{ADFF2F}» {FFFFFF}Change Panel Password\n{ADFF2F}» {FFFFFF}Get ROOT Permission\n{ADFF2F}» {FFFFFF}About Evo Vehicle Ownership", "Select", "Close");
	    }
	}
	
	if(dialogid == DIALOG_EVO_PANELSR)
	{
	    if(response)
	    {
			switch(listitem)
			{
			    case 0: // Set Showroom Name
			    {
			        ShowPlayerDialog(playerid, DIALOG_EVO_PANELSR_NAME, DIALOG_STYLE_INPUT, "{ADFF2F}Change Showroom Name", "{FFFFFF}Select a new name for showroom:", "Change", "Back");
			    }
			    
			    case 1: // Set Showroom Location
			    {
			        GetPlayerPos(playerid, Showrooms[ SelectedSR[playerid] ][SRX], Showrooms[ SelectedSR[playerid] ][SRY], Showrooms[ SelectedSR[playerid] ][SRZ]);
                    Showrooms[ SelectedSR[playerid] ][SRNeedSave] = 1;
                    
			        DestroyPickup(Showrooms[ SelectedSR[playerid] ][SRPick]);
					Delete3DTextLabel(Showrooms[ SelectedSR[playerid] ][SR3D]);
					
					Showrooms[ SelectedSR[playerid] ][SRPick] = CreatePickup(1239, 1, Showrooms[ SelectedSR[playerid] ][SRX], Showrooms[ SelectedSR[playerid] ][SRY], Showrooms[ SelectedSR[playerid] ][SRZ], 0);

					new String[128];
					format(String, 128, "{ADFF2F}SHOWROOM\n{ADFF2F}%s\n{FFFFFF}Showroom ID {ADFF2F}%d", Showrooms[ SelectedSR[playerid] ][SRName], SelectedSR[playerid]);
					Showrooms[ SelectedSR[playerid] ][SR3D] = Create3DTextLabel(String, -1, Showrooms[ SelectedSR[playerid] ][SRX], Showrooms[ SelectedSR[playerid] ][SRY], Showrooms[ SelectedSR[playerid] ][SRZ], 25.0, 0);

					new DiaString[256];

					format(DiaString, 256, "{FFFFFF}Showroom Name \t{ADFF2F}%s\n{FFFFFF}Get Showroom Here\n{FFFFFF}Delete Showroom", Showrooms[ SelectedSR[playerid] ][SRName]);

					format(String, 128, "{FFFFFF}Showroom ID {ADFF2F}%d", SelectedSR[playerid]);

					ShowPlayerDialog(playerid, DIALOG_EVO_PANELSR, DIALOG_STYLE_LIST, String, DiaString, "Select", "Close");
			    }
			    
			    case 2: // Delete Showroom
			    {
			        DeleteShowroom(SelectedSR[playerid]);
			        INFO(playerid, "Showroom that you selected has been deleted");
			    }
			}
	    }else{
	        ShowPlayerDialog(playerid, DIALOG_EVO_PANELHOME, DIALOG_STYLE_LIST, "{ADFF2F}Evo Vehicle Ownership Administrating Panel",
							 "{ADFF2F}» {FFFFFF}Manage a Vehicle\n{ADFF2F}» {FFFFFF}Add a Vehicle \t{ADFF2F}/addev\n{ADFF2F}» {FFFFFF}Delete All Vehicles\n{ADFF2F}» {FFFFFF}Manage a Showroom\n{ADFF2F}» {FFFFFF}Add a Showroom \t{ADFF2F}/addsr\n{ADFF2F}» {FFFFFF}Delete All Showrooms\n{ADFF2F}» {FFFFFF}Change Panel Password\n{ADFF2F}» {FFFFFF}Get ROOT Permission\n{ADFF2F}» {FFFFFF}About Evo Vehicle Ownership", "Select", "Close");
	    }
	}
	
	if(dialogid == DIALOG_EVO_PANELSR_NAME)
	{
	    if(response)
	    {
	        if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_EVO_PANELSR_NAME, DIALOG_STYLE_INPUT, "{ADFF2F}Change Showroom Name", "{FFFFFF}Select a new name for showroom:", "Change", "Back");
			format(Showrooms[ SelectedSR[playerid] ][SRName], 100, inputtext);
			Showrooms[ SelectedSR[playerid] ][SRNeedSave] = 1;

			DestroyPickup(Showrooms[ SelectedSR[playerid] ][SRPick]);
			Delete3DTextLabel(Showrooms[ SelectedSR[playerid] ][SR3D]);

			Showrooms[ SelectedSR[playerid] ][SRPick] = CreatePickup(1239, 1, Showrooms[ SelectedSR[playerid] ][SRX], Showrooms[ SelectedSR[playerid] ][SRY], Showrooms[ SelectedSR[playerid] ][SRZ], 0);

			new String[128];
			format(String, 128, "{ADFF2F}SHOWROOM\n{ADFF2F}%s\n{FFFFFF}Showroom ID {ADFF2F}%d", Showrooms[ SelectedSR[playerid] ][SRName], SelectedSR[playerid]);
			Showrooms[ SelectedSR[playerid] ][SR3D] = Create3DTextLabel(String, -1, Showrooms[ SelectedSR[playerid] ][SRX], Showrooms[ SelectedSR[playerid] ][SRY], Showrooms[ SelectedSR[playerid] ][SRZ], 25.0, 0);

			new DiaString[256];

			format(DiaString, 256, "{FFFFFF}Showroom Name \t{ADFF2F}%s\n{FFFFFF}Get Showroom Here\n{FFFFFF}Delete Showroom", Showrooms[ SelectedSR[playerid] ][SRName]);

			format(String, 128, "{FFFFFF}Showroom ID {ADFF2F}%d", SelectedSR[playerid]);

			ShowPlayerDialog(playerid, DIALOG_EVO_PANELSR, DIALOG_STYLE_LIST, String, DiaString, "Select", "Close");
	    }else{
			new DiaString[256], String[80];

			format(DiaString, 256, "{FFFFFF}Showroom Name \t{ADFF2F}%s\n{FFFFFF}Get Showroom Here\n{FFFFFF}Delete Showroom", Showrooms[ SelectedSR[playerid] ][SRName]);

			format(String, 80, "{FFFFFF}Showroom ID {ADFF2F}%d", SelectedSR[playerid]);

			ShowPlayerDialog(playerid, DIALOG_EVO_PANELSR, DIALOG_STYLE_LIST, String, DiaString, "Select", "Close");
	    }
	}

	if(dialogid == DIALOG_EVO_PANELNEW_MODEL)
	{
	    if(response)
	    {
			if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_EVO_PANELNEW_MODEL, DIALOG_STYLE_INPUT, "{ADFF2F}New Vehicle", "{FFFFFF}Enter the vehicle's model id or name that you want to add:", "Next", "Cancel");

			if(IsNumeric(inputtext))
			{
			    SelectedModel[playerid] = strval(inputtext);
			}else{
			    SelectedModel[playerid] = GetVehicleModelIDFromName(inputtext);
			}
			
			if(SelectedModel[playerid] < 400 || SelectedModel[playerid] > 611) return ERROR(playerid, "Wrong vehicle model"), ShowPlayerDialog(playerid, DIALOG_EVO_PANELNEW_MODEL, DIALOG_STYLE_INPUT, "{ADFF2F}New Vehicle", "{FFFFFF}Enter the vehicle's model id or name that you want to add:", "Next", "Cancel");

			ShowPlayerDialog(playerid, DIALOG_EVO_PANELNEW_PRICE, DIALOG_STYLE_INPUT, "{ADFF2F}New Evo Vehicle", "{FFFFFF}Select price for vehicle that you're adding:", "Next", "Cancel");
	    }else{
    		ShowPlayerDialog(playerid, DIALOG_EVO_PANELHOME, DIALOG_STYLE_LIST, "{ADFF2F}Evo Vehicle Ownership Administrating Panel",
							 "{ADFF2F}» {FFFFFF}Manage a Vehicle\n{ADFF2F}» {FFFFFF}Add a Vehicle \t{ADFF2F}/addev\n{ADFF2F}» {FFFFFF}Delete All Vehicles\n{ADFF2F}» {FFFFFF}Manage a Showroom\n{ADFF2F}» {FFFFFF}Add a Showroom \t{ADFF2F}/addsr\n{ADFF2F}» {FFFFFF}Delete All Showrooms\n{ADFF2F}» {FFFFFF}Change Panel Password\n{ADFF2F}» {FFFFFF}Get ROOT Permission\n{ADFF2F}» {FFFFFF}About Evo Vehicle Ownership", "Select", "Close");
	    }
	}

	if(dialogid == DIALOG_EVO_PANELNEW_PRICE)
	{
	    if(response)
	    {
			if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_EVO_PANELNEW_PRICE, DIALOG_STYLE_INPUT, "{ADFF2F}New Vehicle", "{FFFFFF}Select price for vehicle that you're adding:", "Next", "Cancel");
			SelectedPrice[playerid] = strval(inputtext);

			ShowPlayerDialog(playerid, DIALOG_EVO_PANELNEW_COL1, DIALOG_STYLE_INPUT, "{ADFF2F}New Evo Vehicle", "{FFFFFF}Select vehicle's first color:", "Next", "Cancel");
	    }else{
    		ShowPlayerDialog(playerid, DIALOG_EVO_PANELHOME, DIALOG_STYLE_LIST, "{ADFF2F}Evo Vehicle Ownership Administrating Panel",
							 "{ADFF2F}» {FFFFFF}Manage a Vehicle\n{ADFF2F}» {FFFFFF}Add a Vehicle \t{ADFF2F}/addev\n{ADFF2F}» {FFFFFF}Delete All Vehicles\n{ADFF2F}» {FFFFFF}Manage a Showroom\n{ADFF2F}» {FFFFFF}Add a Showroom \t{ADFF2F}/addsr\n{ADFF2F}» {FFFFFF}Delete All Showrooms\n{ADFF2F}» {FFFFFF}Change Panel Password\n{ADFF2F}» {FFFFFF}Get ROOT Permission\n{ADFF2F}» {FFFFFF}About Evo Vehicle Ownership", "Select", "Close");
	    }
	}
	
	if(dialogid == DIALOG_EVO_PANELNEW_COL1)
	{
	    if(response)
	    {
			if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_EVO_PANELNEW_COL1, DIALOG_STYLE_INPUT, "{ADFF2F}New Vehicle", "{FFFFFF}Select vehicle's first color:", "Next", "Cancel");
			SelectedCol1[playerid] = strval(inputtext);

			ShowPlayerDialog(playerid, DIALOG_EVO_PANELNEW_COL2, DIALOG_STYLE_INPUT, "{ADFF2F}New Evo Vehicle", "{FFFFFF}Select vehicle's second color:", "Next", "Cancel");
	    }else{
    		ShowPlayerDialog(playerid, DIALOG_EVO_PANELHOME, DIALOG_STYLE_LIST, "{ADFF2F}Evo Vehicle Ownership Administrating Panel",
							 "{ADFF2F}» {FFFFFF}Manage a Vehicle\n{ADFF2F}» {FFFFFF}Add a Vehicle \t{ADFF2F}/addev\n{ADFF2F}» {FFFFFF}Delete All Vehicles\n{ADFF2F}» {FFFFFF}Manage a Showroom\n{ADFF2F}» {FFFFFF}Add a Showroom \t{ADFF2F}/addsr\n{ADFF2F}» {FFFFFF}Delete All Showrooms\n{ADFF2F}» {FFFFFF}Change Panel Password\n{ADFF2F}» {FFFFFF}Get ROOT Permission\n{ADFF2F}» {FFFFFF}About Evo Vehicle Ownership", "Select", "Close");
	    }
	}
	
	if(dialogid == DIALOG_EVO_PANELNEW_COL2)
	{
	    if(response)
	    {
			if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_EVO_PANELNEW_COL2, DIALOG_STYLE_INPUT, "{ADFF2F}New Evo Vehicle", "{FFFFFF}Select vehicle's second color:", "Next", "Cancel");
			SelectedCol2[playerid] = strval(inputtext);

			new Float:pX, Float:pY, Float:pZ, Float:pRot;
			GetPlayerPos(playerid, pX, pY, pZ);
			GetPlayerFacingAngle(playerid, pRot);
			
			pX += 5.0 * floatcos(pRot + 90, degrees);
			pY += 5.0 * floatsin(pRot + 90, degrees);
			
			new CreatedID =	CreateEvoVehicle(SelectedModel[playerid], "-", pX, pY, pZ, pRot+90, SelectedCol1[playerid], SelectedCol2[playerid], SelectedPrice[playerid]);

			INFO(playerid, "You added vehicle in system");
			
			new String[64];
			
			format(String, 64, "System ID of the vehicle that you added is {ADFF2F}%d", CreatedID);
			INFO(playerid, String);
			
			INFO(playerid, "You can manage this vehicle in EVO Administrating Panel");
	    }else{
    		ShowPlayerDialog(playerid, DIALOG_EVO_PANELHOME, DIALOG_STYLE_LIST, "{ADFF2F}Evo Vehicle Ownership Administrating Panel",
							 "{ADFF2F}» {FFFFFF}Manage a Vehicle\n{ADFF2F}» {FFFFFF}Add a Vehicle \t{ADFF2F}/addev\n{ADFF2F}» {FFFFFF}Delete All Vehicles\n{ADFF2F}» {FFFFFF}Manage a Showroom\n{ADFF2F}» {FFFFFF}Add a Showroom \t{ADFF2F}/addsr\n{ADFF2F}» {FFFFFF}Delete All Showrooms\n{ADFF2F}» {FFFFFF}Change Panel Password\n{ADFF2F}» {FFFFFF}Get ROOT Permission\n{ADFF2F}» {FFFFFF}About Evo Vehicle Ownership", "Select", "Close");
	    }
	}
	
	if(dialogid == DIALOG_EVO_PANELCPASS)
	{
	    if(response)
	    {
			if(!strlen(inputtext)) return ERROR(playerid, "You haven't entered a new password yet."), ShowPlayerDialog(playerid, DIALOG_EVO_PANELCPASS, DIALOG_STYLE_INPUT, "{ADFF2F}Change Panel Password", "{FFFFFF}Enter a new password for panel:", "Change", "Back");

			format(EVOPanelPass, 150, inputtext);
			
			INFO(playerid, "Panel password has been changed.");
			
			ShowPlayerDialog(playerid, DIALOG_EVO_PANELHOME, DIALOG_STYLE_LIST, "{ADFF2F}Evo Vehicle Ownership Administrating Panel",
							 "{ADFF2F}» {FFFFFF}Manage a Vehicle\n{ADFF2F}» {FFFFFF}Add a Vehicle \t{ADFF2F}/addev\n{ADFF2F}» {FFFFFF}Delete All Vehicles\n{ADFF2F}» {FFFFFF}Manage a Showroom\n{ADFF2F}» {FFFFFF}Add a Showroom \t{ADFF2F}/addsr\n{ADFF2F}» {FFFFFF}Delete All Showrooms\n{ADFF2F}» {FFFFFF}Change Panel Password\n{ADFF2F}» {FFFFFF}Get ROOT Permission\n{ADFF2F}» {FFFFFF}About Evo Vehicle Ownership", "Select", "Close");
	    }else{
    		ShowPlayerDialog(playerid, DIALOG_EVO_PANELHOME, DIALOG_STYLE_LIST, "{ADFF2F}Evo Vehicle Ownership Administrating Panel",
							 "{ADFF2F}» {FFFFFF}Manage a Vehicle\n{ADFF2F}» {FFFFFF}Add a Vehicle \t{ADFF2F}/addev\n{ADFF2F}» {FFFFFF}Delete All Vehicles\n{ADFF2F}» {FFFFFF}Manage a Showroom\n{ADFF2F}» {FFFFFF}Add a Showroom \t{ADFF2F}/addsr\n{ADFF2F}» {FFFFFF}Delete All Showrooms\n{ADFF2F}» {FFFFFF}Change Panel Password\n{ADFF2F}» {FFFFFF}Get ROOT Permission\n{ADFF2F}» {FFFFFF}About Evo Vehicle Ownership", "Select", "Close");
	    }
	}
	
	if(dialogid == DIALOG_EVO_PANELABOUT)
	{
		ShowPlayerDialog(playerid, DIALOG_EVO_PANELHOME, DIALOG_STYLE_LIST, "{ADFF2F}Evo Vehicle Ownership Administrating Panel",
							 "{ADFF2F}» {FFFFFF}Manage a Vehicle\n{ADFF2F}» {FFFFFF}Add a Vehicle \t{ADFF2F}/addev\n{ADFF2F}» {FFFFFF}Delete All Vehicles\n{ADFF2F}» {FFFFFF}Manage a Showroom\n{ADFF2F}» {FFFFFF}Add a Showroom \t{ADFF2F}/addsr\n{ADFF2F}» {FFFFFF}Delete All Showrooms\n{ADFF2F}» {FFFFFF}Change Panel Password\n{ADFF2F}» {FFFFFF}Get ROOT Permission\n{ADFF2F}» {FFFFFF}About Evo Vehicle Ownership", "Select", "Close");
	}
	
	if(dialogid == DIALOG_EVO_PANELVEHID)
	{
	    if(response)
	    {
	        if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_EVO_PANELVEHID, DIALOG_STYLE_INPUT, "{ADFF2F}Manage a Vehicle", "{FFFFFF}Enter the vehicle's id that you want to manage in system:", "Manage", "Back");
			new id = strval(inputtext);
			SelectedEV[playerid] = id;
			
			if(EvoVehicles[id][EVExist] == 0) return ERROR(playerid, "Wrong Evo Vehicle ID"), ShowPlayerDialog(playerid, DIALOG_EVO_PANELVEHID, DIALOG_STYLE_INPUT, "{ADFF2F}Manage a Vehicle - ID", "{FFFFFF}Type ID of Vehicle That You want to Manage.", "Manage", "Back");

			INFO(playerid, "Select the information that you'll change and select \"Manage\"");
			
			ShowAdminEvPanel(playerid, SelectedEV[playerid]);
		}else{
    		ShowPlayerDialog(playerid, DIALOG_EVO_PANELHOME, DIALOG_STYLE_LIST, "{ADFF2F}Evo Vehicle Ownership Administrating Panel",
							 "{ADFF2F}» {FFFFFF}Manage a Vehicle\n{ADFF2F}» {FFFFFF}Add a Vehicle \t{ADFF2F}/addev\n{ADFF2F}» {FFFFFF}Delete All Vehicles\n{ADFF2F}» {FFFFFF}Manage a Showroom\n{ADFF2F}» {FFFFFF}Add a Showroom \t{ADFF2F}/addsr\n{ADFF2F}» {FFFFFF}Delete All Showrooms\n{ADFF2F}» {FFFFFF}Change Panel Password\n{ADFF2F}» {FFFFFF}Get ROOT Permission\n{ADFF2F}» {FFFFFF}About Evo Vehicle Ownership", "Select", "Close");
	    }
	}
	
	if(dialogid == DIALOG_EVO_PANELVEH)
	{
	    if(response)
	    {
			switch(listitem)
			{
			    case 0: // Model
			    {
			        ShowPlayerDialog(playerid, DIALOG_EVO_PANELVEH_MODEL, DIALOG_STYLE_INPUT, "{ADFF2F}Vehicle Model", "{FFFFFF}Select the new vehicle model id or name of selected vehicle:", "Change", "Back");
			    }

				case 1: // Owner
				{
			        ShowPlayerDialog(playerid, DIALOG_EVO_PANELVEH_OWNER, DIALOG_STYLE_INPUT, "{ADFF2F}Vehicle Owner", "{FFFFFF}Select the new owner of selected vehicle:", "Change", "Back");
				}
				
				case 2: // Color 1
				{
			        ShowPlayerDialog(playerid, DIALOG_EVO_PANELVEH_COL1, DIALOG_STYLE_INPUT, "{ADFF2F}Vehicle Color 1", "{FFFFFF}Select the new first color of selected vehicle:", "Change", "Back");
				}
				
				case 3: // Color 2
				{
			        ShowPlayerDialog(playerid, DIALOG_EVO_PANELVEH_COL2, DIALOG_STYLE_INPUT, "{ADFF2F}Vehicle Color 2", "{FFFFFF}Select the new second color of selected vehicle:", "Change", "Back");
				}
	
				case 4: // Price
				{
			        ShowPlayerDialog(playerid, DIALOG_EVO_PANELVEH_PRICE, DIALOG_STYLE_INPUT, "{ADFF2F}Vehicle Price", "{FFFFFF}Select the new price of selected vehicle:", "Change", "Back");
				}
				
				case 5: // Security
				{
			        ShowPlayerDialog(playerid, DIALOG_EVO_PANELVEH_SEC, DIALOG_STYLE_LIST, "{ADFF2F}Vehicle Security", "{FFFFFF}None\n{FFFFFF}Killing\n{FFFFFF}Slapping", "Change", "Back");
				}
				
				case 6: // Lock
				{
			        ShowPlayerDialog(playerid, DIALOG_EVO_PANELVEH_LOCK, DIALOG_STYLE_LIST, "{ADFF2F}Vehicle Lock", "{FFFFFF}Unlocked\n{FFFFFF}Locked", "Change", "Back");
				}
				
				case 7: // Plate
				{
			        ShowPlayerDialog(playerid, DIALOG_EVO_PANELVEH_PLATE, DIALOG_STYLE_INPUT, "{ADFF2F}Vehicle Plate", "{FFFFFF}Select the new plate of selected vehicle:", "Change", "Back");
				}
				
				case 8: // PJ
				{
			        ShowPlayerDialog(playerid, DIALOG_EVO_PANELVEH_PJ, DIALOG_STYLE_INPUT, "{ADFF2F}Vehicle Paintjob", "{FFFFFF}Select the new paintjob id of selected vehicle:", "Change", "Back");
				}
				
				case 9: // Get Vehicle
				{
				    new Float:pX, Float:pY, Float:pZ, Float:pRot;
				    GetPlayerPos(playerid, pX, pY, pZ);
				    GetPlayerFacingAngle(playerid, pRot);
				    
					pX += 5.0 * floatcos(pRot + 90, degrees);
					pY += 5.0 * floatsin(pRot + 90, degrees);
					
					SetVehiclePos(EvoVehicles[ SelectedEV[playerid] ][EVVehID], pX, pY, pZ);
					SetVehicleZAngle(EvoVehicles[ SelectedEV[playerid] ][EVVehID], pRot+90);

					INFO(playerid, "You got vehicle that you selected");

                    ShowAdminEvPanel(playerid, SelectedEV[playerid]);
				}
				
				case 10: // Delete Vehicle
				{
				    DeleteEvoVehicle(SelectedEV[playerid]);
					INFO(playerid, "You deleted vehicle that you selected from system");
					ShowPlayerDialog(playerid, DIALOG_EVO_PANELHOME, DIALOG_STYLE_LIST, "{ADFF2F}Evo Vehicle Ownership Administrating Panel",
							 "{ADFF2F}» {FFFFFF}Manage a Vehicle\n{ADFF2F}» {FFFFFF}Add a Vehicle \t{ADFF2F}/addev\n{ADFF2F}» {FFFFFF}Delete All Vehicles\n{ADFF2F}» {FFFFFF}Manage a Showroom\n{ADFF2F}» {FFFFFF}Add a Showroom \t{ADFF2F}/addsr\n{ADFF2F}» {FFFFFF}Delete All Showrooms\n{ADFF2F}» {FFFFFF}Change Panel Password\n{ADFF2F}» {FFFFFF}Get ROOT Permission\n{ADFF2F}» {FFFFFF}About Evo Vehicle Ownership", "Select", "Close");
				}
			}
	    }else{
    		ShowPlayerDialog(playerid, DIALOG_EVO_PANELHOME, DIALOG_STYLE_LIST, "{ADFF2F}Evo Vehicle Ownership Administrating Panel",
							 "{ADFF2F}» {FFFFFF}Manage a Vehicle\n{ADFF2F}» {FFFFFF}Add a Vehicle \t{ADFF2F}/addev\n{ADFF2F}» {FFFFFF}Delete All Vehicles\n{ADFF2F}» {FFFFFF}Manage a Showroom\n{ADFF2F}» {FFFFFF}Add a Showroom \t{ADFF2F}/addsr\n{ADFF2F}» {FFFFFF}Delete All Showrooms\n{ADFF2F}» {FFFFFF}Change Panel Password\n{ADFF2F}» {FFFFFF}Get ROOT Permission\n{ADFF2F}» {FFFFFF}About Evo Vehicle Ownership", "Select", "Close");
	    }
	}

	if(dialogid == DIALOG_EVO_PANELVEH_MODEL)
	{
	    if(response)
	    {
			if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_EVO_PANELVEH_MODEL, DIALOG_STYLE_INPUT, "{ADFF2F}Vehicle Model", "{FFFFFF}Select the new vehicle model id or name of selected vehicle:", "Change", "Back");
			new model;
			
			if(IsNumeric(inputtext))
			{
			    model = strval(inputtext);
			}else{
				model = GetVehicleModelIDFromName(inputtext);
			}
			
			if(model < 400 || model > 611) return ERROR(playerid, "Wrong vehicle model!"),ShowPlayerDialog(playerid, DIALOG_EVO_PANELVEH_MODEL, DIALOG_STYLE_INPUT, "{ADFF2F}Vehicle Model", "{FFFFFF}Select the new vehicle model id or name of selected vehicle:", "Change", "Back");


			new EvoVehicleID = SelectedEV[playerid];

			EvoVehicles[ EvoVehicleID][EVModel] = model;
   			DestroyVehicle( EvoVehicles[ EvoVehicleID ][EVVehID] );
      		VehInSystem[ EvoVehicles[ EvoVehicleID ][EVVehID]] = 0;

			EvoVehicles[ EvoVehicleID ][EVVehID] = CreateVehicle(EvoVehicles[ EvoVehicleID ][EVModel], EvoVehicles[ EvoVehicleID ][EVX], EvoVehicles[ EvoVehicleID ][EVY], EvoVehicles[ EvoVehicleID ][EVZ], EvoVehicles[ EvoVehicleID ][EVRot], EvoVehicles[ EvoVehicleID ][EVCol1], EvoVehicles[ EvoVehicleID ][EVCol2], -1);
			VehEVID[ EvoVehicles[ EvoVehicleID ][EVVehID] ] = EvoVehicleID;
			VehInSystem[ EvoVehicles[ EvoVehicleID ][EVVehID] ] = 1;
			SetVehicleNumberPlate(EvoVehicles[ EvoVehicleID ][EVVehID], EvoVehicles[ EvoVehicleID ][EVPlate]);
			SetVehicleToRespawn(EvoVehicles[ EvoVehicleID ][EVVehID]);
			LoadVehicleMod(EvoVehicleID);

			EvoVehicles[ SelectedEV[playerid] ][EVNeedSave] = 1;
			
			INFO(playerid, "Vehicle's model has been changed successfully");
			
        	ShowAdminEvPanel(playerid, SelectedEV[playerid]);
	    }else{
            ShowAdminEvPanel(playerid, SelectedEV[playerid]);
	    }
	}

	if(dialogid == DIALOG_EVO_PANELVEH_OWNER)
	{
	    if(response)
	    {
	        if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_EVO_PANELVEH_OWNER, DIALOG_STYLE_INPUT, "{ADFF2F}Vehicle Owner", "{FFFFFF}Select the new owner of selected vehicle:", "Change", "Back");
	        format(EvoVehicles[ SelectedEV[playerid] ][EVOwner], 40, inputtext);
	        
	        EvoVehicles[ SelectedEV[playerid] ][EVNeedSave] = 1;
	        
			INFO(playerid, "Vehicle's owner has been changed successfully");

            ShowAdminEvPanel(playerid, SelectedEV[playerid]);
	    }else{
			ShowAdminEvPanel(playerid, SelectedEV[playerid]);
		}
	}
	
	if(dialogid == DIALOG_EVO_PANELVEH_COL1)
	{
	    if(response)
	    {
	        if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_EVO_PANELVEH_COL1, DIALOG_STYLE_INPUT, "{ADFF2F}Vehicle Color 1", "{FFFFFF}Select the new first color of selected vehicle:", "Change", "Back");
	        new col = strval(inputtext);
	        
	        EvoVehicles[ SelectedEV[playerid] ][EVCol1] = col;
	        ChangeVehicleColor(EvoVehicles[ SelectedEV[playerid] ][EVVehID], EvoVehicles[ SelectedEV[playerid] ][EVCol1], EvoVehicles[ SelectedEV[playerid] ][EVCol2]);
	        
	        EvoVehicles[ SelectedEV[playerid] ][EVNeedSave] = 1;
	        
			INFO(playerid, "Vehicle's first color has been changed successfully");

            ShowAdminEvPanel(playerid, SelectedEV[playerid]);
	    }else{
			ShowAdminEvPanel(playerid, SelectedEV[playerid]);
		}
	}

	if(dialogid == DIALOG_EVO_PANELVEH_COL2)
	{
	    if(response)
	    {
	        if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_EVO_PANELVEH_COL2, DIALOG_STYLE_INPUT, "{ADFF2F}Vehicle Color 2", "{FFFFFF}Select the new second color of selected vehicle:", "Change", "Back");
	        new col = strval(inputtext);

	        EvoVehicles[ SelectedEV[playerid] ][EVCol2] = col;
	        ChangeVehicleColor(EvoVehicles[ SelectedEV[playerid] ][EVVehID], EvoVehicles[ SelectedEV[playerid] ][EVCol1], EvoVehicles[ SelectedEV[playerid] ][EVCol2]);

            EvoVehicles[ SelectedEV[playerid] ][EVNeedSave] = 1;
            
			INFO(playerid, "Vehicle's second color has been changed successfully");
			
			ShowAdminEvPanel(playerid, SelectedEV[playerid]);
	    }else{
	        ShowAdminEvPanel(playerid, SelectedEV[playerid]);
	    }
	}

	if(dialogid == DIALOG_EVO_PANELVEH_PRICE)
	{
	    if(response)
	    {
	        if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_EVO_PANELVEH_PRICE, DIALOG_STYLE_INPUT, "{ADFF2F}Vehicle Price", "{FFFFFF}Select the new price of selected vehicle:", "Change", "Back");
	        new price = strval(inputtext);

	        EvoVehicles[ SelectedEV[playerid] ][EVPrice] = price;

            EvoVehicles[ SelectedEV[playerid] ][EVNeedSave] = 1;
            
			INFO(playerid, "Vehicle's price has been changed successfully");
			
			ShowAdminEvPanel(playerid, SelectedEV[playerid]);
	    }else{
	        ShowAdminEvPanel(playerid, SelectedEV[playerid]);
	    }
	}

	if(dialogid == DIALOG_EVO_PANELVEH_SEC)
	{
	    if(response)
	    {
	        EvoVehicles[ SelectedEV[playerid] ][EVSecurity] = listitem;
	        
	        EvoVehicles[ SelectedEV[playerid] ][EVNeedSave] = 1;
	        
			INFO(playerid, "Vehicle's security system has been changed successfully");

            ShowAdminEvPanel(playerid, SelectedEV[playerid]);
	    }else{
            ShowAdminEvPanel(playerid, SelectedEV[playerid]);
	    }
	}

	if(dialogid == DIALOG_EVO_PANELVEH_LOCK)
	{
	    if(response)
	    {
	        EvoVehicles[ SelectedEV[playerid] ][EVLock] = listitem;
			LockEvoVehicle(SelectedEV[playerid], listitem);
			
            EvoVehicles[ SelectedEV[playerid] ][EVNeedSave] = 1;
            
			INFO(playerid, "Vehicle's lock state has been changed successfully");

            ShowAdminEvPanel(playerid, SelectedEV[playerid]);
	    }else{
            ShowAdminEvPanel(playerid, SelectedEV[playerid]);
	    }
	}

	if(dialogid == DIALOG_EVO_PANELVEH_PLATE)
	{
	    if(response)
	    {
	        if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_EVO_PANELVEH_PLATE, DIALOG_STYLE_INPUT, "{ADFF2F}Vehicle Plate", "{FFFFFF}Select the new plate of selected vehicle:", "Change", "Back");
	        format(EvoVehicles[ SelectedEV[playerid] ][EVPlate], 30, inputtext);
	        
	        SetVehicleNumberPlate(EvoVehicles[ SelectedEV[playerid] ][EVVehID], EvoVehicles[ SelectedEV[playerid] ][EVPlate]);
	        SetVehicleToRespawn(EvoVehicles[ SelectedEV[playerid] ][EVVehID]);

            EvoVehicles[ SelectedEV[playerid] ][EVNeedSave] = 1;
            
			INFO(playerid, "Vehicle's plate has been changed successfully");

            ShowAdminEvPanel(playerid, SelectedEV[playerid]);
	    }else{
			ShowAdminEvPanel(playerid, SelectedEV[playerid]);
		}
	}

	if(dialogid == DIALOG_EVO_PANELVEH_PJ)
	{
	    if(response)
	    {
	        if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_EVO_PANELVEH_PJ, DIALOG_STYLE_INPUT, "{ADFF2F}Vehicle Paintjob", "{FFFFFF}Select the new paintjob id of selected vehicle:", "Change", "Back");
	        EvoVehicles[ SelectedEV[playerid] ][EVPJ] = strval(inputtext);

	        ChangeVehiclePaintjob(EvoVehicles[ SelectedEV[playerid] ][EVVehID], EvoVehicles[ SelectedEV[playerid] ][EVPJ]);

            EvoVehicles[ SelectedEV[playerid] ][EVNeedSave] = 1;
            
			INFO(playerid, "Vehicle's paintjob has been changed successfully");

            ShowAdminEvPanel(playerid, SelectedEV[playerid]);
	    }else{
			ShowAdminEvPanel(playerid, SelectedEV[playerid]);
		}
	}

	// Player Vehicle Administrating
	if(dialogid == DIALOG_A_VEHLIST)
	{
		if(response)
		{
		    SelectedEV[playerid] = GetPlayerVehicleInSlot(playerid, listitem+1);

			ShowPlayerEVPanel(playerid, SelectedEV[playerid]);
		}
	}
	
	if(dialogid == DIALOG_A_HOME)
	{
		if(response)
		{
		    switch(listitem)
		    {
		        case 0: // Get Vehicle
		        {
		            new Float:pX, Float:pY, Float:pZ, Float:pRot;
		            GetPlayerPos(playerid, pX, pY, pZ);
		            GetPlayerFacingAngle(playerid, pRot);

		            pX += 5.0 * floatcos(pRot+90, degrees);
		            pY += 5.0 * floatsin(pRot+90, degrees);

		            SetVehiclePos(EvoVehicles[ SelectedEV[playerid] ][EVVehID], pX, pY, pZ);
					SetVehicleZAngle(EvoVehicles[ SelectedEV[playerid] ][EVVehID], pRot+90);

					INFO(playerid, "You got here your vehicle successfully");

					ShowPlayerEVPanel(playerid, SelectedEV[playerid]);
		        }
		        
		        case 1: // Sell Vehicle
		        {
		            GivePlayerMoney(playerid, EvoVehicles[ SelectedEV[playerid] ][EVPrice]);
		            format(EvoVehicles[ SelectedEV[playerid] ][EVOwner], 40, "-");
					EvoVehicles[ SelectedEV[playerid] ][EVNeedSave] = 1;

		            INFO(playerid, "You sold your vehicle successfully");

					new PEVCount = GetPlayerVehicleCount(playerid);

					if(PEVCount == 0) return 1;

					new DiaString[512], PEVID;

					for(new i; i < PEVCount; i++)
					{
						PEVID = GetPlayerVehicleInSlot(playerid, i+1);

						format(DiaString, 512, "%s{ADFF2F}%d# {FFFFFF}%s\n", DiaString, i+1, VehNames[ EvoVehicles[PEVID][EVModel]-400]);
					}

					ShowPlayerDialog(playerid, DIALOG_A_VEHLIST, DIALOG_STYLE_LIST, "{ADFF2F}My Vehicles", DiaString, "Manage", "Close");
		        }
		        
		        case 2: // Vehicle Lock
		        {
					switch(EvoVehicles[ SelectedEV[playerid] ][EVLock])
					{
					    case 0: EvoVehicles[ SelectedEV[playerid] ][EVLock] = 1;
					    case 1: EvoVehicles[ SelectedEV[playerid] ][EVLock] = 0;
					}
					
					LockEvoVehicle(SelectedEV[playerid], EvoVehicles[ SelectedEV[playerid] ][EVLock]);
					EvoVehicles[ SelectedEV[playerid] ][EVNeedSave] = 1;
					ShowPlayerEVPanel(playerid, SelectedEV[playerid]);
		        }
		        
		        case 3: // Vehicle Security
		        {
					if(EvoVehicles[ SelectedEV[playerid] ][EVSecurity] != 2)
					{
					    EvoVehicles[ SelectedEV[playerid] ][EVSecurity]++;
					}else{
					    EvoVehicles[ SelectedEV[playerid] ][EVSecurity] = 0;
					}
					
					EvoVehicles[ SelectedEV[playerid] ][EVNeedSave] = 1;
					ShowPlayerEVPanel(playerid, SelectedEV[playerid]);
		        }
		        
		        case 4: // Vehicle Plate
		        {
		            ShowPlayerDialog(playerid, DIALOG_A_PLATE, DIALOG_STYLE_INPUT, "{ADFF2F}Change Plate", "{FFFFFF}Select the new plate of your vehicle:", "Change", "Back");
		        }
		        
		        #if AUTOMATIC_PARK == false
				case 5: // Park Vehicle
				{
				    GetVehiclePos(EvoVehicles[ SelectedEV[playerid] ][EVVehID], EvoVehicles[ SelectedEV[playerid] ][EVX], EvoVehicles[ SelectedEV[playerid] ][EVY], EvoVehicles[ SelectedEV[playerid] ][EVZ]);
				    GetVehicleZAngle(EvoVehicles[ SelectedEV[playerid] ][EVVehID], EvoVehicles[ SelectedEV[playerid] ][EVRot]);
				    
				    EvoVehicles[ SelectedEV[playerid] ][EVNeedSave] = 1;
				    
				    INFO(playerid, "Your vehicle has been parked");
				    
				    ShowPlayerEVPanel(playerid, SelectedEV[playerid]);
				}
		        #endif
		    }
		}else{
			new PEVCount = GetPlayerVehicleCount(playerid);

			new DiaString[512], PEVID;

			for(new i; i < PEVCount; i++)
			{
				PEVID = GetPlayerVehicleInSlot(playerid, i+1);

				format(DiaString, 512, "%s{ADFF2F}%d# {FFFFFF}%s\n", DiaString, i+1, VehNames[ EvoVehicles[PEVID][EVModel]-400]);
			}

			ShowPlayerDialog(playerid, DIALOG_A_VEHLIST, DIALOG_STYLE_LIST, "{ADFF2F}My Vehicles", DiaString, "Manage", "Close");
		}
	}
	
	if(dialogid == DIALOG_A_PLATE)
	{
	    if(response)
	    {
	        if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_A_PLATE, DIALOG_STYLE_INPUT, "{ADFF2F}Change Plate", "{FFFFFF}Select the new plate of your vehicle:", "Change", "Back");
	        format(EvoVehicles[ SelectedEV[playerid] ][EVPlate], 30, inputtext);

			GetVehiclePos(EvoVehicles[ SelectedEV[playerid] ][EVVehID], EvoVehicles[ SelectedEV[playerid] ][EVX], EvoVehicles[ SelectedEV[playerid] ][EVY], EvoVehicles[ SelectedEV[playerid] ][EVZ]);
			GetVehicleZAngle(EvoVehicles[ SelectedEV[playerid] ][EVVehID], EvoVehicles[ SelectedEV[playerid] ][EVRot]);
			GetVehicleMod(SelectedEV[playerid]);
			
			SetVehicleNumberPlate(EvoVehicles[ SelectedEV[playerid] ][EVVehID], EvoVehicles[ SelectedEV[playerid] ][EVPlate]);
	        SetVehicleToRespawn(EvoVehicles[ SelectedEV[playerid] ][EVVehID]);

		    EvoVehicles[ SelectedEV[playerid] ][EVNeedSave] = 1;
            
	        INFO(playerid, "Vehicle's plate has been changed successfully");
	        
	        ShowPlayerEVPanel(playerid, SelectedEV[playerid]);
	    }else{
	        ShowPlayerEVPanel(playerid, SelectedEV[playerid]);
	    }
	}
	
	// Buying Evo Vehicle
	if(dialogid == DIALOG_BUY_VEHICLE)
	{
	    if(response)
	    {
	        new EVSystemID = VehEVID[ GetPlayerVehicleID(playerid) ];
	        
	        if(GetPlayerVehicleCount(playerid) == MAX_PLAYER_EVO_VEHICLE) return ERROR(playerid, "You have already reached owned vehicle limit");
	        if(GetPlayerMoney(playerid) < EvoVehicles[ EVSystemID ][EVPrice]) return ERROR(playerid, "You don't have enough money for buy this vehicle!");

			GivePlayerMoney(playerid, -EvoVehicles[ EVSystemID ][EVPrice]);
			format(EvoVehicles[ EVSystemID ][EVOwner], 40, GetName(playerid));
			EvoVehicles[ EVSystemID ][EVNeedSave] = 1;
			
	        new EVMessage[256];
	        format(EVMessage, 256, "{FFFFFF}You bought {ADFF2F}%s {FFFFFF}for {ADFF2F}%d $", VehNames[ EvoVehicles[ EVSystemID ][EVModel]-400 ], EvoVehicles[ EVSystemID ][EVPrice]);

			INFO(playerid, EVMessage);
			INFO(playerid, "You can write {ADFF2F}/myveh {FFFFFF}for manage your vehicles");
		}
	}
	
	// Buying Evo Vehicle From Showroom
	if(dialogid == DIALOG_SRVEH)
	{
	    if(response)
	    {
            new EVSystemID = VehEVID[ GetPlayerVehicleID(playerid) ];

	        if(GetPlayerVehicleCount(playerid) == MAX_PLAYER_EVO_VEHICLE) return ERROR(playerid, "You have already reached limit of the player vehicle"), RemovePlayerFromVehicle(playerid);
	        if(GetPlayerMoney(playerid) < EvoVehicles[ EVSystemID ][EVPrice]) return ERROR(playerid, "You don't have enough money for buy it!"), RemovePlayerFromVehicle(playerid);

			new DiaString[512];
			
			for(new i; i < sizeof(VehColors); i++)
			{
			    format(DiaString, 512, "%s{FFFFFF}%s\n", DiaString, VehColors[i][VCName]);
			}
			
			ShowPlayerDialog(playerid, DIALOG_SRVEH_COLOR, DIALOG_STYLE_LIST, "{ADFF2F}Vehicle Color", DiaString, "Select", "Cancel");
	    }else{
	        if(pInfo[playerid][pRoot] != 1) RemovePlayerFromVehicle(playerid);
	    }
	}
	
	if(dialogid == DIALOG_SRVEH_COLOR)
	{
	    if(response)
	    {
			new EVSystemID = VehEVID[ GetPlayerVehicleID(playerid) ];
			
			CreateEvoVehicle(EvoVehicles[ EVSystemID ][EVModel], GetName(playerid), Showrooms[ SelectedSR[playerid] ][SRX], Showrooms[ SelectedSR[playerid] ][SRY], Showrooms[ SelectedSR[playerid] ][SRZ], 0, VehColors[listitem][VCColor], VehColors[listitem][VCColor], EvoVehicles[ EVSystemID ][EVPrice]);
			GivePlayerMoney(playerid, -EvoVehicles[ EVSystemID ][EVPrice]);
			
			INFO(playerid, "Congratulations! You bought a new vehicle");
			INFO(playerid, "You can enter your vehicle in front of showroom");
			INFO(playerid, "You can use /myveh command for manage your vehicles");
			
			RemovePlayerFromVehicle(playerid);
	    }else{
	        if(pInfo[playerid][pRoot] != 1) RemovePlayerFromVehicle(playerid);
	    }
	}
	return 1;
}

// =============================[SYSTEM PUBLICS]============================= //
// For System
// - LoadEVO
public LoadEVO(name[], value[])
{
	INI_String("PANELPASS", EVOPanelPass, 150);
	INI_Int("LASTVEHICLEID", LastEvoVehicleID);
	INI_Int("LASTSHOWROOMID", LastShowroomID);
	return 1;
}


// - SaveEVO
public SaveEVO()
{
	new EVFileName[35];
	format(EVFileName, 35, "%s/options.ini", EVOVEHICLE_MAIN_DIR);

	new INI:EvoFile = INI_Open(EVFileName);

	INI_WriteString(EvoFile, "PANELPASS", EVOPanelPass);
	INI_WriteInt(EvoFile, "LASTVEHICLEID", LastEvoVehicleID);
	INI_WriteInt(EvoFile, "LASTSHOWROOMID", LastShowroomID);

	INI_Close(EvoFile);
}

// Evo Vehicle Version Controller
// - EvoVehicle_Init
public EvoVehicle_Init(index, response_code, data[])
{
	printf("<========================================>");
	printf("                                          ");
	printf("      <Evo Script Version Controller>     ");
	printf("         <Evo Vehicle Ownership>          ");
	printf("                                          ");

	printf("            Installed Version             ");
	printf("                  %s                      ", VERSION);
	printf("                                          ");
	printf("              Last Version                ");
	printf("                  %s                      ", data);
	printf("                                          ");

	if(response_code == 200)
    {
        if(!strcmp(data, VERSION, true))
        {
            printf("           Your EVO is actual           ");
        }else{
  			printf("             Your EVO is old            ");
			printf("                                          ");
			printf("     Download the new version of EVO     ");
			printf("         From Topic in Forum-SAMP        ");
        }
    }else{
		printf("                ERROR                     ");
		printf("        We couldn't get response          ");
		printf("             From Website                 ");
		printf("                                          ");
		printf("             EXPLANATION                  ");
		printf("       %s", ConnectionErrors[response_code]);
    }

	printf("                                          ");
	printf("<========================================>");
}

// - EvoVehicle_InGame
public EvoVehicle_InGame(index, response_code, data[])
{
	new String[512];

    if(response_code == 200)
    {
        format(String, 512, "{FFFFFF}Installed Version \t{ADFF2F}%s\n{FFFFFF}Last Version \t{ADFF2F}%s\n \n", VERSION, data);

        if(!strcmp(data, VERSION, true))
        {
            format(String, 512, "%s{FFFFFF}Your Evo Vehicle Ownership is actual", String);
        }else{
            format(String, 512, "%s{FFFFFF}Your Evo Vehicle Ownership is old\nDownload the new version of EVO from topic in Forum-SAMP", String);
        }

        ShowPlayerDialog(index, 9999, DIALOG_STYLE_MSGBOX, "{ADFF2F}Evo Script Version Controller", String, "Close", "");
    }else{
        format(String, 512, "{FF0000}We couldn't get response from website!\n \n{FF0000}%s", ConnectionErrors[response_code]);

	    ShowPlayerDialog(index, 9999, DIALOG_STYLE_MSGBOX, "{ADFF2F}Evo Script Version Controller", String, "Close", "");
    }
}

// For Evo Vehicles
// - CreateEvoVehicle
public CreateEvoVehicle(Modelid, Owner[], Float:X, Float:Y, Float:Z, Float:Rot, Col1, Col2, Price)
{
	new CreatedID;
	
	CreatedID = GetEmptyEvoVehicleID();
	
	Iter_Add(EVs, CreatedID);
	LastEvoVehicleID = Iter_Last(EVs)+1;
	
	EvoVehicles[CreatedID][EVModel] = Modelid;
	format(EvoVehicles[CreatedID][EVOwner], 40, Owner);
	EvoVehicles[CreatedID][EVX] = X;
	EvoVehicles[CreatedID][EVY] = Y;
	EvoVehicles[CreatedID][EVZ] = Z;
	EvoVehicles[CreatedID][EVRot] = Rot;
	EvoVehicles[CreatedID][EVCol1] = Col1;
	EvoVehicles[CreatedID][EVCol2] = Col2;
	EvoVehicles[CreatedID][EVPrice] = Price;
	EvoVehicles[CreatedID][EVSecurity] = 0;
	EvoVehicles[CreatedID][EVLock] = 0;
	format(EvoVehicles[CreatedID][EVPlate], 30, Owner);
	EvoVehicles[CreatedID][EVPJ] = -1;
	EvoVehicles[CreatedID][EVExist] = 1;

	EvoVehicles[CreatedID][EVVehID] = CreateVehicle(Modelid, X, Y, Z, Rot, Col1, Col2, -1);
	VehEVID[ EvoVehicles[CreatedID][EVVehID] ] = CreatedID;
	VehInSystem[ EvoVehicles[CreatedID][EVVehID] ] = 1;
	SetVehicleNumberPlate(EvoVehicles[CreatedID][EVVehID], Owner);
	SetVehicleToRespawn(EvoVehicles[CreatedID][EVVehID]);
	
	new FileName[35];
	format(FileName, 35, "%s/Vehicle_%d.ini", EVOVEHICLE_VEHICLE_DIR, CreatedID);
	
	new INI:VehFile = INI_Open(FileName);
	
	INI_SetTag(VehFile, "evo");
	
	INI_WriteInt(VehFile, "MODEL", Modelid);
	INI_WriteString(VehFile, "OWNER", Owner);
	INI_WriteFloat(VehFile, "X", X);
	INI_WriteFloat(VehFile, "Y", Y);
	INI_WriteFloat(VehFile, "Z", Z);
	INI_WriteFloat(VehFile, "ROT", Rot);
	INI_WriteInt(VehFile, "COL1", Col1);
	INI_WriteInt(VehFile, "COL2", Col2);
	INI_WriteInt(VehFile, "PRICE", Price);
	INI_WriteInt(VehFile, "SECURITY", 0);
	INI_WriteInt(VehFile, "LOCK", 0);
	INI_WriteString(VehFile, "PLATE", Owner);
	INI_WriteInt(VehFile, "PJ", -1);
	SaveAllVehicleComponentsToFile(VehFile, CreatedID);
	
	INI_Close(VehFile);
	
	return CreatedID;
}

// - DeleteEvoVehicle
public DeleteEvoVehicle(vehicleid)
{
	EvoVehicles[vehicleid][EVExist] = 0;
	DestroyVehicle(EvoVehicles[vehicleid][EVVehID]);
	VehInSystem[ EvoVehicles[vehicleid][EVVehID] ] = 0;
	
	Iter_Remove(EVs, vehicleid);
	LastEvoVehicleID = Iter_Last(EVs)+1;

	new FileName[35];
	format(FileName, 35, "%s/Vehicle_%d.ini", EVOVEHICLE_VEHICLE_DIR, vehicleid);
	fremove(FileName);
	return 1;
}

// - LoadEvoVehicles
public LoadEvoVehicles()
{
	new EVFileName[35], Loadedcount;

	for(new i = LastLoaded; i < LastEvoVehicleID; i++)
	{
		format(EVFileName, 35, "%s/Vehicle_%d.ini", EVOVEHICLE_VEHICLE_DIR, i);

		if(fexist(EVFileName))
		{
		    INI_ParseFile(EVFileName, "LoadEvoVehicle_%s", .bExtra = true, .extra = i);
		    
		    Iter_Add(EVs, i);
		    
	    	EvoVehicles[i][EVVehID] = CreateVehicle(EvoVehicles[i][EVModel], EvoVehicles[i][EVX], EvoVehicles[i][EVY], EvoVehicles[i][EVZ], EvoVehicles[i][EVRot], EvoVehicles[i][EVCol1], EvoVehicles[i][EVCol2], -1);
			VehEVID[ EvoVehicles[i][EVVehID] ] = i;
			VehInSystem[ EvoVehicles[i][EVVehID] ] = 1;
			SetVehicleNumberPlate(EvoVehicles[i][EVVehID], EvoVehicles[i][EVPlate]);
			SetVehicleToRespawn(EvoVehicles[i][EVVehID]);

			LoadVehicleMod(i);
			
			Loadedcount++;
			
			if(Loadedcount == 50)
			{
				LastLoaded = i+1;
				SetTimer("LoadEvoVehicles", 10000, 0);
				break;
			}
		}
		
		if(i == LastEvoVehicleID-1)
		{
			LastLoaded = 0;
			break;
		}
	}

}

// - LoadEvoVehicle_evo
public LoadEvoVehicle_evo(EvoVehicleID, name[], value[])
{
	INI_Int("MODEL", EvoVehicles[ EvoVehicleID ][EVModel]);
	INI_String("OWNER", EvoVehicles[ EvoVehicleID ][EVOwner], 40);
	INI_Float("X", EvoVehicles[ EvoVehicleID ][EVX]);
	INI_Float("Y", EvoVehicles[ EvoVehicleID ][EVY]);
	INI_Float("Z", EvoVehicles[ EvoVehicleID ][EVZ]);
	INI_Float("ROT", EvoVehicles[ EvoVehicleID ][EVRot]);
	INI_Int("COL1", EvoVehicles[ EvoVehicleID ][EVCol1]);
	INI_Int("COL2", EvoVehicles[ EvoVehicleID ][EVCol2]);
	INI_Int("PRICE", EvoVehicles[ EvoVehicleID ][EVPrice]);
	INI_Int("SECURITY", EvoVehicles[ EvoVehicleID ][EVSecurity]);
	INI_Int("LOCK", EvoVehicles[ EvoVehicleID ][EVLock]);
	INI_String("PLATE", EvoVehicles[ EvoVehicleID ][EVPlate], 30);
	INI_Int("PJ", EvoVehicles[ EvoVehicleID ][EVPJ]);
	EvoVehicles[ EvoVehicleID ][EVExist] = 1;
	LoadAllVehicleComponents(EvoVehicleID, name, value);
	return 1;
}

// - SaveEvoVehicles
public SaveEvoVehicles(last)
{
	new EVFileName[35], INI:VehFile, SavedCount;
	Unloading = last;

	new Float:NewX, Float:NewY, Float:NewZ, Float:NewRot;

	for(new i = LastSaved; i < LastEvoVehicleID; i++)
	{
		if(EvoVehicles[i][EVExist] == 1)
		{
		    #if AUTOMATIC_PARK == true

			GetVehiclePos(EvoVehicles[i][EVVehID], NewX, NewY, NewZ);
			GetVehicleZAngle(EvoVehicles[i][EVVehID], NewRot);

			if(NewX != EvoVehicles[i][EVX] || NewY != EvoVehicles[i][EVY] || NewZ != EvoVehicles[i][EVZ] || NewRot != EvoVehicles[i][EVRot]) EvoVehicles[i][EVNeedSave] = 1;

			#else

			GetVehiclePos(EvoVehicles[i][EVVehID], NewX, NewY, NewZ);
			GetVehicleZAngle(EvoVehicles[i][EVVehID], NewRot);

			if((!strcmp("-", EvoVehicles[i][EVOwner], true) || !strfind(EvoVehicles[i][EVOwner], "Galeri", true)) ) && ( NewX != EvoVehicles[i][EVX] || NewY != EvoVehicles[i][EVY] || NewZ != EvoVehicles[i][EVZ] || NewRot != EvoVehicles[i][EVRot] )) EvoVehicles[i][EVNeedSave] = 1;

			#endif
			
			if(EvoVehicles[i][EVNeedSave] == 1)
		    {
		        if(SavedCount == 10 && Unloading == 0)
		        {
		            LastSaved = i;
		            SetTimer("SaveEvoVehicles", 5000, 0);
		            break;
		        }
		        
		    	format(EVFileName, 35, "%s/Vehicle_%d.ini", EVOVEHICLE_VEHICLE_DIR, i);
		    
				VehFile = INI_Open(EVFileName);
				
				INI_SetTag(VehFile, "evo");
				
				INI_WriteInt(VehFile, "MODEL", EvoVehicles[i][EVModel]);
				INI_WriteString(VehFile, "OWNER", EvoVehicles[i][EVOwner]);
				INI_WriteFloat(VehFile, "X", EvoVehicles[i][EVX]);
				INI_WriteFloat(VehFile, "Y", EvoVehicles[i][EVY]);
				INI_WriteFloat(VehFile, "Z", EvoVehicles[i][EVZ]);
				INI_WriteFloat(VehFile, "ROT", EvoVehicles[i][EVRot]);
				INI_WriteInt(VehFile, "COL1", EvoVehicles[i][EVCol1]);
				INI_WriteInt(VehFile, "COL2", EvoVehicles[i][EVCol2]);
				INI_WriteInt(VehFile, "PRICE", EvoVehicles[i][EVPrice]);
				INI_WriteInt(VehFile, "SECURITY", EvoVehicles[i][EVSecurity]);
				INI_WriteInt(VehFile, "LOCK", EvoVehicles[i][EVLock]);
				INI_WriteString(VehFile, "PLATE", EvoVehicles[i][EVPlate]);
				INI_WriteInt(VehFile, "PJ", EvoVehicles[i][EVPJ]);
				SaveAllVehicleComponentsToFile(VehFile, i);

				INI_Close(VehFile);
				
				SavedCount++;
		    }
		}
		
		if(i == LastEvoVehicleID-1)
		{
		    LastSaved = 0;
		    break;
		}
	}
}

// For Showroom
// - CreateShowroom
public CreateShowroom(Name[], Float:X, Float:Y, Float:Z)
{
	new CreatedID = GetEmptyShowroomID();

	Iter_Add(SRs, CreatedID);
	LastShowroomID = Iter_Last(SRs)+1;

	format(Showrooms[CreatedID][SRName], 100, Name);
	Showrooms[CreatedID][SRX] = X;
	Showrooms[CreatedID][SRY] = Y;
	Showrooms[CreatedID][SRZ] = Z;
	Showrooms[CreatedID][SRExist] = 1;

	Showrooms[CreatedID][SRPick] = CreatePickup(1239, 1, X, Y, Z, 0);

	new String[128];
	format(String, 128, "{ADFF2F}SHOWROOM\n{ADFF2F}%s\n{FFFFFF}Showroom ID {ADFF2F}%d", Showrooms[CreatedID][SRName], CreatedID);
	Showrooms[CreatedID][SR3D] = Create3DTextLabel(String, -1, X, Y, Z, 25.0, 0);
	
	new FileName[35];
	format(FileName, 35, "%s/Showroom_%d.ini", EVOVEHICLE_SHOWROOM_DIR, CreatedID);

	new INI:SRFile = INI_Open(FileName);

	INI_SetTag(SRFile, "evo");

	INI_WriteString(SRFile, "NAME", Name);
	INI_WriteFloat(SRFile, "X", X);
	INI_WriteFloat(SRFile, "Y", Y);
	INI_WriteFloat(SRFile, "Z", Z);

	INI_Close(SRFile);

	return CreatedID;
}

// - DeleteShowroom
public DeleteShowroom(showroomid)
{
	Showrooms[showroomid][SRExist] = 0;
	DestroyPickup(Showrooms[showroomid][SRPick]);
	Delete3DTextLabel(Showrooms[showroomid][SR3D]);

	Iter_Remove(SRs, showroomid);
	LastShowroomID = Iter_Last(SRs)+1;

	new FileName[35];
	format(FileName, 35, "%s/Showroom_%d.ini", EVOVEHICLE_SHOWROOM_DIR, showroomid);
	fremove(FileName);
}

// - LoadShowrooms
public LoadShowrooms()
{
	new SRFileName[35], Loadedcount, String[128];
	
	for(new i = LastLoadedSR; i < LastShowroomID; i++)
	{
		format(SRFileName, 35, "%s/Galeri_%d.ini", EVOVEHICLE_SHOWROOM_DIR, i);

		if(fexist(SRFileName))
		{
		    INI_ParseFile(SRFileName, "LoadShowroom_%s", .bExtra = true, .extra = i);

			Showrooms[i][SRPick] = CreatePickup(1239, 1, Showrooms[i][SRX], Showrooms[i][SRY], Showrooms[i][SRZ], 0);

			format(String, 128, "{ADFF2F}SHOWROOM\n{ADFF2F}%s\n{FFFFFF}Showroom ID {ADFF2F}%d", Showrooms[i][SRName], i);
			Showrooms[i][SR3D] = Create3DTextLabel(String, -1, Showrooms[i][SRX], Showrooms[i][SRY], Showrooms[i][SRZ], 25.0, 0);

            Showrooms[i][SRExist] = 1;
            
			Loadedcount++;

			if(Loadedcount == 50)
			{
				LastLoadedSR = i+1;
				SetTimer("LoadShowrooms", 10000, 0);
				break;
			}
		}

		if(i == LastShowroomID-1)
		{
			LastLoadedSR = 0;
			break;
		}
	}
}

// - LoadShowroom_evo
public LoadShowroom_evo(ShowroomID, name[], value[])
{
	INI_String("NAME", Showrooms[ ShowroomID ][SRName], 100);
	INI_Float("X", Showrooms[ ShowroomID ][SRX]);
	INI_Float("Y", Showrooms[ ShowroomID ][SRY]);
	INI_Float("Z", Showrooms[ ShowroomID ][SRZ]);
	Showrooms[ ShowroomID ][SRExist] = 1;
	return 1;
}

// - Save Showrooms
public SaveShowrooms(last)
{
	new SRFileName[35], INI:SRFile, SavedCount;
	Unloading = last;
	
	for(new i = LastSavedSR; i < LastShowroomID; i++)
	{
		if(Showrooms[i][SRExist] == 1)
		{
			if(Showrooms[i][SRNeedSave] == 1)
		    {
		        if(SavedCount == 10 && Unloading == 0)
		        {
		            LastSavedSR = i;
		            SetTimer("SaveShowrooms", 5000, 0);
		            break;
		        }

		    	format(SRFileName, 35, "%s/Showroom_%d.ini", EVOVEHICLE_SHOWROOM_DIR, i);

				SRFile = INI_Open(SRFileName);

				INI_SetTag(SRFile, "evo");

				INI_WriteString(SRFile, "NAME", Showrooms[i][SRName]);
				INI_WriteFloat(SRFile, "X", Showrooms[i][SRX]);
				INI_WriteFloat(SRFile, "Y", Showrooms[i][SRY]);
				INI_WriteFloat(SRFile, "Z", Showrooms[i][SRZ]);

				INI_Close(SRFile);

				SavedCount++;
		    }
		}

		if(i == LastShowroomID-1)
		{
		    LastSavedSR = 0;
		    break;
		}
	}
}
Reply
#59

Quote:
Originally Posted by Dishonored
Посмотреть сообщение
Hello,
I just downloaded Evo Vehicle Manage and i modified just 3 values:
#define AUTOMATIC_PARK false
#define MAX_EVO_VEHICLE 5000
#define MAX_PLAYER_EVO_VEHICLE 30

I receive a lot of errors (10). Please compile it for me.. thanks!

Код:
/*
================================================================================

                          Evo Vehicle Ownership
                                  IX.3
                               Essentials
                      By Exertion ( A.K.A "EvoturK" )

                            Copyright © 2011

================================================================================

						 	  EvoENGINE 3.0
                     Performanced Evo Script Engine

================================================================================
*/

// =============================[INCLUDES]=================================== //
#include <a_samp>               // SA:MP    Include By SA:MP Team
#include <EvoVehicle>           // I-Sync   Include By Exertion
#include <zcmd>                 // ZCMD     Include By ZeeX
#include <YSI\y_ini>            // Y_INI    Include By ******
#include <YSI\y_timers>         // Y_TIMERS Include By ******
#include <foreach>              // Foreach  Include By ******

// =============================[DEFINES]==================================== //
// Defining it as Filter Script
#define FILTERSCRIPT

// System Version Number
#define VERSION                                           "9.3"

// System Options
#define MAX_EVO_VEHICLE                                   200
#define MAX_PLAYER_EVO_VEHICLE                            10

#define MAX_SHOWROOM                                      20

#define AUTOMATIC_PARK                                    true

// System Dirs
#define EVOVEHICLE_MAIN_DIR                               "EVO"
#define EVOVEHICLE_VEHICLE_DIR                            "EVO/Vehicles"
#define EVOVEHICLE_SHOWROOM_DIR                           "EVO/Showrooms"

// System Dialogs
// - Normal Vehicle Buying
#define DIALOG_BUY_VEHICLE                                1600

// - EVO Admin Panel
#define DIALOG_EVO_PANELPASS                              1601
#define DIALOG_EVO_PANELHOME                              1602
#define DIALOG_EVO_PANELVEHID                             1603
#define DIALOG_EVO_PANELCPASS                             1604
#define DIALOG_EVO_PANELABOUT                             1605

// - Vehicle Management in Admin Panel
#define DIALOG_EVO_PANELVEH                               1606
#define DIALOG_EVO_PANELVEH_MODEL                         1607
#define DIALOG_EVO_PANELVEH_OWNER                         1608
#define DIALOG_EVO_PANELVEH_COL1                          1609
#define DIALOG_EVO_PANELVEH_COL2                          1610
#define DIALOG_EVO_PANELVEH_PRICE                         1611
#define DIALOG_EVO_PANELVEH_SEC                           1612
#define DIALOG_EVO_PANELVEH_LOCK                          1613
#define DIALOG_EVO_PANELVEH_PLATE                         1614
#define DIALOG_EVO_PANELVEH_PJ                            1615

// - Add Evo Vehicle in Admin Panel
#define DIALOG_EVO_PANELNEW_MODEL                         1616
#define DIALOG_EVO_PANELNEW_PRICE                         1617
#define DIALOG_EVO_PANELNEW_COL1                          1618
#define DIALOG_EVO_PANELNEW_COL2                          1619

// - Add Showroom in Admin Panel
#define DIALOG_EVO_PANELNSR_NAME                          1620

// - Showroom Management in Admin Panel
#define DIALOG_EVO_PANELSRID                              1621
#define DIALOG_EVO_PANELSR                                1622
#define DIALOG_EVO_PANELSR_NAME                           1623

// - Player Evo Vehicle Management
#define DIALOG_A_HOME                                     1624
#define DIALOG_A_VEHLIST                                  1625
#define DIALOG_A_PLATE                                    1626

// - Buying Vehicle from Showroom
#define DIALOG_SRVEH                                      1627
#define DIALOG_SRVEH_COLOR                                1628

// ============================[FORWARDS]==================================== //
// For System
forward LoadEVO(name[], value[]);
forward SaveEVO();

// For Evo Script Version Controller
forward EvoVehicle_Init(index, response_code, data[]);
forward EvoVehicle_InGame(index, response_code, data[]);

// For Vehicle
forward CreateEvoVehicle(Modelid, Owner[], Float:X, Float:Y, Float:Z, Float:Rot, Col1, Col2, Price);
forward DeleteEvoVehicle(vehicleid);
forward LoadEvoVehicles();
forward LoadEvoVehicle_evo(EvoVehicleID, name[], value[]);
forward SaveEvoVehicles(last);

// For Showroom
forward CreateShowroom(Name[], Float:X, Float:Y, Float:Z);
forward DeleteShowroom(showroomid);
forward LoadShowrooms();
forward LoadShowroom_evo(ShowroomID, name[], value[]);
forward SaveShowrooms(last);

// ===========================[VARIABLES]==================================== //
// For System
new EVOPanelPass[150];

new Unloading;

new LastEvoVehicleID,
	LastSaved,
	LastLoaded;

new LastShowroomID,
	LastSavedSR,
	LastLoadedSR;
	
// For Players
enum pInfos
{
pRoot
};

new pInfo[MAX_PLAYERS][pInfos];

new SelectedEV[MAX_PLAYERS];

new SelectedModel[MAX_PLAYERS];
new SelectedPrice[MAX_PLAYERS];
new SelectedCol1[MAX_PLAYERS];
new SelectedCol2[MAX_PLAYERS];

new SelectedSR[MAX_PLAYERS];
new SelectedName[MAX_PLAYERS][100];

// For Vehicles
new Iterator:EVs<MAX_EVO_VEHICLE>;

enum EvoVehicleInfos
{
	EVModel,
	EVOwner[40],
	Float:EVX,
	Float:EVY,
	Float:EVZ,
	Float:EVRot,
	EVCol1,
	EVCol2,
	EVPrice,
	EVSecurity,
	EVLock,
	EVPlate[30],
	EVPJ,
	EVVehID,
	EVExist,
	EVNeedSave
};

new EvoVehicles[MAX_EVO_VEHICLE][EvoVehicleInfos];

new EvoVehicleComponent[MAX_EVO_VEHICLE][14];

new VehEVID[MAX_VEHICLES];
new VehInSystem[MAX_VEHICLES];

// For Showrooms
new Iterator:SRs<MAX_SHOWROOM>;

enum ShowroomInfos
{
	SRName[100],
	Float:SRX,
	Float:SRY,
	Float:SRZ,
	SRExist,
	SRNeedSave,
	SRPick,
	Text3D:SR3D
};

new Showrooms[MAX_SHOWROOM][ShowroomInfos];

// Vehicle Colors
enum VehColorInfos
{
	VCName[40],
	VCColor
};

new VehColors[13][VehColorInfos]={
{"White", 1},
{"Gray", 157},
{"Black", 0},
{"Red", 3},
{"Green Yellow", 145},
{"Green", 154},
{"Yellow", 194},
{"Dodger Blue", 152},
{"Dark Blue", 223},
{"Light Blue", 166},
{"Turquoise", 163},
{"Orange", 158},
{"Purple", 211}
};

// Vehicle Names
new VehNames[][] =
{
    "Landstalker", "Bravura", "Buffalo", "Linerunner", "Perrenial", "Sentinel",
	"Dumper", "Firetruck", "Trashmaster", "Stretch", "Manana", "Infernus",
	"Voodoo", "Pony", "Mule", "Cheetah", "Ambulance", "Leviathan", "Moonbeam",
    "Esperanto", "Taxi", "Washington", "Bobcat", "Whoopee", "BFInjection",
	"Hunter", "Premier", "Enforcer", "Securicar", "Banshee", "Predator", "Bus",
	"Rhino", "Barracks", "Hotknife", "Trailer", "Previon", "Coach", "Cabbie",
	"Stallion", "Rumpo", "RC Bandit", "Romero", "Packer", "Monster", "Admiral",
	"Squalo", "Seasparrow", "Pizzaboy", "Tram", "Trailer", "Turismo", "Speeder",
	"Reefer", "Tropic", "Flatbed", "Yankee", "Caddy", "Solair", "BerkleysRCVan",
	"Skimmer", "PCJ-600", "Faggio", "Freeway", "RCBaron", "RCRaider", "Glendale",
	"Oceanic","Sanchez", "Sparrow", "Patriot", "Quad", "Coastguard", "Dinghy",
	"Hermes", "Sabre", "Rustler", "ZR-350", "Walton", "Regina", "Comet", "BMX",
	"Burrito", "Camper", "Marquis", "Baggage", "Dozer", "Maverick", "NewsChopper",
	"Rancher", "FBI Rancher", "Virgo", "Greenwood", "Jetmax", "Hotring", "Sandking",
	"BlistaCompact", "PoliceMaverick", "Boxvillde", "Benson", "Mesa", "RCGoblin",
	"HotringRacerA", "HotringRacerB", "BloodringBanger", "Rancher", "SuperGT",
	"Elegant", "Journey", "Bike", "MountainBike", "Beagle", "Cropduster", "Stunt",
 	"Tanker", "Roadtrain", "Nebula", "Majestic", "Buccaneer", "Shamal", "Hydra",
 	"FCR-900", "NRG-500", "HPV1000", "CementTruck", "TowTruck", "Fortune",
 	"Cadrona", "FBITruck", "Willard", "Forklift", "Tractor", "Combine", "Feltzer",
 	"Remington", "Slamvan", "Blade", "Freight", "Streak", "Vortex", "Vincent",
    "Bullet", "Clover", "Sadler", "Firetruck", "Hustler", "Intruder", "Primo",
	"Cargobob", "Tampa", "Sunrise", "Merit", "Utility", "Nevada", "Yosemite",
	"Windsor", "Monster", "Monster", "Uranus", "Jester", "Sultan", "Stratium",
	"Elegy", "Raindance", "RCTiger", "Flash", "Tahoma", "Savanna", "Bandito",
    "FreightFlat", "StreakCarriage", "Kart", "Mower", "Dune", "Sweeper",
	"Broadway", "Tornado", "AT-400", "DFT-30", "Huntley", "Stafford", "BF-400",
	"News Van", "Tug", "Trailer", "Emperor", "Wayfarer", "Euros", "Hotdog", "Club",
	"FreightBox", "Trailer", "Andromada", "Dodo", "RC Cam", "Launch", "LSPD",
 	"SFPD", "LVPD", "PoliceRanger", "Picador", "S.W.A.T", "Alpha",
 	"Phoenix", "Glendale", "Sadler", "Luggage", "Luggage", "Stairs", "Boxville",
 	"Tiller", "UtilityTrailer"
};

// Vehicle State Names
new LockInfos[2][30]={"Unlocked", "Locked"};
new SecurityInfos[3][40]={"None", "Killing", "Slapping"};

// Connection Errors
new ConnectionErrors[6][40]=
{
"Wrong Website",
"No Socket",
"Couldn't Connect",
"Couldn't Write",
"String Too Long",
"Wait Some Seconds"
};

// ================================[TIMERS]================================== //
task SaveEvoVehicleSystem[150000]()
{
	SaveEVO();
	SaveEvoVehicles(0);
	SaveShowrooms(0);
}

// ==============================[FUNCTIONS]================================= //
// Message Functions
// - Info
INFO(playerid, msg[])
{
	new msg2[512];
	format(msg2, 512, "{ADFF2F}« ! » {FFFFFF}%s", msg);
	return SendClientMessage(playerid, -1, msg2);
}

// - Error
ERROR(playerid, msg[])
{
	new msg2[512];
	format(msg2, 512, "{FF3030}« ! » {FFFFFF}%s", msg);
	return SendClientMessage(playerid, -1, msg2);
}

// - Usage
USAGE(playerid, msg[])
{
	new msg2[512];
	format(msg2, 512, "{FFFFFF}« USAGE » %s", msg);
	return SendClientMessage(playerid, -1, msg2);
}

// Essential Functions
// - GetName
GetName(playerid)
{
	new Name[40];
	GetPlayerName(playerid, Name, 40);
	return Name;
}

// - IsNumeric
IsNumeric(string[])
{
	for (new i = 0, j = strlen(string);
	i < j; i++)
	{
	if (string[i] > '9' || string[i] < '0')
	return 0;
	}
	return 1;
}

// - Strtok
strtok(const string[], &index)
{
	new length = strlen(string);
	while ((index < length) && (string[index] <= ' '))
	{
		index++;
	}

	new offset = index;
	new result[20];
	while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
	{
		result[index - offset] = string[index];
		index++;
	}
	result[index - offset] = EOS;
	return result;
}

// - Strrest
strrest(const string[], &index)
{
	new length = strlen(string);
	while ((index < length) && (string[index] <= ' '))
	{
		index++;
	}
	new offset = index;
	new result[128];
	while ((index < length) && ((index - offset) < (sizeof(result) - 1)))
	{
		result[index - offset] = string[index];
		index++;
	}
	result[index - offset] = EOS;
	return result;
}

// - SSCANF
stock sscanf(string[], format[], {Float,_}:...)
{
	#if defined isnull
		if (isnull(string))
	#else
		if (string[0] == 0 || (string[0] == 1 && string[1] == 0))
	#endif
		{
			return format[0];
		}
	#pragma tabsize 4
	new
		formatPos = 0,
		stringPos = 0,
		paramPos = 2,
		paramCount = numargs(),
		delim = ' ';
	while (string[stringPos] && string[stringPos] <= ' ')
	{
		stringPos++;
	}
	while (paramPos < paramCount && string[stringPos])
	{
		switch (format[formatPos++])
		{
			case '\0':
			{
				return 0;
			}
			case 'i', 'd':
			{
				new
					neg = 1,
					num = 0,
					ch = string[stringPos];
				if (ch == '-')
				{
					neg = -1;
					ch = string[++stringPos];
				}
				do
				{
					stringPos++;
					if ('0' <= ch <= '9')
					{
						num = (num * 10) + (ch - '0');
					}
					else
					{
						return -1;
					}
				}
				while ((ch = string[stringPos]) > ' ' && ch != delim);
				setarg(paramPos, 0, num * neg);
			}
			case 'h', 'x':
			{
				new
					num = 0,
					ch = string[stringPos];
				do
				{
					stringPos++;
					switch (ch)
					{
						case 'x', 'X':
						{
							num = 0;
							continue;
						}
						case '0' .. '9':
						{
							num = (num << 4) | (ch - '0');
						}
						case 'a' .. 'f':
						{
							num = (num << 4) | (ch - ('a' - 10));
						}
						case 'A' .. 'F':
						{
							num = (num << 4) | (ch - ('A' - 10));
						}
						default:
						{
							return -1;
						}
					}
				}
				while ((ch = string[stringPos]) > ' ' && ch != delim);
				setarg(paramPos, 0, num);
			}
			case 'c':
			{
				setarg(paramPos, 0, string[stringPos++]);
			}
			case 'f':
			{

				new changestr[16], changepos = 0, strpos = stringPos;
				while(changepos < 16 && string[strpos] && string[strpos] != delim)
				{
					changestr[changepos++] = string[strpos++];
    				}
				changestr[changepos] = '\0';
				setarg(paramPos,0,_:floatstr(changestr));
			}
			case 'p':
			{
				delim = format[formatPos++];
				continue;
			}
			case '\'':
			{
				new
					end = formatPos - 1,
					ch;
				while ((ch = format[++end]) && ch != '\'') {}
				if (!ch)
				{
					return -1;
				}
				format[end] = '\0';
				if ((ch = strfind(string, format[formatPos], false, stringPos)) == -1)
				{
					if (format[end + 1])
					{
						return -1;
					}
					return 0;
				}
				format[end] = '\'';
				stringPos = ch + (end - formatPos);
				formatPos = end + 1;
			}
			case 'u':
			{
				new
					end = stringPos - 1,
					id = 0,
					bool:num = true,
					ch;
				while ((ch = string[++end]) && ch != delim)
				{
					if (num)
					{
						if ('0' <= ch <= '9')
						{
							id = (id * 10) + (ch - '0');
						}
						else
						{
							num = false;
						}
					}
				}
				if (num && IsPlayerConnected(id))
				{
					setarg(paramPos, 0, id);
				}
				else
				{
					#if !defined foreach
						#define foreach(%1,%2) for (new %2 = 0; %2 < MAX_PLAYERS; %2++) if (IsPlayerConnected(%2))
						#define __SSCANF_FOREACH__
					#endif
					string[end] = '\0';
					num = false;
					new
						name[MAX_PLAYER_NAME];
					id = end - stringPos;
					foreach (Player, playerid)
					{
						GetPlayerName(playerid, name, sizeof (name));
						if (!strcmp(name, string[stringPos], true, id))
						{
							setarg(paramPos, 0, playerid);
							num = true;
							break;
						}
					}
					if (!num)
					{
						setarg(paramPos, 0, INVALID_PLAYER_ID);
					}
					string[end] = ch;
					#if defined __SSCANF_FOREACH__
						#undef foreach
						#undef __SSCANF_FOREACH__
					#endif
				}
				stringPos = end;
			}
			case 's', 'z':
			{
				new
					i = 0,
					ch;
				if (format[formatPos])
				{
					while ((ch = string[stringPos++]) && ch != delim)
					{
						setarg(paramPos, i++, ch);
					}
					if (!i)
					{
						return -1;
					}
				}
				else
				{
					while ((ch = string[stringPos++]))
					{
						setarg(paramPos, i++, ch);
					}
				}
				stringPos--;
				setarg(paramPos, i, '\0');
			}
			default:
			{
				continue;
			}
		}
		while (string[stringPos] && string[stringPos] != delim && string[stringPos] > ' ')
		{
			stringPos++;
		}
		while (string[stringPos] && (string[stringPos] == delim || string[stringPos] <= ' '))
		{
			stringPos++;
		}
		paramPos++;
	}
	do
	{
		if ((delim = format[formatPos++]) > ' ')
		{
			if (delim == '\'')
			{
				while ((delim = format[formatPos++]) && delim != '\'') {}
			}
			else if (delim != 'z')
			{
				return delim;
			}
		}
	}
	while (delim > ' ');
	return 0;
}

// Vehicle Functions
// - GetVehicleModelIDFromName
GetVehicleModelIDFromName(vehname[])
{
	new Result = -1;

	for(new BModel; BModel < 211; BModel++)
	{
	    if(!strfind(VehNames[BModel],vehname,true))
	    {
	        Result = BModel+400;
	        break;
		}
	}

	return Result;
}

// - GetEmptyEvoVehicleID
GetEmptyEvoVehicleID()
{
	return Iter_Free(EVs);
}

// - LockEvoVehicle
LockEvoVehicle(vehicleid, lockinfo)
{
	for(new i; i < GetMaxPlayers(); i++)
	{
	    if(!IsPlayerConnected(i)) continue;
	    SetVehicleParamsForPlayer(EvoVehicles[vehicleid][EVVehID], i, 0, lockinfo);
	}
}

// - SaveAllVehicleComponentsToFile
SaveAllVehicleComponentsToFile(INI:File, EVID)
{
	new ComponentKey[10];

	for(new i; i < 14; i++)
	{
		format(ComponentKey, 10, "COMPONENT%d", i+1);
		EvoVehicleComponent[EVID][i] = GetVehicleComponentInSlot(EvoVehicles[EVID][EVVehID], i);
	    INI_WriteInt(File, ComponentKey, EvoVehicleComponent[EVID][i]);
	}
}

// - LoadAllVehicleComponents
LoadAllVehicleComponents(EVID, name[], value[])
{
	new ComponentKey[10];

 	for(new i; i < 14; i++)
 	{
        format(ComponentKey, 10, "COMPONENT%d", i+1);
        INI_Int(ComponentKey, EvoVehicleComponent[ EVID ][i]);
	}
	return 1;
}

// - LoadVehicleMod
LoadVehicleMod(EVID)
{
	if(EvoVehicles[ EVID ][EVPJ] != -1)
	{
		ChangeVehiclePaintjob(EvoVehicles[ EVID ][EVVehID], EvoVehicles[ EVID ][EVPJ]);
	}

	for(new i; i < 14; i++)
	{
	    AddVehicleComponent(EvoVehicles[ EVID ][EVVehID], EvoVehicleComponent[ EVID ][i]);
	}
}

// - GetVehicleMod
GetVehicleMod(EVID)
{
	for(new i; i < 14; i++)
	{
	    EvoVehicleComponent[ EVID ][i] = GetVehicleComponentInSlot(EvoVehicles[ EVID ][EVVehID], i);
	}
}


// For Showrooms
// -GetEmptyShowroomID
GetEmptyShowroomID()
{
	return Iter_Free(SRs);
}

// For Admins
// - ShowAdminEVPanel
ShowAdminEvPanel(playerid, vehicleid)
{
	new DiaString[1024], String[128];

	format(DiaString, 1024, "{FFFFFF}Model \t{ADFF2F}%s\n", VehNames[ EvoVehicles[vehicleid][EVModel]-400 ]);
	format(DiaString, 1024, "%s{FFFFFF}Owner \t{ADFF2F}%s\n", DiaString, EvoVehicles[vehicleid][EVOwner]);
	format(DiaString, 1024, "%s{FFFFFF}Color1 \t{ADFF2F}%d\n", DiaString, EvoVehicles[vehicleid][EVCol1]);
	format(DiaString, 1024, "%s{FFFFFF}Color2 \t{ADFF2F}%d\n", DiaString, EvoVehicles[vehicleid][EVCol2]);
	format(DiaString, 1024, "%s{FFFFFF}Price \t{ADFF2F}%d$\n", DiaString, EvoVehicles[vehicleid][EVPrice]);
	format(DiaString, 1024, "%s{FFFFFF}Security \t{ADFF2F}%s\n", DiaString, SecurityInfos[ EvoVehicles[vehicleid][EVSecurity] ]);
	format(DiaString, 1024, "%s{FFFFFF}Lock \t{ADFF2F}%s\n", DiaString, LockInfos[ EvoVehicles[vehicleid][EVLock] ]);
	format(DiaString, 1024, "%s{FFFFFF}Plate \t{ADFF2F}%s\n", DiaString, EvoVehicles[vehicleid][EVPlate]);
	format(DiaString, 1024, "%s{FFFFFF}Paintjob \t{ADFF2F}%d\n", DiaString, EvoVehicles[vehicleid][EVPJ]);
	format(DiaString, 1024, "%s{FFFFFF}Get Vehicle\n{FFFFFF}Delete Vehicle", DiaString);

	format(String, 128, "{FFFFFF}Evo Vehicle ID {ADFF2F}%d", vehicleid);

	ShowPlayerDialog(playerid, DIALOG_EVO_PANELVEH, DIALOG_STYLE_LIST, String, DiaString, "Edit", "Back");

}

// For Players
// - ShowPlayerEVPanel
ShowPlayerEVPanel(playerid, vehicleid)
{
	new DiaString[1024], String[128];

	format(DiaString, 1024, "{FFFFFF}Get Vehicle\n{FFFFFF}Sell Vehicle\n");
	format(DiaString, 1024, "%s{FFFFFF}Doors \t{ADFF2F}%s\n", DiaString, LockInfos[ EvoVehicles[vehicleid][EVLock] ]);
    format(DiaString, 1024, "%s{FFFFFF}Security \t{ADFF2F}%s\n", DiaString, SecurityInfos[ EvoVehicles[vehicleid][EVSecurity] ]);
    format(DiaString, 1024, "%s{FFFFFF}Plate \t{ADFF2F}%s\n", DiaString, EvoVehicles[vehicleid][EVPlate]);

	#if AUTOMATIC_PARK == false
	format(DiaString, 1024, "%s{FFFFFF}Park Vehicle\n", DiaString);
	#endif
	
	format(String, 128, "{FFFFFF}Vehicle {ADFF2F}%s", VehNames[ EvoVehicles[vehicleid][EVModel]-400 ]);

	ShowPlayerDialog(playerid, DIALOG_A_HOME, DIALOG_STYLE_LIST, String, DiaString, "Edit", "Close");
}

// - LoadLockedEvoVehiclesForPlayer
LoadLockedEvoVehiclesForPlayer(playerid)
{
	foreach(new i : EVs)
	{
	    if(EvoVehicles[i][EVExist] == 0) continue;
		SetVehicleParamsForPlayer(EvoVehicles[i][EVVehID], playerid, 0, EvoVehicles[i][EVLock]);
	}
}

// - GetPlayerVehicleCount
GetPlayerVehicleCount(playerid)
{
	new Result;
	
	foreach(new i : EVs)
	{
	    if(EvoVehicles[i][EVExist] == 0) continue;
	    if(!strcmp(GetName(playerid), EvoVehicles[i][EVOwner], true)) Result++;
	}
	
	return Result;
}

// - GetPlayerVehicleInSlot
GetPlayerVehicleInSlot(playerid, slotid)
{
	new Count, Result;
	
	foreach(new i : EVs)
	{
	    if(EvoVehicles[i][EVExist] == 0) continue;
	    if(!strcmp(GetName(playerid), EvoVehicles[i][EVOwner], true)) Count++;
	    if(Count == slotid) { Result = i; break; }
	}
	
	return Result;
}


// For I-Sync

// - _GetVehicleOwner
stock _GetVehicleOwner(vehicleid)
{
	return EvoVehicles[vehicleid][EVOwner];
}

// - _SetVehicleOwner
stock _SetVehicleOwner(vehicleid, owner[])
{
	return format(EvoVehicles[vehicleid][EVOwner], 40, owner);
}

// - _GetVehiclePrice
stock _GetVehiclePrice(vehicleid)
{
	return EvoVehicles[vehicleid][EVPrice];
}

// - _SetVehiclePrice
stock _SetVehiclePrice(vehicleid, price)
{
	return EvoVehicles[vehicleid][EVPrice] = price;
}

// - _GetSystemIDFromVehicleID
stock _GetSystemIDFromVehicleID(vehicleid)
{
	if(VehInSystem[vehicleid] == 1) return VehEVID[vehicleID];
	return -1;
}

// - _IsVehicleInSystem
stock _IsVehicleInSystem(vehicleid)
{
	return VehInSystem[vehicleid];
}

// - _CreateEvoVehicle
stock _CreateEvoVehicle(Modelid, Owner[], Float:X, Float:Y, Float:Z, Float:Rot, Col1, Col2, Price)
{
	return CreateEvoVehicle(Modelid, Owner, X, Y, Z, Rot, Col1, Col2, Price);
}

// - _DeleteEvoVehicle
stock _DeleteEvoVehicle(vehicleid)
{
	return DeleteEvoVehicle(vehicleid);
}

// ================================[COMMANDS]================================ //
// Evo Vehicle Administrating & Help

// - /evovehicle
COMMAND:evovehicle(playerid, params[])
{
	new parameter[20];
	
	if(!sscanf(params, "s", parameter))
	{
	    if(!strcmp("help", parameter, true))
	    {

	        ShowPlayerDialog(playerid, 9999, DIALOG_STYLE_MSGBOX, "{ADFF2F}Evo Vehicle Ownership Help", "{FFFFFF}You can get in a vehicle on road for buy it.\n{FFFFFF}When you got in vehicle, a dialog asks u : \"Do you want to buy it?\".\n{FFFFFF}If you select \"Yes\", you can buy it.\n \n{FFFFFF}And you can manage your vehicles with {ADFF2F}/myveh {FFFFFF}command", "Close", "");

		}else if(!strcmp("manage", parameter, true))
	    {

	        if(pInfo[playerid][pRoot] == 1) return ShowPlayerDialog(playerid, DIALOG_EVO_PANELHOME, DIALOG_STYLE_LIST, "{ADFF2F}Evo Vehicle Ownership Administrating Panel",
								 									"{ADFF2F}» {FFFFFF}Manage a Vehicle\n{ADFF2F}» {FFFFFF}Add a Vehicle \t{ADFF2F}/addev\n{ADFF2F}» {FFFFFF}Delete All Vehicles\n{ADFF2F}» {FFFFFF}Manage a Showroom\n{ADFF2F}» {FFFFFF}Add a Showroom \t{ADFF2F}/addsr\n{ADFF2F}» {FFFFFF}Delete All Showrooms\n{ADFF2F}» {FFFFFF}Change Panel Password\n{ADFF2F}» {FFFFFF}Get ROOT Permission\n{ADFF2F}» {FFFFFF}About Evo Vehicle Ownership", "Select", "Close");

			if(!strcmp(EVOPanelPass, "default", true))
	        {
                ShowPlayerDialog(playerid, DIALOG_EVO_PANELPASS, DIALOG_STYLE_PASSWORD, "{ADFF2F}Evo Vehicle Ownership Administrating Panel Login", "{FFFFFF}You didn't set a password for {ADFF2F}Evo Vehicle Ownership Administrating Panel {FFFFFF}before.\n{FFFFFF}Please select a password for EVO Administrating Panel to finish setup.", "Select", "Cancel");
			}else{
				ShowPlayerDialog(playerid, DIALOG_EVO_PANELPASS, DIALOG_STYLE_PASSWORD, "{ADFF2F}Evo Vehicle Ownership Administrating Panel Login", "{FFFFFF}Enter the password for login {ADFF2F}Evo Vehicle Ownership Administrating Panel", "Login", "Cancel");
			}
		}else if(!strcmp("versioncontrol", parameter, true))
		{

            HTTP(playerid, HTTP_GET, "evoturk.p.ht/versions/evoaraba-essentials-en.txt", "", "EvoVehicle_InGame");
		
		}else return ERROR(playerid, "Wrong parameter!");
	}else return USAGE(playerid, "/evovehicle {ADFF2F}[help/manage/versioncontrol]");
	return 1;
}

// - /addev
COMMAND:addev(playerid, params[])
{
	if(pInfo[playerid][pRoot] == 0) return ERROR(playerid, "You cannot add vehicle in system without ROOT Permission");
	new tmp[60], idx;
	tmp = strtok(params, idx);
	if(!strlen(tmp)) return USAGE(playerid, "/addev {ADFF2F}[model][price][color1][color2][owner]"), USAGE(playerid, "If you want to add vehicle without owner, set vehicle owner's name as: -");
	new omodel;

	if(IsNumeric(tmp))
	{
	    omodel = strval(tmp);
	}else{
	    omodel = GetVehicleModelIDFromName(tmp);
	}

	if(omodel < 400 || omodel > 600) return ERROR(playerid, "Wrong vehicle model");

	tmp = strtok(params, idx);
	if(!strlen(tmp)) return USAGE(playerid, "/addev {ADFF2F}[model][price][color1][color2][owner]"), USAGE(playerid, "If you want to add vehicle without owner, set vehicle owner's name as: -");
	new oprice = strval(tmp);

	tmp = strtok(params, idx);
	if(!strlen(tmp)) return USAGE(playerid, "/addev {ADFF2F}[model][price][color1][color2][owner]"), USAGE(playerid, "If you want to add vehicle without owner, set vehicle owner's name as: -");
	new ocolor1 = strval(tmp);

	tmp = strtok(params, idx);
	if(!strlen(tmp)) return USAGE(playerid, "/addev {ADFF2F}[model][price][color1][color2][owner]"), USAGE(playerid, "If you want to add vehicle without owner, set vehicle owner's name as: -");
	new ocolor2 = strval(tmp);

	tmp = strtok(params, idx);
	if(!strlen(tmp)) return USAGE(playerid, "/addev {ADFF2F}[model][price][color1][color2][owner]"), USAGE(playerid, "If you want to add vehicle without owner, set vehicle owner's name as: -");

	new Float:pX, Float:pY, Float:pZ, Float:pRot;
	GetPlayerPos(playerid, pX, pY, pZ);
	GetPlayerFacingAngle(playerid, pRot);

	pX += 5.0 * floatcos(pRot + 90, degrees);
	pY += 5.0 * floatsin(pRot + 90, degrees);

	new CreatedID =	CreateEvoVehicle(omodel, tmp, pX, pY, pZ, pRot+90, ocolor1, ocolor2, oprice);

	INFO(playerid, "You added a vehicle in system");

	new String[64];

	format(String, 64, "ID of the vehicle that you added : {ADFF2F}%d", CreatedID);
	INFO(playerid, String);

	INFO(playerid, "You can manage the vehicle that you add in Evo Vehicle Ownership panel.");

	return 1;
}

// - /addsr
COMMAND:addsr(playerid, params[])
{
	if(pInfo[playerid][pRoot] == 0) return ERROR(playerid, "You cannot add showroom in system without ROOT Permission");
	new tmp[256], idx;
	tmp = strrest(params, idx);
	if(!strlen(tmp)) return USAGE(playerid, "/addsr {ADFF2F}[name]");

	new CreatedID, String[128], Float:pX, Float:pY, Float:pZ;
	GetPlayerPos(playerid, pX, pY, pZ);

	CreatedID = CreateShowroom(tmp, pX, pY, pZ);

	INFO(playerid, "You added a showroom in system");

	format(String, 128, "ID of the showroom that you added : %d", CreatedID);
	INFO(playerid, String);

	INFO(playerid, "You can add vehicle in this showroom like that adding vehicle in system");

	format(String, 128, "Additional you must make vehicle's owner Showroom%d", CreatedID);
	INFO(playerid, String);

	return 1;
}


// Player Evo Vehicle Management

// - /myveh
COMMAND:myveh(playerid, params[])
{
	new PEVCount = GetPlayerVehicleCount(playerid);
	
	if(PEVCount == 0) return ERROR(playerid, "You don't have a vehicle!");
	
	new DiaString[512], PEVID;

	for(new i; i < PEVCount; i++)
	{
		PEVID = GetPlayerVehicleInSlot(playerid, i+1);
		
		format(DiaString, 512, "%s{ADFF2F}%d# {FFFFFF}%s\n", DiaString, i+1, VehNames[ EvoVehicles[PEVID][EVModel]-400]);
	}
	
	ShowPlayerDialog(playerid, DIALOG_A_VEHLIST, DIALOG_STYLE_LIST, "{ADFF2F}My Vehicles", DiaString, "Manage", "Close");
	return 1;
}

// ================================[PUBLICS]================================= //
public OnFilterScriptInit()
{
	// Evo Scripts Loader Text
	printf("<=================================================>");
	printf("<                                                 >");
	printf("<               Evo Vehicle Ownership             >");
	printf("<                       IX.3                      >");
	printf("<                    Essentials                   >");
	printf("<           By Exertion ( A.K.A EvoturK )         >");
	printf("<                                                 >");
	printf("<=================================================>");
	printf("<                                                 >");
	
	
	
	// Loading System
	new EVFileName[35];
	format(EVFileName, 35, "%s/options.ini", EVOVEHICLE_MAIN_DIR);
	
    INI_ParseFile(EVFileName, "LoadEVO");
    
    printf("<            System Information Loaded            >");
    
    
	// Loading System Vehicles
	LoadEvoVehicles();
	
	printf("<                Vehicles Loaded                  >");
	
	
	// Loading Vehicle Showrooms
	LoadShowrooms();
	
	printf("<               Showrooms Loaded                  >");
	
	

	printf("<                                                 >");
	printf("<=================================================>");
	
	
	// Evo Scripts Version Controller
    HTTP(0, HTTP_GET, "evoturk.p.ht/versions/evoaraba-essentials-en.txt", "", "EvoVehicle_Init");
    
	return 1;
}


public OnFilterScriptExit()
{
	// Unloading Signal
	Unloading = 1;

	// Evo Scripts Unloader Text
	printf("<=================================================>");
	printf("<                                                 >");
	printf("<               Evo Vehicle Ownership             >");
	printf("<                       IX.3                      >");
	printf("<                    Essentials                   >");
	printf("<           By Exertion ( A.K.A EvoturK )         >");
	printf("<                                                 >");
	printf("<=================================================>");
	printf("<                                                 >");



	// Saving System
	SaveEVO();
	
	printf("<              System Information Saved           >");
	
	
	// Saving System Vehicles
	SaveEvoVehicles(1);
	
	printf("<                   Vehicles Saved                >");


	// Saving Vehicle Showrooms
	SaveShowrooms(1);
	
	printf("<                  Showrooms Saved                >");


	// Delete System Waste
	// Deleting System Waste
	foreach(new i : EVs)
	{
	    DestroyVehicle(EvoVehicles[i][EVVehID]);
	}

	foreach(new i : SRs)
	{
	    DestroyPickup(Showrooms[i][SRPick]);
	    Delete3DTextLabel(Showrooms[i][SR3D]);
	}

	printf("<             System Waste was Deleted            >");
	


	printf("<                                                 >");
	printf("<=================================================>");
	return 1;
}

public OnPlayerConnect(playerid)
{
	pInfo[playerid][pRoot] = 0;
	return 1;
}

public OnPlayerSpawn(playerid)
{
    LoadLockedEvoVehiclesForPlayer(playerid);
	return 1;
}

public OnPlayerEnterVehicle(playerid, vehicleid)
{
	if(VehInSystem[vehicleid] == 1)
	{
	    new String[128];

	   	new EVSystemID = VehEVID[vehicleid];

   		format(String, 128, "System ID : %d {ADFF2F}| {FFFFFF}Model : %s", EVSystemID, VehNames[ EvoVehicles[ EVSystemID ][EVModel]-400 ]);
		INFO(playerid, String);
		
		if(!strfind(EvoVehicles[ EVSystemID ][EVOwner], "Showroom", true))
		{
		    INFO(playerid, "This vehicle is for sale in Showroom.");
		}else{
		    if(!strfind("-", EvoVehicles[ EVSystemID ][EVOwner], true)) return INFO(playerid, "This vehicle doesn't have any owner and it is for sale.");

			if(!strfind(GetName(playerid), EvoVehicles[ EVSystemID ][EVOwner], true))
			{
				INFO(playerid, "Welcome to Your Vehicle");
			}else{
			    format(String, 128, "This vehicles owner is {ADFF2F}%s", EvoVehicles[ EVSystemID ][EVOwner]);
			    INFO(playerid, String);
			}
		}
	}
	return 1;
}

public OnVehicleSpawn(vehicleid)
{
	if(VehInSystem[vehicleid] == 1)
	{
		ChangeVehicleColor(vehicleid, EvoVehicles[ VehEVID[vehicleid] ][EVCol1], EvoVehicles[ VehEVID[vehicleid] ][EVCol2]);
		LoadVehicleMod(VehEVID[vehicleid]);
		
		SetVehiclePos(vehicleid, EvoVehicles[ VehEVID[vehicleid] ][EVX], EvoVehicles[ VehEVID[vehicleid] ][EVY], EvoVehicles[ VehEVID[vehicleid] ][EVZ]);
		SetVehicleZAngle(vehicleid, EvoVehicles[ VehEVID[vehicleid] ][EVRot]);
	}
	return 1;
}

public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
	if(VehInSystem[vehicleid] == 1)
	{
	    EvoVehicles[ VehEVID[vehicleid] ][EVPJ] = paintjobid;
	    EvoVehicles[ VehEVID[vehicleid] ][EVNeedSave] = 1;
	}
	return 1;
}

public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
	if(VehInSystem[vehicleid] == 1)
	{
	    EvoVehicles[ VehEVID[vehicleid] ][EVCol1] = color1;
	    EvoVehicles[ VehEVID[vehicleid] ][EVCol2] = color2;
 	    EvoVehicles[ VehEVID[vehicleid] ][EVNeedSave] = 1;
	}
	return 1;
}

public OnVehicleMod(playerid, vehicleid, componentid)
{
	if(VehInSystem[vehicleid] == 1)
	{
	    GetVehicleMod( VehEVID[vehicleid] );
 	    EvoVehicles[ VehEVID[vehicleid] ][EVNeedSave] = 1;
	}
	return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
	if(newstate == PLAYER_STATE_DRIVER)
	{
	    if(VehInSystem[ GetPlayerVehicleID(playerid) ] == 1)
	    {
	        new EVSystemID = VehEVID[ GetPlayerVehicleID(playerid) ];
		    
	        if(!strfind(EvoVehicles[ EVSystemID ][EVOwner], "Showroom", true))
	        {
			    new SRN[30];
				strmid(SRN, EvoVehicles[ EVSystemID ][EVOwner], 8, strlen(EvoVehicles[ EVSystemID ][EVOwner]), 30);
	            SelectedSR[playerid] = strval(SRN);
	            
				new DiaString[512];
				format(DiaString, 512, "{FFFFFF}Model\t{ADFF2F}%s\n", VehNames[ EvoVehicles[ EVSystemID ][EVModel]-400 ]);
				format(DiaString, 512, "%s{FFFFFF}Price\t{ADFF2F}%d$\n", DiaString, EvoVehicles[ EVSystemID ][EVPrice]);
				format(DiaString, 512, "%s{FFFFFF}Do you want buy this vehicle?", DiaString);
				
				ShowPlayerDialog(playerid, DIALOG_SRVEH, DIALOG_STYLE_MSGBOX, "{ADFF2F}Showroom", DiaString, "Yes", "No");
	        }else{
	            if(!strcmp(EvoVehicles[ EVSystemID ][EVOwner], "-", true))
	            {
					new DiaString[512];
					format(DiaString, 512, "{FFFFFF}Model\t{ADFF2F}%s\n", VehNames[ EvoVehicles[ EVSystemID ][EVModel]-400 ]);
					format(DiaString, 512, "%s{FFFFFF}Price\t{ADFF2F}%d$\n", DiaString, EvoVehicles[ EVSystemID ][EVPrice]);
					format(DiaString, 512, "%s{FFFFFF}Do you want buy this vehicle?", DiaString);

					ShowPlayerDialog(playerid, DIALOG_BUY_VEHICLE, DIALOG_STYLE_MSGBOX, "{ADFF2F}Vehicle for Sale", DiaString, "Yes", "No");
	            }else{
	            	if(!strcmp(EvoVehicles[ EVSystemID ][EVOwner], GetName(playerid), true))
	            	{
						INFO(playerid, "You can manage your vehicle with /myveh command.");
	            	}else{
						switch(EvoVehicles[ EVSystemID ][EVSecurity])
						{
					    	case 1:
					    	{
								INFO(playerid, "Sorry, This vehicle's owner has started Killing Security System");
								SetPlayerHealth(playerid, 0.0);
							}

					    	case 2:
					    	{
								INFO(playerid, "Sorry, This vehicle's owner has started Slapping Security System");

								new Float:pX, Float:pY, Float:pZ;
								GetPlayerPos(playerid, pX, pY, pZ);
								SetPlayerPos(playerid, pX, pY, pZ+10);
					    	}
						}
	            	}
				}
	        }
	    }
	}
	return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	// Evo Vehicle Ownership Administrating
	if(dialogid == DIALOG_EVO_PANELPASS)
	{
	    if(response)
		{
		    if(!strlen(inputtext)) return ERROR(playerid, "You don't enter panel password");
		    if(!strcmp("default", EVOPanelPass, true)) return format(EVOPanelPass, 150, inputtext), INFO(playerid, "You selected panel password. Login panel again.");
			if(!strcmp(EVOPanelPass, inputtext, true))
			{
			    ShowPlayerDialog(playerid, DIALOG_EVO_PANELHOME, DIALOG_STYLE_LIST, "{ADFF2F}Evo Vehicle Ownership Administrating Panel",
							     "{ADFF2F}» {FFFFFF}Manage a Vehicle\n{ADFF2F}» {FFFFFF}Add a Vehicle \t{ADFF2F}/addev\n{ADFF2F}» {FFFFFF}Delete All Vehicles\n{ADFF2F}» {FFFFFF}Manage a Showroom\n{ADFF2F}» {FFFFFF}Add a Showroom \t{ADFF2F}/addsr\n{ADFF2F}» {FFFFFF}Delete All Showrooms\n{ADFF2F}» {FFFFFF}Change Panel Password\n{ADFF2F}» {FFFFFF}Get ROOT Permission\n{ADFF2F}» {FFFFFF}About Evo Vehicle Ownership", "Select", "Close");
			}else return ERROR(playerid, "Wrong panel password");
		}
	}
	
	if(dialogid == DIALOG_EVO_PANELHOME)
	{
		if(response)
		{
			switch(listitem)
			{
			    case 0: // Manage Vehicle
			    {
			        ShowPlayerDialog(playerid, DIALOG_EVO_PANELVEHID, DIALOG_STYLE_INPUT, "{ADFF2F}Manage a Vehicle", "{FFFFFF}Enter the vehicle's id that you want to manage in system:", "Manage", "Back");
			    }

				case 1: // Add Vehicle
				{
				    ShowPlayerDialog(playerid, DIALOG_EVO_PANELNEW_MODEL, DIALOG_STYLE_INPUT, "{ADFF2F}New Vehicle", "{FFFFFF}Enter the vehicle's model id or name that you want to add:", "Next", "Cancel");
				}
				
				case 2: // Delete All Vehicles
				{
				    new FileName[35];
				    
				    foreach(new i: EVs)
				    {
       					EvoVehicles[i][EVExist] = 0;
						DestroyVehicle(EvoVehicles[i][EVVehID]);
						VehInSystem[ EvoVehicles[i][EVVehID] ] = 0;

						format(FileName, 35, "%s/Vehicle_%d.ini", EVOVEHICLE_VEHICLE_DIR, i);
						fremove(FileName);

    					new next;
    					Iter_SafeRemove(EVs, i, next);
    					i = next;
				    }

				    INFO(playerid, "You deleted all vehicles in system.");
				    
				    ShowPlayerDialog(playerid, DIALOG_EVO_PANELHOME, DIALOG_STYLE_LIST, "{ADFF2F}Evo Vehicle Ownership Administrating Panel",
							     	 "{ADFF2F}» {FFFFFF}Manage a Vehicle\n{ADFF2F}» {FFFFFF}Add a Vehicle \t{ADFF2F}/addev\n{ADFF2F}» {FFFFFF}Delete All Vehicles\n{ADFF2F}» {FFFFFF}Manage a Showroom\n{ADFF2F}» {FFFFFF}Add a Showroom \t{ADFF2F}/addsr\n{ADFF2F}» {FFFFFF}Delete All Showrooms\n{ADFF2F}» {FFFFFF}Change Panel Password\n{ADFF2F}» {FFFFFF}Get ROOT Permission\n{ADFF2F}» {FFFFFF}About Evo Vehicle Ownership", "Select", "Close");
				}
				
				case 3: // Manage Showroom
				{
				    ShowPlayerDialog(playerid, DIALOG_EVO_PANELSRID, DIALOG_STYLE_INPUT, "{ADFF2F}Manage a Showroom", "{FFFFFF}Enter the showroom's id that you want to manage in system:", "Manage", "Back");
				}
				
				case 4: // Add Showroom
				{
				    ShowPlayerDialog(playerid, DIALOG_EVO_PANELNSR_NAME, DIALOG_STYLE_INPUT, "{ADFF2F}New Showroom", "{FFFFFF}Notice : You must be in the place where you want to add showroom at.\n{FFFFFF}{FFFFFF}Enter the vehicle's name that you want to add:", "Next", "Cancel");
				}
				
				case 5: // Delete All Showrooms
				{
				    new FileName[35];
				    
				    foreach(new i: SRs)
				    {
						Showrooms[i][SRExist] = 0;
						DestroyPickup(Showrooms[i][SRPick]);
						Delete3DTextLabel(Showrooms[i][SR3D]);

						format(FileName, 35, "%s/Showroom_%d.ini", EVOVEHICLE_SHOWROOM_DIR, i);
						fremove(FileName);

    					new next;
    					Iter_SafeRemove(SRs, i, next);
    					i = next;
				    }

				    INFO(playerid, "You deleted all showrooms in system.");
				    
				    ShowPlayerDialog(playerid, DIALOG_EVO_PANELHOME, DIALOG_STYLE_LIST, "{ADFF2F}Evo Vehicle Ownership Administrating Panel",
							     	 "{ADFF2F}» {FFFFFF}Manage a Vehicle\n{ADFF2F}» {FFFFFF}Add a Vehicle \t{ADFF2F}/addev\n{ADFF2F}» {FFFFFF}Delete All Vehicles\n{ADFF2F}» {FFFFFF}Manage a Showroom\n{ADFF2F}» {FFFFFF}Add a Showroom \t{ADFF2F}/addsr\n{ADFF2F}» {FFFFFF}Delete All Showrooms\n{ADFF2F}» {FFFFFF}Change Panel Password\n{ADFF2F}» {FFFFFF}Get ROOT Permission\n{ADFF2F}» {FFFFFF}About Evo Vehicle Ownership", "Select", "Close");
				}
				
				case 6: // Change Password
				{
				    ShowPlayerDialog(playerid, DIALOG_EVO_PANELCPASS, DIALOG_STYLE_INPUT, "{ADFF2F}Change Panel Password", "{FFFFFF}Enter a new password for panel:", "Change", "Back");
				}
				
				case 7: // Get ROOT Permission
				{
				    pInfo[playerid][pRoot] = 1;
					INFO(playerid, "You got ROOT Permission in Evo Vehicle System.");
					INFO(playerid, "You can enter EVO Administrating Panel without enter password.");
			    	ShowPlayerDialog(playerid, DIALOG_EVO_PANELHOME, DIALOG_STYLE_LIST, "{ADFF2F}Evo Vehicle Ownership Administrating Panel",
							     	 "{ADFF2F}» {FFFFFF}Manage a Vehicle\n{ADFF2F}» {FFFFFF}Add a Vehicle \t{ADFF2F}/addev\n{ADFF2F}» {FFFFFF}Delete All Vehicles\n{ADFF2F}» {FFFFFF}Manage a Showroom\n{ADFF2F}» {FFFFFF}Add a Showroom \t{ADFF2F}/addsr\n{ADFF2F}» {FFFFFF}Delete All Showrooms\n{ADFF2F}» {FFFFFF}Change Panel Password\n{ADFF2F}» {FFFFFF}Get ROOT Permission\n{ADFF2F}» {FFFFFF}About Evo Vehicle Ownership", "Select", "Close");
				}
				
				case 8: // About EVO
				{
				    ShowPlayerDialog(playerid, DIALOG_EVO_PANELABOUT, DIALOG_STYLE_MSGBOX, "{ADFF2F}About Evo Vehicle Ownership", "{FFFFFF}Coder \t{ADFF2F}Exertion. ( aKa EvoturK )\n{FFFFFF}Version \t{ADFF2F}IX.3 Essentials\n{FFFFFF}Version Date \t{ADFF2F}07.08.2013\n{FFFFFF}EvoENGINE \t{ADFF2F}3.0\n \n{FFFFFF}Web Site \t{ADFF2F}evoturk.p.ht", "Back", "");
				}
			}
		}
	}

	if(dialogid == DIALOG_EVO_PANELNSR_NAME)
	{
	    if(response)
	    {
	        if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_EVO_PANELNSR_NAME, DIALOG_STYLE_INPUT, "{ADFF2F}New Showroom", "{FFFFFF}Notice : You must be in the place where you want to add showroom at.\n{FFFFFF}{FFFFFF}Enter the vehicle's name that you want to add:", "Next", "Cancel");
	        format(SelectedName[playerid], 100, inputtext);
	        
			new CreatedID, String[128], Float:pX, Float:pY, Float:pZ;
			GetPlayerPos(playerid, pX, pY, pZ);

			CreatedID = CreateShowroom(SelectedName[playerid], pX, pY, pZ);
			
			INFO(playerid, "You add a new showroom in system");
			
			format(String, 128, "Showroom's ID in system is %d", CreatedID);
			INFO(playerid, String);
			
			INFO(playerid, "You can add vehicle to galery like adding vehicle in system");
			
			format(String, 128, "Additional, you must set vehicle's owner Showroom%d", CreatedID);
			INFO(playerid, String);
			
            ShowPlayerDialog(playerid, DIALOG_EVO_PANELHOME, DIALOG_STYLE_LIST, "{ADFF2F}Evo Vehicle Ownership Administrating Panel",
							 "{ADFF2F}» {FFFFFF}Manage a Vehicle\n{ADFF2F}» {FFFFFF}Add a Vehicle \t{ADFF2F}/addev\n{ADFF2F}» {FFFFFF}Delete All Vehicles\n{ADFF2F}» {FFFFFF}Manage a Showroom\n{ADFF2F}» {FFFFFF}Add a Showroom \t{ADFF2F}/addsr\n{ADFF2F}» {FFFFFF}Delete All Showrooms\n{ADFF2F}» {FFFFFF}Change Panel Password\n{ADFF2F}» {FFFFFF}Get ROOT Permission\n{ADFF2F}» {FFFFFF}About Evo Vehicle Ownership", "Select", "Close");
	    }else{
	        ShowPlayerDialog(playerid, DIALOG_EVO_PANELHOME, DIALOG_STYLE_LIST, "{ADFF2F}Evo Vehicle Ownership Administrating Panel",
							 "{ADFF2F}» {FFFFFF}Manage a Vehicle\n{ADFF2F}» {FFFFFF}Add a Vehicle \t{ADFF2F}/addev\n{ADFF2F}» {FFFFFF}Delete All Vehicles\n{ADFF2F}» {FFFFFF}Manage a Showroom\n{ADFF2F}» {FFFFFF}Add a Showroom \t{ADFF2F}/addsr\n{ADFF2F}» {FFFFFF}Delete All Showrooms\n{ADFF2F}» {FFFFFF}Change Panel Password\n{ADFF2F}» {FFFFFF}Get ROOT Permission\n{ADFF2F}» {FFFFFF}About Evo Vehicle Ownership", "Select", "Close");
	    }
	}
	
	if(dialogid == DIALOG_EVO_PANELSRID)
	{
	    if(response)
	    {
	        if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_EVO_PANELSRID, DIALOG_STYLE_INPUT, "{ADFF2F}Manage a Showroom", "{FFFFFF}Enter the showroom's id that you want to manage in system:", "Manage", "Back");
			new id = strval(inputtext);
			SelectedSR[playerid] = id;
			
			if(Showrooms[id][SRExist] == 0) return ERROR(playerid, "Wrong Showroom ID'i"), ShowPlayerDialog(playerid, DIALOG_EVO_PANELSRID, DIALOG_STYLE_INPUT, "{ADFF2F}Manage a Showroom", "{FFFFFF}Enter the showroom's id that you want to manage in system:", "Manage", "Back");
			
			new DiaString[256], String[80];

			format(DiaString, 256, "{FFFFFF}Showroom Name \t{ADFF2F}%s\n{FFFFFF}Get Showroom Here\n{FFFFFF}Delete Showroom", Showrooms[ SelectedSR[playerid] ][SRName]);
			
			format(String, 80, "{FFFFFF}Showroom ID {ADFF2F}%d", SelectedSR[playerid]);
			
			ShowPlayerDialog(playerid, DIALOG_EVO_PANELSR, DIALOG_STYLE_LIST, String, DiaString, "Select", "Close");
	    }else{
	        ShowPlayerDialog(playerid, DIALOG_EVO_PANELHOME, DIALOG_STYLE_LIST, "{ADFF2F}Evo Vehicle Ownership Administrating Panel",
							 "{ADFF2F}» {FFFFFF}Manage a Vehicle\n{ADFF2F}» {FFFFFF}Add a Vehicle \t{ADFF2F}/addev\n{ADFF2F}» {FFFFFF}Delete All Vehicles\n{ADFF2F}» {FFFFFF}Manage a Showroom\n{ADFF2F}» {FFFFFF}Add a Showroom \t{ADFF2F}/addsr\n{ADFF2F}» {FFFFFF}Delete All Showrooms\n{ADFF2F}» {FFFFFF}Change Panel Password\n{ADFF2F}» {FFFFFF}Get ROOT Permission\n{ADFF2F}» {FFFFFF}About Evo Vehicle Ownership", "Select", "Close");
	    }
	}
	
	if(dialogid == DIALOG_EVO_PANELSR)
	{
	    if(response)
	    {
			switch(listitem)
			{
			    case 0: // Set Showroom Name
			    {
			        ShowPlayerDialog(playerid, DIALOG_EVO_PANELSR_NAME, DIALOG_STYLE_INPUT, "{ADFF2F}Change Showroom Name", "{FFFFFF}Select a new name for showroom:", "Change", "Back");
			    }
			    
			    case 1: // Set Showroom Location
			    {
			        GetPlayerPos(playerid, Showrooms[ SelectedSR[playerid] ][SRX], Showrooms[ SelectedSR[playerid] ][SRY], Showrooms[ SelectedSR[playerid] ][SRZ]);
                    Showrooms[ SelectedSR[playerid] ][SRNeedSave] = 1;
                    
			        DestroyPickup(Showrooms[ SelectedSR[playerid] ][SRPick]);
					Delete3DTextLabel(Showrooms[ SelectedSR[playerid] ][SR3D]);
					
					Showrooms[ SelectedSR[playerid] ][SRPick] = CreatePickup(1239, 1, Showrooms[ SelectedSR[playerid] ][SRX], Showrooms[ SelectedSR[playerid] ][SRY], Showrooms[ SelectedSR[playerid] ][SRZ], 0);

					new String[128];
					format(String, 128, "{ADFF2F}SHOWROOM\n{ADFF2F}%s\n{FFFFFF}Showroom ID {ADFF2F}%d", Showrooms[ SelectedSR[playerid] ][SRName], SelectedSR[playerid]);
					Showrooms[ SelectedSR[playerid] ][SR3D] = Create3DTextLabel(String, -1, Showrooms[ SelectedSR[playerid] ][SRX], Showrooms[ SelectedSR[playerid] ][SRY], Showrooms[ SelectedSR[playerid] ][SRZ], 25.0, 0);

					new DiaString[256];

					format(DiaString, 256, "{FFFFFF}Showroom Name \t{ADFF2F}%s\n{FFFFFF}Get Showroom Here\n{FFFFFF}Delete Showroom", Showrooms[ SelectedSR[playerid] ][SRName]);

					format(String, 128, "{FFFFFF}Showroom ID {ADFF2F}%d", SelectedSR[playerid]);

					ShowPlayerDialog(playerid, DIALOG_EVO_PANELSR, DIALOG_STYLE_LIST, String, DiaString, "Select", "Close");
			    }
			    
			    case 2: // Delete Showroom
			    {
			        DeleteShowroom(SelectedSR[playerid]);
			        INFO(playerid, "Showroom that you selected has been deleted");
			    }
			}
	    }else{
	        ShowPlayerDialog(playerid, DIALOG_EVO_PANELHOME, DIALOG_STYLE_LIST, "{ADFF2F}Evo Vehicle Ownership Administrating Panel",
							 "{ADFF2F}» {FFFFFF}Manage a Vehicle\n{ADFF2F}» {FFFFFF}Add a Vehicle \t{ADFF2F}/addev\n{ADFF2F}» {FFFFFF}Delete All Vehicles\n{ADFF2F}» {FFFFFF}Manage a Showroom\n{ADFF2F}» {FFFFFF}Add a Showroom \t{ADFF2F}/addsr\n{ADFF2F}» {FFFFFF}Delete All Showrooms\n{ADFF2F}» {FFFFFF}Change Panel Password\n{ADFF2F}» {FFFFFF}Get ROOT Permission\n{ADFF2F}» {FFFFFF}About Evo Vehicle Ownership", "Select", "Close");
	    }
	}
	
	if(dialogid == DIALOG_EVO_PANELSR_NAME)
	{
	    if(response)
	    {
	        if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_EVO_PANELSR_NAME, DIALOG_STYLE_INPUT, "{ADFF2F}Change Showroom Name", "{FFFFFF}Select a new name for showroom:", "Change", "Back");
			format(Showrooms[ SelectedSR[playerid] ][SRName], 100, inputtext);
			Showrooms[ SelectedSR[playerid] ][SRNeedSave] = 1;

			DestroyPickup(Showrooms[ SelectedSR[playerid] ][SRPick]);
			Delete3DTextLabel(Showrooms[ SelectedSR[playerid] ][SR3D]);

			Showrooms[ SelectedSR[playerid] ][SRPick] = CreatePickup(1239, 1, Showrooms[ SelectedSR[playerid] ][SRX], Showrooms[ SelectedSR[playerid] ][SRY], Showrooms[ SelectedSR[playerid] ][SRZ], 0);

			new String[128];
			format(String, 128, "{ADFF2F}SHOWROOM\n{ADFF2F}%s\n{FFFFFF}Showroom ID {ADFF2F}%d", Showrooms[ SelectedSR[playerid] ][SRName], SelectedSR[playerid]);
			Showrooms[ SelectedSR[playerid] ][SR3D] = Create3DTextLabel(String, -1, Showrooms[ SelectedSR[playerid] ][SRX], Showrooms[ SelectedSR[playerid] ][SRY], Showrooms[ SelectedSR[playerid] ][SRZ], 25.0, 0);

			new DiaString[256];

			format(DiaString, 256, "{FFFFFF}Showroom Name \t{ADFF2F}%s\n{FFFFFF}Get Showroom Here\n{FFFFFF}Delete Showroom", Showrooms[ SelectedSR[playerid] ][SRName]);

			format(String, 128, "{FFFFFF}Showroom ID {ADFF2F}%d", SelectedSR[playerid]);

			ShowPlayerDialog(playerid, DIALOG_EVO_PANELSR, DIALOG_STYLE_LIST, String, DiaString, "Select", "Close");
	    }else{
			new DiaString[256], String[80];

			format(DiaString, 256, "{FFFFFF}Showroom Name \t{ADFF2F}%s\n{FFFFFF}Get Showroom Here\n{FFFFFF}Delete Showroom", Showrooms[ SelectedSR[playerid] ][SRName]);

			format(String, 80, "{FFFFFF}Showroom ID {ADFF2F}%d", SelectedSR[playerid]);

			ShowPlayerDialog(playerid, DIALOG_EVO_PANELSR, DIALOG_STYLE_LIST, String, DiaString, "Select", "Close");
	    }
	}

	if(dialogid == DIALOG_EVO_PANELNEW_MODEL)
	{
	    if(response)
	    {
			if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_EVO_PANELNEW_MODEL, DIALOG_STYLE_INPUT, "{ADFF2F}New Vehicle", "{FFFFFF}Enter the vehicle's model id or name that you want to add:", "Next", "Cancel");

			if(IsNumeric(inputtext))
			{
			    SelectedModel[playerid] = strval(inputtext);
			}else{
			    SelectedModel[playerid] = GetVehicleModelIDFromName(inputtext);
			}
			
			if(SelectedModel[playerid] < 400 || SelectedModel[playerid] > 611) return ERROR(playerid, "Wrong vehicle model"), ShowPlayerDialog(playerid, DIALOG_EVO_PANELNEW_MODEL, DIALOG_STYLE_INPUT, "{ADFF2F}New Vehicle", "{FFFFFF}Enter the vehicle's model id or name that you want to add:", "Next", "Cancel");

			ShowPlayerDialog(playerid, DIALOG_EVO_PANELNEW_PRICE, DIALOG_STYLE_INPUT, "{ADFF2F}New Evo Vehicle", "{FFFFFF}Select price for vehicle that you're adding:", "Next", "Cancel");
	    }else{
    		ShowPlayerDialog(playerid, DIALOG_EVO_PANELHOME, DIALOG_STYLE_LIST, "{ADFF2F}Evo Vehicle Ownership Administrating Panel",
							 "{ADFF2F}» {FFFFFF}Manage a Vehicle\n{ADFF2F}» {FFFFFF}Add a Vehicle \t{ADFF2F}/addev\n{ADFF2F}» {FFFFFF}Delete All Vehicles\n{ADFF2F}» {FFFFFF}Manage a Showroom\n{ADFF2F}» {FFFFFF}Add a Showroom \t{ADFF2F}/addsr\n{ADFF2F}» {FFFFFF}Delete All Showrooms\n{ADFF2F}» {FFFFFF}Change Panel Password\n{ADFF2F}» {FFFFFF}Get ROOT Permission\n{ADFF2F}» {FFFFFF}About Evo Vehicle Ownership", "Select", "Close");
	    }
	}

	if(dialogid == DIALOG_EVO_PANELNEW_PRICE)
	{
	    if(response)
	    {
			if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_EVO_PANELNEW_PRICE, DIALOG_STYLE_INPUT, "{ADFF2F}New Vehicle", "{FFFFFF}Select price for vehicle that you're adding:", "Next", "Cancel");
			SelectedPrice[playerid] = strval(inputtext);

			ShowPlayerDialog(playerid, DIALOG_EVO_PANELNEW_COL1, DIALOG_STYLE_INPUT, "{ADFF2F}New Evo Vehicle", "{FFFFFF}Select vehicle's first color:", "Next", "Cancel");
	    }else{
    		ShowPlayerDialog(playerid, DIALOG_EVO_PANELHOME, DIALOG_STYLE_LIST, "{ADFF2F}Evo Vehicle Ownership Administrating Panel",
							 "{ADFF2F}» {FFFFFF}Manage a Vehicle\n{ADFF2F}» {FFFFFF}Add a Vehicle \t{ADFF2F}/addev\n{ADFF2F}» {FFFFFF}Delete All Vehicles\n{ADFF2F}» {FFFFFF}Manage a Showroom\n{ADFF2F}» {FFFFFF}Add a Showroom \t{ADFF2F}/addsr\n{ADFF2F}» {FFFFFF}Delete All Showrooms\n{ADFF2F}» {FFFFFF}Change Panel Password\n{ADFF2F}» {FFFFFF}Get ROOT Permission\n{ADFF2F}» {FFFFFF}About Evo Vehicle Ownership", "Select", "Close");
	    }
	}
	
	if(dialogid == DIALOG_EVO_PANELNEW_COL1)
	{
	    if(response)
	    {
			if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_EVO_PANELNEW_COL1, DIALOG_STYLE_INPUT, "{ADFF2F}New Vehicle", "{FFFFFF}Select vehicle's first color:", "Next", "Cancel");
			SelectedCol1[playerid] = strval(inputtext);

			ShowPlayerDialog(playerid, DIALOG_EVO_PANELNEW_COL2, DIALOG_STYLE_INPUT, "{ADFF2F}New Evo Vehicle", "{FFFFFF}Select vehicle's second color:", "Next", "Cancel");
	    }else{
    		ShowPlayerDialog(playerid, DIALOG_EVO_PANELHOME, DIALOG_STYLE_LIST, "{ADFF2F}Evo Vehicle Ownership Administrating Panel",
							 "{ADFF2F}» {FFFFFF}Manage a Vehicle\n{ADFF2F}» {FFFFFF}Add a Vehicle \t{ADFF2F}/addev\n{ADFF2F}» {FFFFFF}Delete All Vehicles\n{ADFF2F}» {FFFFFF}Manage a Showroom\n{ADFF2F}» {FFFFFF}Add a Showroom \t{ADFF2F}/addsr\n{ADFF2F}» {FFFFFF}Delete All Showrooms\n{ADFF2F}» {FFFFFF}Change Panel Password\n{ADFF2F}» {FFFFFF}Get ROOT Permission\n{ADFF2F}» {FFFFFF}About Evo Vehicle Ownership", "Select", "Close");
	    }
	}
	
	if(dialogid == DIALOG_EVO_PANELNEW_COL2)
	{
	    if(response)
	    {
			if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_EVO_PANELNEW_COL2, DIALOG_STYLE_INPUT, "{ADFF2F}New Evo Vehicle", "{FFFFFF}Select vehicle's second color:", "Next", "Cancel");
			SelectedCol2[playerid] = strval(inputtext);

			new Float:pX, Float:pY, Float:pZ, Float:pRot;
			GetPlayerPos(playerid, pX, pY, pZ);
			GetPlayerFacingAngle(playerid, pRot);
			
			pX += 5.0 * floatcos(pRot + 90, degrees);
			pY += 5.0 * floatsin(pRot + 90, degrees);
			
			new CreatedID =	CreateEvoVehicle(SelectedModel[playerid], "-", pX, pY, pZ, pRot+90, SelectedCol1[playerid], SelectedCol2[playerid], SelectedPrice[playerid]);

			INFO(playerid, "You added vehicle in system");
			
			new String[64];
			
			format(String, 64, "System ID of the vehicle that you added is {ADFF2F}%d", CreatedID);
			INFO(playerid, String);
			
			INFO(playerid, "You can manage this vehicle in EVO Administrating Panel");
	    }else{
    		ShowPlayerDialog(playerid, DIALOG_EVO_PANELHOME, DIALOG_STYLE_LIST, "{ADFF2F}Evo Vehicle Ownership Administrating Panel",
							 "{ADFF2F}» {FFFFFF}Manage a Vehicle\n{ADFF2F}» {FFFFFF}Add a Vehicle \t{ADFF2F}/addev\n{ADFF2F}» {FFFFFF}Delete All Vehicles\n{ADFF2F}» {FFFFFF}Manage a Showroom\n{ADFF2F}» {FFFFFF}Add a Showroom \t{ADFF2F}/addsr\n{ADFF2F}» {FFFFFF}Delete All Showrooms\n{ADFF2F}» {FFFFFF}Change Panel Password\n{ADFF2F}» {FFFFFF}Get ROOT Permission\n{ADFF2F}» {FFFFFF}About Evo Vehicle Ownership", "Select", "Close");
	    }
	}
	
	if(dialogid == DIALOG_EVO_PANELCPASS)
	{
	    if(response)
	    {
			if(!strlen(inputtext)) return ERROR(playerid, "You haven't entered a new password yet."), ShowPlayerDialog(playerid, DIALOG_EVO_PANELCPASS, DIALOG_STYLE_INPUT, "{ADFF2F}Change Panel Password", "{FFFFFF}Enter a new password for panel:", "Change", "Back");

			format(EVOPanelPass, 150, inputtext);
			
			INFO(playerid, "Panel password has been changed.");
			
			ShowPlayerDialog(playerid, DIALOG_EVO_PANELHOME, DIALOG_STYLE_LIST, "{ADFF2F}Evo Vehicle Ownership Administrating Panel",
							 "{ADFF2F}» {FFFFFF}Manage a Vehicle\n{ADFF2F}» {FFFFFF}Add a Vehicle \t{ADFF2F}/addev\n{ADFF2F}» {FFFFFF}Delete All Vehicles\n{ADFF2F}» {FFFFFF}Manage a Showroom\n{ADFF2F}» {FFFFFF}Add a Showroom \t{ADFF2F}/addsr\n{ADFF2F}» {FFFFFF}Delete All Showrooms\n{ADFF2F}» {FFFFFF}Change Panel Password\n{ADFF2F}» {FFFFFF}Get ROOT Permission\n{ADFF2F}» {FFFFFF}About Evo Vehicle Ownership", "Select", "Close");
	    }else{
    		ShowPlayerDialog(playerid, DIALOG_EVO_PANELHOME, DIALOG_STYLE_LIST, "{ADFF2F}Evo Vehicle Ownership Administrating Panel",
							 "{ADFF2F}» {FFFFFF}Manage a Vehicle\n{ADFF2F}» {FFFFFF}Add a Vehicle \t{ADFF2F}/addev\n{ADFF2F}» {FFFFFF}Delete All Vehicles\n{ADFF2F}» {FFFFFF}Manage a Showroom\n{ADFF2F}» {FFFFFF}Add a Showroom \t{ADFF2F}/addsr\n{ADFF2F}» {FFFFFF}Delete All Showrooms\n{ADFF2F}» {FFFFFF}Change Panel Password\n{ADFF2F}» {FFFFFF}Get ROOT Permission\n{ADFF2F}» {FFFFFF}About Evo Vehicle Ownership", "Select", "Close");
	    }
	}
	
	if(dialogid == DIALOG_EVO_PANELABOUT)
	{
		ShowPlayerDialog(playerid, DIALOG_EVO_PANELHOME, DIALOG_STYLE_LIST, "{ADFF2F}Evo Vehicle Ownership Administrating Panel",
							 "{ADFF2F}» {FFFFFF}Manage a Vehicle\n{ADFF2F}» {FFFFFF}Add a Vehicle \t{ADFF2F}/addev\n{ADFF2F}» {FFFFFF}Delete All Vehicles\n{ADFF2F}» {FFFFFF}Manage a Showroom\n{ADFF2F}» {FFFFFF}Add a Showroom \t{ADFF2F}/addsr\n{ADFF2F}» {FFFFFF}Delete All Showrooms\n{ADFF2F}» {FFFFFF}Change Panel Password\n{ADFF2F}» {FFFFFF}Get ROOT Permission\n{ADFF2F}» {FFFFFF}About Evo Vehicle Ownership", "Select", "Close");
	}
	
	if(dialogid == DIALOG_EVO_PANELVEHID)
	{
	    if(response)
	    {
	        if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_EVO_PANELVEHID, DIALOG_STYLE_INPUT, "{ADFF2F}Manage a Vehicle", "{FFFFFF}Enter the vehicle's id that you want to manage in system:", "Manage", "Back");
			new id = strval(inputtext);
			SelectedEV[playerid] = id;
			
			if(EvoVehicles[id][EVExist] == 0) return ERROR(playerid, "Wrong Evo Vehicle ID"), ShowPlayerDialog(playerid, DIALOG_EVO_PANELVEHID, DIALOG_STYLE_INPUT, "{ADFF2F}Manage a Vehicle - ID", "{FFFFFF}Type ID of Vehicle That You want to Manage.", "Manage", "Back");

			INFO(playerid, "Select the information that you'll change and select \"Manage\"");
			
			ShowAdminEvPanel(playerid, SelectedEV[playerid]);
		}else{
    		ShowPlayerDialog(playerid, DIALOG_EVO_PANELHOME, DIALOG_STYLE_LIST, "{ADFF2F}Evo Vehicle Ownership Administrating Panel",
							 "{ADFF2F}» {FFFFFF}Manage a Vehicle\n{ADFF2F}» {FFFFFF}Add a Vehicle \t{ADFF2F}/addev\n{ADFF2F}» {FFFFFF}Delete All Vehicles\n{ADFF2F}» {FFFFFF}Manage a Showroom\n{ADFF2F}» {FFFFFF}Add a Showroom \t{ADFF2F}/addsr\n{ADFF2F}» {FFFFFF}Delete All Showrooms\n{ADFF2F}» {FFFFFF}Change Panel Password\n{ADFF2F}» {FFFFFF}Get ROOT Permission\n{ADFF2F}» {FFFFFF}About Evo Vehicle Ownership", "Select", "Close");
	    }
	}
	
	if(dialogid == DIALOG_EVO_PANELVEH)
	{
	    if(response)
	    {
			switch(listitem)
			{
			    case 0: // Model
			    {
			        ShowPlayerDialog(playerid, DIALOG_EVO_PANELVEH_MODEL, DIALOG_STYLE_INPUT, "{ADFF2F}Vehicle Model", "{FFFFFF}Select the new vehicle model id or name of selected vehicle:", "Change", "Back");
			    }

				case 1: // Owner
				{
			        ShowPlayerDialog(playerid, DIALOG_EVO_PANELVEH_OWNER, DIALOG_STYLE_INPUT, "{ADFF2F}Vehicle Owner", "{FFFFFF}Select the new owner of selected vehicle:", "Change", "Back");
				}
				
				case 2: // Color 1
				{
			        ShowPlayerDialog(playerid, DIALOG_EVO_PANELVEH_COL1, DIALOG_STYLE_INPUT, "{ADFF2F}Vehicle Color 1", "{FFFFFF}Select the new first color of selected vehicle:", "Change", "Back");
				}
				
				case 3: // Color 2
				{
			        ShowPlayerDialog(playerid, DIALOG_EVO_PANELVEH_COL2, DIALOG_STYLE_INPUT, "{ADFF2F}Vehicle Color 2", "{FFFFFF}Select the new second color of selected vehicle:", "Change", "Back");
				}
	
				case 4: // Price
				{
			        ShowPlayerDialog(playerid, DIALOG_EVO_PANELVEH_PRICE, DIALOG_STYLE_INPUT, "{ADFF2F}Vehicle Price", "{FFFFFF}Select the new price of selected vehicle:", "Change", "Back");
				}
				
				case 5: // Security
				{
			        ShowPlayerDialog(playerid, DIALOG_EVO_PANELVEH_SEC, DIALOG_STYLE_LIST, "{ADFF2F}Vehicle Security", "{FFFFFF}None\n{FFFFFF}Killing\n{FFFFFF}Slapping", "Change", "Back");
				}
				
				case 6: // Lock
				{
			        ShowPlayerDialog(playerid, DIALOG_EVO_PANELVEH_LOCK, DIALOG_STYLE_LIST, "{ADFF2F}Vehicle Lock", "{FFFFFF}Unlocked\n{FFFFFF}Locked", "Change", "Back");
				}
				
				case 7: // Plate
				{
			        ShowPlayerDialog(playerid, DIALOG_EVO_PANELVEH_PLATE, DIALOG_STYLE_INPUT, "{ADFF2F}Vehicle Plate", "{FFFFFF}Select the new plate of selected vehicle:", "Change", "Back");
				}
				
				case 8: // PJ
				{
			        ShowPlayerDialog(playerid, DIALOG_EVO_PANELVEH_PJ, DIALOG_STYLE_INPUT, "{ADFF2F}Vehicle Paintjob", "{FFFFFF}Select the new paintjob id of selected vehicle:", "Change", "Back");
				}
				
				case 9: // Get Vehicle
				{
				    new Float:pX, Float:pY, Float:pZ, Float:pRot;
				    GetPlayerPos(playerid, pX, pY, pZ);
				    GetPlayerFacingAngle(playerid, pRot);
				    
					pX += 5.0 * floatcos(pRot + 90, degrees);
					pY += 5.0 * floatsin(pRot + 90, degrees);
					
					SetVehiclePos(EvoVehicles[ SelectedEV[playerid] ][EVVehID], pX, pY, pZ);
					SetVehicleZAngle(EvoVehicles[ SelectedEV[playerid] ][EVVehID], pRot+90);

					INFO(playerid, "You got vehicle that you selected");

                    ShowAdminEvPanel(playerid, SelectedEV[playerid]);
				}
				
				case 10: // Delete Vehicle
				{
				    DeleteEvoVehicle(SelectedEV[playerid]);
					INFO(playerid, "You deleted vehicle that you selected from system");
					ShowPlayerDialog(playerid, DIALOG_EVO_PANELHOME, DIALOG_STYLE_LIST, "{ADFF2F}Evo Vehicle Ownership Administrating Panel",
							 "{ADFF2F}» {FFFFFF}Manage a Vehicle\n{ADFF2F}» {FFFFFF}Add a Vehicle \t{ADFF2F}/addev\n{ADFF2F}» {FFFFFF}Delete All Vehicles\n{ADFF2F}» {FFFFFF}Manage a Showroom\n{ADFF2F}» {FFFFFF}Add a Showroom \t{ADFF2F}/addsr\n{ADFF2F}» {FFFFFF}Delete All Showrooms\n{ADFF2F}» {FFFFFF}Change Panel Password\n{ADFF2F}» {FFFFFF}Get ROOT Permission\n{ADFF2F}» {FFFFFF}About Evo Vehicle Ownership", "Select", "Close");
				}
			}
	    }else{
    		ShowPlayerDialog(playerid, DIALOG_EVO_PANELHOME, DIALOG_STYLE_LIST, "{ADFF2F}Evo Vehicle Ownership Administrating Panel",
							 "{ADFF2F}» {FFFFFF}Manage a Vehicle\n{ADFF2F}» {FFFFFF}Add a Vehicle \t{ADFF2F}/addev\n{ADFF2F}» {FFFFFF}Delete All Vehicles\n{ADFF2F}» {FFFFFF}Manage a Showroom\n{ADFF2F}» {FFFFFF}Add a Showroom \t{ADFF2F}/addsr\n{ADFF2F}» {FFFFFF}Delete All Showrooms\n{ADFF2F}» {FFFFFF}Change Panel Password\n{ADFF2F}» {FFFFFF}Get ROOT Permission\n{ADFF2F}» {FFFFFF}About Evo Vehicle Ownership", "Select", "Close");
	    }
	}

	if(dialogid == DIALOG_EVO_PANELVEH_MODEL)
	{
	    if(response)
	    {
			if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_EVO_PANELVEH_MODEL, DIALOG_STYLE_INPUT, "{ADFF2F}Vehicle Model", "{FFFFFF}Select the new vehicle model id or name of selected vehicle:", "Change", "Back");
			new model;
			
			if(IsNumeric(inputtext))
			{
			    model = strval(inputtext);
			}else{
				model = GetVehicleModelIDFromName(inputtext);
			}
			
			if(model < 400 || model > 611) return ERROR(playerid, "Wrong vehicle model!"),ShowPlayerDialog(playerid, DIALOG_EVO_PANELVEH_MODEL, DIALOG_STYLE_INPUT, "{ADFF2F}Vehicle Model", "{FFFFFF}Select the new vehicle model id or name of selected vehicle:", "Change", "Back");


			new EvoVehicleID = SelectedEV[playerid];

			EvoVehicles[ EvoVehicleID][EVModel] = model;
   			DestroyVehicle( EvoVehicles[ EvoVehicleID ][EVVehID] );
      		VehInSystem[ EvoVehicles[ EvoVehicleID ][EVVehID]] = 0;

			EvoVehicles[ EvoVehicleID ][EVVehID] = CreateVehicle(EvoVehicles[ EvoVehicleID ][EVModel], EvoVehicles[ EvoVehicleID ][EVX], EvoVehicles[ EvoVehicleID ][EVY], EvoVehicles[ EvoVehicleID ][EVZ], EvoVehicles[ EvoVehicleID ][EVRot], EvoVehicles[ EvoVehicleID ][EVCol1], EvoVehicles[ EvoVehicleID ][EVCol2], -1);
			VehEVID[ EvoVehicles[ EvoVehicleID ][EVVehID] ] = EvoVehicleID;
			VehInSystem[ EvoVehicles[ EvoVehicleID ][EVVehID] ] = 1;
			SetVehicleNumberPlate(EvoVehicles[ EvoVehicleID ][EVVehID], EvoVehicles[ EvoVehicleID ][EVPlate]);
			SetVehicleToRespawn(EvoVehicles[ EvoVehicleID ][EVVehID]);
			LoadVehicleMod(EvoVehicleID);

			EvoVehicles[ SelectedEV[playerid] ][EVNeedSave] = 1;
			
			INFO(playerid, "Vehicle's model has been changed successfully");
			
        	ShowAdminEvPanel(playerid, SelectedEV[playerid]);
	    }else{
            ShowAdminEvPanel(playerid, SelectedEV[playerid]);
	    }
	}

	if(dialogid == DIALOG_EVO_PANELVEH_OWNER)
	{
	    if(response)
	    {
	        if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_EVO_PANELVEH_OWNER, DIALOG_STYLE_INPUT, "{ADFF2F}Vehicle Owner", "{FFFFFF}Select the new owner of selected vehicle:", "Change", "Back");
	        format(EvoVehicles[ SelectedEV[playerid] ][EVOwner], 40, inputtext);
	        
	        EvoVehicles[ SelectedEV[playerid] ][EVNeedSave] = 1;
	        
			INFO(playerid, "Vehicle's owner has been changed successfully");

            ShowAdminEvPanel(playerid, SelectedEV[playerid]);
	    }else{
			ShowAdminEvPanel(playerid, SelectedEV[playerid]);
		}
	}
	
	if(dialogid == DIALOG_EVO_PANELVEH_COL1)
	{
	    if(response)
	    {
	        if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_EVO_PANELVEH_COL1, DIALOG_STYLE_INPUT, "{ADFF2F}Vehicle Color 1", "{FFFFFF}Select the new first color of selected vehicle:", "Change", "Back");
	        new col = strval(inputtext);
	        
	        EvoVehicles[ SelectedEV[playerid] ][EVCol1] = col;
	        ChangeVehicleColor(EvoVehicles[ SelectedEV[playerid] ][EVVehID], EvoVehicles[ SelectedEV[playerid] ][EVCol1], EvoVehicles[ SelectedEV[playerid] ][EVCol2]);
	        
	        EvoVehicles[ SelectedEV[playerid] ][EVNeedSave] = 1;
	        
			INFO(playerid, "Vehicle's first color has been changed successfully");

            ShowAdminEvPanel(playerid, SelectedEV[playerid]);
	    }else{
			ShowAdminEvPanel(playerid, SelectedEV[playerid]);
		}
	}

	if(dialogid == DIALOG_EVO_PANELVEH_COL2)
	{
	    if(response)
	    {
	        if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_EVO_PANELVEH_COL2, DIALOG_STYLE_INPUT, "{ADFF2F}Vehicle Color 2", "{FFFFFF}Select the new second color of selected vehicle:", "Change", "Back");
	        new col = strval(inputtext);

	        EvoVehicles[ SelectedEV[playerid] ][EVCol2] = col;
	        ChangeVehicleColor(EvoVehicles[ SelectedEV[playerid] ][EVVehID], EvoVehicles[ SelectedEV[playerid] ][EVCol1], EvoVehicles[ SelectedEV[playerid] ][EVCol2]);

            EvoVehicles[ SelectedEV[playerid] ][EVNeedSave] = 1;
            
			INFO(playerid, "Vehicle's second color has been changed successfully");
			
			ShowAdminEvPanel(playerid, SelectedEV[playerid]);
	    }else{
	        ShowAdminEvPanel(playerid, SelectedEV[playerid]);
	    }
	}

	if(dialogid == DIALOG_EVO_PANELVEH_PRICE)
	{
	    if(response)
	    {
	        if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_EVO_PANELVEH_PRICE, DIALOG_STYLE_INPUT, "{ADFF2F}Vehicle Price", "{FFFFFF}Select the new price of selected vehicle:", "Change", "Back");
	        new price = strval(inputtext);

	        EvoVehicles[ SelectedEV[playerid] ][EVPrice] = price;

            EvoVehicles[ SelectedEV[playerid] ][EVNeedSave] = 1;
            
			INFO(playerid, "Vehicle's price has been changed successfully");
			
			ShowAdminEvPanel(playerid, SelectedEV[playerid]);
	    }else{
	        ShowAdminEvPanel(playerid, SelectedEV[playerid]);
	    }
	}

	if(dialogid == DIALOG_EVO_PANELVEH_SEC)
	{
	    if(response)
	    {
	        EvoVehicles[ SelectedEV[playerid] ][EVSecurity] = listitem;
	        
	        EvoVehicles[ SelectedEV[playerid] ][EVNeedSave] = 1;
	        
			INFO(playerid, "Vehicle's security system has been changed successfully");

            ShowAdminEvPanel(playerid, SelectedEV[playerid]);
	    }else{
            ShowAdminEvPanel(playerid, SelectedEV[playerid]);
	    }
	}

	if(dialogid == DIALOG_EVO_PANELVEH_LOCK)
	{
	    if(response)
	    {
	        EvoVehicles[ SelectedEV[playerid] ][EVLock] = listitem;
			LockEvoVehicle(SelectedEV[playerid], listitem);
			
            EvoVehicles[ SelectedEV[playerid] ][EVNeedSave] = 1;
            
			INFO(playerid, "Vehicle's lock state has been changed successfully");

            ShowAdminEvPanel(playerid, SelectedEV[playerid]);
	    }else{
            ShowAdminEvPanel(playerid, SelectedEV[playerid]);
	    }
	}

	if(dialogid == DIALOG_EVO_PANELVEH_PLATE)
	{
	    if(response)
	    {
	        if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_EVO_PANELVEH_PLATE, DIALOG_STYLE_INPUT, "{ADFF2F}Vehicle Plate", "{FFFFFF}Select the new plate of selected vehicle:", "Change", "Back");
	        format(EvoVehicles[ SelectedEV[playerid] ][EVPlate], 30, inputtext);
	        
	        SetVehicleNumberPlate(EvoVehicles[ SelectedEV[playerid] ][EVVehID], EvoVehicles[ SelectedEV[playerid] ][EVPlate]);
	        SetVehicleToRespawn(EvoVehicles[ SelectedEV[playerid] ][EVVehID]);

            EvoVehicles[ SelectedEV[playerid] ][EVNeedSave] = 1;
            
			INFO(playerid, "Vehicle's plate has been changed successfully");

            ShowAdminEvPanel(playerid, SelectedEV[playerid]);
	    }else{
			ShowAdminEvPanel(playerid, SelectedEV[playerid]);
		}
	}

	if(dialogid == DIALOG_EVO_PANELVEH_PJ)
	{
	    if(response)
	    {
	        if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_EVO_PANELVEH_PJ, DIALOG_STYLE_INPUT, "{ADFF2F}Vehicle Paintjob", "{FFFFFF}Select the new paintjob id of selected vehicle:", "Change", "Back");
	        EvoVehicles[ SelectedEV[playerid] ][EVPJ] = strval(inputtext);

	        ChangeVehiclePaintjob(EvoVehicles[ SelectedEV[playerid] ][EVVehID], EvoVehicles[ SelectedEV[playerid] ][EVPJ]);

            EvoVehicles[ SelectedEV[playerid] ][EVNeedSave] = 1;
            
			INFO(playerid, "Vehicle's paintjob has been changed successfully");

            ShowAdminEvPanel(playerid, SelectedEV[playerid]);
	    }else{
			ShowAdminEvPanel(playerid, SelectedEV[playerid]);
		}
	}

	// Player Vehicle Administrating
	if(dialogid == DIALOG_A_VEHLIST)
	{
		if(response)
		{
		    SelectedEV[playerid] = GetPlayerVehicleInSlot(playerid, listitem+1);

			ShowPlayerEVPanel(playerid, SelectedEV[playerid]);
		}
	}
	
	if(dialogid == DIALOG_A_HOME)
	{
		if(response)
		{
		    switch(listitem)
		    {
		        case 0: // Get Vehicle
		        {
		            new Float:pX, Float:pY, Float:pZ, Float:pRot;
		            GetPlayerPos(playerid, pX, pY, pZ);
		            GetPlayerFacingAngle(playerid, pRot);

		            pX += 5.0 * floatcos(pRot+90, degrees);
		            pY += 5.0 * floatsin(pRot+90, degrees);

		            SetVehiclePos(EvoVehicles[ SelectedEV[playerid] ][EVVehID], pX, pY, pZ);
					SetVehicleZAngle(EvoVehicles[ SelectedEV[playerid] ][EVVehID], pRot+90);

					INFO(playerid, "You got here your vehicle successfully");

					ShowPlayerEVPanel(playerid, SelectedEV[playerid]);
		        }
		        
		        case 1: // Sell Vehicle
		        {
		            GivePlayerMoney(playerid, EvoVehicles[ SelectedEV[playerid] ][EVPrice]);
		            format(EvoVehicles[ SelectedEV[playerid] ][EVOwner], 40, "-");
					EvoVehicles[ SelectedEV[playerid] ][EVNeedSave] = 1;

		            INFO(playerid, "You sold your vehicle successfully");

					new PEVCount = GetPlayerVehicleCount(playerid);

					if(PEVCount == 0) return 1;

					new DiaString[512], PEVID;

					for(new i; i < PEVCount; i++)
					{
						PEVID = GetPlayerVehicleInSlot(playerid, i+1);

						format(DiaString, 512, "%s{ADFF2F}%d# {FFFFFF}%s\n", DiaString, i+1, VehNames[ EvoVehicles[PEVID][EVModel]-400]);
					}

					ShowPlayerDialog(playerid, DIALOG_A_VEHLIST, DIALOG_STYLE_LIST, "{ADFF2F}My Vehicles", DiaString, "Manage", "Close");
		        }
		        
		        case 2: // Vehicle Lock
		        {
					switch(EvoVehicles[ SelectedEV[playerid] ][EVLock])
					{
					    case 0: EvoVehicles[ SelectedEV[playerid] ][EVLock] = 1;
					    case 1: EvoVehicles[ SelectedEV[playerid] ][EVLock] = 0;
					}
					
					LockEvoVehicle(SelectedEV[playerid], EvoVehicles[ SelectedEV[playerid] ][EVLock]);
					EvoVehicles[ SelectedEV[playerid] ][EVNeedSave] = 1;
					ShowPlayerEVPanel(playerid, SelectedEV[playerid]);
		        }
		        
		        case 3: // Vehicle Security
		        {
					if(EvoVehicles[ SelectedEV[playerid] ][EVSecurity] != 2)
					{
					    EvoVehicles[ SelectedEV[playerid] ][EVSecurity]++;
					}else{
					    EvoVehicles[ SelectedEV[playerid] ][EVSecurity] = 0;
					}
					
					EvoVehicles[ SelectedEV[playerid] ][EVNeedSave] = 1;
					ShowPlayerEVPanel(playerid, SelectedEV[playerid]);
		        }
		        
		        case 4: // Vehicle Plate
		        {
		            ShowPlayerDialog(playerid, DIALOG_A_PLATE, DIALOG_STYLE_INPUT, "{ADFF2F}Change Plate", "{FFFFFF}Select the new plate of your vehicle:", "Change", "Back");
		        }
		        
		        #if AUTOMATIC_PARK == false
				case 5: // Park Vehicle
				{
				    GetVehiclePos(EvoVehicles[ SelectedEV[playerid] ][EVVehID], EvoVehicles[ SelectedEV[playerid] ][EVX], EvoVehicles[ SelectedEV[playerid] ][EVY], EvoVehicles[ SelectedEV[playerid] ][EVZ]);
				    GetVehicleZAngle(EvoVehicles[ SelectedEV[playerid] ][EVVehID], EvoVehicles[ SelectedEV[playerid] ][EVRot]);
				    
				    EvoVehicles[ SelectedEV[playerid] ][EVNeedSave] = 1;
				    
				    INFO(playerid, "Your vehicle has been parked");
				    
				    ShowPlayerEVPanel(playerid, SelectedEV[playerid]);
				}
		        #endif
		    }
		}else{
			new PEVCount = GetPlayerVehicleCount(playerid);

			new DiaString[512], PEVID;

			for(new i; i < PEVCount; i++)
			{
				PEVID = GetPlayerVehicleInSlot(playerid, i+1);

				format(DiaString, 512, "%s{ADFF2F}%d# {FFFFFF}%s\n", DiaString, i+1, VehNames[ EvoVehicles[PEVID][EVModel]-400]);
			}

			ShowPlayerDialog(playerid, DIALOG_A_VEHLIST, DIALOG_STYLE_LIST, "{ADFF2F}My Vehicles", DiaString, "Manage", "Close");
		}
	}
	
	if(dialogid == DIALOG_A_PLATE)
	{
	    if(response)
	    {
	        if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_A_PLATE, DIALOG_STYLE_INPUT, "{ADFF2F}Change Plate", "{FFFFFF}Select the new plate of your vehicle:", "Change", "Back");
	        format(EvoVehicles[ SelectedEV[playerid] ][EVPlate], 30, inputtext);

			GetVehiclePos(EvoVehicles[ SelectedEV[playerid] ][EVVehID], EvoVehicles[ SelectedEV[playerid] ][EVX], EvoVehicles[ SelectedEV[playerid] ][EVY], EvoVehicles[ SelectedEV[playerid] ][EVZ]);
			GetVehicleZAngle(EvoVehicles[ SelectedEV[playerid] ][EVVehID], EvoVehicles[ SelectedEV[playerid] ][EVRot]);
			GetVehicleMod(SelectedEV[playerid]);
			
			SetVehicleNumberPlate(EvoVehicles[ SelectedEV[playerid] ][EVVehID], EvoVehicles[ SelectedEV[playerid] ][EVPlate]);
	        SetVehicleToRespawn(EvoVehicles[ SelectedEV[playerid] ][EVVehID]);

		    EvoVehicles[ SelectedEV[playerid] ][EVNeedSave] = 1;
            
	        INFO(playerid, "Vehicle's plate has been changed successfully");
	        
	        ShowPlayerEVPanel(playerid, SelectedEV[playerid]);
	    }else{
	        ShowPlayerEVPanel(playerid, SelectedEV[playerid]);
	    }
	}
	
	// Buying Evo Vehicle
	if(dialogid == DIALOG_BUY_VEHICLE)
	{
	    if(response)
	    {
	        new EVSystemID = VehEVID[ GetPlayerVehicleID(playerid) ];
	        
	        if(GetPlayerVehicleCount(playerid) == MAX_PLAYER_EVO_VEHICLE) return ERROR(playerid, "You have already reached owned vehicle limit");
	        if(GetPlayerMoney(playerid) < EvoVehicles[ EVSystemID ][EVPrice]) return ERROR(playerid, "You don't have enough money for buy this vehicle!");

			GivePlayerMoney(playerid, -EvoVehicles[ EVSystemID ][EVPrice]);
			format(EvoVehicles[ EVSystemID ][EVOwner], 40, GetName(playerid));
			EvoVehicles[ EVSystemID ][EVNeedSave] = 1;
			
	        new EVMessage[256];
	        format(EVMessage, 256, "{FFFFFF}You bought {ADFF2F}%s {FFFFFF}for {ADFF2F}%d $", VehNames[ EvoVehicles[ EVSystemID ][EVModel]-400 ], EvoVehicles[ EVSystemID ][EVPrice]);

			INFO(playerid, EVMessage);
			INFO(playerid, "You can write {ADFF2F}/myveh {FFFFFF}for manage your vehicles");
		}
	}
	
	// Buying Evo Vehicle From Showroom
	if(dialogid == DIALOG_SRVEH)
	{
	    if(response)
	    {
            new EVSystemID = VehEVID[ GetPlayerVehicleID(playerid) ];

	        if(GetPlayerVehicleCount(playerid) == MAX_PLAYER_EVO_VEHICLE) return ERROR(playerid, "You have already reached limit of the player vehicle"), RemovePlayerFromVehicle(playerid);
	        if(GetPlayerMoney(playerid) < EvoVehicles[ EVSystemID ][EVPrice]) return ERROR(playerid, "You don't have enough money for buy it!"), RemovePlayerFromVehicle(playerid);

			new DiaString[512];
			
			for(new i; i < sizeof(VehColors); i++)
			{
			    format(DiaString, 512, "%s{FFFFFF}%s\n", DiaString, VehColors[i][VCName]);
			}
			
			ShowPlayerDialog(playerid, DIALOG_SRVEH_COLOR, DIALOG_STYLE_LIST, "{ADFF2F}Vehicle Color", DiaString, "Select", "Cancel");
	    }else{
	        if(pInfo[playerid][pRoot] != 1) RemovePlayerFromVehicle(playerid);
	    }
	}
	
	if(dialogid == DIALOG_SRVEH_COLOR)
	{
	    if(response)
	    {
			new EVSystemID = VehEVID[ GetPlayerVehicleID(playerid) ];
			
			CreateEvoVehicle(EvoVehicles[ EVSystemID ][EVModel], GetName(playerid), Showrooms[ SelectedSR[playerid] ][SRX], Showrooms[ SelectedSR[playerid] ][SRY], Showrooms[ SelectedSR[playerid] ][SRZ], 0, VehColors[listitem][VCColor], VehColors[listitem][VCColor], EvoVehicles[ EVSystemID ][EVPrice]);
			GivePlayerMoney(playerid, -EvoVehicles[ EVSystemID ][EVPrice]);
			
			INFO(playerid, "Congratulations! You bought a new vehicle");
			INFO(playerid, "You can enter your vehicle in front of showroom");
			INFO(playerid, "You can use /myveh command for manage your vehicles");
			
			RemovePlayerFromVehicle(playerid);
	    }else{
	        if(pInfo[playerid][pRoot] != 1) RemovePlayerFromVehicle(playerid);
	    }
	}
	return 1;
}

// =============================[SYSTEM PUBLICS]============================= //
// For System
// - LoadEVO
public LoadEVO(name[], value[])
{
	INI_String("PANELPASS", EVOPanelPass, 150);
	INI_Int("LASTVEHICLEID", LastEvoVehicleID);
	INI_Int("LASTSHOWROOMID", LastShowroomID);
	return 1;
}


// - SaveEVO
public SaveEVO()
{
	new EVFileName[35];
	format(EVFileName, 35, "%s/options.ini", EVOVEHICLE_MAIN_DIR);

	new INI:EvoFile = INI_Open(EVFileName);

	INI_WriteString(EvoFile, "PANELPASS", EVOPanelPass);
	INI_WriteInt(EvoFile, "LASTVEHICLEID", LastEvoVehicleID);
	INI_WriteInt(EvoFile, "LASTSHOWROOMID", LastShowroomID);

	INI_Close(EvoFile);
}

// Evo Vehicle Version Controller
// - EvoVehicle_Init
public EvoVehicle_Init(index, response_code, data[])
{
	printf("<========================================>");
	printf("                                          ");
	printf("      <Evo Script Version Controller>     ");
	printf("         <Evo Vehicle Ownership>          ");
	printf("                                          ");

	printf("            Installed Version             ");
	printf("                  %s                      ", VERSION);
	printf("                                          ");
	printf("              Last Version                ");
	printf("                  %s                      ", data);
	printf("                                          ");

	if(response_code == 200)
    {
        if(!strcmp(data, VERSION, true))
        {
            printf("           Your EVO is actual           ");
        }else{
  			printf("             Your EVO is old            ");
			printf("                                          ");
			printf("     Download the new version of EVO     ");
			printf("         From Topic in Forum-SAMP        ");
        }
    }else{
		printf("                ERROR                     ");
		printf("        We couldn't get response          ");
		printf("             From Website                 ");
		printf("                                          ");
		printf("             EXPLANATION                  ");
		printf("       %s", ConnectionErrors[response_code]);
    }

	printf("                                          ");
	printf("<========================================>");
}

// - EvoVehicle_InGame
public EvoVehicle_InGame(index, response_code, data[])
{
	new String[512];

    if(response_code == 200)
    {
        format(String, 512, "{FFFFFF}Installed Version \t{ADFF2F}%s\n{FFFFFF}Last Version \t{ADFF2F}%s\n \n", VERSION, data);

        if(!strcmp(data, VERSION, true))
        {
            format(String, 512, "%s{FFFFFF}Your Evo Vehicle Ownership is actual", String);
        }else{
            format(String, 512, "%s{FFFFFF}Your Evo Vehicle Ownership is old\nDownload the new version of EVO from topic in Forum-SAMP", String);
        }

        ShowPlayerDialog(index, 9999, DIALOG_STYLE_MSGBOX, "{ADFF2F}Evo Script Version Controller", String, "Close", "");
    }else{
        format(String, 512, "{FF0000}We couldn't get response from website!\n \n{FF0000}%s", ConnectionErrors[response_code]);

	    ShowPlayerDialog(index, 9999, DIALOG_STYLE_MSGBOX, "{ADFF2F}Evo Script Version Controller", String, "Close", "");
    }
}

// For Evo Vehicles
// - CreateEvoVehicle
public CreateEvoVehicle(Modelid, Owner[], Float:X, Float:Y, Float:Z, Float:Rot, Col1, Col2, Price)
{
	new CreatedID;
	
	CreatedID = GetEmptyEvoVehicleID();
	
	Iter_Add(EVs, CreatedID);
	LastEvoVehicleID = Iter_Last(EVs)+1;
	
	EvoVehicles[CreatedID][EVModel] = Modelid;
	format(EvoVehicles[CreatedID][EVOwner], 40, Owner);
	EvoVehicles[CreatedID][EVX] = X;
	EvoVehicles[CreatedID][EVY] = Y;
	EvoVehicles[CreatedID][EVZ] = Z;
	EvoVehicles[CreatedID][EVRot] = Rot;
	EvoVehicles[CreatedID][EVCol1] = Col1;
	EvoVehicles[CreatedID][EVCol2] = Col2;
	EvoVehicles[CreatedID][EVPrice] = Price;
	EvoVehicles[CreatedID][EVSecurity] = 0;
	EvoVehicles[CreatedID][EVLock] = 0;
	format(EvoVehicles[CreatedID][EVPlate], 30, Owner);
	EvoVehicles[CreatedID][EVPJ] = -1;
	EvoVehicles[CreatedID][EVExist] = 1;

	EvoVehicles[CreatedID][EVVehID] = CreateVehicle(Modelid, X, Y, Z, Rot, Col1, Col2, -1);
	VehEVID[ EvoVehicles[CreatedID][EVVehID] ] = CreatedID;
	VehInSystem[ EvoVehicles[CreatedID][EVVehID] ] = 1;
	SetVehicleNumberPlate(EvoVehicles[CreatedID][EVVehID], Owner);
	SetVehicleToRespawn(EvoVehicles[CreatedID][EVVehID]);
	
	new FileName[35];
	format(FileName, 35, "%s/Vehicle_%d.ini", EVOVEHICLE_VEHICLE_DIR, CreatedID);
	
	new INI:VehFile = INI_Open(FileName);
	
	INI_SetTag(VehFile, "evo");
	
	INI_WriteInt(VehFile, "MODEL", Modelid);
	INI_WriteString(VehFile, "OWNER", Owner);
	INI_WriteFloat(VehFile, "X", X);
	INI_WriteFloat(VehFile, "Y", Y);
	INI_WriteFloat(VehFile, "Z", Z);
	INI_WriteFloat(VehFile, "ROT", Rot);
	INI_WriteInt(VehFile, "COL1", Col1);
	INI_WriteInt(VehFile, "COL2", Col2);
	INI_WriteInt(VehFile, "PRICE", Price);
	INI_WriteInt(VehFile, "SECURITY", 0);
	INI_WriteInt(VehFile, "LOCK", 0);
	INI_WriteString(VehFile, "PLATE", Owner);
	INI_WriteInt(VehFile, "PJ", -1);
	SaveAllVehicleComponentsToFile(VehFile, CreatedID);
	
	INI_Close(VehFile);
	
	return CreatedID;
}

// - DeleteEvoVehicle
public DeleteEvoVehicle(vehicleid)
{
	EvoVehicles[vehicleid][EVExist] = 0;
	DestroyVehicle(EvoVehicles[vehicleid][EVVehID]);
	VehInSystem[ EvoVehicles[vehicleid][EVVehID] ] = 0;
	
	Iter_Remove(EVs, vehicleid);
	LastEvoVehicleID = Iter_Last(EVs)+1;

	new FileName[35];
	format(FileName, 35, "%s/Vehicle_%d.ini", EVOVEHICLE_VEHICLE_DIR, vehicleid);
	fremove(FileName);
	return 1;
}

// - LoadEvoVehicles
public LoadEvoVehicles()
{
	new EVFileName[35], Loadedcount;

	for(new i = LastLoaded; i < LastEvoVehicleID; i++)
	{
		format(EVFileName, 35, "%s/Vehicle_%d.ini", EVOVEHICLE_VEHICLE_DIR, i);

		if(fexist(EVFileName))
		{
		    INI_ParseFile(EVFileName, "LoadEvoVehicle_%s", .bExtra = true, .extra = i);
		    
		    Iter_Add(EVs, i);
		    
	    	EvoVehicles[i][EVVehID] = CreateVehicle(EvoVehicles[i][EVModel], EvoVehicles[i][EVX], EvoVehicles[i][EVY], EvoVehicles[i][EVZ], EvoVehicles[i][EVRot], EvoVehicles[i][EVCol1], EvoVehicles[i][EVCol2], -1);
			VehEVID[ EvoVehicles[i][EVVehID] ] = i;
			VehInSystem[ EvoVehicles[i][EVVehID] ] = 1;
			SetVehicleNumberPlate(EvoVehicles[i][EVVehID], EvoVehicles[i][EVPlate]);
			SetVehicleToRespawn(EvoVehicles[i][EVVehID]);

			LoadVehicleMod(i);
			
			Loadedcount++;
			
			if(Loadedcount == 50)
			{
				LastLoaded = i+1;
				SetTimer("LoadEvoVehicles", 10000, 0);
				break;
			}
		}
		
		if(i == LastEvoVehicleID-1)
		{
			LastLoaded = 0;
			break;
		}
	}

}

// - LoadEvoVehicle_evo
public LoadEvoVehicle_evo(EvoVehicleID, name[], value[])
{
	INI_Int("MODEL", EvoVehicles[ EvoVehicleID ][EVModel]);
	INI_String("OWNER", EvoVehicles[ EvoVehicleID ][EVOwner], 40);
	INI_Float("X", EvoVehicles[ EvoVehicleID ][EVX]);
	INI_Float("Y", EvoVehicles[ EvoVehicleID ][EVY]);
	INI_Float("Z", EvoVehicles[ EvoVehicleID ][EVZ]);
	INI_Float("ROT", EvoVehicles[ EvoVehicleID ][EVRot]);
	INI_Int("COL1", EvoVehicles[ EvoVehicleID ][EVCol1]);
	INI_Int("COL2", EvoVehicles[ EvoVehicleID ][EVCol2]);
	INI_Int("PRICE", EvoVehicles[ EvoVehicleID ][EVPrice]);
	INI_Int("SECURITY", EvoVehicles[ EvoVehicleID ][EVSecurity]);
	INI_Int("LOCK", EvoVehicles[ EvoVehicleID ][EVLock]);
	INI_String("PLATE", EvoVehicles[ EvoVehicleID ][EVPlate], 30);
	INI_Int("PJ", EvoVehicles[ EvoVehicleID ][EVPJ]);
	EvoVehicles[ EvoVehicleID ][EVExist] = 1;
	LoadAllVehicleComponents(EvoVehicleID, name, value);
	return 1;
}

// - SaveEvoVehicles
public SaveEvoVehicles(last)
{
	new EVFileName[35], INI:VehFile, SavedCount;
	Unloading = last;

	new Float:NewX, Float:NewY, Float:NewZ, Float:NewRot;

	for(new i = LastSaved; i < LastEvoVehicleID; i++)
	{
		if(EvoVehicles[i][EVExist] == 1)
		{
		    #if AUTOMATIC_PARK == true

			GetVehiclePos(EvoVehicles[i][EVVehID], NewX, NewY, NewZ);
			GetVehicleZAngle(EvoVehicles[i][EVVehID], NewRot);

			if(NewX != EvoVehicles[i][EVX] || NewY != EvoVehicles[i][EVY] || NewZ != EvoVehicles[i][EVZ] || NewRot != EvoVehicles[i][EVRot]) EvoVehicles[i][EVNeedSave] = 1;

			#else

			GetVehiclePos(EvoVehicles[i][EVVehID], NewX, NewY, NewZ);
			GetVehicleZAngle(EvoVehicles[i][EVVehID], NewRot);

			if((!strcmp("-", EvoVehicles[i][EVOwner], true) || !strfind(EvoVehicles[i][EVOwner], "Galeri", true)) ) && ( NewX != EvoVehicles[i][EVX] || NewY != EvoVehicles[i][EVY] || NewZ != EvoVehicles[i][EVZ] || NewRot != EvoVehicles[i][EVRot] )) EvoVehicles[i][EVNeedSave] = 1;

			#endif
			
			if(EvoVehicles[i][EVNeedSave] == 1)
		    {
		        if(SavedCount == 10 && Unloading == 0)
		        {
		            LastSaved = i;
		            SetTimer("SaveEvoVehicles", 5000, 0);
		            break;
		        }
		        
		    	format(EVFileName, 35, "%s/Vehicle_%d.ini", EVOVEHICLE_VEHICLE_DIR, i);
		    
				VehFile = INI_Open(EVFileName);
				
				INI_SetTag(VehFile, "evo");
				
				INI_WriteInt(VehFile, "MODEL", EvoVehicles[i][EVModel]);
				INI_WriteString(VehFile, "OWNER", EvoVehicles[i][EVOwner]);
				INI_WriteFloat(VehFile, "X", EvoVehicles[i][EVX]);
				INI_WriteFloat(VehFile, "Y", EvoVehicles[i][EVY]);
				INI_WriteFloat(VehFile, "Z", EvoVehicles[i][EVZ]);
				INI_WriteFloat(VehFile, "ROT", EvoVehicles[i][EVRot]);
				INI_WriteInt(VehFile, "COL1", EvoVehicles[i][EVCol1]);
				INI_WriteInt(VehFile, "COL2", EvoVehicles[i][EVCol2]);
				INI_WriteInt(VehFile, "PRICE", EvoVehicles[i][EVPrice]);
				INI_WriteInt(VehFile, "SECURITY", EvoVehicles[i][EVSecurity]);
				INI_WriteInt(VehFile, "LOCK", EvoVehicles[i][EVLock]);
				INI_WriteString(VehFile, "PLATE", EvoVehicles[i][EVPlate]);
				INI_WriteInt(VehFile, "PJ", EvoVehicles[i][EVPJ]);
				SaveAllVehicleComponentsToFile(VehFile, i);

				INI_Close(VehFile);
				
				SavedCount++;
		    }
		}
		
		if(i == LastEvoVehicleID-1)
		{
		    LastSaved = 0;
		    break;
		}
	}
}

// For Showroom
// - CreateShowroom
public CreateShowroom(Name[], Float:X, Float:Y, Float:Z)
{
	new CreatedID = GetEmptyShowroomID();

	Iter_Add(SRs, CreatedID);
	LastShowroomID = Iter_Last(SRs)+1;

	format(Showrooms[CreatedID][SRName], 100, Name);
	Showrooms[CreatedID][SRX] = X;
	Showrooms[CreatedID][SRY] = Y;
	Showrooms[CreatedID][SRZ] = Z;
	Showrooms[CreatedID][SRExist] = 1;

	Showrooms[CreatedID][SRPick] = CreatePickup(1239, 1, X, Y, Z, 0);

	new String[128];
	format(String, 128, "{ADFF2F}SHOWROOM\n{ADFF2F}%s\n{FFFFFF}Showroom ID {ADFF2F}%d", Showrooms[CreatedID][SRName], CreatedID);
	Showrooms[CreatedID][SR3D] = Create3DTextLabel(String, -1, X, Y, Z, 25.0, 0);
	
	new FileName[35];
	format(FileName, 35, "%s/Showroom_%d.ini", EVOVEHICLE_SHOWROOM_DIR, CreatedID);

	new INI:SRFile = INI_Open(FileName);

	INI_SetTag(SRFile, "evo");

	INI_WriteString(SRFile, "NAME", Name);
	INI_WriteFloat(SRFile, "X", X);
	INI_WriteFloat(SRFile, "Y", Y);
	INI_WriteFloat(SRFile, "Z", Z);

	INI_Close(SRFile);

	return CreatedID;
}

// - DeleteShowroom
public DeleteShowroom(showroomid)
{
	Showrooms[showroomid][SRExist] = 0;
	DestroyPickup(Showrooms[showroomid][SRPick]);
	Delete3DTextLabel(Showrooms[showroomid][SR3D]);

	Iter_Remove(SRs, showroomid);
	LastShowroomID = Iter_Last(SRs)+1;

	new FileName[35];
	format(FileName, 35, "%s/Showroom_%d.ini", EVOVEHICLE_SHOWROOM_DIR, showroomid);
	fremove(FileName);
}

// - LoadShowrooms
public LoadShowrooms()
{
	new SRFileName[35], Loadedcount, String[128];
	
	for(new i = LastLoadedSR; i < LastShowroomID; i++)
	{
		format(SRFileName, 35, "%s/Galeri_%d.ini", EVOVEHICLE_SHOWROOM_DIR, i);

		if(fexist(SRFileName))
		{
		    INI_ParseFile(SRFileName, "LoadShowroom_%s", .bExtra = true, .extra = i);

			Showrooms[i][SRPick] = CreatePickup(1239, 1, Showrooms[i][SRX], Showrooms[i][SRY], Showrooms[i][SRZ], 0);

			format(String, 128, "{ADFF2F}SHOWROOM\n{ADFF2F}%s\n{FFFFFF}Showroom ID {ADFF2F}%d", Showrooms[i][SRName], i);
			Showrooms[i][SR3D] = Create3DTextLabel(String, -1, Showrooms[i][SRX], Showrooms[i][SRY], Showrooms[i][SRZ], 25.0, 0);

            Showrooms[i][SRExist] = 1;
            
			Loadedcount++;

			if(Loadedcount == 50)
			{
				LastLoadedSR = i+1;
				SetTimer("LoadShowrooms", 10000, 0);
				break;
			}
		}

		if(i == LastShowroomID-1)
		{
			LastLoadedSR = 0;
			break;
		}
	}
}

// - LoadShowroom_evo
public LoadShowroom_evo(ShowroomID, name[], value[])
{
	INI_String("NAME", Showrooms[ ShowroomID ][SRName], 100);
	INI_Float("X", Showrooms[ ShowroomID ][SRX]);
	INI_Float("Y", Showrooms[ ShowroomID ][SRY]);
	INI_Float("Z", Showrooms[ ShowroomID ][SRZ]);
	Showrooms[ ShowroomID ][SRExist] = 1;
	return 1;
}

// - Save Showrooms
public SaveShowrooms(last)
{
	new SRFileName[35], INI:SRFile, SavedCount;
	Unloading = last;
	
	for(new i = LastSavedSR; i < LastShowroomID; i++)
	{
		if(Showrooms[i][SRExist] == 1)
		{
			if(Showrooms[i][SRNeedSave] == 1)
		    {
		        if(SavedCount == 10 && Unloading == 0)
		        {
		            LastSavedSR = i;
		            SetTimer("SaveShowrooms", 5000, 0);
		            break;
		        }

		    	format(SRFileName, 35, "%s/Showroom_%d.ini", EVOVEHICLE_SHOWROOM_DIR, i);

				SRFile = INI_Open(SRFileName);

				INI_SetTag(SRFile, "evo");

				INI_WriteString(SRFile, "NAME", Showrooms[i][SRName]);
				INI_WriteFloat(SRFile, "X", Showrooms[i][SRX]);
				INI_WriteFloat(SRFile, "Y", Showrooms[i][SRY]);
				INI_WriteFloat(SRFile, "Z", Showrooms[i][SRZ]);

				INI_Close(SRFile);

				SavedCount++;
		    }
		}

		if(i == LastShowroomID-1)
		{
		    LastSavedSR = 0;
		    break;
		}
	}
}
Show the errors u get...
Reply
#60

Why after restart the server, cars are blocked the showroom?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)