All pastes #337393 Raw Edit

Unnamed

public text v1 · immutable
·published 2007-02-02 19:22 UTC
rendered paste body
#include <a_samp>
#include <core>
#include <float>
#include <file>
#include <dini>

#define GAMEMODETEXT "-"

#define FILE_SETTINGS "freeroam/config/settings.ini"
#define FILE_TOTALSTAT "freeroam/save/totalstat.ini"
#define FILE_PROPS "freeroam/save/props.ini"
#define FILE_CARS "freeroam/save/cars.ini"
#define FILE_LOG "freeroam/logs/freeroam.log"
#define FILE_CHEATLOG "freeroam/logs/cheat.log"
#define FILE_REPORT "freeroam/logs/report.log"

#define DIR_PLAYERS "freeroam/players/"
#define DIR_CLANS "freeroam/clans/"

#define MAX_VALUE 200000000

#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_RED 0xCC2222AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_BLUE 0x6666FFAA
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_ORANGE 0xFF9900AA

#define INACTIVE_PLAYER_ID 255

#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_RED 0xAA3333AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_WHITE 0xFFFFFFAA

//Vehicles
#define GROVE_VEHICLE_ONE 567,2509.9382,-1667.7566,13.3356,5.5935,86,86
#define GROVE_VEHICLE_TWO 567,2506.9841,-1677.4115,13.3292,325.3867,86,86
#define GROVE_VEHICLE_THREE 567,2501.5195,-1655.5464,13.3189,69.0657,86,86
#define GROVE_VEHICLE_FOUR 567,2484.7808,-1653.7554,13.2652,86.9443,86,86
#define GROVE_VEHICLE_FIVE 567,2468.3486,-1653.4425,13.2643,91.4342,86,86

//Gang characters
#define CLASS_GROVE_ONE 105,2491.4653,-1670.0663,13.3359,57.6821,0,0,0,0,0,0

//Player class selection
#define CLASS_OUTSIDE_INT playerid,0
#define CLASS_PLAYER_POS playerid,508.7362,-87.4335,998.9609
#define CLASS_CAM_POS playerid,508.7362,-83.4335,998.9609
#define CLASS_CAM_LOOKAT playerid,508.7362,-87.4335,998.9609
#define CLASS_FACE_ANGLE playerid,0.0

//Fuel (Relevant code!)
#define TIME 3000
#define AMOUNT 100

new worldTime;

new playername[MAX_PLAYERS][MAX_PLAYER_NAME];
new playerCheckpoint[MAX_PLAYERS];
new playercolor[MAX_PLAYERS];
new clan[MAX_PLAYERS][MAX_STRING];
new claninvite[MAX_PLAYERS][MAX_STRING];
new lastclass[MAX_PLAYERS];
new classrestored[MAX_PLAYERS];
new idle[MAX_PLAYERS];
new Float:idlepos[MAX_PLAYERS][3];
new spectator[MAX_PLAYERS][3];
new Float:spectlastpos[MAX_PLAYERS][3];
new logged[MAX_PLAYERS];
new logintimeout[MAX_PLAYERS];
new wrongpasses[MAX_PLAYERS];
new votes[MAX_PLAYERS];
new votetype[MAX_PLAYERS];
new votetime[MAX_PLAYERS];
new voted[MAX_PLAYERS][MAX_PLAYERS];
new muted[MAX_PLAYERS];
new mutetime[MAX_PLAYERS];
new mutetimer[MAX_PLAYERS];
new jailed[MAX_PLAYERS];
new jailtime[MAX_PLAYERS];
new jailtimer[MAX_PLAYERS];
new frozen[MAX_PLAYERS];
new reporttimeout[MAX_PLAYERS];
new god[MAX_PLAYERS];
new query[MAX_PLAYERS];
new ignore[MAX_PLAYERS][MAX_PLAYERS];
new antispawnkill[MAX_PLAYERS];
new antispawnkilltimeout[MAX_PLAYERS];
new cheatdeaths[MAX_PLAYERS];
new cheatweapons[MAX_PLAYERS];
new killsinarow[MAX_PLAYERS];
new smoney[MAX_PLAYERS];
new bank[MAX_PLAYERS];
new bounty[MAX_PLAYERS];
new respect[MAX_PLAYERS];

new playerColors[8] = {
0xAFAFAFAA,0x33AA33AA,0xCC2222AA,0xFFFF00AA,0xFFFFFFAA,0x6666FFAA,0xFF9900AA,0x33CCFFAA,
};

#define LSMAX_SPAWNS 6

new Float:LSSpawnPos[LSMAX_SPAWNS][4] = {
{1532.1046,-1358.4192,329.4535},
{1683.1896,-2330.6575,13.5469},
{2486.5681,-1670.9923,13.3359},
{1870.0269,-1388.8231,13.5216},
{1268.3682,-799.3672,88.3050},
{2774.8599,-1852.3954,9.7755}
};

#define SFMAX_SPAWNS 6

new Float:SFSpawnPos[SFMAX_SPAWNS][4] = {
{413.5205,-2532.7800,19.1484},
{1424.7515,-290.4666,14.1484},
{2338.9946,-1638.5332,483.7031},
{1764.6228,-961.6686,24.8828},
{2756.8435,-201.3327,6.8944},
{2720.7114,-319.1288,7.8438}
};

#define LVMAX_SPAWNS 7

new Float:LVSpawnPos[LVMAX_SPAWNS][4] = {
{2000.5062,-1538.6100,13.5859},
{1683.1896,-2330.6575,13.5469},
{1688.8633,-1447.8511,10.7674},
{380.7953,-2226.7837,42.0938},
{154.0290,-1945.1022,4.4476},
{2238.7185,-2449.2815,11.0372},
{1929.1727,-1780.1941,18.9046}
};

#define MAX_SPAWNS 3

new SpawnNames[MAX_SPAWNS][32] = {
	"Los Santos",
	"San Fierro",
	"Las Venturas"
};

#define MAX_POINTS 49

#define CP_BANK 	0
#define CP_BANK2 	1
#define CP_PIRATE 	2
#define CP_ROOF 	3
#define CP_PORT 	4
#define CP_AMMU     5
#define CP_AMMU2 	6
#define CP_SPRES 	7
#define CP_AIR1		8
#define CP_AIR2     9
#define CP_AIR3 	10
#define CP_DRAGON   11
#define CP_SEXSHOP  12
#define CP_BAR      13
#define CP_CALIGULA 14
#define CP_ZIP      15
#define CP_BINCO    16
#define CP_TATOO    17
#define CP_BOTIQUE  18
#define CP_JIZZY    19
#define CP_PIZZA    20
#define CP_VICTIM   21
#define CP_STRIPCLUB	22
#define CP_WANGCARS 23
#define CP_EMERALD	24
#define CP_VISAGE   25
#define CP_SUBURBAN 26
#define CP_PROLAPS  27
#define CP_BURGER   28
#define CP_CLUCKIN	29
#define CP_CLUB		30
#define CP_DS		31
#define CP_ZOMBO	32
#define CP_STATION1   33
#define CP_STATION2   34
#define CP_STATION3   35
#define CP_STATION4   36
#define CP_STATION5   37
#define CP_STATION6   38
#define CP_STATION7   39
#define CP_STATION8   40
#define CP_STATION9   41
#define CP_STATION10  42
#define CP_STATION11  43
#define CP_STATION12  44
#define CP_STATION13  45
#define CP_STATION14  46
#define CP_STATION15  47
#define CP_STATION16  48

#define P_DRAGON    0
#define P_SEXSHOP   1
#define P_BAR       2
#define P_CALIGULA  3
#define P_ZIP       4
#define P_BINCO     5
#define P_TATOO     6
#define P_BOTIQUE   7
#define P_JIZZY     8
#define P_PIZZA     9
#define P_VICTIM    10
#define P_STRIPCLUB	11
#define P_WANGCARS	12
#define P_EMERALD	13
#define P_VISAGE	14
#define P_SUBURBAN	15
#define P_PROLAPS	16
#define P_BURGER	17
#define P_CLUCKIN	18
#define P_CLUB		19
#define P_DS		20
#define P_ZOMBO		21

#define P_OFFSET    11

new Float:checkCoords[MAX_POINTS][4] = {
{-36.5483,-57.9948,-17.2655,-49.2967},      //BANK
{-38.2322,-91.9060,-14.9639,-74.7610},      //BANK2
{1894.6128,1445.3431,2084.9739,1637.8186},  //PIRATE
{1430.9136,-1470.1956,1662.9897,-1246.3189},//ROOFTOP
{-1679.0770,-76.0700,-1383.9709,262.7759},  //PORT
{284.0546,-86.4384,302.9315,-56.6674},      //AMMUNATION
{284.2423,-41.2138,299.9136,-31.3263},      //AMMUNATION2
{350.7979,152.1248,380.1650,217.2340},      //SPAWNRESIDENCE
{1566.9074,-2386.0454,1833.3936,-2238.2758},//AIRPORT1
{-1742.0072,-695.7512,-1218.6909,-25.0761}, //AIRPORT2
{1461.3699,1300.9025,1823.6639,1646.0739},  //AIRPORT3
{1925.1511,968.2358,2019.0715,1067.4276},   //DRAGON
{-115.9544,-24.2706,-99.1631,-7.1391},      //SEXSHOP
{487.6558,-88.5900,512.0635, -67.7503},     //BAR
{2216.7971,1638.0493,2255.2097,1714.0806},  //CALIGULA
{144.9131,-96.0927,177.4128,-70.7923},    	//ZIP
{201.4462,-112.4556,218.5237,-95.1238},     //BINCO
{-204.7623,-44.0326,-200.2330,-39.8128},    //TATOO
{416.7485,-84.4242,422.6890,-74.0611},		//BOTIQUE
{-2676.0637,1398.3545,-2642.4065,1421.6180},//JIZZY
{369.0025,-131.6332,378.1711,-116.3600}, 	//PIZZA
{201.9053,-11.7524,225.9064,-4.1778},     	//VICTIM
{1201.1422,-16.6343,1223.4420,12.6656},     //STRIPCLUB
{-1996.0801,253.4684,-1942.0564,310.0717},  //WANG CARS
{2099.1985,2328.5200,2179.1382,2405.8721},  //EMERALD ISLE
{1998.3783,1875.9679,2066.3425,1957.0034},  //THE VISAGE
{199.4294,-46.8185,209.5469,-34.0015},  	//SUBURBAN
{198.8601,-137.9890,214.9677,-128.5504},  	//PRO LAPS
{363.5299,-73.9080,381.7558,-57.7846},  	//BURGER SHOT
{364.8330,-10.3823,380.1563,-6.4998},  		//CLUCKIN' BELL
{478.4092,-22.1267,498.3633,-7.5962},  		//CLUB
{198.9507,-166.7670,210.7806,-156.2189},  	//DIDIER SACHS
{-1986.7450,640.8196,-1918.7468,712.6972},  	//ZOMBOTECH
{2098.1316,901.7380,2137.7456,963.0146},
{2617.5967,1062.8710,2656.6526,1142.5109},
{501.7475,1626.7821,653.2095,1774.1093},
{-1351.2833,2638.8943,-1265.1661,2738.6450},
{-2450.3767,949.5080,-2400.8530,1069.8329},
{-1715.5112,349.5567,-1658.8451,458.3686},
{-2265.3027,-2586.3762,-2219.1868,-2558.2539},
{-1657.4102,-2763.3518,-1501.5303,-2666.7454},
{1903.7450,-1795.7990,1955.5667,-1759.5187},
{-135.2077,-1199.8291,-43.7008,-1134.7999},
{1336.7378,454.7961,1430.0760,483.9776},
{648.2494,-592.9003,670.9278,-540.8264},
{-1494.2593,1854.1290,-1449.4076,1885.2032},
{2097.0452,2708.1218,2172.7161,2762.7495},
{2187.6587,2462.8057,2215.5042,2495.0332},
{1577.7729,2182.5112,1616.5842,2242.3628}
};

new Float:checkpoints[MAX_POINTS][3] = {
{-22.2549,-55.6575,1003.5469},
{-27.0437,-89.4715,1003.5468},
{2000.3132,1538.6012,13.5859},
{1532.4611,-1358.3649,329.4507},
{-1534.5357,112.4920,17.0078},
{291.0004,-84.5168,1001.5156},
{291.3284,-39.9767,1001.5156},
{362.4501,173.5097,1008.3828},
{1682.5954,-2330.7429,13.5468},
{-1424.3686,-290.0866,14.1484},
{1688.1124,1447.6761,10.7679},
{1989.0619,1005.5241,994.4688},
{-103.5525,-22.4661,1000.7188},
{501.4927,-75.4323,998.7578},
{2235.5408,1679.0402,1008.3594},
{161.1875,-79.9915,1001.8047},
{207.5640,-97.8188,1005.2578},
{-203.4864,-41.2045,1002.2734},
{418.5547,-80.1667,1001.8047},
{-2649.101,1409.747,906.2734},
{376.0949,-125.8507,1001.5},
{218.443,-8.778273,1001.211},
{1212.3918,-10.9459,1000.9219},
{-1957.5327,300.2131,35.4688},
{2127.5940,2370.4255,10.8203},
{2022.5179,1916.6848,12.3397},
{203.6803,-40.7557,1001.8047},
{206.9941,-133.5536,1002.8672},
{367.5272,-67.4198,1001.5078},
{371.3292,-8.9039,1001.8516},
{487.3790,-14.7161,1000.6797},
{204.3967,-161.7745,1000.5234},
{-1950.9393,674.2313,46.5625}
{2109.2126,917.5845,10.8203,5.0},
{2640.1831,1103.9224,10.8203,5.0},
{611.8934,1694.7921,6.7193,5.0},
{-1327.5398,2682.9771,49.7896,5.0},
{-2413.7427,975.9317,45.0031,5.0},
{-1672.3597,414.2950,6.8866,5.0},
{-2244.1365,-2560.6294,31.6276,5.0},
{-1603.0166,-2709.3589,48.2419,5.0},
{1939.3275,-1767.6813,13.2787,5.0},
{-94.7651,-1174.8079,1.9979,5.0},
{1381.6699,462.6467,19.8540,5.0},
{657.8167,-559.6507,16.0630,5.0},
{-1478.2916,1862.8318,32.3617,5.0},
{2147.3054,2744.9377,10.5263,5.0},
{2204.9602,2480.3494,10.5278,5.0},
{1590.9493,2202.2637,10.5247,5.0}
};

new checkpointType[MAX_POINTS] = {
	CP_BANK,
	CP_BANK2,
	CP_PIRATE,
	CP_ROOF,
	CP_PORT,
	CP_AMMU,
	CP_AMMU2,
	CP_SPRES,
	CP_AIR1,
	CP_AIR2,
	CP_AIR3,
	CP_DRAGON,
	CP_SEXSHOP,
	CP_BAR,
	CP_CALIGULA,
	CP_ZIP,
	CP_BINCO,
	CP_TATOO,
	CP_BOTIQUE,
	CP_JIZZY,
	CP_PIZZA,
	CP_VICTIM,
	CP_STRIPCLUB,
	CP_WANGCARS,
	CP_EMERALD,
	CP_VISAGE,
	CP_SUBURBAN,
	CP_PROLAPS,
	CP_BURGER,
	CP_CLUCKIN,
	CP_CLUB,
	CP_DS,
	CP_ZOMBO
	CP_STATION1,
CP_STATION2,
CP_STATION3,
CP_STATION4,
CP_STATION5,
CP_STATION6,
CP_STATION7,
CP_STATION8,
CP_STATION9,
CP_STATION10,
CP_STATION11,
CP_STATION12,
CP_STATION13,
CP_STATION14,
CP_STATION15,
CP_STATION16
};

#define MAX_PROPERTIES 22

new propertyowner[MAX_PROPERTIES][MAX_STRING];

new propertyBuyAble[MAX_PROPERTIES] = {
	1,  //DRAGON
	1,  //SEXSHOP
	1,	//BAR
	1,	//CALIGULA
	1, 	//ZIP
	1,  //BINCO
	1,  //TATOO
	1,	//BOTIQUE
	1,	//JIZZY
	1,	//PIZZA
	1,	//VICTIM
	1,	//STRIPCLUB
	1,  //WANG CARS
	1,  //EMERALD ISLE
	1,  //THE VISAGE
	1, 	//SUBURBAN
	1, 	//PRO LAPS
	1, 	//BURGER SHOT
	1,	//CLUCKIN' BELL
	1,	//CLUB
	1,	//DIDIER SACHS
	1	//ZOMBOTECH
};

new propertyReBuyAble[MAX_PROPERTIES] = {
	1,  //DRAGON
	1,  //SEXSHOP
	1,	//BAR
	1,	//CALIGULA
	1, 	//ZIP
	1,  //BINCO
	1,  //TATOO
	1,	//BOTIQUE
	1,	//JIZZY
	1,	//PIZZA
	1,	//VICTIM
	1,	//STRIPCLUB
	1,  //WANG CARS
	1,  //EMERALD ISLE
	1,  //THE VISAGE
	1, 	//SUBURBAN
	1, 	//PRO LAPS
	1, 	//BURGER SHOT
	1,	//CLUCKIN' BELL
	1,	//CLUB
	1,	//DIDIER SACHS
	1	//ZOMBOTECH
};

new propertyNames[MAX_PROPERTIES][32] = {
	"Four Dragons Casino",
	"Sex Shop",
	"Bar",
	"Caligula Casino",
	"Zip Shop",
	"Binco Shop",
	"Tatoo Parlor",
	"Botique",
	"Jizzy's Club",
	"The Well Stacked Pizza",
	"Victim Shop",
	"Strip Club",
	"Wang Cars",
	"Emerald Isle",
	"The Visage",
	"Sub Urban",
	"Pro Laps",
	"Burger Shot",
	"Cluckin' Bell",
	"Club",
	"Didier Sachs",
	"Zombotech Corp."
};

new propertyValues[MAX_PROPERTIES] = {
	400000, //Four dragons casino
	50000, //Sex Shop
	800000, //Bar
	350000, //Caligula Casino
	600000, //Zip Shop
	600000, //Binco Shop
	150000,//Tatoo Parlor
	300000, //Botique
	450000, //Jizzy`s Club
	20000, //The Well stacked Pizza
	60000, //Victim Shop
	1200000, //Strip Club
	800000, //Twang Cars
	400000, //Emerald isle
	350000, //The Visage
	60000, //Sub Urban
	20000, // Pro Laps
	80000, //Burger Shot
	400000, //Clucking` Bell
	200000, // Club
	500000, //Didier Sachs
	160000 // Zombotech Crop
};

new propertyEarnings[MAX_PROPERTIES] = {
	4000,
	5000,
	8000,
	3500,
	6000,
	6000,
	1500,
	3000,
	4500,
	200,
	10000,
	8000,
	4000,
	3500,
	600,
	200,
	800,
	4000,
	2000,
	5000,
	5000,
	1600
};

#define WEAP_MELEE 8

new weaponNamesMelee[WEAP_MELEE][32] = {
	"Golf Club",
	"Night Stick",
	"Knife",
	"Baseball Bat",
	"Shovel",
	"Pool Cue",
	"Katana",
	"Chainsaw"
};

new weaponIDsMelee[WEAP_MELEE] = {
	2, //Golf Club
	3, //Night Stick
	4, //Knife
	5, //Baseball Bat
	6, //Shovel
	7, //Pool cue
	8, //Katana
	9  //Chainsaw
};

new weaponCostMelee[WEAP_MELEE] = {
    1000,
	1500,
	3000,
	1500,
	1000,
	1000,
	3000,
	5000
};

#define WEAP_PISTOLS 3

new weaponNamesPistols[WEAP_PISTOLS][32] = {
	"Pistol",
	"Silenced Pistol",
	"Desert Eagle"
};

new weaponIDsPistols[WEAP_PISTOLS] = {
	22,     //Pistol
	23,     //Silenced Pistol
	24      //Desert Eagle
};

new weaponCostPistols[WEAP_PISTOLS] = {
	20,
	30,
	60
};

#define WEAP_SHOTGUNS 3

new weaponNamesShotguns[WEAP_SHOTGUNS][32] = {
	"Shotgun",
	"Sawn Off",
	"Combat Shotgun"
};

new weaponIDsShotguns[WEAP_SHOTGUNS] = {
	25,     //Shotgun
	26,     //Sawn Off
	27      //Combat shotgun
};

new weaponCostShotguns[WEAP_SHOTGUNS] = {
	70,
	120,
	150
};

#define WEAP_SMGS 3

new weaponNamesSMGs[WEAP_SMGS][32] = {
	"Tec9",
	"Micro Uzi",
	"MP5"
};

new weaponIDsSMGs[WEAP_SMGS] = {
	32,     //Tec9
	28,     //Micro Uzi
	29      //MP5
};

new weaponCostSMGs[WEAP_SMGS] = {
	50,
	80,
	150
};

#define WEAP_RIFLES 2

new weaponNamesRifles[WEAP_RIFLES][32] = {
	"AK47",
	"M4"
};

new weaponIDsRifles[WEAP_RIFLES] = {
	30,     //AK47
	31		//M4
};

new weaponCostRifles[WEAP_RIFLES] = {
	250,
	300
};

#define WEAP_RIFLES2 1

new weaponNamesRifles2[WEAP_RIFLES2][32] = { "Rifle" };

new weaponIDsRifles2[WEAP_RIFLES2] = { 33 };

new weaponCostRifles2[WEAP_RIFLES2] = { 200 };

#define WEAP_GIFTS 4

new weaponNamesGifts[WEAP_GIFTS][32] = {
	"Purple Dildo",
	"White Dildo",
	"Flowers",
	"Cane"
};

new weaponIDsGifts[WEAP_GIFTS] = {
	10, //Purple Dildo
	12, //White Dildo
	14, //Flowers
	15  //Cane
};

new weaponCostGifts[WEAP_GIFTS] = {
	1000,
	1000,
	1500,
	2000
};

#define WEAP_SPRAYS 2

new weaponNamesSprays[WEAP_SPRAYS][32] = {
	"Spray Paint",
	"Fire Extinguisher"
};

new weaponIDsSprays[WEAP_SPRAYS] = {
	41, //Spray Paint
	42  //Fire Extinguisher
};

new weaponCostSprays[WEAP_SPRAYS] = {
	100,
	100
};

#define RANKS_RESPECT 12

new RankRespectNames[RANKS_RESPECT][32] = {
	"Very Very Bad Guy",
	"Sinister Asshole",
	"Sith",
	"Darksider",
	"Thief",
	"Unknown",
	"Famous",
	"Lightsider",
	"Jedi",
	"Respectable Guy",
	"Godfather",
	"MADEMAN"
};

new RankRespect[RANKS_RESPECT] = {
	-100,
	-50,
	-25,
	-10,
	-5,
	0,
	10,
	25,
	50,
	100,
	250,
	1000
};

#define RANKS_KILLS 12

new RankKillNames[RANKS_KILLS][32] = {
	"Civilian",
	"Pickpocket",
	"Criminal",
	"Murderer",
	"Buster",
	"Gangsta",
	"OG",
	"Maniac",
	"Hitman",
	"Terrorist",
	"Monster",
	"GODOFGTA"
};

new RankKills[RANKS_KILLS] = {
	0,
	5,
	10,
	25,
	50,
	100,
	250,
	500,
	1000,
	2500,
	5000,
	10000
};

#define RANKS_KILLSIAR 12

new RankKillIARNames[RANKS_KILLSIAR][32] = {
	"Pacific",
	"Double-killer",
	"Mega-killer",
	"Ultra-killer",
	"Ludicrous-killer",
	"Worth Ten",
	"Damned",
	"Cheated Death",
	"Serial Killer",
	"Army",
	"Holy Shit",
	"BLASTBOY"
};

new RankKillsIAR[RANKS_KILLSIAR] = {
	0,
	2,
	4,
	6,
	8,
	10,
	12,
	14,
	16,
	18,
	20,
	25
};

#define RANKS_DEATHS 12

new RankDeathNames[RANKS_DEATHS][32] = {
	"Virgin",
	"Victim",
	"Target",
	"Crackhead",
	"Bitch",
	"Undead",
	"Meat",
	"Frag",
	"Sieve",
	"Fucked Up",
	"Ghost",
	"LIVELONG"
};

new RankDeaths[RANKS_DEATHS] = {
	0,
	5,
	10,
	25,
	50,
	100,
	250,
	500,
	1000,
	2500,
	5000,
	10000
};

#define RANKS_SUICIDES 12

new RankSuicideNames[RANKS_SUICIDES][32] = {
	"Intelligent",
	"Bad Lucker",
	"Self-killer",
	"Crazy",
	"Shithead",
	"Psycho",
	"Life-hater",
	"Kamikazee",
	"Freefaller",
	"Nutter",
	"Headless",
	"YAKUZADEATH"
};

new RankSuicides[RANKS_SUICIDES] = {
	0,
	5,
	10,
	25,
	50,
	100,
	250,
	500,
	1000,
	2500,
	5000,
	10000
};

#define RANKS_MONEY 12

new RankMoneyNames[RANKS_MONEY][32] = {
	"Looser",
	"Bad Player",
	"Casino Beginner",
	"Poor Man",
	"Usual",
	"Businessman",
	"Rich Guy",
	"Lucker",
	"Millioneer",
	"Big Boss",
	"Oligarch",
	"IAMDAVEJ"
};

new RankMoneys[RANKS_MONEY] = {
	-1000000,
	-100000,
	-10000,
	0,
	10000,
	100000,
	1000000,
	5000000,
	10000000,
	50000000,
	100000000,
	1000000000
};

#define RANKS_BOUNTY 8

new RankBountyNames[RANKS_BOUNTY][32] = {
	"Not Needed",
	"Ordered",
	"Low Interest",
	"Big Interest",
	"Wanted",
	"Main Target",
	"Most Wanted",
	"DESIRES"
};

new RankBounty[RANKS_BOUNTY] = {
	0,
	10000,
	50000,
	100000,
	500000,
	1000000,
	5000000,
	10000000
};

#define MAX_LOCS 14

new Float:TLocs[MAX_LOCS][3] = {
{2492.9375,-1670.4402,13.3359},
{1925.1957,-2426.8733,13.5391},
{1556.2386,-1357.8395,329.4544},
{154.0820,-1938.4050,3.7734},

{-2026.0696,175.2042,28.8359},
{-1281.1655,-166.1917,14.1484},
{-1753.8291,885.4835,295.8750},
{-2678.8230,1595.1827,217.2739},

{2030.2551,1007.9247,10.8203},
{1525.6610,1594.5865,10.8203},
{2057.1145,2435.5623,165.6172},

{-2321.2866,-1637.9414,483.7031},
{324.9738,2520.6030,16.6942},
{213.6413,1904.4032,17.6406}
};

new TLocNames[MAX_LOCS][32] = {
	"LS: Groove St.",
	"LS: Airport",
	"LS: Highest Building",
	"LS: Lighthouse",
	"SF: Doherty",
	"SF: Airport",
	"SF: Highest Building",
	"SF: Golden Gate",
	"LV: Four Dragons",
	"LV: Airport",
	"LV: Highest Building",
	"Mountain Chilliad",
	"Abandoned Airport",
	"Area 69"
};

main()
{
		print("\n----------------------------------------------------------");
		print("   Running Freeroam");
		print("----------------------------------------------------------\n");

		WriteLog("");
		WriteLog("*** Freeroam gamemode loaded!");
		WriteLog("");

		worldTime = 12;
}

new motdstring1[MAX_STRING] = "";
new motdstring2[MAX_STRING] = "";
new motdstring3[MAX_STRING] = "";
new motdstring4[MAX_STRING] = "";
new motdcolor[MAX_STRING] = "FFFFFFAA";
new usestandardchat = 0;
new usestandardpms = 0;
new allowdeadpeoplechating = 1;
new mutepmsonmuting = 0;
new adminsseepms = 1;
new queryprefix[MAX_STRING] = "!";
new adminchatprefix[MAX_STRING] = "#";
new adminchatcolor[MAX_STRING] = "0xFF9900AA";
new loggingtype = 3;
new cheatlog = 1;
new usedefaultplayercolor = 0;
new defaultplayercolor[MAX_STRING] = "FFFFFFAA";
new crashinsteadofkick = 0;
new anticheatenabled = 1;
new healthscan = 1;
new onhealthcheat = 2;
new Float:maxhealth = 100.0;
new moneyscan = 1;
new onmoneycheat = 2;
new maxmoney = 20000000;
new ignorenonscripttransactions = 0;
new antiweaponcheat = 1;
new onweaponcheat = 2;
new weaponcheatstopunish = 3;
new forbiddenweapons[MAX_STRING] = "1,16,17,18,35,36,37,38,39,40";
new antideathcheat = 1;
new ondeathcheat = 2;
new cheatdeathstopunish = 2;
new antiidle = 1;
new idlekicktime = 5;
new spawnedplayercolor[MAX_STRING] = "ABCDEF00";
new enableantispawnkill = 1;
new spawnkilltimeout = 5000;
new onspawnkill = 3;
new spawnkilljailtime = 10;
new antirooftopkill = 1;
new onrooftopkill = 3;
new rooftopkilljailtime = 5;
new antiportshipkill = 1;
new onportshipkill = 3;
new portshipkilljailtime = 5;
new antipirateshipkill = 1;
new onpirateshipkill = 3;
new pirateshipkilljailtime = 5;
new antidriveby = 0;
new ondriveby = 3;
new drivebyjailtime = 10;
new savemoneyonbadkill = 1;
new freezejailed = 0;
new addtimeforkillinjail = 10;
new nopunishlevel = 3;
new spawnmoney = 2500;
new timecycle = 1;
new showtimeupdate = 1;
new rooftop = 1;
new rooftopmoney = 100;
new portship = 1;
new portshipmoney = 150;
new pirateship = 1;
new pirateshipmoney = 100;
new allowregister = 1;
new registerrequired = 0;
new maxusers = 1000;
new loggingtimeoutkick = 1;
new loggingtimeout = 20000;
new kickonnotloggedspawn = 0;
new wrongpassestokick = 5;
new saveposition = 1;
new Float:minzpos = 0.0;
new Float:maxzpos = 700.0;
new savehealth = 1;
new respectforkill = 2;
new respectforclankill = -1;
new respectfordeath = -1;
new respectforsuicide = -1;
new respectfordriveby = -5;
new respectforholdareakill = -10;
new respectforspawnkill = -10;
new respectrequired = 1;
new respecttosetbounty = 30;
new respecttogetbounty = 0;
new respecttobuyprops = 15;
new respecttobuycars = 5;
new respecttospawnweapons = 2;
new respecttoholdareas = 0;
new respecttospawnchange = 10;
new respecttoairports = 0;
new respecttochangeowncolor = 20;
new respecttocreateclan = 100;
new respecttochangeclancolor = 200;
new clans = 1;
new clanregister = 1;
new maxclans = 200;
new clanbank = 1;
new clanchatprefix[MAX_STRING] = "@";
new usedefaultclanchatcolor = 0;
new defaultclanchatcolor[MAX_STRING] = "33CCFFAA";
new allowclanchangecolor = 1;
new clanchangecolorcost = 50000000;
new enableadminscript = 1;
new locking = 1;
new enablebank = 1;
new send = 1;
new transact = 1;
new enablebounty = 1;
new properties = 8;
new sellpropertyonquit = 0;
new offlinepaymentdivisor = 100;
new carbuy = 1;
new maxcars = 5;
new caropenwhenoffline = 0;
new spawnweapons = 1;
new spawnweaponsammolimit = 1000;
new reloadcost = 5000;
new skydive = 1;
new maxskydive = 2000;
new allowcarskydive = 0;
new parachute = 1;
new reporting = 1;
new reportingtimeout = 2;
new votekick = 1;
new votekicktime = 60;
new votekickminplayers = 10;
new votekickpercent = 50;
new voteban = 1;
new votebantime = 30;
new votebanminplayers = 10;
new votebanpercent = 90;
new allowspawnchange = 1;
new spawnchangecost = 50000;
new airports = 1;
new airportticket = 1000;
new allowchangecolor = 1;
new changecolorcost = 25000000;
new spectators = 1;
new spectatormaxdist = 20;
new statsofothers = 1;
new statsmoneyofothers = 1;
new statsofotherclans = 1;
new statsmoneyofotherclans = 1;

public LoadSettings()
{
	if (!dini_Exists(FILE_SETTINGS)) {
		dini_Create(FILE_SETTINGS);

        dini_Set(FILE_SETTINGS, "motdstring1", "");
        dini_Set(FILE_SETTINGS, "motdstring2", "");
        dini_Set(FILE_SETTINGS, "motdstring3", "");
        dini_Set(FILE_SETTINGS, "motdstring4", "");
        dini_Set(FILE_SETTINGS, "motdcolor", "FFFFFFAA");
        dini_IntSet(FILE_SETTINGS, "usestandardchat", 0);
        dini_IntSet(FILE_SETTINGS, "usestandardpms", 0);
        dini_IntSet(FILE_SETTINGS, "allowdeadpeoplechating", 1);
        dini_IntSet(FILE_SETTINGS, "mutepmsonmuting", 0);
        dini_IntSet(FILE_SETTINGS, "adminsseepms", 1);
        dini_Set(FILE_SETTINGS, "queryprefix", "!");
        dini_Set(FILE_SETTINGS, "adminchatprefix", "#");
        dini_Set(FILE_SETTINGS, "adminchatcolor", "FFFFFFAA");
        dini_IntSet(FILE_SETTINGS, "loggingtype", 3);
        dini_IntSet(FILE_SETTINGS, "cheatlog", 1);
        dini_IntSet(FILE_SETTINGS, "usedefaultplayercolor", 0);
        dini_Set(FILE_SETTINGS, "defaultplayercolor", "FFFFFFAA");
        dini_IntSet(FILE_SETTINGS, "crashinsteadofkick", 0);
        dini_IntSet(FILE_SETTINGS, "anticheatenabled", 1);
        dini_IntSet(FILE_SETTINGS, "healthscan", 1);
        dini_IntSet(FILE_SETTINGS, "onhealthcheat", 2);
        dini_FloatSet(FILE_SETTINGS, "maxhealth", 100.0);
        dini_IntSet(FILE_SETTINGS, "moneyscan", 1);
        dini_IntSet(FILE_SETTINGS, "onmoneycheat", 2);
        dini_IntSet(FILE_SETTINGS, "maxmoney", 9000000);
        dini_IntSet(FILE_SETTINGS, "ignorenonscripttransactions", 0);
        dini_IntSet(FILE_SETTINGS, "antiweaponcheat", 1);
        dini_IntSet(FILE_SETTINGS, "onweaponcheat", 2);
        dini_IntSet(FILE_SETTINGS, "weaponcheatstopunish", 3);
        dini_Set(FILE_SETTINGS, "forbiddenweapons", "1,16,17,18,35,36,37,38,39,40");
        dini_IntSet(FILE_SETTINGS, "antideathcheat", 1);
        dini_IntSet(FILE_SETTINGS, "ondeathcheat", 2);
        dini_IntSet(FILE_SETTINGS, "cheatdeathstopunish", 2);
        dini_IntSet(FILE_SETTINGS, "antiidle", 1);
        dini_IntSet(FILE_SETTINGS, "idlekicktime", 5);
        dini_Set(FILE_SETTINGS, "spawnedplayercolor", "ABCDEF00");
        dini_IntSet(FILE_SETTINGS, "enableantispawnkill", 1);
		dini_IntSet(FILE_SETTINGS, "spawnkilltimeout", 5000);
		dini_IntSet(FILE_SETTINGS, "onspawnkill", 3);
		dini_IntSet(FILE_SETTINGS, "spawnkilljailtime", 10);
		dini_IntSet(FILE_SETTINGS, "antirooftopkill", 1);
		dini_IntSet(FILE_SETTINGS, "onrooftopkill", 3);
		dini_IntSet(FILE_SETTINGS, "rooftopkilljailtime", 10);
		dini_IntSet(FILE_SETTINGS, "antiportshipkill", 1);
		dini_IntSet(FILE_SETTINGS, "onportshipkill", 3);
		dini_IntSet(FILE_SETTINGS, "portshipkilljailtime", 10);
		dini_IntSet(FILE_SETTINGS, "antipirateshipkill", 1);
		dini_IntSet(FILE_SETTINGS, "onpirateshipkill", 3);
		dini_IntSet(FILE_SETTINGS, "pirateshipkilljailtime", 10);
		dini_IntSet(FILE_SETTINGS, "antidriveby", 0);
		dini_IntSet(FILE_SETTINGS, "ondriveby", 3);
		dini_IntSet(FILE_SETTINGS, "drivebyjailtime", 10);
        dini_IntSet(FILE_SETTINGS, "savemoneyonbadkill", 1);
        dini_IntSet(FILE_SETTINGS, "freezejailed", 0);
        dini_IntSet(FILE_SETTINGS, "addtimeforkillinjail", 10);
        dini_IntSet(FILE_SETTINGS, "nopunishlevel", 3);
        dini_IntSet(FILE_SETTINGS, "spawnmoney", 5000);
        dini_IntSet(FILE_SETTINGS, "timecycle", 1);
        dini_IntSet(FILE_SETTINGS, "showtimeupdate", 1);
        dini_IntSet(FILE_SETTINGS, "rooftop", 1);
        dini_IntSet(FILE_SETTINGS, "rooftopmoney", 100);
        dini_IntSet(FILE_SETTINGS, "portship", 1);
        dini_IntSet(FILE_SETTINGS, "portshipmoney", 100);
        dini_IntSet(FILE_SETTINGS, "pirateship", 1);
        dini_IntSet(FILE_SETTINGS, "pirateshipmoney", 100);
        dini_IntSet(FILE_SETTINGS, "allowregister", 1);
        dini_IntSet(FILE_SETTINGS, "registerrequired", 0);
        dini_IntSet(FILE_SETTINGS, "maxusers", 1000);
        dini_IntSet(FILE_SETTINGS, "loggingtimeoutkick", 1);
        dini_IntSet(FILE_SETTINGS, "loggingtimeout", 20000);
        dini_IntSet(FILE_SETTINGS, "kickonnotloggedspawn", 0);
        dini_IntSet(FILE_SETTINGS, "wrongpassestokick", 5);
        dini_IntSet(FILE_SETTINGS, "saveposition", 1);
        dini_FloatSet(FILE_SETTINGS, "minzpos", 0.0);
        dini_FloatSet(FILE_SETTINGS, "maxzpos", 700.0);
        dini_IntSet(FILE_SETTINGS, "savehealth", 1);
        dini_IntSet(FILE_SETTINGS, "respectforkill", 2);
        dini_IntSet(FILE_SETTINGS, "respectforclankill", -1);
        dini_IntSet(FILE_SETTINGS, "respectfordeath", -1);
        dini_IntSet(FILE_SETTINGS, "respectforsuicide", -1);
        dini_IntSet(FILE_SETTINGS, "respectfordriveby", -5);
        dini_IntSet(FILE_SETTINGS, "respectforholdareakill", -10);
        dini_IntSet(FILE_SETTINGS, "respectforspawnkill", -10);
        dini_IntSet(FILE_SETTINGS, "respectrequired", 1);
        dini_IntSet(FILE_SETTINGS, "respecttosetbounty", 30);
        dini_IntSet(FILE_SETTINGS, "respecttogetbounty", 0);
        dini_IntSet(FILE_SETTINGS, "respecttobuyprops", 100);
        dini_IntSet(FILE_SETTINGS, "respecttobuycars", 50);
        dini_IntSet(FILE_SETTINGS, "respecttospawnweapons", 10);
        dini_IntSet(FILE_SETTINGS, "respecttoholdareas", 0);
        dini_IntSet(FILE_SETTINGS, "respecttospawnchange", 10);
        dini_IntSet(FILE_SETTINGS, "respecttoairports", 0);
        dini_IntSet(FILE_SETTINGS, "respecttochangeowncolor", 150);
        dini_IntSet(FILE_SETTINGS, "respecttocreateclan", 100);
        dini_IntSet(FILE_SETTINGS, "respecttochangeclancolor", 200);
        dini_IntSet(FILE_SETTINGS, "clans", 1);
        dini_IntSet(FILE_SETTINGS, "clanregister", 1);
        dini_IntSet(FILE_SETTINGS, "maxclans", 200);
        dini_IntSet(FILE_SETTINGS, "clanbank", 1);
        dini_Set(FILE_SETTINGS, "clanchatprefix", "@");
        dini_IntSet(FILE_SETTINGS, "usedefaultclanchatcolor", 0);
        dini_Set(FILE_SETTINGS, "defaultclanchatcolor", "33CCFFAA");
        dini_IntSet(FILE_SETTINGS, "allowclanchangecolor", 1);
        dini_IntSet(FILE_SETTINGS, "clanchangecolorcost", 50000000);
        dini_IntSet(FILE_SETTINGS, "enableadminscript", 1);
        dini_IntSet(FILE_SETTINGS, "locking", 1);
        dini_IntSet(FILE_SETTINGS, "enablebank", 1);
        dini_IntSet(FILE_SETTINGS, "send", 1);
        dini_IntSet(FILE_SETTINGS, "transact", 1);
        dini_IntSet(FILE_SETTINGS, "enablebounty", 1);
        dini_IntSet(FILE_SETTINGS, "properties", 1);
        dini_IntSet(FILE_SETTINGS, "sellpropertyonquit", 0);
        dini_IntSet(FILE_SETTINGS, "offlinepaymentdivisor", 100);
        dini_IntSet(FILE_SETTINGS, "carbuy", 1);
        dini_IntSet(FILE_SETTINGS, "maxcars", 1);
        dini_IntSet(FILE_SETTINGS, "caropenwhenoffline", 0);
        dini_IntSet(FILE_SETTINGS, "spawnweapons", 1);
        dini_IntSet(FILE_SETTINGS, "spawnweaponsammolimit", 1000);
        dini_IntSet(FILE_SETTINGS, "reloadcost", 5000);
        dini_IntSet(FILE_SETTINGS, "skydive", 1);
        dini_IntSet(FILE_SETTINGS, "maxskydive", 2000);
        dini_IntSet(FILE_SETTINGS, "allowcarskydive", 0);
        dini_IntSet(FILE_SETTINGS, "parachute", 1);
        dini_IntSet(FILE_SETTINGS, "reporting", 1);
        dini_IntSet(FILE_SETTINGS, "reportingtimeout", 2);
        dini_IntSet(FILE_SETTINGS, "votekick", 1);
        dini_IntSet(FILE_SETTINGS, "votekicktime", 60);
        dini_IntSet(FILE_SETTINGS, "votekickminplayers", 10);
        dini_IntSet(FILE_SETTINGS, "votekickpercent", 50);
        dini_IntSet(FILE_SETTINGS, "voteban", 1);
        dini_IntSet(FILE_SETTINGS, "votebantime", 30);
        dini_IntSet(FILE_SETTINGS, "votebanminplayers", 10);
        dini_IntSet(FILE_SETTINGS, "votebanpercent", 90);
        dini_IntSet(FILE_SETTINGS, "allowspawnchange", 1);
        dini_IntSet(FILE_SETTINGS, "spawnchangecost", 50000);
        dini_IntSet(FILE_SETTINGS, "airports", 1);
        dini_IntSet(FILE_SETTINGS, "airportticket", 1000);
        dini_IntSet(FILE_SETTINGS, "allowchangecolor", 1);
        dini_IntSet(FILE_SETTINGS, "changecolorcost", 25000000);
        dini_IntSet(FILE_SETTINGS, "spectators", 1);
        dini_IntSet(FILE_SETTINGS, "spectatormaxdist", 20);
        dini_IntSet(FILE_SETTINGS, "statsofothers", 1);
        dini_IntSet(FILE_SETTINGS, "statsmoneyofothers", 1);
        dini_IntSet(FILE_SETTINGS, "statsofotherclans", 1);
        dini_IntSet(FILE_SETTINGS, "statsmoneyofotherclans", 1);

        WriteLog("");
        WriteLog("");
        WriteLog("*** Settings file created.");
	}
	else {
		motdstring1 = dini_Get(FILE_SETTINGS, "motdstring1");
		motdstring2 = dini_Get(FILE_SETTINGS, "motdstring2");
		motdstring3 = dini_Get(FILE_SETTINGS, "motdstring3");
		motdstring4 = dini_Get(FILE_SETTINGS, "motdstring4");
		motdcolor = dini_Get(FILE_SETTINGS, "motdcolor");
		usestandardchat = dini_Int(FILE_SETTINGS, "usestandardchat");
		usestandardpms = dini_Int(FILE_SETTINGS, "usestandardpms");
		allowdeadpeoplechating = dini_Int(FILE_SETTINGS, "allowdeadpeoplechating");
		mutepmsonmuting = dini_Int(FILE_SETTINGS, "mutepmsonmuting");
		adminsseepms = dini_Int(FILE_SETTINGS, "adminsseepms");
		queryprefix = dini_Get(FILE_SETTINGS, "queryprefix");
		adminchatprefix = dini_Get(FILE_SETTINGS, "adminchatprefix");
		adminchatcolor = dini_Get(FILE_SETTINGS, "adminchatcolor");
		loggingtype = dini_Int(FILE_SETTINGS, "loggingtype");
		cheatlog = dini_Int(FILE_SETTINGS, "cheatlog");
		usedefaultplayercolor = dini_Int(FILE_SETTINGS, "usedefaultplayercolor");
		defaultplayercolor = dini_Get(FILE_SETTINGS, "defaultplayercolor");
		crashinsteadofkick = dini_Int(FILE_SETTINGS, "crashinsteadofkick");
		anticheatenabled = dini_Int(FILE_SETTINGS, "anticheatenabled");
		healthscan = dini_Int(FILE_SETTINGS, "healthscan");
		onhealthcheat = dini_Int(FILE_SETTINGS, "onhealthcheat");
		maxhealth = dini_Float(FILE_SETTINGS, "maxhealth");
		moneyscan = dini_Int(FILE_SETTINGS, "moneyscan");
		onmoneycheat = dini_Int(FILE_SETTINGS, "onmoneycheat");
		maxmoney = dini_Int(FILE_SETTINGS, "maxmoney");
		ignorenonscripttransactions = dini_Int(FILE_SETTINGS, "ignorenonscripttransactions");
		antiweaponcheat = dini_Int(FILE_SETTINGS, "antiweaponcheat");
		onweaponcheat = dini_Int(FILE_SETTINGS, "onweaponcheat");
		weaponcheatstopunish = dini_Int(FILE_SETTINGS, "weaponcheatstopunish");
		forbiddenweapons = dini_Get(FILE_SETTINGS, "forbiddenweapons");
		antideathcheat = dini_Int(FILE_SETTINGS, "antideathcheat");
		ondeathcheat = dini_Int(FILE_SETTINGS, "ondeathcheat");
		cheatdeathstopunish = dini_Int(FILE_SETTINGS, "cheatdeathstopunish");
		antiidle = dini_Int(FILE_SETTINGS, "antiidle");
		idlekicktime = dini_Int(FILE_SETTINGS, "idlekicktime");
		spawnedplayercolor = dini_Get(FILE_SETTINGS, "spawnedplayercolor");
		enableantispawnkill = dini_Int(FILE_SETTINGS, "enableantispawnkill");
		spawnkilltimeout = dini_Int(FILE_SETTINGS, "spawnkilltimeout");
		antirooftopkill = dini_Int(FILE_SETTINGS, "antirooftopkill");
		antiportshipkill = dini_Int(FILE_SETTINGS, "antiportshipkill");
		antipirateshipkill = dini_Int(FILE_SETTINGS, "antipirateshipkill");
		antidriveby = dini_Int(FILE_SETTINGS, "antidriveby");
		enableantispawnkill = dini_Int(FILE_SETTINGS, "enableantispawnkill");
		spawnkilltimeout = dini_Int(FILE_SETTINGS, "spawnkilltimeout");
		onspawnkill = dini_Int(FILE_SETTINGS, "onspawnkill");
		spawnkilljailtime = dini_Int(FILE_SETTINGS, "spawnkilljailtime");
		antirooftopkill = dini_Int(FILE_SETTINGS, "antirooftopkill");
		onrooftopkill = dini_Int(FILE_SETTINGS, "onrooftopkill");
		rooftopkilljailtime = dini_Int(FILE_SETTINGS, "rooftopkilljailtime");
		antiportshipkill = dini_Int(FILE_SETTINGS, "antiportshipkill");
		onportshipkill = dini_Int(FILE_SETTINGS, "onportshipkill");
		portshipkilljailtime = dini_Int(FILE_SETTINGS, "portshipkilljailtime");
		antipirateshipkill = dini_Int(FILE_SETTINGS, "antipirateshipkill");
		onpirateshipkill = dini_Int(FILE_SETTINGS, "onpirateshipkill");
		pirateshipkilljailtime = dini_Int(FILE_SETTINGS, "pirateshipkilljailtime");
		antidriveby = dini_Int(FILE_SETTINGS, "antidriveby");
		ondriveby = dini_Int(FILE_SETTINGS, "ondriveby");
		drivebyjailtime = dini_Int(FILE_SETTINGS, "drivebyjailtime");
		savemoneyonbadkill = dini_Int(FILE_SETTINGS, "savemoneyonbadkill");
		freezejailed = dini_Int(FILE_SETTINGS, "freezejailed");
		addtimeforkillinjail = dini_Int(FILE_SETTINGS, "addtimeforkillinjail");
		nopunishlevel = dini_Int(FILE_SETTINGS, "nopunishlevel");
		spawnmoney = dini_Int(FILE_SETTINGS, "spawnmoney");
		timecycle = dini_Int(FILE_SETTINGS, "timecycle");
		showtimeupdate = dini_Int(FILE_SETTINGS, "showtimeupdate");
		rooftop = dini_Int(FILE_SETTINGS, "rooftop");
		rooftopmoney = dini_Int(FILE_SETTINGS, "rooftopmoney");
		portship = dini_Int(FILE_SETTINGS, "portship");
		portshipmoney = dini_Int(FILE_SETTINGS, "portshipmoney");
		pirateship = dini_Int(FILE_SETTINGS, "pirateship");
		pirateshipmoney = dini_Int(FILE_SETTINGS, "pirateshipmoney");
		allowregister = dini_Int(FILE_SETTINGS, "allowregister");
		registerrequired = dini_Int(FILE_SETTINGS, "registerrequired");
		maxusers = dini_Int(FILE_SETTINGS, "maxusers");
		loggingtimeoutkick = dini_Int(FILE_SETTINGS, "loggingtimeoutkick");
		loggingtimeout = dini_Int(FILE_SETTINGS, "loggingtimeout");
		kickonnotloggedspawn = dini_Int(FILE_SETTINGS, "kickonnotloggedspawn");
		wrongpassestokick = dini_Int(FILE_SETTINGS, "wrongpassestokick");
		saveposition = dini_Int(FILE_SETTINGS, "saveposition");
		minzpos = dini_Float(FILE_SETTINGS, "minzpos");
		maxzpos = dini_Float(FILE_SETTINGS, "maxzpos");
		savehealth = dini_Int(FILE_SETTINGS, "savehealth");
		respectforkill = dini_Int(FILE_SETTINGS, "respectforkill");
		respectforclankill = dini_Int(FILE_SETTINGS, "respectforclankill");
		respectfordeath = dini_Int(FILE_SETTINGS, "respectfordeath");
		respectforsuicide = dini_Int(FILE_SETTINGS, "respectforsuicide");
		respectfordriveby = dini_Int(FILE_SETTINGS, "respectfordriveby");
		respectforholdareakill = dini_Int(FILE_SETTINGS, "respectforholdareakill");
		respectforspawnkill = dini_Int(FILE_SETTINGS, "respectforspawnkill");
		respectrequired = dini_Int(FILE_SETTINGS, "respectrequired");
		respecttosetbounty = dini_Int(FILE_SETTINGS, "respecttosetbounty");
		respecttogetbounty = dini_Int(FILE_SETTINGS, "respecttogetbounty");
		respecttobuyprops = dini_Int(FILE_SETTINGS, "respecttobuyprops");
		respecttobuycars = dini_Int(FILE_SETTINGS, "respecttobuycars");
		respecttospawnweapons = dini_Int(FILE_SETTINGS, "respecttospawnweapons");
		respecttoholdareas = dini_Int(FILE_SETTINGS, "respecttoholdareas");
		respecttospawnchange = dini_Int(FILE_SETTINGS, "respecttospawnchange");
		respecttoairports = dini_Int(FILE_SETTINGS, "respecttoairports");
		respecttochangeowncolor = dini_Int(FILE_SETTINGS, "respecttochangeowncolor");
		respecttocreateclan = dini_Int(FILE_SETTINGS, "respecttocreateclan");
		respecttochangeclancolor = dini_Int(FILE_SETTINGS, "respecttochangeclancolor");
		clans = dini_Int(FILE_SETTINGS, "clans");
		clanregister = dini_Int(FILE_SETTINGS, "clanregister");
		maxclans = dini_Int(FILE_SETTINGS, "maxclans");
		clanbank = dini_Int(FILE_SETTINGS, "clanbank");
		clanchatprefix = dini_Get(FILE_SETTINGS, "clanchatprefix");
		usedefaultclanchatcolor = dini_Int(FILE_SETTINGS, "usedefaultclanchatcolor");
		defaultclanchatcolor = dini_Get(FILE_SETTINGS, "defaultclanchatcolor");
		allowclanchangecolor = dini_Int(FILE_SETTINGS, "allowclanchangecolor");
		clanchangecolorcost = dini_Int(FILE_SETTINGS, "clanchangecolorcost");
		enableadminscript = dini_Int(FILE_SETTINGS, "enableadminscript");
		locking = dini_Int(FILE_SETTINGS, "locking");
		enablebank = dini_Int(FILE_SETTINGS, "enablebank");
		send = dini_Int(FILE_SETTINGS, "send");
		transact = dini_Int(FILE_SETTINGS, "transact");
		enablebounty = dini_Int(FILE_SETTINGS, "enablebounty");
		properties = dini_Int(FILE_SETTINGS, "properties");
		sellpropertyonquit = dini_Int(FILE_SETTINGS, "sellpropertyonquit");
		offlinepaymentdivisor = dini_Int(FILE_SETTINGS, "offlinepaymentdivisor");
		carbuy = dini_Int(FILE_SETTINGS, "carbuy");
		maxcars = dini_Int(FILE_SETTINGS, "maxcars");
		caropenwhenoffline = dini_Int(FILE_SETTINGS, "caropenwhenoffline");
		spawnweapons = dini_Int(FILE_SETTINGS, "spawnweapons");
		spawnweaponsammolimit = dini_Int(FILE_SETTINGS, "spawnweaponsammolimit");
		reloadcost = dini_Int(FILE_SETTINGS, "reloadcost");
		skydive = dini_Int(FILE_SETTINGS, "skydive");
		maxskydive = dini_Int(FILE_SETTINGS, "maxskydive");
		allowcarskydive = dini_Int(FILE_SETTINGS, "allowcarskydive");
		parachute = dini_Int(FILE_SETTINGS, "parachute");
		reporting = dini_Int(FILE_SETTINGS, "reporting");
		reportingtimeout = dini_Int(FILE_SETTINGS, "reportingtimeout");
		votekick = dini_Int(FILE_SETTINGS, "votekick");
		votekicktime = dini_Int(FILE_SETTINGS, "votekicktime");
		votekickminplayers = dini_Int(FILE_SETTINGS, "votekickminplayers");
		votekickpercent = dini_Int(FILE_SETTINGS, "votekickpercent");
		voteban = dini_Int(FILE_SETTINGS, "voteban");
		votebantime = dini_Int(FILE_SETTINGS, "votebantime");
		votebanminplayers = dini_Int(FILE_SETTINGS, "votebanminplayers");
		votebanpercent = dini_Int(FILE_SETTINGS, "votebanpercent");
		allowspawnchange = dini_Int(FILE_SETTINGS, "allowspawnchange");
		spawnchangecost = dini_Int(FILE_SETTINGS, "spawnchangecost");
		airports = dini_Int(FILE_SETTINGS, "airports");
		airportticket = dini_Int(FILE_SETTINGS, "airportticket");
		allowchangecolor = dini_Int(FILE_SETTINGS, "allowchangecolor");
		changecolorcost = dini_Int(FILE_SETTINGS, "changecolorcost");
		spectators = dini_Int(FILE_SETTINGS, "spectators");
		spectatormaxdist = dini_Int(FILE_SETTINGS, "spectatormaxdist");
		statsofothers = dini_Int(FILE_SETTINGS, "statsofothers");
		statsmoneyofothers = dini_Int(FILE_SETTINGS, "statsmoneyofothers");
		statsofotherclans = dini_Int(FILE_SETTINGS, "statsofotherclans");
		statsmoneyofotherclans = dini_Int(FILE_SETTINGS, "statsmoneyofotherclans");

        WriteLog("");
        WriteLog("");
        WriteLog("*** Settings file loaded.");
	}
}

WriteLog(string[])
{
	new h, m, s;
	new tmp[MAX_STRING];

	gettime(h,m,s);

	if (strlen(string)) format(tmp, sizeof(tmp), "[%d:%d:%d] %s", h,m,s,string);
	if (loggingtype == 1 || loggingtype == 3) printf(tmp);
	if (loggingtype == 2 || loggingtype == 3) {
	    new File:f = fopen(FILE_LOG, io_append);
		fwrite(f, tmp);
		fwrite(f, "\r\n");
		fclose(f);
	}
}

getCheckpointType(playerid)
{
	return checkpointType[playerCheckpoint[playerid]];
}

IsPlayerAt(playerid, Float:x1, Float:y1, Float:x2, Float:y2)
{
    new Float:x, Float:y, Float:z;

	GetPlayerPos(playerid, x, y, z);
	if (x >= x1 && x <= x2 && y >= y1 && y <= y2) return 1;

	return 0;
}

EncodeNick(playernick[])
{
	new tmp[MAX_STRING];

	set(tmp, strlower(playernick));

	tmp = strreplace("_", "_00", tmp);
	tmp = strreplace(";", "_01", tmp);
	tmp = strreplace("!", "_02", tmp);
	tmp = strreplace("/", "_03", tmp);
	tmp = strreplace("\\", "_04", tmp);
	tmp = strreplace("[", "_05", tmp);
	tmp = strreplace("]", "_06", tmp);
	tmp = strreplace("?", "_07", tmp);
	tmp = strreplace(".", "_08", tmp);
	tmp = strreplace("*", "_09", tmp);
	tmp = strreplace("<", "_10", tmp);
	tmp = strreplace(">", "_11", tmp);
	tmp = strreplace("{", "_12", tmp);
	tmp = strreplace("}", "_13", tmp);
	tmp = strreplace(" ", "_14", tmp);
	tmp = strreplace("\"", "_15", tmp);
	tmp = strreplace(":", "_16", tmp);
	tmp = strreplace("|", "_17", tmp);
	tmp = strreplace("=", "_18", tmp);

	return tmp;
}

#define MAX_CLASSES 300

new classes;
new classmodel[MAX_CLASSES];

AddPlayerClass2(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo)
{
    classmodel[classes] = modelid;
	classes++;

	AddPlayerClass(modelid, spawn_x, spawn_y, spawn_z, z_angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
}

new VehicleModels[MAX_VEHICLES+1];
new admincar[MAX_VEHICLES+1];
new carValues[MAX_VEHICLES+1];
new carBuyAble[MAX_VEHICLES+1];
new carowner[MAX_VEHICLES+1][MAX_STRING];

new VehicleNames[212][32] = {
   "Landstalker",   "Bravura",   "Buffalo",   "Linerunner",   "Perrenial",   "Sentinel",
   "Dumper",   "Firetruck",   "Trashmaster",   "Stretch",   "Manana",   "Infernus",
   "Voodoo",   "Pony",   "Mule",   "Cheetah",   "Ambulance",   "Leviathan",
   "Moonbeam",   "Esperanto",   "Taxi",   "Washington",   "Bobcat",   "Mr. Whoopee",
   "BF Injection",   "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",   "Berkley's RC Van",
   "Skimmer",   "PCJ-600",   "Faggio",   "Freeway",   "RC Baron",   "RC Raider",
   "Glendale",   "Oceanic",   "Sanchez",   "Sparrow",   "Patriot",   "Quad",
   "Coastguard",   "Dinghy",   "Hermes",   "Sabre",   "Rustler",   "ZR350",
   "Walton",   "Regina",   "Comet",   "BMX",   "Burrito",   "Camper",   "Marquis",
   "Baggage",   "Dozer",   "Maverick",   "SAN Maverick",   "Rancher",   "FBI Rancher",
   "Virgo",   "Greenwood",   "Jetmax",   "Hotring",   "Sandking",   "Blista Compact",
   "Police Maverick",   "Boxville",   "Benson",   "Mesa",   "RC Goblin",   "Hotring Racer",
   "Hotring Racer",   "Bloodring Banger",   "Rancher",   "Super GT",   "Elegant",
   "Journey",   "Bike",   "Mountain Bike",   "Beagle",   "Cropdust",   "Stunt",
   "Tanker",   "Roadtrain",   "Nebula",   "Majestic",   "Buccaneer",   "Shamal",
   "Hydra",   "FCR-900",   "NRG500",   "HPV1000",   "Cement Truck",   "Tow Truck",
   "Fortune",   "Cadrona",   "FBI Truck",   "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",   "Stratum",
   "Elegy",   "Raindance",   "RC Tiger",   "Flash",   "Tahoma",   "Savanna",
   "Bandito",   "Freight",   "Trailer",   "Kart",   "Mower",   "Duneride",
   "Sweeper",   "Broadway",   "Tornado",   "AT-400",   "DFT-30",   "Huntley",
   "Stafford",   "BF-400",   "Newsvan",   "Tug",   "Trailer",   "Emperor",
   "Wayfarer",   "Euros",   "Hotdog",   "Club",   "Trailer",   "Trailer",
   "Andromada",   "Dodo",   "RC Cam",   "Launch",   "LSPD Police Car",
   "SFPD Police Car",   "LVPD Police Car",   "Ranger",   "Picador",   "S.W.A.T. Van",
   "Alpha",   "Phoenix",   "Glendale",   "Sadler",   "Luggage Trailer",   "Luggage Trailer",
   "Stair Trailer",   "Boxville",   "Farm Plow",   "Utility Trailer"
};

GetVehicleName(vehicleid)
{
	return VehicleNames[VehicleModels[vehicleid]-400];
}

GetVehicleDriver(vehicleid)
{
	for (new i=0;i<MAX_PLAYERS;i++)
		if (IsPlayerConnected(i) && GetPlayerVehicleID(i) == vehicleid && GetPlayerState(i) == PLAYER_STATE_DRIVER) return i;

	return INVALID_PLAYER_ID;
}

MutePlayer(playerid, kickername[], reason[], duration=0, unmute=false)
{
    new string[MAX_STRING];
	if (!unmute) {
		if (PlayerAccess(playerid) >= nopunishlevel && nopunishlevel > 0) return;

		muted[playerid] = 1;
		if (duration > 0) mutetime[playerid] = duration;
		else mutetime[playerid] = -1;

		format(string, sizeof(string), "--- %s (id: %d) muted by %s for %d minute(s). Reason: %s", playername[playerid],playerid,kickername,duration,reason);
		WriteLog(string);
		format(string, sizeof(string), "* %s (id: %d) muted by %s for %d minute(s). Reason: %s", playername[playerid],playerid,kickername,duration,reason);
		SendClientMessageToAll(COLOR_RED, string);
		SendClientMessage(playerid,COLOR_YELLOW,"You are muted");

		format(string, sizeof(string), "UnMutePlayer%d", playerid);
		mutetimer[playerid] = SetTimer(string, duration*60000, 0);
	}
	else {
	    muted[playerid] = 0;

	    format(string, sizeof(string), "--- %s (id: %d) unmuted by %s. Reason: %s", playername[playerid],playerid,kickername,reason);
		WriteLog(string);
		format(string, sizeof(string), "* %s (id: %d) unmuted by %s. Reason: %s", playername[playerid],playerid,kickername,reason);
		SendClientMessageToAll(COLOR_GREEN, string);
		SendClientMessage(playerid,COLOR_YELLOW,"You are unmuted.");
	}
}

public UnMutePlayer0() MutePlayer(0, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer1() MutePlayer(1, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer2() MutePlayer(2, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer3() MutePlayer(3, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer4() MutePlayer(4, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer5() MutePlayer(5, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer6() MutePlayer(6, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer7() MutePlayer(7, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer8() MutePlayer(8, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer9() MutePlayer(9, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer10() MutePlayer(10, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer11() MutePlayer(11, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer12() MutePlayer(12, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer13() MutePlayer(13, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer14() MutePlayer(14, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer15() MutePlayer(15, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer16() MutePlayer(16, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer17() MutePlayer(17, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer18() MutePlayer(18, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer19() MutePlayer(19, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer20() MutePlayer(20, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer21() MutePlayer(21, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer22() MutePlayer(22, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer23() MutePlayer(23, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer24() MutePlayer(24, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer25() MutePlayer(25, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer26() MutePlayer(26, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer27() MutePlayer(27, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer28() MutePlayer(28, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer29() MutePlayer(29, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer30() MutePlayer(30, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer31() MutePlayer(31, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer32() MutePlayer(32, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer33() MutePlayer(33, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer34() MutePlayer(34, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer35() MutePlayer(35, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer36() MutePlayer(36, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer37() MutePlayer(37, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer38() MutePlayer(38, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer39() MutePlayer(39, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer40() MutePlayer(40, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer41() MutePlayer(41, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer42() MutePlayer(42, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer43() MutePlayer(43, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer44() MutePlayer(44, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer45() MutePlayer(45, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer46() MutePlayer(46, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer47() MutePlayer(47, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer48() MutePlayer(48, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer49() MutePlayer(49, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer50() MutePlayer(50, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer51() MutePlayer(51, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer52() MutePlayer(52, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer53() MutePlayer(53, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer54() MutePlayer(54, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer55() MutePlayer(55, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer56() MutePlayer(56, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer57() MutePlayer(57, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer58() MutePlayer(58, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer59() MutePlayer(59, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer60() MutePlayer(60, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer61() MutePlayer(61, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer62() MutePlayer(62, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer63() MutePlayer(63, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer64() MutePlayer(64, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer65() MutePlayer(65, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer66() MutePlayer(66, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer67() MutePlayer(67, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer68() MutePlayer(68, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer69() MutePlayer(69, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer70() MutePlayer(70, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer71() MutePlayer(71, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer72() MutePlayer(72, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer73() MutePlayer(73, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer74() MutePlayer(74, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer75() MutePlayer(75, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer76() MutePlayer(76, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer77() MutePlayer(77, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer78() MutePlayer(78, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer79() MutePlayer(79, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer80() MutePlayer(80, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer81() MutePlayer(81, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer82() MutePlayer(82, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer83() MutePlayer(83, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer84() MutePlayer(84, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer85() MutePlayer(85, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer86() MutePlayer(86, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer87() MutePlayer(87, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer88() MutePlayer(88, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer89() MutePlayer(89, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer90() MutePlayer(90, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer91() MutePlayer(91, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer92() MutePlayer(92, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer93() MutePlayer(93, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer94() MutePlayer(94, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer95() MutePlayer(95, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer96() MutePlayer(96, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer97() MutePlayer(97, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer98() MutePlayer(98, "!Protection!", "Mute time expired!", 0, true);
public UnMutePlayer99() MutePlayer(99, "!Protection!", "Mute time expired!", 0, true);

JailPlayer(playerid, kickername[], reason[], duration=0, unjail=false)
{
    new string[MAX_STRING];
	if (!unjail) {
		if (PlayerAccess(playerid) >= nopunishlevel && nopunishlevel > 0) return;

		jailed[playerid] = 1;
		if (duration > 0) jailtime[playerid] = duration;
		else jailtime[playerid] = -1;
		if (GetPlayerState(playerid) != PLAYER_STATE_NONE && GetPlayerState(playerid) != PLAYER_STATE_WASTED) {
			RemovePlayerFromVehicle(playerid);
			SetPlayerInterior(playerid, 6);
			SetPlayerPos(playerid, 265.1273,77.6823,1001.0391);
			if (freezejailed) FreezePlayer(playerid);
		}

		format(string, sizeof(string), "--- %s (id: %d) jailed by %s for %d minute(s). Reason: %s", playername[playerid],playerid,kickername,duration,reason);
		WriteLog(string);
		format(string, sizeof(string), "* %s (id: %d) jailed by %s for %d minute(s). Reason: %s", playername[playerid],playerid,kickername,duration,reason);
		SendClientMessageToAll(COLOR_RED, string);

		format(string, sizeof(string), "UnJailPlayer%d", playerid);
		jailtimer[playerid] = SetTimer(string, duration*60000, 0);
	}
	else {
	    jailed[playerid] = 0;
	    if (GetPlayerState(playerid) != PLAYER_STATE_NONE && GetPlayerState(playerid) != PLAYER_STATE_WASTED) {
	    	RemovePlayerFromVehicle(playerid);
			SetPlayerInterior(playerid, 0);
			SetPlayerPos(playerid, 1551.4037,-1675.3488,15.8326);
			FreezePlayer(playerid, true);
		}

	    format(string, sizeof(string), "--- %s (id: %d) released by %s. Reason: %s", playername[playerid],playerid,kickername,reason);
		WriteLog(string);
		format(string, sizeof(string), "* %s (id: %d) released by %s. Reason: %s", playername[playerid],playerid,kickername,reason);
		SendClientMessageToAll(COLOR_GREEN, string);
		SendClientMessage(playerid,COLOR_YELLOW,"You are released");
	}
}

public UnJailPlayer0() JailPlayer(0, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer1() JailPlayer(1, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer2() JailPlayer(2, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer3() JailPlayer(3, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer4() JailPlayer(4, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer5() JailPlayer(5, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer6() JailPlayer(6, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer7() JailPlayer(7, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer8() JailPlayer(8, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer9() JailPlayer(9, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer10() JailPlayer(10, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer11() JailPlayer(11, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer12() JailPlayer(12, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer13() JailPlayer(13, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer14() JailPlayer(14, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer15() JailPlayer(15, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer16() JailPlayer(16, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer17() JailPlayer(17, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer18() JailPlayer(18, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer19() JailPlayer(19, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer20() JailPlayer(20, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer21() JailPlayer(21, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer22() JailPlayer(22, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer23() JailPlayer(23, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer24() JailPlayer(24, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer25() JailPlayer(25, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer26() JailPlayer(26, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer27() JailPlayer(27, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer28() JailPlayer(28, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer29() JailPlayer(29, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer30() JailPlayer(30, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer31() JailPlayer(31, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer32() JailPlayer(32, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer33() JailPlayer(33, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer34() JailPlayer(34, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer35() JailPlayer(35, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer36() JailPlayer(36, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer37() JailPlayer(37, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer38() JailPlayer(38, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer39() JailPlayer(39, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer40() JailPlayer(40, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer41() JailPlayer(41, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer42() JailPlayer(42, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer43() JailPlayer(43, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer44() JailPlayer(44, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer45() JailPlayer(45, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer46() JailPlayer(46, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer47() JailPlayer(47, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer48() JailPlayer(48, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer49() JailPlayer(49, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer50() JailPlayer(50, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer51() JailPlayer(51, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer52() JailPlayer(52, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer53() JailPlayer(53, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer54() JailPlayer(54, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer55() JailPlayer(55, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer56() JailPlayer(56, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer57() JailPlayer(57, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer58() JailPlayer(58, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer59() JailPlayer(59, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer60() JailPlayer(60, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer61() JailPlayer(61, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer62() JailPlayer(62, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer63() JailPlayer(63, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer64() JailPlayer(64, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer65() JailPlayer(65, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer66() JailPlayer(66, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer67() JailPlayer(67, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer68() JailPlayer(68, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer69() JailPlayer(69, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer70() JailPlayer(70, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer71() JailPlayer(71, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer72() JailPlayer(72, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer73() JailPlayer(73, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer74() JailPlayer(74, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer75() JailPlayer(75, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer76() JailPlayer(76, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer77() JailPlayer(77, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer78() JailPlayer(78, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer79() JailPlayer(79, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer80() JailPlayer(80, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer81() JailPlayer(81, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer82() JailPlayer(82, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer83() JailPlayer(83, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer84() JailPlayer(84, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer85() JailPlayer(85, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer86() JailPlayer(86, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer87() JailPlayer(87, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer88() JailPlayer(88, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer89() JailPlayer(89, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer90() JailPlayer(90, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer91() JailPlayer(91, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer92() JailPlayer(92, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer93() JailPlayer(93, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer94() JailPlayer(94, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer95() JailPlayer(95, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer96() JailPlayer(96, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer97() JailPlayer(97, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer98() JailPlayer(98, "!Protection!", "Jail time expired!", 0, true);
public UnJailPlayer99() JailPlayer(99, "!Protection!", "Jail time expired!", 0, true);

FreezePlayer(playerid, unfreeze=false)
{
	if (!unfreeze) {
		TogglePlayerControllable(playerid, 0);
		frozen[playerid] = 1;
	}
	else {
		TogglePlayerControllable(playerid, 1);
		frozen[playerid] = 0;
	}
}

public KickPlayer0() Kick(0);
public KickPlayer1() Kick(1);
public KickPlayer2() Kick(2);
public KickPlayer3() Kick(3);
public KickPlayer4() Kick(4);
public KickPlayer5() Kick(5);
public KickPlayer6() Kick(6);
public KickPlayer7() Kick(7);
public KickPlayer8() Kick(8);
public KickPlayer9() Kick(9);
public KickPlayer10() Kick(10);
public KickPlayer11() Kick(11);
public KickPlayer12() Kick(12);
public KickPlayer13() Kick(13);
public KickPlayer14() Kick(14);
public KickPlayer15() Kick(15);
public KickPlayer16() Kick(16);
public KickPlayer17() Kick(17);
public KickPlayer18() Kick(18);
public KickPlayer19() Kick(19);
public KickPlayer20() Kick(20);
public KickPlayer21() Kick(21);
public KickPlayer22() Kick(22);
public KickPlayer23() Kick(23);
public KickPlayer24() Kick(24);
public KickPlayer25() Kick(25);
public KickPlayer26() Kick(26);
public KickPlayer27() Kick(27);
public KickPlayer28() Kick(28);
public KickPlayer29() Kick(29);
public KickPlayer30() Kick(30);
public KickPlayer31() Kick(31);
public KickPlayer32() Kick(32);
public KickPlayer33() Kick(33);
public KickPlayer34() Kick(34);
public KickPlayer35() Kick(35);
public KickPlayer36() Kick(36);
public KickPlayer37() Kick(37);
public KickPlayer38() Kick(38);
public KickPlayer39() Kick(39);
public KickPlayer40() Kick(40);
public KickPlayer41() Kick(41);
public KickPlayer42() Kick(42);
public KickPlayer43() Kick(43);
public KickPlayer44() Kick(44);
public KickPlayer45() Kick(45);
public KickPlayer46() Kick(46);
public KickPlayer47() Kick(47);
public KickPlayer48() Kick(48);
public KickPlayer49() Kick(49);
public KickPlayer50() Kick(50);
public KickPlayer51() Kick(51);
public KickPlayer52() Kick(52);
public KickPlayer53() Kick(53);
public KickPlayer54() Kick(54);
public KickPlayer55() Kick(55);
public KickPlayer56() Kick(56);
public KickPlayer57() Kick(57);
public KickPlayer58() Kick(58);
public KickPlayer59() Kick(59);
public KickPlayer60() Kick(60);
public KickPlayer61() Kick(61);
public KickPlayer62() Kick(62);
public KickPlayer63() Kick(63);
public KickPlayer64() Kick(64);
public KickPlayer65() Kick(65);
public KickPlayer66() Kick(66);
public KickPlayer67() Kick(67);
public KickPlayer68() Kick(68);
public KickPlayer69() Kick(69);
public KickPlayer70() Kick(70);
public KickPlayer71() Kick(71);
public KickPlayer72() Kick(72);
public KickPlayer73() Kick(73);
public KickPlayer74() Kick(74);
public KickPlayer75() Kick(75);
public KickPlayer76() Kick(76);
public KickPlayer77() Kick(77);
public KickPlayer78() Kick(78);
public KickPlayer79() Kick(79);
public KickPlayer80() Kick(80);
public KickPlayer81() Kick(81);
public KickPlayer82() Kick(82);
public KickPlayer83() Kick(83);
public KickPlayer84() Kick(84);
public KickPlayer85() Kick(85);
public KickPlayer86() Kick(86);
public KickPlayer87() Kick(87);
public KickPlayer88() Kick(88);
public KickPlayer89() Kick(89);
public KickPlayer90() Kick(90);
public KickPlayer91() Kick(91);
public KickPlayer92() Kick(92);
public KickPlayer93() Kick(93);
public KickPlayer94() Kick(94);
public KickPlayer95() Kick(95);
public KickPlayer96() Kick(96);
public KickPlayer97() Kick(97);
public KickPlayer98() Kick(98);
public KickPlayer99() Kick(99);

KickPlayer(playerid, kickername[], reason[])
{
	new string[MAX_STRING];

	if (PlayerAccess(playerid) >= nopunishlevel && nopunishlevel > 0) return;

	if (strcmp(kickername, "!AntiCheat!", true) == 0) {
		if (!anticheatenabled) return;
		if (cheatlog == 1) {
	        new File:f = fopen(FILE_CHEATLOG, io_append);
	        new h, m, s;
			new day, month, year;

			gettime(h,m,s);
			getdate(year,month,day);

	        format(string, sizeof(string), "%d.%d.%d [%d:%d:%d] Kicked %s (id: %d) for cheating: %s", day,month,year,h,m,s,playername[playerid],playerid,reason);
			fwrite(f, string);
			fwrite(f, "\r\n");
			fclose(f);
		}
	}

	format(string, sizeof(string), "*** %s (id: %d) kicked by %s. Reason: %s", playername[playerid],playerid,kickername,reason);
	WriteLog(string);
	SendClientMessageToAll(COLOR_GREY, string);
	GameTextForPlayer(playerid, "You are kicked from the server!", 1000, 2);

	if (crashinsteadofkick) {
		GameTextForPlayer(playerid, "~", 1000, 5);
		playercolor[playerid] = 0;
		SetPlayerColor(playerid, 0);
	}
	else {
		format(string, sizeof(string), "KickPlayer%d", playerid);
		SetTimer(string, 2000, 0);
	}

	dini_IntSet(FILE_TOTALSTAT, "kicks", dini_Int(FILE_TOTALSTAT, "kicks")+1);
}

BanPlayer(playerid, kickername[], reason[])
{
	new string[MAX_STRING];

	if (PlayerAccess(playerid) >= nopunishlevel && nopunishlevel > 0) return;

	if (strcmp(kickername, "!AntiCheat!", true) == 0) {
		if (!anticheatenabled) return;
		if (cheatlog) {
	        new File:f = fopen(FILE_CHEATLOG, io_append);
	        new h, m, s;
			new day, month, year;

			gettime(h,m,s);
			getdate(year,month,day);

	        format(string, sizeof(string), "%d.%d.%d [%d:%d:%d] Banned %s (id: %d) for cheating: %s", day,month,year,h,m,s,playername[playerid],playerid,reason);
			fwrite(f, string);
			fwrite(f, "\r\n");
			fclose(f);
		}
	}

	format(string, sizeof(string), "*** %s (id: %d) banned by %s. Reason: %s", playername[playerid],playerid,kickername,reason);
	WriteLog(string);
	SendClientMessageToAll(COLOR_GREY, string);
	GameTextForPlayer(playerid, "You are banned from the server. For unbann go to this site http://badboy10.freehostia.com/fr/", 1000, 2);

	Ban(playerid);

	dini_IntSet(FILE_TOTALSTAT, "bans", dini_Int(FILE_TOTALSTAT, "bans")+1);
}

GiveMoney(playerid, amount)
{
	if (IsPlayerConnected(playerid)) {
		if (GetPlayerMoney(playerid)+amount <= maxmoney) {
		    GivePlayerMoney(playerid, amount);
		    if (!dini_Exists(FILE_TOTALSTAT)) dini_Create(FILE_TOTALSTAT);
			if (amount > 0) {
                if (dini_Int(FILE_TOTALSTAT, "moneyreceived")+amount > 2000000000) dini_IntSet(FILE_TOTALSTAT, "moneyreceived", amount);
				else dini_IntSet(FILE_TOTALSTAT, "moneyreceived", dini_Int(FILE_TOTALSTAT, "moneyreceived")+amount);
			}
			else {
			    if (dini_Int(FILE_TOTALSTAT, "moneylost")-amount > 2000000000) dini_IntSet(FILE_TOTALSTAT, "moneylost", -amount);
				else dini_IntSet(FILE_TOTALSTAT, "moneylost", dini_Int(FILE_TOTALSTAT, "moneylost")-amount);
			}
			smoney[playerid] += amount;
		}
		else {
		    if (bank[playerid]+amount < MAX_VALUE) bank[playerid] += amount;
		    SendClientMessage(playerid, COLOR_RED, "* WARNING! Your money at maximum and you cannot receive more money!");
		    SendClientMessage(playerid, COLOR_RED, "* Store money in bank or send them to be able to get more.");
            SendClientMessage(playerid, COLOR_YELLOW, "* Last transaction stored in bank.");
		}
	}
}

SwapMoney(playerid, toplayerid, amount)
{
	if (IsPlayerConnected(playerid) && IsPlayerConnected(toplayerid)) {
	    GivePlayerMoney(playerid, -amount);
	    smoney[playerid] -= amount;
		if (GetPlayerMoney(toplayerid)+amount <= maxmoney) {
		    GivePlayerMoney(toplayerid, amount);
		    smoney[toplayerid] += amount;
		}
		else {
		    if (bank[toplayerid]+amount < MAX_VALUE) bank[toplayerid] += amount;
		    SendClientMessage(toplayerid, COLOR_RED, "* WARNING! Your money at maximum and you cannot receive more money!");
		    SendClientMessage(toplayerid, COLOR_RED, "* Store money in bank or send them to be able to get more.");
            SendClientMessage(toplayerid, COLOR_YELLOW, "* Last transaction stored in bank.");
		}
	}
}

GetPlayers()
{
	new players;

	for (new i=0;i<MAX_PLAYERS;i++)
	    if (IsPlayerConnected(i)) players++;

	return players;
}

GetPlayerId(playernick[])
{
	for (new i=0;i<MAX_PLAYERS;i++)
		if (IsPlayerConnected(i) && strcmp(playernick, playername[i], true) == 0) return i;

	return INVALID_PLAYER_ID;
}

PlayerFile(playernick[])
{
	new tmp[MAX_STRING];
	format(tmp, sizeof(tmp), "%s%s.player", DIR_PLAYERS,EncodeNick(playernick));
	return tmp;
}

PlayerAccess(playerid)
{
	if (IsPlayerAdmin(playerid)) return 4;
	if (logged[playerid]) return dini_Int(PlayerFile(playername[playerid]), "access");
	return 0;
}

SendAdminMessage(color, string[])
{
	for (new i=0;i<MAX_PLAYERS;i++)
	    if (PlayerAccess(i) >= 1) SendClientMessage(i, color, string);
}

SendChatMessage(playerid, color, string[])
{
	for (new i=0;i<MAX_PLAYERS;i++)
	    if (ignore[i][playerid] != 1) SendClientMessage(i, color, string);
}

public LoginTimeout0() if (!logged[0]) KickPlayer(0, "!Protection!", "Login timeout!");
public LoginTimeout1() if (!logged[1]) KickPlayer(1, "!Protection!", "Login timeout!");
public LoginTimeout2() if (!logged[2]) KickPlayer(2, "!Protection!", "Login timeout!");
public LoginTimeout3() if (!logged[3]) KickPlayer(3, "!Protection!", "Login timeout!");
public LoginTimeout4() if (!logged[4]) KickPlayer(4, "!Protection!", "Login timeout!");
public LoginTimeout5() if (!logged[5]) KickPlayer(5, "!Protection!", "Login timeout!");
public LoginTimeout6() if (!logged[6]) KickPlayer(6, "!Protection!", "Login timeout!");
public LoginTimeout7() if (!logged[7]) KickPlayer(7, "!Protection!", "Login timeout!");
public LoginTimeout8() if (!logged[8]) KickPlayer(8, "!Protection!", "Login timeout!");
public LoginTimeout9() if (!logged[9]) KickPlayer(9, "!Protection!", "Login timeout!");
public LoginTimeout10() if (!logged[10]) KickPlayer(10, "!Protection!", "Login timeout!");
public LoginTimeout11() if (!logged[11]) KickPlayer(11, "!Protection!", "Login timeout!");
public LoginTimeout12() if (!logged[12]) KickPlayer(12, "!Protection!", "Login timeout!");
public LoginTimeout13() if (!logged[13]) KickPlayer(13, "!Protection!", "Login timeout!");
public LoginTimeout14() if (!logged[14]) KickPlayer(14, "!Protection!", "Login timeout!");
public LoginTimeout15() if (!logged[15]) KickPlayer(15, "!Protection!", "Login timeout!");
public LoginTimeout16() if (!logged[16]) KickPlayer(16, "!Protection!", "Login timeout!");
public LoginTimeout17() if (!logged[17]) KickPlayer(17, "!Protection!", "Login timeout!");
public LoginTimeout18() if (!logged[18]) KickPlayer(18, "!Protection!", "Login timeout!");
public LoginTimeout19() if (!logged[19]) KickPlayer(19, "!Protection!", "Login timeout!");
public LoginTimeout20() if (!logged[20]) KickPlayer(20, "!Protection!", "Login timeout!");
public LoginTimeout21() if (!logged[21]) KickPlayer(21, "!Protection!", "Login timeout!");
public LoginTimeout22() if (!logged[22]) KickPlayer(22, "!Protection!", "Login timeout!");
public LoginTimeout23() if (!logged[23]) KickPlayer(23, "!Protection!", "Login timeout!");
public LoginTimeout24() if (!logged[24]) KickPlayer(24, "!Protection!", "Login timeout!");
public LoginTimeout25() if (!logged[25]) KickPlayer(25, "!Protection!", "Login timeout!");
public LoginTimeout26() if (!logged[26]) KickPlayer(26, "!Protection!", "Login timeout!");
public LoginTimeout27() if (!logged[27]) KickPlayer(27, "!Protection!", "Login timeout!");
public LoginTimeout28() if (!logged[28]) KickPlayer(28, "!Protection!", "Login timeout!");
public LoginTimeout29() if (!logged[29]) KickPlayer(29, "!Protection!", "Login timeout!");
public LoginTimeout30() if (!logged[30]) KickPlayer(30, "!Protection!", "Login timeout!");
public LoginTimeout31() if (!logged[31]) KickPlayer(31, "!Protection!", "Login timeout!");
public LoginTimeout32() if (!logged[32]) KickPlayer(32, "!Protection!", "Login timeout!");
public LoginTimeout33() if (!logged[33]) KickPlayer(33, "!Protection!", "Login timeout!");
public LoginTimeout34() if (!logged[34]) KickPlayer(34, "!Protection!", "Login timeout!");
public LoginTimeout35() if (!logged[35]) KickPlayer(35, "!Protection!", "Login timeout!");
public LoginTimeout36() if (!logged[36]) KickPlayer(36, "!Protection!", "Login timeout!");
public LoginTimeout37() if (!logged[37]) KickPlayer(37, "!Protection!", "Login timeout!");
public LoginTimeout38() if (!logged[38]) KickPlayer(38, "!Protection!", "Login timeout!");
public LoginTimeout39() if (!logged[39]) KickPlayer(39, "!Protection!", "Login timeout!");
public LoginTimeout40() if (!logged[40]) KickPlayer(40, "!Protection!", "Login timeout!");
public LoginTimeout41() if (!logged[41]) KickPlayer(41, "!Protection!", "Login timeout!");
public LoginTimeout42() if (!logged[42]) KickPlayer(42, "!Protection!", "Login timeout!");
public LoginTimeout43() if (!logged[43]) KickPlayer(43, "!Protection!", "Login timeout!");
public LoginTimeout44() if (!logged[44]) KickPlayer(44, "!Protection!", "Login timeout!");
public LoginTimeout45() if (!logged[45]) KickPlayer(45, "!Protection!", "Login timeout!");
public LoginTimeout46() if (!logged[46]) KickPlayer(46, "!Protection!", "Login timeout!");
public LoginTimeout47() if (!logged[47]) KickPlayer(47, "!Protection!", "Login timeout!");
public LoginTimeout48() if (!logged[48]) KickPlayer(48, "!Protection!", "Login timeout!");
public LoginTimeout49() if (!logged[49]) KickPlayer(49, "!Protection!", "Login timeout!");
public LoginTimeout50() if (!logged[50]) KickPlayer(50, "!Protection!", "Login timeout!");
public LoginTimeout51() if (!logged[51]) KickPlayer(51, "!Protection!", "Login timeout!");
public LoginTimeout52() if (!logged[52]) KickPlayer(52, "!Protection!", "Login timeout!");
public LoginTimeout53() if (!logged[53]) KickPlayer(53, "!Protection!", "Login timeout!");
public LoginTimeout54() if (!logged[54]) KickPlayer(54, "!Protection!", "Login timeout!");
public LoginTimeout55() if (!logged[55]) KickPlayer(55, "!Protection!", "Login timeout!");
public LoginTimeout56() if (!logged[56]) KickPlayer(56, "!Protection!", "Login timeout!");
public LoginTimeout57() if (!logged[57]) KickPlayer(57, "!Protection!", "Login timeout!");
public LoginTimeout58() if (!logged[58]) KickPlayer(58, "!Protection!", "Login timeout!");
public LoginTimeout59() if (!logged[59]) KickPlayer(59, "!Protection!", "Login timeout!");
public LoginTimeout60() if (!logged[60]) KickPlayer(60, "!Protection!", "Login timeout!");
public LoginTimeout61() if (!logged[61]) KickPlayer(61, "!Protection!", "Login timeout!");
public LoginTimeout62() if (!logged[62]) KickPlayer(62, "!Protection!", "Login timeout!");
public LoginTimeout63() if (!logged[63]) KickPlayer(63, "!Protection!", "Login timeout!");
public LoginTimeout64() if (!logged[64]) KickPlayer(64, "!Protection!", "Login timeout!");
public LoginTimeout65() if (!logged[65]) KickPlayer(65, "!Protection!", "Login timeout!");
public LoginTimeout66() if (!logged[66]) KickPlayer(66, "!Protection!", "Login timeout!");
public LoginTimeout67() if (!logged[67]) KickPlayer(67, "!Protection!", "Login timeout!");
public LoginTimeout68() if (!logged[68]) KickPlayer(68, "!Protection!", "Login timeout!");
public LoginTimeout69() if (!logged[69]) KickPlayer(69, "!Protection!", "Login timeout!");
public LoginTimeout70() if (!logged[70]) KickPlayer(70, "!Protection!", "Login timeout!");
public LoginTimeout71() if (!logged[71]) KickPlayer(71, "!Protection!", "Login timeout!");
public LoginTimeout72() if (!logged[72]) KickPlayer(72, "!Protection!", "Login timeout!");
public LoginTimeout73() if (!logged[73]) KickPlayer(73, "!Protection!", "Login timeout!");
public LoginTimeout74() if (!logged[74]) KickPlayer(74, "!Protection!", "Login timeout!");
public LoginTimeout75() if (!logged[75]) KickPlayer(75, "!Protection!", "Login timeout!");
public LoginTimeout76() if (!logged[76]) KickPlayer(76, "!Protection!", "Login timeout!");
public LoginTimeout77() if (!logged[77]) KickPlayer(77, "!Protection!", "Login timeout!");
public LoginTimeout78() if (!logged[78]) KickPlayer(78, "!Protection!", "Login timeout!");
public LoginTimeout79() if (!logged[79]) KickPlayer(79, "!Protection!", "Login timeout!");
public LoginTimeout80() if (!logged[80]) KickPlayer(80, "!Protection!", "Login timeout!");
public LoginTimeout81() if (!logged[81]) KickPlayer(81, "!Protection!", "Login timeout!");
public LoginTimeout82() if (!logged[82]) KickPlayer(82, "!Protection!", "Login timeout!");
public LoginTimeout83() if (!logged[83]) KickPlayer(83, "!Protection!", "Login timeout!");
public LoginTimeout84() if (!logged[84]) KickPlayer(84, "!Protection!", "Login timeout!");
public LoginTimeout85() if (!logged[85]) KickPlayer(85, "!Protection!", "Login timeout!");
public LoginTimeout86() if (!logged[86]) KickPlayer(86, "!Protection!", "Login timeout!");
public LoginTimeout87() if (!logged[87]) KickPlayer(87, "!Protection!", "Login timeout!");
public LoginTimeout88() if (!logged[88]) KickPlayer(88, "!Protection!", "Login timeout!");
public LoginTimeout89() if (!logged[89]) KickPlayer(89, "!Protection!", "Login timeout!");
public LoginTimeout90() if (!logged[90]) KickPlayer(90, "!Protection!", "Login timeout!");
public LoginTimeout91() if (!logged[91]) KickPlayer(91, "!Protection!", "Login timeout!");
public LoginTimeout92() if (!logged[92]) KickPlayer(92, "!Protection!", "Login timeout!");
public LoginTimeout93() if (!logged[93]) KickPlayer(93, "!Protection!", "Login timeout!");
public LoginTimeout94() if (!logged[94]) KickPlayer(94, "!Protection!", "Login timeout!");
public LoginTimeout95() if (!logged[95]) KickPlayer(95, "!Protection!", "Login timeout!");
public LoginTimeout96() if (!logged[96]) KickPlayer(96, "!Protection!", "Login timeout!");
public LoginTimeout97() if (!logged[97]) KickPlayer(97, "!Protection!", "Login timeout!");
public LoginTimeout98() if (!logged[98]) KickPlayer(98, "!Protection!", "Login timeout!");
public LoginTimeout99() if (!logged[99]) KickPlayer(99, "!Protection!", "Login timeout!");

public AntiSpawnKill0() antispawnkill[0] = 0;
public AntiSpawnKill1() antispawnkill[1] = 0;
public AntiSpawnKill2() antispawnkill[2] = 0;
public AntiSpawnKill3() antispawnkill[3] = 0;
public AntiSpawnKill4() antispawnkill[4] = 0;
public AntiSpawnKill5() antispawnkill[5] = 0;
public AntiSpawnKill6() antispawnkill[6] = 0;
public AntiSpawnKill7() antispawnkill[7] = 0;
public AntiSpawnKill8() antispawnkill[8] = 0;
public AntiSpawnKill9() antispawnkill[9] = 0;
public AntiSpawnKill10() antispawnkill[10] = 0;
public AntiSpawnKill11() antispawnkill[11] = 0;
public AntiSpawnKill12() antispawnkill[12] = 0;
public AntiSpawnKill13() antispawnkill[13] = 0;
public AntiSpawnKill14() antispawnkill[14] = 0;
public AntiSpawnKill15() antispawnkill[15] = 0;
public AntiSpawnKill16() antispawnkill[16] = 0;
public AntiSpawnKill17() antispawnkill[17] = 0;
public AntiSpawnKill18() antispawnkill[18] = 0;
public AntiSpawnKill19() antispawnkill[19] = 0;
public AntiSpawnKill20() antispawnkill[20] = 0;
public AntiSpawnKill21() antispawnkill[21] = 0;
public AntiSpawnKill22() antispawnkill[22] = 0;
public AntiSpawnKill23() antispawnkill[23] = 0;
public AntiSpawnKill24() antispawnkill[24] = 0;
public AntiSpawnKill25() antispawnkill[25] = 0;
public AntiSpawnKill26() antispawnkill[26] = 0;
public AntiSpawnKill27() antispawnkill[27] = 0;
public AntiSpawnKill28() antispawnkill[28] = 0;
public AntiSpawnKill29() antispawnkill[29] = 0;
public AntiSpawnKill30() antispawnkill[30] = 0;
public AntiSpawnKill31() antispawnkill[31] = 0;
public AntiSpawnKill32() antispawnkill[32] = 0;
public AntiSpawnKill33() antispawnkill[33] = 0;
public AntiSpawnKill34() antispawnkill[34] = 0;
public AntiSpawnKill35() antispawnkill[35] = 0;
public AntiSpawnKill36() antispawnkill[36] = 0;
public AntiSpawnKill37() antispawnkill[37] = 0;
public AntiSpawnKill38() antispawnkill[38] = 0;
public AntiSpawnKill39() antispawnkill[39] = 0;
public AntiSpawnKill40() antispawnkill[40] = 0;
public AntiSpawnKill41() antispawnkill[41] = 0;
public AntiSpawnKill42() antispawnkill[42] = 0;
public AntiSpawnKill43() antispawnkill[43] = 0;
public AntiSpawnKill44() antispawnkill[44] = 0;
public AntiSpawnKill45() antispawnkill[45] = 0;
public AntiSpawnKill46() antispawnkill[46] = 0;
public AntiSpawnKill47() antispawnkill[47] = 0;
public AntiSpawnKill48() antispawnkill[48] = 0;
public AntiSpawnKill49() antispawnkill[49] = 0;
public AntiSpawnKill50() antispawnkill[50] = 0;
public AntiSpawnKill51() antispawnkill[51] = 0;
public AntiSpawnKill52() antispawnkill[52] = 0;
public AntiSpawnKill53() antispawnkill[53] = 0;
public AntiSpawnKill54() antispawnkill[54] = 0;
public AntiSpawnKill55() antispawnkill[55] = 0;
public AntiSpawnKill56() antispawnkill[56] = 0;
public AntiSpawnKill57() antispawnkill[57] = 0;
public AntiSpawnKill58() antispawnkill[58] = 0;
public AntiSpawnKill59() antispawnkill[59] = 0;
public AntiSpawnKill60() antispawnkill[60] = 0;
public AntiSpawnKill61() antispawnkill[61] = 0;
public AntiSpawnKill62() antispawnkill[62] = 0;
public AntiSpawnKill63() antispawnkill[63] = 0;
public AntiSpawnKill64() antispawnkill[64] = 0;
public AntiSpawnKill65() antispawnkill[65] = 0;
public AntiSpawnKill66() antispawnkill[66] = 0;
public AntiSpawnKill67() antispawnkill[67] = 0;
public AntiSpawnKill68() antispawnkill[68] = 0;
public AntiSpawnKill69() antispawnkill[69] = 0;
public AntiSpawnKill70() antispawnkill[70] = 0;
public AntiSpawnKill71() antispawnkill[71] = 0;
public AntiSpawnKill72() antispawnkill[72] = 0;
public AntiSpawnKill73() antispawnkill[73] = 0;
public AntiSpawnKill74() antispawnkill[74] = 0;
public AntiSpawnKill75() antispawnkill[75] = 0;
public AntiSpawnKill76() antispawnkill[76] = 0;
public AntiSpawnKill77() antispawnkill[77] = 0;
public AntiSpawnKill78() antispawnkill[78] = 0;
public AntiSpawnKill79() antispawnkill[79] = 0;
public AntiSpawnKill80() antispawnkill[80] = 0;
public AntiSpawnKill81() antispawnkill[81] = 0;
public AntiSpawnKill82() antispawnkill[82] = 0;
public AntiSpawnKill83() antispawnkill[83] = 0;
public AntiSpawnKill84() antispawnkill[84] = 0;
public AntiSpawnKill85() antispawnkill[85] = 0;
public AntiSpawnKill86() antispawnkill[86] = 0;
public AntiSpawnKill87() antispawnkill[87] = 0;
public AntiSpawnKill88() antispawnkill[88] = 0;
public AntiSpawnKill89() antispawnkill[89] = 0;
public AntiSpawnKill90() antispawnkill[90] = 0;
public AntiSpawnKill91() antispawnkill[91] = 0;
public AntiSpawnKill92() antispawnkill[92] = 0;
public AntiSpawnKill93() antispawnkill[93] = 0;
public AntiSpawnKill94() antispawnkill[94] = 0;
public AntiSpawnKill95() antispawnkill[95] = 0;
public AntiSpawnKill96() antispawnkill[96] = 0;
public AntiSpawnKill97() antispawnkill[97] = 0;
public AntiSpawnKill98() antispawnkill[98] = 0;
public AntiSpawnKill99() antispawnkill[99] = 0;

/*RandomColor()
{
    new color;
    color = random(0xFFFFFF) + 0xFF;

	return color;
}*/

public checkpointUpdate()
{
	for (new i=0;i<MAX_PLAYERS;i++)
	    if (IsPlayerConnected(i))
	        for (new j=0;j<MAX_POINTS;j++) {
	            if (IsPlayerAt(i, checkCoords[j][0],checkCoords[j][1],checkCoords[j][2],checkCoords[j][3])) {
	                if (playerCheckpoint[i] != j) {
	                    DisablePlayerCheckpoint(i);
						SetPlayerCheckpoint(i, checkpoints[j][0],checkpoints[j][1],checkpoints[j][2], 2);
						playerCheckpoint[i] = j;
					}
	            }
				else if (playerCheckpoint[i] == j) {
	                DisablePlayerCheckpoint(i);
	                playerCheckpoint[i] = 999;
         	    }
	        }
}

public TimeUpdate()
{
    new string[MAX_STRING];
	if (timecycle) {
		worldTime++;
		worldTime %= 24;
		SetWorldTime(worldTime);

		if (showtimeupdate) {
			format(string, sizeof(string), "~w~Its now ~r~%d:00", worldTime);
			GameTextForAll(string, 3000, 6);
		}
	}
}
//----------------------------------------------------------------------------------------------------
public getCheckpointType(playerID) {
return checkpointType[playerCheckpoint[playerID]];
}

//IsPlayerInArea function
public isPlayerInArea(playerID, Float:data[4])
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerID, X, Y, Z);
if(X >= data[0] && X <= data[2] && Y >= data[1] && Y <= data[3])
{
return 1;
}
return 0;
}

//Update the players checkpoint function
public checkpointUpdate()
{
for(new i=0; i<MAX_PLAYERS; i++)
{
 if(IsPlayerConnected(i))
  {
  for(new j=0; j < MAX_POINTS; j++)
  {
  if(isPlayerInArea(i, checkCoords[j]))
   {
   if(playerCheckpoint[i]!=j)
    {
    DisablePlayerCheckpoint(i);
    SetPlayerCheckpoint(i, checkpoints[j][0],checkpoints[j][1],checkpoints[j][2],checkpoints[j][3]);
    playerCheckpoint[i] = j;
    }
   }
   else
   {
   if(playerCheckpoint[i]==j)
    {
    DisablePlayerCheckpoint(i);
    playerCheckpoint[i] = 999;
    }
   }
  }
  }
}
}

//Fuel check function
public CheckFuel(playerid)
{
new Ptmess[32];
for(new i=0;i<MAX_PLAYERS;i++)
 {
  if(IsPlayerConnected(i) == 1 && IsPlayerInAnyVehicle(i) == 1)
   {
   if(GetPlayerState(i) == 2)
    {
	 new Vi;
     Vi = GetPlayerVehicleID(i);
     Petrol[Vi]--;

     if(Petrol[Vi] >= 1)
      {
      format(Ptmess, sizeof(Ptmess), "~w~Petrol ->~r~%d", Petrol[Vi]);
      GameTextForPlayer(i, Ptmess, 500, 4);
      }
      else
      {
      RemovePlayerFromVehicle(i);
      SendClientMessage(i, COLOR_RED, "Your vehicle ran out of petrol");
      if(Petrol[Vi] < 0)
	   {
	   Petrol[Vi] = 0;
	   }
      }

      if(Petrol[i] >= 51)
       {
       format(Ptmess, sizeof(Ptmess), "~w~Petrol ->%d", Petrol[Vi]);
       GameTextForPlayer(i, Ptmess, 500, 4);
       }

	 }
    }
 }
}

//Refill fuel function
public FuelRefill(playerid)
{
new VID;
VID = GetPlayerVehicleID(playerid);
if(Petrol[VID] < AMOUNT)
 {
 new FillUp;
 FillUp = AMOUNT - Petrol[VID];
 if(GetPlayerMoney(playerid) >= FillUp)
  {
  Petrol[VID] +=FillUp;
  new mess[64];
  format(mess, sizeof(mess), "You put %d units of petrol in your vehicle", FillUp);
  SendClientMessage(playerid, COLOR_WHITE, mess);
  GivePlayerMoney(playerid, -FillUp);
  return 1;
  }
  else
  {
  SendClientMessage(playerid, COLOR_RED, "You don't have enough money for petrol");
  return 1;
  }
 }
 else
 {
 SendClientMessage(playerid, COLOR_RED, "Your vehicle is allready full with petrol");
 return 1;
 }
return 1;
}


public HoldAreasScoreUpdate()
{
    for (new i=0;i<MAX_PLAYERS;i++)
        if (IsPlayerConnected(i) && (!respectrequired || respect[i] >= respecttoholdareas)) {
            if (rooftop && IsPlayerAt(i, 1530.9, -1370.2, 1563.0, -1346.3)) GiveMoney(i, rooftopmoney);
            if (portship && IsPlayerAt(i, -1579.1, 24.1, -1484.0, 163.0)) GiveMoney(i, portshipmoney);
            if (pirateship && IsPlayerAt(i, 1995.5, 1518.0, 2006.0, 1569.0)) GiveMoney(i, pirateshipmoney);
		}
}

public GlobalPlayerSave()
{
    new Float:x, Float:y, Float:z;

    for (new i=0;i<MAX_PLAYERS;i++) {
	    if (dini_Exists(PlayerFile(playername[i])) && logged[i] == 1) {
			dini_IntSet(PlayerFile(playername[i]), "money", GetPlayerMoney(i));
       		if (bank[i] <= MAX_VALUE) dini_IntSet(PlayerFile(playername[i]), "bank", bank[i]);
      		dini_IntSet(PlayerFile(playername[i]), "bounty", bounty[i]);
      		dini_IntSet(PlayerFile(playername[i]), "respect", respect[i]);

      		if (GetPlayerState(i) != PLAYER_STATE_NONE && GetPlayerState(i) != PLAYER_STATE_WASTED && !!frozen[i]) {
				GetPlayerPos(i, x,y,z);
       			dini_FloatSet(PlayerFile(playername[i]), "x", x);
       			dini_FloatSet(PlayerFile(playername[i]), "y", y);
       			dini_FloatSet(PlayerFile(playername[i]), "z", z);
			}

			if (dini_Int(PlayerFile(playername[i]), "killsinarow") < killsinarow[i]) dini_IntSet(PlayerFile(playername[i]), "killsinarow", killsinarow[i]);

            dini_IntSet(PlayerFile(playername[i]), "lastclass", lastclass[i]);

			SendClientMessage(i, COLOR_GREEN, "* Your progress saved");
			SendClientMessage(i, COLOR_GREEN, "* [Nl]Partyserver[EN]");
			SendClientMessage(i, COLOR_GREEN, "* New in this server");
			SendClientMessage(i, COLOR_GREEN, "* 1:Minigames look by /minigames,en/nl");
			SendClientMessage(i, COLOR_GREEN, "* 2:Command (Flip)");
			}
	}

	WriteLog("*** Global player save done.");
}

public PropertyScoreUpdate()
{
	new tmp[MAX_STRING];
	new payments[MAX_PLAYERS];
	new string[MAX_STRING];

	for (new i=0;i<MAX_PROPERTIES;i++) {
	    if (strlen(propertyowner[i])) {
			if (GetPlayerId(propertyowner[i]) != INVALID_PLAYER_ID) {
		    	GiveMoney(GetPlayerId(propertyowner[i]), propertyEarnings[i]);
		    	payments[GetPlayerId(propertyowner[i])] += propertyEarnings[i];
			}
			else {
			    if (sellpropertyonquit) {
			        valstr(tmp, i);
			        dini_Unset(FILE_PROPS, tmp);
			        if (dini_Exists(PlayerFile(propertyowner[i]))) {
			        	tmp = dini_Get(PlayerFile(propertyowner[i]), "money");
		        		if (strval(tmp)+propertyValues[i] < maxmoney) dini_IntSet(PlayerFile(propertyowner[i]), "money", strval(tmp)+propertyValues[i]);
						else {
						    tmp = dini_Get(PlayerFile(propertyowner[i]), "bank");
                    	    if (strval(tmp)+propertyValues[i] <= MAX_VALUE) dini_IntSet(PlayerFile(propertyowner[i]), "bank", strval(tmp)+propertyValues[i]);
						}
					}
					propertyowner[i][0] = 0;
			    }
			    else {
			    	if (dini_Exists(PlayerFile(propertyowner[i]))) {
			        	tmp = dini_Get(PlayerFile(propertyowner[i]), "money");
			        	if (strval(tmp)+propertyEarnings[i]/offlinepaymentdivisor < maxmoney) dini_IntSet(PlayerFile(propertyowner[i]), "money", strval(tmp)+propertyEarnings[i]/offlinepaymentdivisor);
						else {
						    tmp = dini_Get(PlayerFile(propertyowner[i]), "bank");
							if (strval(tmp)+propertyEarnings[i]/offlinepaymentdivisor <= MAX_VALUE) dini_IntSet(PlayerFile(propertyowner[i]), "bank", strval(tmp)+propertyEarnings[i]/offlinepaymentdivisor);
						}
					}
					else {
					    valstr(tmp, i);
						dini_Unset(FILE_PROPS, tmp);
						propertyowner[i][0] = 0;
					}
				}
			}
		}
	}

	for (new i=0;i<MAX_PLAYERS;i++)
		if (IsPlayerConnected(i) && payments[i] != 0) {
		    format(string, sizeof(string), "* You earned €%d from your properties.", payments[i]);
			SendClientMessage(i, COLOR_GREEN, string);
		}
}

public LoadPropertyOwners()
{
	new tmp[MAX_STRING];

    for (new i=0;i<MAX_PROPERTIES;i++) {
	    valstr(tmp, i);
		tmp = dini_Get(FILE_PROPS, tmp);
		if (strlen(tmp)) propertyowner[i] = tmp;
		else propertyowner[i][0] = 0;
	}
}

public VehicleStatusUpdate()
{
	for (new j=1;j<=MAX_VEHICLES;j++)
    	for (new i=0;i<MAX_PLAYERS;i++)
    	    if (IsPlayerConnected(i))
    	        if (GetVehicleDriver(j) == INVALID_PLAYER_ID) {
    	            if (!admincar[j]) SetVehicleParamsForPlayer(j, i, 0, 0);
    	            if (admincar[j] || (strlen(carowner[j]) && strcmp(playername[i], carowner[j], true) != 0)) SetVehicleParamsForPlayer(j, i, 0, 1);
    	            if (PlayerAccess(i) >= nopunishlevel || (GetPlayerId(carowner[j]) == INVALID_PLAYER_ID && caropenwhenoffline == 1)) SetVehicleParamsForPlayer(j, i, 0, 0);
    	            if (strlen(carowner[j]) && strcmp(playername[i], carowner[j], true) == 0) SetVehicleParamsForPlayer(j, i, 1, 0);
    	        }
}
public LoadVehicleOwners()
{
	new tmp[MAX_STRING];

    for (new i=1;i<=MAX_VEHICLES;i++) {
	    valstr(tmp, i);
		tmp = dini_Get(FILE_CARS, tmp);
		if (strlen(tmp)) carowner[i] = tmp;
		else carowner[i][0] = 0;
	}
}

public HealthScan()
{
    new Float:hp;

	if (!healthscan) return;

    for (new i=0;i<MAX_PLAYERS;i++)
	    if (IsPlayerConnected(i) && PlayerAccess(i) < nopunishlevel)
	        if (GetPlayerState(i) != PLAYER_STATE_NONE && GetPlayerState(i) != PLAYER_STATE_WASTED && !god[i]) {
				GetPlayerHealth(i, hp);
	    		if (hp > maxhealth) {
					if (onhealthcheat == 1) KickPlayer(i, "!AntiCheat!", "Possible health cheat!");
					if (onhealthcheat == 2) BanPlayer(i, "!AntiCheat!", "Possible health cheat!");
				}
			}
}

public MoneyScan()
{
	if (!moneyscan) return;

    for (new i=0;i<MAX_PLAYERS;i++)
		if (IsPlayerConnected(i))
		    if (PlayerAccess(i) < nopunishlevel)
				if (GetPlayerMoney(i) > maxmoney) {
			    	ResetPlayerMoney(i);
					if (onmoneycheat == 1) KickPlayer(i, "!AntiCheat!", "Possible money cheat!");
					if (onmoneycheat == 2) BanPlayer(i, "!AntiCheat!", "Possible money cheat!");
				}
}

public MoneyCheck()
{
	if (!ignorenonscripttransactions) return;

	for (new i=0;i<MAX_PLAYERS;i++)
	    if (IsPlayerConnected(i) && GetPlayerMoney(i) > smoney[i]) GivePlayerMoney(i, -GetPlayerMoney(i)+smoney[i]);
}

public ColorCheck()
{
	for (new i=0;i<MAX_PLAYERS;i++)
	    if (!antispawnkill[i]) SetPlayerColor(i, playercolor[i]);
}

public IdleCheck()
{
    new Float:x,Float:y,Float:z;
    new string[MAX_STRING];

    if (!antiidle) return;

    for (new i=0;i<MAX_PLAYERS;i++)
        if (IsPlayerConnected(i)) {
            GetPlayerPos(i, x, y, z);
            if(x == idlepos[i][0] && y == idlepos[i][1] && z == idlepos[i][2] && !frozen[i]) {
                idle[i]++;
                if (idle[i] == idlekicktime) {
                    format(string, sizeof(string), "* You have been idle for %d minutes, please move to a new area.", idle[i]);
                    SendClientMessage(i, COLOR_RED, string);
					SendClientMessage(i, COLOR_RED, "* If you won't move in next 1 minute you will be kicked!");
					GameTextForPlayer(i, "~r~Do not ~b~idle~r~!", 3000, 5);
                }
                if (idle[i] > idlekicktime) {
                    idle[i] = 0;
					KickPlayer(i, "!Protection!", "Idle");
				}
			}
            else idle[i] = 0;

            idlepos[i][0] = x;
            idlepos[i][1] = y;
            idlepos[i][2] = z;
   		}
}

public SpectatorUpdate()
{
	for(new i=0;i<MAX_PLAYERS;i++)
	    if (spectator[i][0] != INVALID_PLAYER_ID && spectator[i][1] > 0 && 0 <= spectator[i][2] <= 2) {
			if (IsPlayerConnected(spectator[i][0])) {
		    	new Float:x, Float:y, Float:z, Float:a;

		   		GetPlayerPos(spectator[i][0], x,y,z);
		   		GetPlayerFacingAngle(spectator[i][0], a);
		   		if (spectator[i][2] == 0) SetPlayerCameraPos(i, x-(floatsin(-a, degrees)*spectator[i][1]),y-(floatcos(-a, degrees)*spectator[i][1]),z+2);
                if (spectator[i][2] == 1) SetPlayerCameraPos(i, x+spectator[i][1],y+spectator[i][1],z+spectator[i][1]);
                if (spectator[i][2] == 2) SetPlayerCameraPos(i, x,y,z+spectator[i][1]);
				SetPlayerCameraLookAt(i, x,y,z);
				SetPlayerPos(i, x,y,z-30);
			}
			else {
				spectator[i][1] = INVALID_PLAYER_ID;

		 		SetSpawnInfo(i,0,classmodel[lastclass[i]],2024.9572,-1561.3475,10.8203,225.9489,0,0,5,1,24,300);
 				SpawnPlayer(i);
				FreezePlayer(i, true);
				GameTextForPlayer(i, "~r~Spectator mode off! ~n~~y~Player left the server.", 3000, 5);
			}
		}
}

public ReportTimeoutUpdate()
{
	if (!reporting) return;

    for (new i=0;i<MAX_PLAYERS;i++)
        if (reporttimeout[i] > 0) reporttimeout[i]--;
}

public VoteKickBanUpdate()
{
	new string[MAX_STRING];

    for (new i=0;i<MAX_PLAYERS;i++)
	    if (IsPlayerConnected(i) && votes[i]) {
            if (votetype[i] == 1) {
            	if ((votes[i]/GetPlayers())*100 >= votekickpercent) {
					votes[i] = 0;

					for (new j=0;j<MAX_PLAYERS;j++) if (voted[j][i]) voted[j][i] = 0;

					format(string, sizeof(string), "--- Vote for kicking of %s (id: %d) ended.", playername[i],i);
					WriteLog(string);
					format(string, sizeof(string), "* Vote for kicking of %s (id: %d) ended.", playername[i],i);
					SendClientMessageToAll(COLOR_ORANGE, string);

					KickPlayer(i, "!Voting!", "You are the one they are voted for...");
				}
                else {
					votetime[i]--;
					if (votetime[i] == 0) {
						votes[i] = 0;

						for (new j=0;j<MAX_PLAYERS;j++) if (voted[j][i]) voted[j][i] = 0;

						format(string, sizeof(string), "--- Vote for kicking of %s (id: %d) is timed out!", playername[i],i);
						WriteLog(string);
						format(string, sizeof(string), "* Vote for kicking of %s (id: %d) is timed out!", playername[i],i);
						SendClientMessageToAll(COLOR_ORANGE, string);
					}
				}
			}
			if (votetype[i] == 2) {
				if (votes[i]/GetPlayers()*100 >= votebanpercent) {
					votes[i] = 0;

					for (new j=0;j<MAX_PLAYERS;j++) if (voted[j][i]) voted[j][i] = 0;

					format(string, sizeof(string), "--- Vote for banning of %s (id: %d) ended.", playername[i],i);
					WriteLog(string);
					format(string, sizeof(string), "* Vote for banning of %s (id: %d) ended.", playername[i],i);
					SendClientMessageToAll(COLOR_RED, string);

					BanPlayer(i, "!Voting!", "You are the one they are voted for...");
				}
                else {
					votetime[i]--;
					if (votetime[i] == 0) {
						votes[i] = 0;

						for (new j=0;j<MAX_PLAYERS;j++) if (voted[j][i]) voted[j][i] = 0;

						format(string, sizeof(string), "--- Vote for banning of %s (id: %d) is timed out!", playername[i],i);
						WriteLog(string);
						format(string, sizeof(string), "* Vote for banning of %s (id: %d) is timed out!", playername[i],i);
						SendClientMessageToAll(COLOR_RED, string);
					}
				}
			}
		}
}

public OnPlayerConnect(playerid)
{
    new string[MAX_STRING];
	new tmp[MAX_STRING], tmp2[MAX_STRING];

	GetPlayerName(playerid, playername[playerid], MAX_PLAYER_NAME);

    if (strlen(motdstring1)) SendClientMessage(playerid, HexToInt(motdcolor), motdstring1);
    if (strlen(motdstring2)) SendClientMessage(playerid, HexToInt(motdcolor), motdstring2);
    if (strlen(motdstring3)) SendClientMessage(playerid, HexToInt(motdcolor), motdstring3);
    if (strlen(motdstring4)) SendClientMessage(playerid, HexToInt(motdcolor), motdstring4);

	playerCheckpoint[playerid] = 999;

    if (usedefaultplayercolor) {
        playercolor[playerid] = HexToInt(defaultplayercolor);
        SetPlayerColor(playerid, HexToInt(defaultplayercolor));
    }
	else playercolor[playerid] = playerColors[playerid];

    if (dini_Exists(PlayerFile(playername[playerid]))) {
        tmp = dini_Get(PlayerFile(playername[playerid]), "blocked");
        if (strval(tmp) == 1) {
            KickPlayer(playerid, "!Protection!", "This account is blocked!");
            return 0;
        }
		SendClientMessage(playerid, COLOR_RED, "* This nick is registered! If you are owner, log in using /login command.");

		if (loggingtimeoutkick) {
		    format(tmp, sizeof(tmp), "LoginTimeout%d", playerid);
			logintimeout[playerid] = SetTimer(tmp, loggingtimeout, 0);
			format(string, sizeof(string), "* If you won't login in next %d seconds, you will be kicked!", loggingtimeout/1000);
			SendClientMessage(playerid, COLOR_RED, string);
		}

		tmp = dini_Get(PlayerFile(playername[playerid]), "money");
		GiveMoney(playerid, strval(tmp));
		tmp = dini_Get(PlayerFile(playername[playerid]), "bank");
		bank[playerid] = strval(tmp);
		tmp = dini_Get(PlayerFile(playername[playerid]), "bounty");
		bounty[playerid] = strval(tmp);

		tmp = dini_Get(PlayerFile(playername[playerid]), "mutetime");
		if (strval(tmp) > 0) mutetime[playerid] = strval(tmp);
		tmp = dini_Get(PlayerFile(playername[playerid]), "muted");
		if (strval(tmp) == 1) {
			muted[playerid] = 1;
			format(string, sizeof(string), "UnMutePlayer%d", playerid);
			mutetimer[playerid] = SetTimer(string, mutetime[playerid]*60000, 0);
		}

        tmp = dini_Get(PlayerFile(playername[playerid]), "jailtime");
		if (strval(tmp) > 0) jailtime[playerid] = strval(tmp);
		tmp = dini_Get(PlayerFile(playername[playerid]), "jailed");
		if (strval(tmp) == 1) {
			jailed[playerid] = 1;
			format(string, sizeof(string), "UnJailPlayer%d", playerid);
			jailtimer[playerid] = SetTimer(string, jailtime[playerid]*60000, 0);
		}

		tmp = dini_Get(PlayerFile(playername[playerid]), "respect");
		respect[playerid] = strval(tmp);

		tmp = dini_Get(PlayerFile(playername[playerid]), "color");
  		if (strlen(tmp)) {
  		    playercolor[playerid] = HexToInt(tmp);
			SetPlayerColor(playerid, HexToInt(tmp));
		}

		tmp = dini_Get(PlayerFile(playername[playerid]), "clan");
		format(tmp2, sizeof(tmp2), "%s%s.clan", DIR_CLANS,EncodeNick(tmp));
		if (dini_Exists(tmp2)) {
		    clan[playerid] = tmp;
		    tmp = dini_Get(tmp2, "color");
		    if (strlen(tmp)) {
                playercolor[playerid] = HexToInt(tmp);
		    	SetPlayerColor(playerid, HexToInt(tmp));
			}
		}

		tmp = dini_Get(PlayerFile(playername[playerid]), "lastclass");
		lastclass[playerid] = strval(tmp);
    }
    else {
        SendClientMessage(playerid, COLOR_YELLOW, "* In order to save your info (money, frags, etc) you need to /register.");
        SendClientMessage(playerid, COLOR_YELLOW, "* After successful registration identify yourself using /login.");
		if (registerrequired) SendClientMessage(playerid, COLOR_ORANGE, "* NOTE: Registration required on this server.");

        logged[playerid] = 1;
	}

	query[playerid] = spectator[playerid][0] = INVALID_PLAYER_ID;
	for (new i=0;i<MAX_PLAYERS;i++) {
	    voted[playerid][i] = 0;
		ignore[playerid][i] = 0;
	}

	format(string, sizeof(string), "--- %s (id: %d) connected.", playername[playerid],playerid);
	WriteLog(string);

	return 1;
}

public OnPlayerDisconnect(playerid)
{
	new string[MAX_STRING];
	new tmp[MAX_STRING];
	new Float:x, Float:y, Float:z;
	new Float:hp;

	if (dini_Exists(PlayerFile(playername[playerid])) && logged[playerid] == 1) {
		dini_IntSet(PlayerFile(playername[playerid]), "money", GetPlayerMoney(playerid));
       	if (bank[playerid] > MAX_VALUE) bank[playerid] = MAX_VALUE;
  		dini_IntSet(PlayerFile(playername[playerid]), "bank", bank[playerid]);
      	dini_IntSet(PlayerFile(playername[playerid]), "bounty", bounty[playerid]);
      	dini_IntSet(PlayerFile(playername[playerid]), "respect", respect[playerid]);

      	if (GetPlayerState(playerid) != PLAYER_STATE_NONE && GetPlayerState(playerid) != PLAYER_STATE_WASTED && !frozen[playerid]) {
			GetPlayerPos(playerid, x,y,z);
       		dini_FloatSet(PlayerFile(playername[playerid]), "x", x);
       		dini_FloatSet(PlayerFile(playername[playerid]), "y", y);
       		dini_FloatSet(PlayerFile(playername[playerid]), "z", z);
		}

		tmp = dini_Get(PlayerFile(playername[playerid]), "killsinarow");
		if (strval(tmp) < killsinarow[playerid]) dini_IntSet(PlayerFile(playername[playerid]), "killsinarow", killsinarow[playerid]);

        dini_IntSet(PlayerFile(playername[playerid]), "lastclass", lastclass[playerid]);

        GetPlayerHealth(playerid, hp);
        if (0 < hp < maxhealth) dini_FloatSet(PlayerFile(playername[playerid]), "health", hp);

        if (muted[playerid]) {
			dini_IntSet(PlayerFile(playername[playerid]), "muted", 1);
			dini_IntSet(PlayerFile(playername[playerid]), "mutetime", mutetime[playerid]);
		}
		else dini_Unset(PlayerFile(playername[playerid]), "muted");
		if (jailed[playerid]) {
			dini_IntSet(PlayerFile(playername[playerid]), "jailed", 1);
			dini_IntSet(PlayerFile(playername[playerid]), "jailtime", jailtime[playerid]);
		}
		else dini_Unset(PlayerFile(playername[playerid]), "jailed");

		format(string, sizeof(string), "--- %s logged out.", playername[playerid]);
		WriteLog(string);
	}

	KillTimer(logintimeout[playerid]);
	KillTimer(antispawnkilltimeout[playerid]);
	KillTimer(mutetimer[playerid]);
	KillTimer(jailtimer[playerid]);

	logged[playerid] = playercolor[playerid] = clan[playerid][0] = bank[playerid] = bounty[playerid] = god[playerid] = jailed[playerid] = muted[playerid] = 0;
	killsinarow[playerid] = cheatdeaths[playerid] = wrongpasses[playerid] = cheatweapons[playerid] = idle[playerid] = lastclass[playerid] = classrestored[playerid] = 0;
    mutetime[playerid] = jailtime[playerid] = frozen[playerid] = votes[playerid] = votetime[playerid] = respect[playerid] = 0;

	format(string, sizeof(string), "--- %s (id: %d) disconnected.", playername[playerid],playerid);
	WriteLog(string);

	playername[playerid][0] = 0;
}

public OnPlayerRequestClass(playerid, classid)
{
	SetupPlayerForClassSelection(playerid);

	if (!classrestored[playerid]) {
	    SetSpawnInfo(playerid,0,classmodel[lastclass[playerid]],2024.9572,-1561.3475,10.8203,225.9489,0,0,5,1,24,300);
	    classrestored[playerid] = 1;
	}
	else lastclass[playerid] = classid;

	return 1;
}

public SetupPlayerForClassSelection(playerid)
{
 	SetPlayerInterior(playerid, 14);
	SetPlayerPos(playerid, 258.4893,-41.4008,1002.0234);
	SetPlayerFacingAngle(playerid, 270.0);
	SetPlayerCameraPos(playerid, 256.0815,-43.0475,1004.0234);
	SetPlayerCameraLookAt(playerid, 258.4893,-41.4008,1002.0234);
}

public OnPlayerSpawn(playerid)
{
	new string[MAX_STRING];
	new tmp[MAX_STRING], tmp2[MAX_STRING], tmp3[MAX_STRING];

	SetPlayerInterior(playerid, 0);

	if (dini_Exists(PlayerFile(playername[playerid]))) {
	    if (logged[playerid] == 1) {
			if (saveposition) {
			    tmp3 = dini_Get(PlayerFile(playername[playerid]), "z");
			    if (strlen(tmp3) && minzpos < floatstr(tmp3) < maxzpos) {
	                tmp = dini_Get(PlayerFile(playername[playerid]), "x");
					tmp2 = dini_Get(PlayerFile(playername[playerid]), "y");
					if (strlen(tmp) && strlen(tmp2)) SetPlayerPos(playerid, floatstr(tmp), floatstr(tmp2), floatstr(tmp3));
				}
				else {
				    new posid;
				    tmp = dini_Get(PlayerFile(playername[playerid]), "spawn");
				    if (strval(tmp) == 0) {
				    	posid = random(LSMAX_SPAWNS-1);
						SetPlayerPos(playerid, LSSpawnPos[posid][0], LSSpawnPos[posid][1], LSSpawnPos[posid][2]);
						SetPlayerFacingAngle(playerid, LSSpawnPos[posid][3]);
					}
					if (strval(tmp) == 1) {
				    	posid = random(SFMAX_SPAWNS-1);
						SetPlayerPos(playerid, SFSpawnPos[posid][0], SFSpawnPos[posid][1], SFSpawnPos[posid][2]);
						SetPlayerFacingAngle(playerid, SFSpawnPos[posid][3]);
					}
					if (strval(tmp) == 2) {
				    	posid = random(LVMAX_SPAWNS-1);
						SetPlayerPos(playerid, LVSpawnPos[posid][0], LVSpawnPos[posid][1], LVSpawnPos[posid][2]);
						SetPlayerFacingAngle(playerid, LVSpawnPos[posid][3]);
					}
				}
			}

			if (savehealth) {
				tmp = dini_Get(PlayerFile(playername[playerid]), "health");
				if (strlen(tmp) && 0 < floatstr(tmp) < maxhealth) SetPlayerHealth(playerid, floatstr(tmp));
			}

			if (spawnweapons) {
            	tmp = dini_Get(PlayerFile(playername[playerid]), "weapon1");
				if (strval(tmp) != 0) GivePlayerWeapon(playerid, strval(tmp), 1);
				tmp = dini_Get(PlayerFile(playername[playerid]), "weapon2");
				tmp2 = dini_Get(PlayerFile(playername[playerid]), "ammo2");
				if (strval(tmp) != 0 && strval(tmp2) != 0) GivePlayerWeapon(playerid, strval(tmp), strval(tmp2));
				tmp = dini_Get(PlayerFile(playername[playerid]), "weapon3");
				tmp2 = dini_Get(PlayerFile(playername[playerid]), "ammo3");
				if (strval(tmp) != 0 && strval(tmp2) != 0) GivePlayerWeapon(playerid, strval(tmp), strval(tmp2));
				tmp = dini_Get(PlayerFile(playername[playerid]), "weapon4");
				tmp2 = dini_Get(PlayerFile(playername[playerid]), "ammo4");
				if (strval(tmp) != 0 && strval(tmp2) != 0) GivePlayerWeapon(playerid, strval(tmp), strval(tmp2));
				tmp = dini_Get(PlayerFile(playername[playerid]), "weapon5");
				tmp2 = dini_Get(PlayerFile(playername[playerid]), "ammo5");
				if (strval(tmp) != 0 && strval(tmp2) != 0) GivePlayerWeapon(playerid, strval(tmp), strval(tmp2));
				tmp = dini_Get(PlayerFile(playername[playerid]), "weapon6");
				tmp2 = dini_Get(PlayerFile(playername[playerid]), "ammo6");
				if (strval(tmp) != 0 && strval(tmp2) != 0) GivePlayerWeapon(playerid, strval(tmp), strval(tmp2));
				tmp = dini_Get(PlayerFile(playername[playerid]), "weapon7");
				if (strval(tmp) != 0) GivePlayerWeapon(playerid, strval(tmp), 1);
				tmp = dini_Get(PlayerFile(playername[playerid]), "weapon8");
				tmp2 = dini_Get(PlayerFile(playername[playerid]), "ammo8");
				if (strval(tmp) != 0 && strval(tmp2) != 0) GivePlayerWeapon(playerid, strval(tmp), strval(tmp2));
			}
		}
		else if (kickonnotloggedspawn) KickPlayer(playerid, "!Protection!", "You must be logged before spawn!");
	}
	else if (registerrequired) KickPlayer(playerid, "!Protection!", "Only registered users allowed.");

	if (spectator[playerid][0] != INVALID_PLAYER_ID) {
	    spectator[playerid][0] = INVALID_PLAYER_ID;
	    if (spectlastpos[playerid][0] != 0 && spectlastpos[playerid][1] != 0 && spectlastpos[playerid][2] != 0) SetPlayerPos(playerid, spectlastpos[playerid][0], spectlastpos[playerid][1], spectlastpos[playerid][2]);

        GameTextForPlayer(playerid, "~r~Spectator mode off!", 3000, 5);
	}

	if (jailed[playerid] == 1) {
		SetPlayerInterior(playerid, 6);
		SetPlayerPos(playerid, 265.1273,77.6823,1001.0391);
	    if (freezejailed) FreezePlayer(playerid);
		format(string, sizeof(string), "--- %s (id: %d) spawned as prisoner.", playername[playerid],playerid);
		WriteLog(string);
        SendClientMessage(playerid, COLOR_RED, "* Your prisoner status restored.");
	}
	else {
	    format(string, sizeof(string), "--- %s (id: %d) spawned.", playername[playerid],playerid);
        WriteLog(string);
	}

	if (GetPlayerMoney(playerid) <= 0) GiveMoney(playerid, spawnmoney-GetPlayerMoney(playerid));

	format(tmp, sizeof(tmp), "AntiSpawnKill%d", playerid);
	antispawnkill[playerid] = 1;
	antispawnkilltimeout[playerid] = SetTimer(tmp, spawnkilltimeout, 0);
	SetPlayerColor(playerid, HexToInt(spawnedplayercolor));

	return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    new playercash;
	new string[MAX_STRING];
	new tmp[MAX_STRING];
	new idx, detected, respectchange1, respectchange2;

	playercash = GetPlayerMoney(playerid);

	if (killerid == INVALID_PLAYER_ID) {
        SendDeathMessage(INVALID_PLAYER_ID, playerid, reason);
		SetPlayerScore(playerid, GetPlayerScore(playerid)-1);

		if (dini_Exists(PlayerFile(playername[playerid])) && logged[playerid] == 1) dini_IntSet(PlayerFile(playername[playerid]), "suicides", dini_Int(PlayerFile(playername[playerid]), "suicides")+1);

		if (strlen(clan[playerid])) format(tmp, sizeof(tmp), "%s%s.clan", DIR_CLANS,EncodeNick(clan[playerid]));
		if (dini_Exists(tmp) && logged[playerid] == 1) dini_IntSet(tmp, "suicides", dini_Int(tmp, "suicides")+1);

        if (!dini_Exists(FILE_TOTALSTAT)) dini_Create(FILE_TOTALSTAT);
        tmp = dini_Get(FILE_TOTALSTAT, "suicides");
		dini_IntSet(FILE_TOTALSTAT, "suicides", strval(tmp)+1);

		respect[playerid] += respectforsuicide;
		respectchange1 += respectforsuicide;

		GiveMoney(playerid, -playercash);

		format(string, sizeof(string), "--- %s (id: %d) suicided with weapon (id: %d).", playername[playerid],playerid,reason);
		WriteLog(string);
	}
	else {
	    SendDeathMessage(killerid, playerid, reason);
		SetPlayerScore(killerid, GetPlayerScore(killerid)+1);

        if (dini_Exists(PlayerFile(playername[killerid])) && logged[killerid] == 1) {
        	tmp = dini_Get(PlayerFile(playername[killerid]), "kills");
			dini_IntSet(PlayerFile(playername[killerid]), "kills", strval(tmp)+1);
		}

		respect[killerid] += respectforkill;
		respectchange2 += respectforkill;

		if (strlen(clan[playerid]) && strlen(clan[killerid]) && strcmp(clan[playerid], clan[killerid], true) == 0) {
		    respect[killerid] += respectforclankill;
			respectchange2 += respectforclankill;
		}

		if (strlen(clan[killerid])) format(tmp, sizeof(tmp), "%s%s.clan", DIR_CLANS,EncodeNick(clan[killerid]));
		if (dini_Exists(tmp) && logged[playerid] == 1) dini_IntSet(tmp, "kills", dini_Int(tmp, "kills")+1);

        if (!dini_Exists(FILE_TOTALSTAT)) dini_Create(FILE_TOTALSTAT);
		dini_IntSet(FILE_TOTALSTAT, "kills", dini_Int(FILE_TOTALSTAT, "kills")+1);

		if ((!respectrequired || respect[playerid] >= respecttogetbounty) && bounty[playerid] > 0) {
			format(string, sizeof(string), "* You earned a bounty of €%d for killing %s.", bounty[playerid],playername[playerid]);
			SendClientMessage(killerid, COLOR_GREEN, string);

			GiveMoney(killerid, bounty[playerid]);
			bounty[playerid] = 0;
		}

		format(string, sizeof(string), "--- %s (id: %d) killed %s (id: %d) with weapon (id: %d).", playername[killerid],killerid,playername[playerid],playerid,reason);
		WriteLog(string);

		killsinarow[killerid]++;

		if (IsPlayerConnected(killerid))
			if (IsPlayerInAnyVehicle(killerid) && GetVehicleDriver(GetPlayerVehicleID(killerid)) == killerid && PlayerAccess(killerid) < nopunishlevel && detected != 1) {
				respect[killerid] += respectfordriveby;
				respectchange2 += respectfordriveby;

				if (antidriveby) {
					format(string, sizeof(string), "--- %s (id: %d) punished for drive-by.", playername[killerid],killerid);
					WriteLog(string);
					SendClientMessage(killerid, COLOR_RED, "* You punished for drive-by.");

					if (ondriveby == 1) KickPlayer(killerid, "!Protection!", "Do not drive-by!");
				    if (ondriveby == 2) BanPlayer(killerid, "!Protection!", "Do not drive-by!");
				    if (ondriveby == 3) JailPlayer(killerid, "!Protection!", "Do not drive-by!", drivebyjailtime);
				    if (ondriveby == 4) SetPlayerHealth(killerid, 0.0);
				}

				detected = 1;
			}

        if (IsPlayerConnected(killerid))
		   	if (antispawnkill[playerid] == 1 && PlayerAccess(killerid) < nopunishlevel && detected != 1) {
		        respect[killerid] += respectforspawnkill;
		        respectchange2 += respectforspawnkill;

 	           if (enableantispawnkill) {
					format(string, sizeof(string), "--- %s (id: %d) punished for spawn killing.", playername[killerid],killerid);
					WriteLog(string);
				    SendClientMessage(killerid, COLOR_RED, "* You punished for spawn killing.");

                    if (onspawnkill == 1) KickPlayer(killerid, "!Protection!", "Do not kill on spawn!");
				    if (onspawnkill == 2) BanPlayer(killerid, "!Protection!", "Do not kill on spawn!");
				    if (onspawnkill == 3) JailPlayer(killerid, "!Protection!", "Do not kill on spawn!", spawnkilljailtime);
				    if (onspawnkill == 4) SetPlayerHealth(killerid, 0.0);
				}

				detected = 1;
			}

        if (IsPlayerConnected(killerid))
	   		if ((IsPlayerAt(playerid, 1530.9, -1370.2, 1563.0, -1346.3) || IsPlayerAt(killerid, 1530.9, -1370.2, 1563.0, -1346.3)) && PlayerAccess(killerid) < nopunishlevel && detected != 1) {
	        	respect[killerid] += respectforholdareakill;
	        	respectchange2 += respectforholdareakill;

	        	if (antirooftopkill) {
					format(string, sizeof(string), "--- %s (id: %d) punished for killing on the roof.", playername[killerid],killerid);
					WriteLog(string);
					SendClientMessage(killerid, COLOR_RED, "* You punished for killing on the roof.");

                    if (onrooftopkill == 1) KickPlayer(killerid, "!Protection!", "Do not kill on hold areas!");
				    if (onrooftopkill == 2) BanPlayer(killerid, "!Protection!", "Do not kill on hold areas!");
				    if (onrooftopkill == 3) JailPlayer(killerid, "!Protection!", "Do not kill on hold areas!", rooftopkilljailtime);
				    if (onrooftopkill == 4) SetPlayerHealth(killerid, 0.0);
				}

				detected = 1;
			}

        if (IsPlayerConnected(killerid))
	   		if ((IsPlayerAt(playerid, -1579.1, 24.1, -1484.0, 163.0) || IsPlayerAt(killerid, -1579.1, 24.1, -1484.0, 163.0)) && PlayerAccess(playerid) < nopunishlevel && detected != 1) {
	        	respect[killerid] += respectforholdareakill;
	        	respectchange2 += respectforholdareakill;

	        	if (antiportshipkill) {
					format(string, sizeof(string), "--- %s (id: %d) punished for killing on the cargo ship.", playername[killerid],killerid);
					WriteLog(string);
					SendClientMessage(killerid, COLOR_RED, "* You punished for killing on the cargo ship.");

                    if (onportshipkill == 1) KickPlayer(killerid, "!Protection!", "Do not kill on hold areas!");
				    if (onportshipkill == 2) BanPlayer(killerid, "!Protection!", "Do not kill on hold areas!");
				    if (onportshipkill == 3) JailPlayer(killerid, "!Protection!", "Do not kill on hold areas!", portshipkilljailtime);
				    if (onportshipkill == 4) SetPlayerHealth(killerid, 0.0);
				}

	            detected = 1;
			}

        if (IsPlayerConnected(killerid))
	   		if ((IsPlayerAt(playerid, 1995.5, 1518.0, 2006.0, 1569.0) || IsPlayerAt(killerid, 1995.5, 1518.0, 2006.0, 1569.0)) && PlayerAccess(killerid) < nopunishlevel && detected != 1) {
	        	respect[killerid] += respectforholdareakill;
	        	respectchange2 += respectforholdareakill;

	        	if (antipirateshipkill) {
					format(string, sizeof(string), "--- %s (id: %d) punished for killing on the pirate ship.", playername[killerid],killerid);
					WriteLog(string);
					SendClientMessage(killerid, COLOR_RED, "* You punished for killing on the pirate ship.");

                    if (onpirateshipkill == 1) KickPlayer(killerid, "!Protection!", "Do not kill on hold areas!");
				    if (onpirateshipkill == 2) BanPlayer(killerid, "!Protection!", "Do not kill on hold areas!");
				    if (onpirateshipkill == 3) JailPlayer(killerid, "!Protection!", "Do not kill on hold areas!", pirateshipkilljailtime);
				    if (onpirateshipkill == 4) SetPlayerHealth(killerid, 0.0);
				}

	            detected = 1;
			}

		if (IsPlayerConnected(killerid)) {
	        if (jailed[killerid] && addtimeforkillinjail != 0) {
				jailtime[killerid] += addtimeforkillinjail;
				format(string, sizeof(string), "--- %s (id: %d) punished for killing in the jail: %d minutes.", playername[killerid],killerid,addtimeforkillinjail);
				WriteLog(string);
				if (addtimeforkillinjail < 0) format(string, sizeof(string), "~w~%d ~r~minutes!", addtimeforkillinjail);
                if (addtimeforkillinjail > 0) format(string, sizeof(string), "~w~+%d ~r~minutes! ~n~Do not kill here!", addtimeforkillinjail);
				GameTextForPlayer(killerid, string, 3000, 5);

				detected = 1;
			}

			if ((detected != 1 || !savemoneyonbadkill) && playercash > 0) SwapMoney(playerid, killerid, playercash);

		    if (antiweaponcheat && PlayerAccess(killerid) < nopunishlevel) {
				for (new i=0;i<47;i++)
				    if (reason == strval(strtok(forbiddenweapons, idx, ',')) && reason != 0) {
						cheatdeaths[playerid]++;
						if (antideathcheat && cheatdeaths[playerid] >= cheatdeathstopunish && PlayerAccess(playerid) < nopunishlevel) {
					    	if (ondeathcheat == 1) KickPlayer(playerid, "!AntiCheat!", "Death cheat detected!");
							if (ondeathcheat == 2) BanPlayer(playerid, "!AntiCheat!", "Death cheat detected!");
						}
						else {
						    cheatweapons[killerid]++;
						    if (cheatweapons[killerid] >= weaponcheatstopunish) {
								if (onweaponcheat == 1) KickPlayer(killerid, "!AntiCheat!", "Forbidden weapon detected!");
								if (onweaponcheat == 2) BanPlayer(killerid, "!AntiCheat!", "Forbidden weapon detected!");
							}
						}
						break;
					}
			}
		}
	}

 	if (dini_Exists(PlayerFile(playername[playerid])) && logged[playerid] == 1) {
		dini_IntSet(PlayerFile(playername[playerid]), "deaths", dini_Int(PlayerFile(playername[playerid]), "deaths")+1);

		dini_Unset(PlayerFile(playername[playerid]), "x");
    	dini_Unset(PlayerFile(playername[playerid]), "y");
    	dini_Unset(PlayerFile(playername[playerid]), "z");

    	dini_Unset(PlayerFile(playername[playerid]), "health");

		if (strlen(clan[playerid])) format(tmp, sizeof(tmp), "%s%s.clan", DIR_CLANS,EncodeNick(clan[playerid]));
		if (dini_Exists(tmp) && logged[playerid] == 1) dini_IntSet(tmp, "deaths", dini_Int(tmp, "deaths")+1);
	}

	respect[playerid] += respectfordeath;
	respectchange1 += respectfordeath;

 	if (!dini_Exists(FILE_TOTALSTAT)) dini_Create(FILE_TOTALSTAT);
	dini_IntSet(FILE_TOTALSTAT, "deaths", dini_Int(FILE_TOTALSTAT, "deaths")+1);

   	killsinarow[playerid] = 0;
   	KillTimer(antispawnkilltimeout[playerid]);

	if (respectchange1 != 0) {
		if (respectchange1 > 0) format(string, sizeof(string), "~g~Respect: %d (~w~Total: %d)", respectchange1,respect[playerid]);
        else format(string, sizeof(string), "~r~Respect: %d (~w~Total: %d)", respectchange1,respect[playerid]);
		GameTextForPlayer(playerid, string, 3000, 5);
	}

	if (respectchange2 != 0 && IsPlayerConnected(killerid)) {
		if (respectchange2 > 0) format(string, sizeof(string), "~g~Respect: %d (~w~Total: %d)", respectchange2,respect[killerid]);
        else format(string, sizeof(string), "~r~Respect: %d (~w~Total: %d)", respectchange2,respect[killerid]);
		GameTextForPlayer(killerid, string, 3000, 5);
	}

 	return 1;
}

public OnPlayerText(playerid, text[]) {
	new string[MAX_STRING];
	new tmp[MAX_STRING], tmp2[MAX_STRING];
	new color;

	if (!allowdeadpeoplechating && (GetPlayerState(playerid) == PLAYER_STATE_NONE || GetPlayerState(playerid) == PLAYER_STATE_WASTED)) {
		format(string, sizeof(string), "--- Blocked message from dead %s (id: %d): %s", playername[playerid],playerid,text);
		WriteLog(string);
		SendClientMessage(playerid, COLOR_RED, "* You dead and cannot send messages.");

		return 0;
	}

	tmp = dini_Get(PlayerFile(playername[playerid]), "pmprefix");
	if (!strlen(tmp)) tmp = queryprefix;
	if (text[0] == tmp[0] && query[playerid] != INVALID_PLAYER_ID) {
 		if (IsPlayerConnected(query[playerid])) {
  		    format(string, sizeof(string), "! PM: %s (id: %d) to %s (id: %d): %s", playername[playerid],playerid,playername[query[playerid]],query[playerid],text);
			WriteLog(string);
			if (adminsseepms) SendAdminMessage(playercolor[playerid], string);

			format(string, sizeof(string), "! PM to %s (id: %d): %s", playername[query[playerid]],query[playerid],text);
    		SendClientMessage(playerid, playercolor[playerid], string);
            if (ignore[query[playerid]][playerid] != 1) {
				format(string, sizeof(string), "! PM from %s (id: %d): %s", playername[playerid],playerid,text);
    			SendClientMessage(query[playerid], playercolor[playerid], string);
			}
 		}
 		else {
			format(string, sizeof(string), "* %d is not an active player.", query[playerid]);
			SendClientMessage(playerid, COLOR_YELLOW, string);
		}

		return 0;
	}

	if (muted[playerid] == 1) {
	    format(string, sizeof(string), "--- Muted message from %s (id: %d): %s", playername[playerid],playerid,text);
		WriteLog(string);
		GameTextForPlayer(playerid, "~r~You are muted and cannot send messages.", 3000, 5);

		return 0;
	}

	if (strlen(clan[playerid])) format(tmp, sizeof(tmp), "%s%s.clan", DIR_CLANS,EncodeNick(clan[playerid]));
    if (dini_Exists(tmp) && logged[playerid] == 1) {
        tmp2 = dini_Get(tmp2, "clanchatprefix");
        if (!strlen(string)) tmp2 = clanchatprefix;
        if (text[0] == tmp2[0]) {
        	format(string, sizeof(string), "PMCHAT: %s (id: %d) to %s clan: %s", playername[playerid],playerid,clan[playerid],text);
			WriteLog(string);

	        for (new i=0;i<MAX_PLAYERS;i++)
				if (IsPlayerConnected(i) && strlen(clan[i]) && strlen(clan[playerid]) && strcmp(clan[i], clan[playerid], true) == 0 && logged[i] == 1) {
					format(string, sizeof(string), "PMCHAT: %s (id: %d): %s", playername[playerid],playerid,text);
					if (usedefaultclanchatcolor) color = HexToInt(defaultclanchatcolor);
					else color = playercolor[playerid];
					SendClientMessage(i, color, string);
				}

			return 0;
		}
	}

	if (text[0] == adminchatprefix[0] && PlayerAccess(playerid) >= 1) {
	    format(string, sizeof(string), "# ADMINCHAT: %s (id: %d): %s", playername[playerid],playerid,text);
		WriteLog(string);
	    format(string, sizeof(string), "# ADMINCHAT: %s (id: %d): %s", playername[playerid],playerid,text);
		SendAdminMessage(HexToInt(adminchatcolor), string);

        return 0;
	}

	format(string, sizeof(string), "%s (id: %d): %s", playername[playerid],playerid,text);
	WriteLog(string);

	if (usestandardchat) return 1;
   	else SendChatMessage(playerid, playercolor[playerid], string);

	return 0;
}

public OnPlayerPrivmsg(playerid, targetid, text[])
{
	new string[MAX_STRING];

	if (muted[playerid] == 1 && mutepmsonmuting) {
	    format(string, sizeof(string), "--- Muted private message from %s (id: %d) to %s (id: %d): %s", playername[playerid],playerid,playername[targetid],targetid,text);
		WriteLog(string);
		GameTextForPlayer(playerid, "~r~You are muted and cannot send messages.", 3000, 5);

		return 0;
	}

    if (!usestandardpms) {
		if (IsPlayerConnected(targetid)) {
		    format(string, sizeof(string), "! PM: %s (id: %d) to %s (id: %d): %s", playername[playerid],playerid,playername[targetid],targetid,text);
			WriteLog(string);
			if (adminsseepms && !PlayerAccess(playerid)) SendAdminMessage(playercolor[playerid], string);
			format(string, sizeof(string), "! PM to %s (id: %d): %s", playername[targetid],targetid,text);
   			SendClientMessage(playerid, playercolor[playerid], string);
			if (ignore[targetid][playerid] != 1) {
				format(string, sizeof(string), "! PM from %s (id: %d): %s", playername[playerid],playerid,text);
				SendClientMessage(targetid, playercolor[playerid], string);
			}
		}
		else {
			format(string, sizeof(string), "* %d is not an active player.", targetid);
			SendClientMessage(playerid, COLOR_YELLOW, string);
		}
	}
	else {
	    if (IsPlayerConnected(targetid)) {
		    format(string, sizeof(string), "! PM: %s (id: %d) to %s (id: %d): %s", playername[playerid],playerid,playername[targetid],targetid,text);
			WriteLog(string);
			if (adminsseepms && !PlayerAccess(playerid)) SendAdminMessage(playercolor[playerid], string);
			if (ignore[targetid][playerid] == 1) return 0;
			else return 1;
		}
	}

	return 0;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (!IsPlayerConnected(playerid)) return 0;

	new string[MAX_STRING];
	new cmd[MAX_STRING];
	new giveplayerid, moneys, idx, weaponid;
	new tmp[MAX_STRING], tmp2[MAX_STRING], tmp3[MAX_STRING];
	new Float:x, Float:y, Float:z;

    cmd = strtok(cmdtext, idx);
	strmid(tmp, cmd, 1, strlen(cmd));
	for (new k=0;tmp[k];k++) {
		if ('a' <= tmp[k] <= 'z' || 'A' <= tmp[k] <= 'Z' || 0 <= tmp[k] <= 9) {

	if (strcmp(cmd, "/register", true) == 0) {
		if (!allowregister) {
		    SendClientMessage(playerid, COLOR_RED, "* Register are not allowed on this server!");
		    return 1;
		}

		if (dini_Int(FILE_TOTALSTAT, "users") >= maxusers) {
		    SendClientMessage(playerid, COLOR_RED, "* Sorry, user limit reached and you cannot register!");
			return 1;
		}
if(strcmp(cmdtext, "/gasloc", true) == 0) {
 SendClientMessage(playerid, COLOR_GREEN, "Gas stations are located at:");
 SendClientMessage(playerid, COLOR_YELLOW, "LV South, The Strip -- LV SouthEast, Come-a-lot");
 SendClientMessage(playerid, COLOR_YELLOW, "LV Central, Bonecounty -- LV NorthWest, Tierra Robada");
 SendClientMessage(playerid, COLOR_YELLOW, "SF NorthWest, Juniper Hollow -- SF East, Easter Basin");
 SendClientMessage(playerid, COLOR_YELLOW, "LS SouthWest, Angel Pine -- LS SouthWest, Whetstone");
 SendClientMessage(playerid, COLOR_YELLOW, "LS Central, Idlewood -- LS West, Flint County");
 SendClientMessage(playerid, COLOR_YELLOW, "LS North, montgomery -- LS North, Dillimore");
 SendClientMessage(playerid, COLOR_YELLOW, "LV NorthWest, South Tierra Robada -- LV North, Spiny Bed");
 SendClientMessage(playerid, COLOR_YELLOW, "LV North, Emerald Isle......");
 return 1;
 }
	    tmp = strtok(cmdtext, idx);
	    if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /register [password]");
			return 1;
		}

        if (20 < strlen(tmp) || strlen(tmp) < 5) {
			SendClientMessage(playerid, COLOR_YELLOW, "* Password length must be 5-20 symbols.");
			return 1;
		}

		if (!dini_Exists(PlayerFile(playername[playerid]))) {
		    new day, month, year;
			getdate(year,month,day);

			dini_Create(PlayerFile(playername[playerid]));
			format(tmp2, sizeof(tmp2), "%d.%d.%d", day,month,year);
  			dini_Set(PlayerFile(playername[playerid]), "registered", tmp2);
			dini_IntSet(PlayerFile(playername[playerid]), "password", num_hash(tmp));

			if (!dini_Exists(FILE_TOTALSTAT)) dini_Create(FILE_TOTALSTAT);
			tmp3 = dini_Get(FILE_TOTALSTAT, "users");
			dini_IntSet(FILE_TOTALSTAT, "users", strval(tmp3)+1);
			dini_Set(FILE_TOTALSTAT, "lastuser", playername[playerid]);
			dini_Set(FILE_TOTALSTAT, "lastregdate", tmp2);

			format(string, sizeof(string), "--- %s (id: %d) created account.", playername[playerid],playerid);
			WriteLog(string);
			format(string, sizeof(string), "* Account named %s created! You can login with password %s.", playername[playerid],tmp);
			SendClientMessage(playerid, COLOR_GREEN, string);
		}
		else {
			format(string, sizeof(string), "* %s already registered.", playername[playerid]);
			SendClientMessage(playerid, COLOR_RED, string);
		}

		return 1;
	}

	if (strcmp(cmd, "/login", true) == 0) {
	    tmp = strtok(cmdtext, idx);
	    if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /login [password]");
			return 1;
		}

		if (dini_Exists(PlayerFile(playername[playerid]))) {
	    	if (logged[playerid] == 1) SendClientMessage(playerid, COLOR_YELLOW, "* You already logged.");
			else {
				tmp2 = dini_Get(PlayerFile(playername[playerid]), "password");
				if (num_hash(tmp) != strval(tmp2)) {
	  			    format(string, sizeof(string), "--- %s (id: %d) typed wrong password.", playername[playerid],playerid);
					WriteLog(string);
		    		GameTextForPlayer(playerid, "~r~Wrong password!", 3000, 5);
		    		wrongpasses[playerid]++;
		    		if (wrongpasses[playerid] >= wrongpassestokick) KickPlayer(playerid, "!Protection!", "Too many invalid passwords!");
				}
				else {
				    new h, m, s;
				    new day, month, year;
				    gettime(h,m,s);
					getdate(year,month,day);

					logged[playerid] = 1;
					KillTimer(logintimeout[playerid]);

					format(tmp, sizeof(tmp), "%d.%d.%d [%d:%d:%d]", day,month,year,h,m,s);
					dini_Set(PlayerFile(playername[playerid]), "lastlogged", tmp);

					format(string, sizeof(string), "--- %s (id: %d) logged in.", playername[playerid],playerid);
					WriteLog(string);
					GameTextForPlayer(playerid, "~g~Logged in!", 3000, 5);
				}
			}
		}
		else {
		    format(string, sizeof(string), "* %s no such account.", playername[playerid]);
			SendClientMessage(playerid, COLOR_RED, string);
		}

		return 1;
	}

	if (strcmp(cmd, "/setpass", true) == 0) {
	    tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /setpass [password]");
			return 1;
		}
		if (20 < strlen(tmp) || strlen(tmp) < 5) {
			SendClientMessage(playerid, COLOR_YELLOW, "* Password length must be 5-20 symbols.");
			return 1;
		}

		if (dini_Exists(PlayerFile(playername[playerid]))) {
		    if (logged[playerid] == 1) {
				dini_IntSet(PlayerFile(playername[playerid]), "password", num_hash(tmp));
				format(string, sizeof(string), "--- %s (id: %d) changed his pass to %s.", playername[playerid], playerid, tmp);
				WriteLog(string);
				format(string, sizeof(string), "* Password changed to %s, remember it.", tmp);
				SendClientMessage(playerid, COLOR_GREEN, string);
			}
			else SendClientMessage(playerid, COLOR_RED, "* You must be logged in to change your password.");
		}
		else {
		    format(string, sizeof(string), "* %s no such account.", playername[playerid]);
			SendClientMessage(playerid, COLOR_RED, string);
		}

		return 1;
	}

    if (strcmp(cmd, "/stats", true) == 0) {
        tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
		    if (dini_Exists(PlayerFile(playername[playerid]))) {
				format(string, sizeof(string), "* Statistic for %s:", playername[playerid]);
				SendClientMessage(playerid, COLOR_ORANGE, string);

				for (new i=0;i<RANKS_RESPECT;i++)
				    if (RankRespect[i] <= respect[playerid]) moneys = i;
				format(string, sizeof(string), "* Respect: %d. Rank: %s.", respect[playerid],RankRespectNames[moneys]);
				SendClientMessage(playerid, COLOR_LIGHTBLUE, string);

				tmp2 = dini_Get(PlayerFile(playername[playerid]), "kills");
				for (new i=0;i<RANKS_KILLS;i++)
				    if (RankKills[i] <= strval(tmp2)) moneys = i;
				format(string, sizeof(string), "* Kills: %d. Rank: %s.", strval(tmp2),RankKillNames[moneys]);
				SendClientMessage(playerid, COLOR_GREEN, string);

				tmp2 = dini_Get(PlayerFile(playername[playerid]), "killsinarow");
				for (new i=0;i<RANKS_KILLSIAR;i++)
				    if (RankKillsIAR[i] <= strval(tmp2)) moneys = i;
				format(string, sizeof(string), "* Max kills in a row: %d. Rank: %s.", strval(tmp2),RankKillIARNames[moneys]);
				SendClientMessage(playerid, COLOR_WHITE, string);

				tmp2 = dini_Get(PlayerFile(playername[playerid]), "deaths");
				for (new i=0;i<RANKS_DEATHS;i++)
				    if (RankDeaths[i] <= strval(tmp2)) moneys = i;
				format(string, sizeof(string), "* Deaths: %d. Rank: %s.", strval(tmp2),RankDeathNames[moneys]);
				SendClientMessage(playerid, COLOR_RED, string);

				tmp2 = dini_Get(PlayerFile(playername[playerid]), "suicides");
				for (new i=0;i<RANKS_SUICIDES;i++)
				    if (RankSuicides[i] <= strval(tmp2)) moneys = i;
				format(string, sizeof(string), "* Suicides: %d. Rank: %s.", strval(tmp2),RankSuicideNames[moneys]);
				SendClientMessage(playerid, COLOR_GREY, string);

				for (new i=0;i<RANKS_MONEY;i++)
				    if (RankMoneys[i] <= GetPlayerMoney(playerid)+bank[playerid]) moneys = i;
				format(string, sizeof(string), "* Total money: %d. Rank: %s.", GetPlayerMoney(playerid)+bank[playerid],RankMoneyNames[moneys]);
				SendClientMessage(playerid, COLOR_LIGHTBLUE, string);

				for (new i=0;i<RANKS_BOUNTY;i++)
				    if (RankBounty[i] <= bounty[playerid]) moneys = i;
				format(string, sizeof(string), "* Bounty: %d. Rank: %s.", bounty[playerid],RankBountyNames[moneys]);
				SendClientMessage(playerid, COLOR_YELLOW, string);

				if (strlen(clan[playerid])) {
					format(tmp, sizeof(tmp), "%s%s.clan", DIR_CLANS,EncodeNick(clan[playerid]));
			        if (dini_Exists(tmp)) {
						tmp2 = dini_Get(tmp, "color");
						if (strlen(tmp2)) {
							format(string, sizeof(string), "* Clan: %s.", clan[playerid]);
							SendClientMessage(playerid, HexToInt(tmp2), string);
						}
					}
				}

				tmp2 = dini_Get(PlayerFile(playername[playerid]), "registered");
				format(string, sizeof(string), "* Registration date: %s.", tmp2);
				SendClientMessage(playerid, COLOR_BLUE, string);
			}
			else {
			    format(string, sizeof(string), "* %s no such account.", playername[playerid]);
				SendClientMessage(playerid, COLOR_RED, string);
			}
		}
		else {
		    if (!statsofothers && !PlayerAccess(playerid)) {
		        SendClientMessage(playerid, COLOR_RED, "* You cannot see stats of other players on this server!");
				return 1;
			}

		    if (dini_Exists(PlayerFile(tmp))) {
		        if (GetPlayerId(tmp) != INVALID_PLAYER_ID) {
				    weaponid = bounty[GetPlayerId(tmp)];
					giveplayerid = GetPlayerMoney(GetPlayerId(tmp))+bank[GetPlayerId(tmp)];
				}
				else {
				    tmp2 = dini_Get(PlayerFile(tmp), "money");
					giveplayerid = strval(tmp2);
					tmp2 = dini_Get(PlayerFile(tmp), "bank");
					giveplayerid += strval(tmp2);
					tmp2 = dini_Get(PlayerFile(tmp), "bounty");
					weaponid = strval(tmp2);
					tmp2 = dini_Get(PlayerFile(tmp), "respect");
					idx = strval(tmp2);
				}

				format(string, sizeof(string), "* Statistic for %s:", tmp);
				SendClientMessage(playerid, COLOR_ORANGE, string);

				for (new i=0;i<RANKS_RESPECT;i++)
				    if (RankRespect[i] <= idx) moneys = i;
				format(string, sizeof(string), "* Bounty: %d. Rank: %s.", idx,RankRespectNames[moneys]);
				SendClientMessage(playerid, COLOR_YELLOW, string);

    			tmp2 = dini_Get(PlayerFile(tmp), "kills");
				for (new i=0;i<RANKS_KILLS;i++)
				    if (RankKills[i] <= strval(tmp2)) moneys = i;
				format(string, sizeof(string), "* Kills: %d. Rank: %s.", strval(tmp2),RankKillNames[moneys]);
				SendClientMessage(playerid, COLOR_GREEN, string);

				tmp2 = dini_Get(PlayerFile(tmp), "killsinarow");
				for (new i=0;i<RANKS_KILLSIAR;i++)
				    if (RankKillsIAR[i] <= strval(tmp2)) moneys = i;
				format(string, sizeof(string), "* Max kills in a row: %d. Rank: %s.", strval(tmp2),RankKillIARNames[moneys]);
				SendClientMessage(playerid, COLOR_WHITE, string);

				tmp2 = dini_Get(PlayerFile(tmp), "deaths");
				for (new i=0;i<RANKS_DEATHS;i++)
				    if (RankDeaths[i] <= strval(tmp2)) moneys = i;
				format(string, sizeof(string), "* Deaths: %d. Rank: %s.", strval(tmp2),RankDeathNames[moneys]);
				SendClientMessage(playerid, COLOR_RED, string);

				tmp2 = dini_Get(PlayerFile(tmp), "suicides");
				for (new i=0;i<RANKS_SUICIDES;i++)
				    if (RankSuicides[i] <= strval(tmp2)) moneys = i;
				format(string, sizeof(string), "* Suicides: %d. Rank: %s.", strval(tmp2),RankSuicideNames[moneys]);
				SendClientMessage(playerid, COLOR_GREY, string);

		   		if (statsmoneyofothers || PlayerAccess(playerid) >= 1) {
					for (new i=0;i<RANKS_MONEY;i++)
					    if (RankMoneys[i] <= giveplayerid) moneys = i;
					format(string, sizeof(string), "* Total money: %d. Rank: %s.", giveplayerid,RankMoneyNames[moneys]);
					SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
				}

				for (new i=0;i<RANKS_BOUNTY;i++)
				    if (RankBounty[i] <= weaponid) moneys = i;
				format(string, sizeof(string), "* Bounty: %d. Rank: %s.", weaponid,RankBountyNames[moneys]);
				SendClientMessage(playerid, COLOR_YELLOW, string);

				tmp2 = dini_Get(PlayerFile(tmp), "clan");
				if (strlen(tmp2)) {
					format(string, sizeof(string), "%s%s.clan", DIR_CLANS,EncodeNick(tmp2));
			        if (dini_Exists(string)) {
						tmp3 = dini_Get(string, "color");
						if (strlen(tmp3)) {
							format(string, sizeof(string), "* Clan: %s.", tmp2);
							SendClientMessage(playerid, HexToInt(tmp3), string);
						}
					}
				}

				tmp2 = dini_Get(PlayerFile(tmp), "registered");
                tmp3 = dini_Get(PlayerFile(tmp), "lastlogged");
				format(string, sizeof(string), "* Registration date: %s. Last logged: %s.", tmp2,tmp3);
				SendClientMessage(playerid, COLOR_BLUE, string);
			}
			else {
			    format(string, sizeof(string), "* %s no such account.", tmp);
				SendClientMessage(playerid, COLOR_RED, string);
			}
		}

		return 1;
	}

    if (strcmp(cmd, "/resetpos", true) == 0) {
		if (dini_Exists(PlayerFile(playername[playerid])) && !logged[playerid]) {
  		   	SendClientMessage(playerid, COLOR_YELLOW, "* You must be logged in to use this.");
			return 1;
		}

		dini_Unset(PlayerFile(playername[playerid]), "x");
		dini_Unset(PlayerFile(playername[playerid]), "y");
		dini_Unset(PlayerFile(playername[playerid]), "z");

		SendClientMessage(playerid, COLOR_GREEN, "* Saved position reset!");

		return 1;
	}

	if (strcmp(cmd, "/changecolor", true) == 0) {
	    if (!allowchangecolor) {
	        SendClientMessage(playerid, COLOR_RED, "* Color changing are not allowed on this server!");
			return 1;
		}

		if (respectrequired && respect[playerid] < respecttochangeowncolor) {
			format(string, sizeof(string), "* You need at least %d respect to do it!", respecttochangeowncolor);
			SendClientMessage(playerid, COLOR_RED, string);
			return 1;
		}

		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /changecolor [color]");
			return 1;
		}

		if (strlen(tmp) != 6) {
		    SendClientMessage(playerid, COLOR_YELLOW, "* Color must be in HEX (6 symbols)!");
			return 1;
		}

	    if (bank[playerid] < changecolorcost) {
	        format(string, sizeof(string), "* You need to have €%d in your bank to change color!", strval(tmp));
	        SendClientMessage(playerid, COLOR_RED, string);
			return 1;
		}

		bank[playerid] -= changecolorcost;

		format(tmp2, sizeof(tmp2), "%sFF", tmp);
		dini_Set(PlayerFile(playername[playerid]), "color", tmp2);

		playercolor[playerid] = HexToInt(tmp2);
		SetPlayerColor(playerid, HexToInt(tmp2));

		format(string, sizeof(string), "* Changed your color to %s!", tmp);
		SendClientMessage(playerid, HexToInt(tmp2), string);

		return 1;
	}

	if (strcmp(cmd, "/me", true) == 0) {
	    if (muted[playerid] == 1) {
			GameTextForPlayer(playerid, "~r~You are muted and cannot send messages.", 3000, 5);
			return 1;
		}

	    strmid(tmp, cmdtext, 3, strlen(cmdtext));
	    if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /me [text]");
			return 1;
		}

		format(string, sizeof(string), "* %s (id: %d)%s", playername[playerid],playerid,tmp);
		WriteLog(string);
		SendChatMessage(playerid, COLOR_LIGHTBLUE, string);

		return 1;
	}

	if (strcmp(cmd, "/query", true) == 0) {
		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /query [playerid]");
			return 1;
		}
		giveplayerid = strval(tmp);

		if (IsPlayerConnected(giveplayerid)) {
			query[playerid] = giveplayerid;

			tmp2 = dini_Get(PlayerFile(playername[playerid]), "pmprefix");
			if (!strlen(tmp2)) tmp2 = queryprefix;

			format(string, sizeof(string), "* Now you can send %smessages to %s (id: %d).", tmp2,playername[giveplayerid],giveplayerid);
			SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
		}
		else {
			format(string, sizeof(string), "* %d is not an active player.", giveplayerid);
			SendClientMessage(playerid, COLOR_YELLOW, string);
		}

		return 1;
	}

	if (strcmp(cmd, "/queryprefix", true) == 0) {
		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /queryprefix [symbol]");
			return 1;
		}

		dini_Set(PlayerFile(playername[playerid]), "pmprefix", tmp[0]);

		format(string, sizeof(string), "* Now you must prefix query messages with %s.", tmp[0]);
		SendClientMessage(playerid, COLOR_LIGHTBLUE, string);

		return 1;
	}

	if (strcmp(cmd, "/queryoff", true) == 0) {
	    query[playerid] = INVALID_PLAYER_ID;
		SendClientMessage(playerid, COLOR_YELLOW, "* Your query is turned off.");
		return 1;
	}

	if (strcmp(cmd, "/ignore", true) == 0) {
		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /ignore [playerid]");
			return 1;
		}
		giveplayerid = strval(tmp);

		if (IsPlayerConnected(giveplayerid)) {
		    if (ignore[playerid][giveplayerid] == 1) {
                format(string, sizeof(string), "* %s (id: %d) already in ignore list.", playername[giveplayerid],giveplayerid);
				SendClientMessage(playerid, COLOR_RED, string);
				return 1;
			}
			ignore[playerid][giveplayerid] = 1;

			format(string, sizeof(string), "* Now you won't see messages from %s (id: %d).", playername[giveplayerid],giveplayerid);
			SendClientMessage(playerid, COLOR_RED, string);
		}
		else {
			format(string, sizeof(string), "* %d is not an active player.", giveplayerid);
			SendClientMessage(playerid, COLOR_YELLOW, string);
		}

		return 1;
	}

	if (strcmp(cmd, "/unignore", true) == 0) {
		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /unignore [playerid]");
			return 1;
		}
		giveplayerid = strval(tmp);

		if (IsPlayerConnected(giveplayerid)) {
		    if (ignore[playerid][giveplayerid] == 0) {
                format(string, sizeof(string), "* %s (id: %d) not in ignore list.", playername[giveplayerid],giveplayerid);
				SendClientMessage(playerid, COLOR_RED, string);
				return 1;
			}
			ignore[playerid][giveplayerid] = 0;

			format(string, sizeof(string), "* Now you can see messages from %s (id: %d).", playername[giveplayerid],giveplayerid);
			SendClientMessage(playerid, COLOR_GREEN, string);
		}
		else {
			format(string, sizeof(string), "* %d is not an active player.", giveplayerid);
			SendClientMessage(playerid, COLOR_YELLOW, string);
		}

		return 1;
	}

	if (strcmp(cmd, "/clear", true) == 0) {
	    tmp = strtok(cmdtext, idx);
	    moneys = strval(tmp);
		if (!strlen(tmp) || moneys <= 0) moneys = 10;

		for (new i=1;i<moneys;i++) SendClientMessage(playerid, COLOR_WHITE, " ");

		return 1;
	}

	if (strcmp(cmd, "/clanregister", true) == 0) {
		if (!clans) {
		    SendClientMessage(playerid, COLOR_RED, "* Clans are not allowed on this server!");
		    return 1;
		}

		if (!clanregister) {
		    SendClientMessage(playerid, COLOR_RED, "* Clan register are not allowed on this server!");
		    return 1;
		}

		if (dini_Int(FILE_TOTALSTAT, "clans") >= maxclans) {
		    SendClientMessage(playerid, COLOR_RED, "* Sorry, clan limit reached.");
			return 1;
		}

		if (respectrequired && respect[playerid] < respecttocreateclan) {
			format(string, sizeof(string), "* You need at least %d respect to do it!", respecttocreateclan);
			SendClientMessage(playerid, COLOR_RED, string);
			return 1;
		}

		if (!dini_Exists(PlayerFile(playername[playerid])) || !logged[playerid]) {
  		   	SendClientMessage(playerid, COLOR_YELLOW, "* You must be registered and logged in to use this.");
			return 1;
		}

	    tmp = strtok(cmdtext, idx);
	    if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /clanregister [clanname]");
			return 1;
	    }

	    for (new n=0;tmp[n];n++) {
			if ('a' <= tmp[n] <= 'z' || 'A' <= tmp[n] <= 'Z' || 0 <= tmp[n] <= 9) {

		tmp2 = dini_Get(PlayerFile(playername[playerid]), "clan");
        format(tmp2, sizeof(tmp2), "%s%s.clan", DIR_CLANS,EncodeNick(tmp2));
		if (dini_Exists(tmp2)) {
		    SendClientMessage(playerid, COLOR_YELLOW, "* You must quit your clan first.");
			return 1;
		}

		format(tmp2, sizeof(tmp2), "%s%s.clan", DIR_CLANS,EncodeNick(tmp));
		if (dini_Exists(tmp2)) {
		    format(string, sizeof(string), "* Clan %s already exists!", tmp);
			SendClientMessage(playerid, COLOR_RED, string);
			return 1;
		}

		new day, month, year;
		getdate(year,month,day);

		dini_Create(tmp2);
		format(tmp3, sizeof(tmp3), "%d.%d.%d", day,month,year);
  		dini_Set(tmp2, "registered", tmp3);
		dini_Set(tmp2, "leader", playername[playerid]);
		tmp3 = dini_Get(tmp2, "members");
		dini_IntSet(tmp2, "members", strval(tmp3)+1);

		dini_Set(PlayerFile(playername[playerid]), "clan", tmp);
		clan[playerid] = tmp;

		if (!dini_Exists(FILE_TOTALSTAT)) dini_Create(FILE_TOTALSTAT);
		tmp2 = dini_Get(FILE_TOTALSTAT, "clans");
		dini_IntSet(FILE_TOTALSTAT, "clans", strval(tmp2)+1);
		dini_Set(FILE_TOTALSTAT, "lastclan", tmp);
		format(tmp3, sizeof(tmp3), "%d.%d.%d", day,month,year);
		dini_Set(FILE_TOTALSTAT, "lastclanregdate", tmp3);

    	format(string, sizeof(string), "--- %s (id: %d) registered clan %s.", playername[playerid],playerid,tmp);
    	WriteLog(string);
    	format(string, sizeof(string), "* Clan %s successfully registered! You are the leader!", tmp);
		SendClientMessage(playerid, COLOR_GREEN, string);
		SendClientMessage(playerid, COLOR_GREEN, "* Now you can invite other players in your clan using /claninvite command.");

			}
			else {
				SendClientMessage(playerid, COLOR_RED, "* Clan name should contain ONLY latin characters and digits!");
				return 1;
			}
		}

		return 1;
	}

	if (strcmp(cmd, "/clanjoin", true) == 0) {
		if (!clans) {
		    SendClientMessage(playerid, COLOR_RED, "* Clans are not allowed on this server!");
		    return 1;
		}

		if (!dini_Exists(PlayerFile(playername[playerid])) || !logged[playerid]) {
  		   	SendClientMessage(playerid, COLOR_YELLOW, "* You must be registered and logged in to use this.");
			return 1;
		}

		if (!strlen(claninvite[playerid])) {
		    SendClientMessage(playerid, COLOR_RED, "* You wasn't invited in any clan.");
			return 1;
		}

		tmp = dini_Get(PlayerFile(playername[playerid]), "clan");
        format(tmp, sizeof(tmp), "%s%s.clan", DIR_CLANS,EncodeNick(tmp));
		if (dini_Exists(tmp)) {
		    SendClientMessage(playerid, COLOR_YELLOW, "* You must quit your clan first.");
			return 1;
		}

		format(tmp, sizeof(tmp), "%s%s.clan", DIR_CLANS,EncodeNick(claninvite[playerid]));
		if (!dini_Exists(tmp)) {
		    format(string, sizeof(string), "* Clan %s not exists!", claninvite[playerid]);
			SendClientMessage(playerid, COLOR_RED, string);
			return 1;
		}

		clan[playerid] = claninvite[playerid];
		claninvite[playerid][0] = 0;
		dini_Set(PlayerFile(playername[playerid]), "clan", clan[playerid]);
		tmp2 = dini_Get(tmp, "members");
		dini_IntSet(tmp, "members", strval(tmp2)+1);

		tmp2 = dini_Get(tmp, "color");
		if (strlen(tmp2)) {
			playercolor[playerid] = HexToInt(tmp2);
			SetPlayerColor(playerid, HexToInt(tmp2));
		}

        for (new i=0;i<MAX_PLAYERS;i++)
 			if (IsPlayerConnected(i) && strlen(clan[i]) && strcmp(clan[i], clan[playerid], true) == 0 && logged[i] == 1 && i != playerid) {
		 		format(string, sizeof(string), "* %s (id: %d) joined our clan!", playername[playerid],playerid);
				SendClientMessage(i, COLOR_GREEN, string);
			}

    	format(string, sizeof(string), "--- %s (id: %d) joined clan %s.", playername[playerid],playerid,clan[playerid]);
    	WriteLog(string);
    	format(string, sizeof(string), "* You successfully joined clan %s!", clan[playerid]);
		SendClientMessage(playerid, COLOR_GREEN, string);
		SendClientMessage(playerid, COLOR_GREEN, "* Now you can use /clanbank and clanchat.");

		return 1;
	}

	if (strcmp(cmd, "/clanquit", true) == 0) {
		if (!clans) {
		    SendClientMessage(playerid, COLOR_RED, "* Clans are not allowed on this server!");
		    return 1;
		}

		if (!dini_Exists(PlayerFile(playername[playerid])) || !logged[playerid]) {
  		   	SendClientMessage(playerid, COLOR_YELLOW, "* You must be registered and logged in to use this.");
			return 1;
		}

		tmp = dini_Get(PlayerFile(playername[playerid]), "clan");
        format(tmp, sizeof(tmp), "%s%s.clan", DIR_CLANS,EncodeNick(tmp));
		if (!dini_Exists(tmp)) {
		    SendClientMessage(playerid, COLOR_YELLOW, "* You are not in the clan.");
			return 1;
		}

		dini_Unset(PlayerFile(playername[playerid]), "clan");
		tmp2 = dini_Get(tmp, "members");
		if (strval(tmp2)-1 > 0) dini_IntSet(tmp, "members", strval(tmp2)-1);

    	format(string, sizeof(string), "--- %s (id: %d) left clan %s.", playername[playerid],playerid,clan[playerid]);
    	WriteLog(string);
    	format(string, sizeof(string), "* You left clan %s.", clan[playerid]);
		SendClientMessage(playerid, COLOR_RED, string);

		playercolor[playerid] = playerColors[playerid];
		SetPlayerColor(playerid, playerColors[playerid]);
		tmp2 = dini_Get(PlayerFile(playername[playerid]), "color");
		if (strlen(tmp2)) {
			playercolor[playerid] = HexToInt(tmp2);
			SetPlayerColor(playerid, HexToInt(tmp2));
		}

		tmp2 = dini_Get(tmp, "leader");
		if (strlen(tmp2) && strcmp(playername[playerid], tmp2, true) == 0) {
		    dini_Remove(tmp);

			for (new i=0;i<MAX_PLAYERS;i++)
 				if (IsPlayerConnected(i) && strlen(clan[i]) && strcmp(clan[i], clan[playerid], true) == 0 && logged[i] == 1) {
	   		 		format(string, sizeof(string), "* Clan %s no more exists, leader left it.", clan[playerid]);
					SendClientMessage(i, COLOR_RED, string);

					clan[i][0] = 0;
				}

            format(string, sizeof(string), "--- Clan %s no more exists, leader left it.", tmp2);
    		WriteLog(string);
		}

        clan[playerid][0] = 0;

		return 1;
	}

	if (strcmp(cmd, "/claninvite", true) == 0) {
		if (!clans) {
		    SendClientMessage(playerid, COLOR_RED, "* Clans are not allowed on this server!");
		    return 1;
		}

		if (!dini_Exists(PlayerFile(playername[playerid])) || !logged[playerid]) {
  		   	SendClientMessage(playerid, COLOR_YELLOW, "* You must be registered and logged in to use this.");
			return 1;
		}

		tmp = dini_Get(PlayerFile(playername[playerid]), "clan");
        format(tmp, sizeof(tmp), "%s%s.clan", DIR_CLANS,EncodeNick(tmp));
		if (!dini_Exists(tmp)) {
		    SendClientMessage(playerid, COLOR_YELLOW, "* You are not in the clan.");
			return 1;
		}

		tmp2 = dini_Get(tmp, "leader");
		tmp3 = dini_Get(tmp, "allowinvite");
		if (strlen(tmp2) && strcmp(playername[playerid], tmp2, true) != 0 && strval(tmp3) == 0) {
		    SendClientMessage(playerid, COLOR_YELLOW, "* You must be a leader to do it.");
			return 1;
		}

		tmp2 = strtok(cmdtext, idx);
	    if (!strlen(tmp2)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /claninvite [playerid]");
			return 1;
	    }
	    giveplayerid = strval(tmp2);

	    if (playerid == giveplayerid) {
	        SendClientMessage(playerid, COLOR_RED, "* You can't invite yourself!");
	        return 1;
	    }

	    if (IsPlayerConnected(giveplayerid)) {
			claninvite[giveplayerid] = clan[playerid];

	    	format(string, sizeof(string), "--- %s (id: %d) invited %s (id: %d) into clan %s.", playername[playerid],playerid,playername[giveplayerid],giveplayerid,clan[playerid]);
	    	WriteLog(string);
	    	format(string, sizeof(string), "* You invited %s (id: %d) to join your clan.", playername[giveplayerid],giveplayerid);
			SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
			format(string, sizeof(string), "* %s (id: %d) invited you to join clan %s. Use /clanjoin command.", playername[playerid],playerid,clan[playerid]);
			SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
		}
		else {
		    format(string, sizeof(string), "* %d is not an active player.", giveplayerid);
			SendClientMessage(playerid, COLOR_YELLOW, string);
		}

		return 1;
	}

    if (strcmp(cmd, "/clankick", true) == 0) {
		if (!clans) {
		    SendClientMessage(playerid, COLOR_RED, "* Clans are not allowed on this server!");
		    return 1;
		}

		if (!dini_Exists(PlayerFile(playername[playerid])) || !logged[playerid]) {
  		   	SendClientMessage(playerid, COLOR_YELLOW, "* You must be registered and logged in to use this.");
			return 1;
		}

		tmp = dini_Get(PlayerFile(playername[playerid]), "clan");
        format(tmp, sizeof(tmp), "%s%s.clan", DIR_CLANS,EncodeNick(tmp));
		if (!dini_Exists(tmp)) {
		    SendClientMessage(playerid, COLOR_YELLOW, "* You are not in the clan.");
			return 1;
		}

		tmp2 = dini_Get(tmp, "leader");
		if (strlen(tmp2) && strcmp(playername[playerid], tmp2, true) != 0) {
		    SendClientMessage(playerid, COLOR_YELLOW, "* You must be a leader to do it.");
			return 1;
		}

		tmp2 = strtok(cmdtext, idx);
	    if (!strlen(tmp2)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /clankick [playername]");
			return 1;
	    }

	    if (strcmp(playername[playerid], tmp2, true) == 0) {
	        SendClientMessage(playerid, COLOR_RED, "* You can't kick yourself!");
	        return 1;
	    }

	    tmp3 = dini_Get(PlayerFile(tmp2), "clan");
	    if (strlen(tmp3) && strcmp(clan[playerid], tmp3, true) != 0) {
	        format(string, sizeof(string), "* %s is not in your clan.", tmp2);
			SendClientMessage(playerid, COLOR_RED, string);
	        return 1;
	    }

		dini_Unset(PlayerFile(tmp2), "clan");
		tmp3 = dini_Get(tmp, "members");
		if (strval(tmp3)-1 > 0) dini_IntSet(tmp, "members", strval(tmp3)-1);

    	format(string, sizeof(string), "--- %s (id: %d) kicked %s from clan %s.", playername[playerid],playerid,tmp2,clan[playerid]);
    	WriteLog(string);
    	format(string, sizeof(string), "* You kicked %s from your clan.", tmp2);
		SendClientMessage(playerid, COLOR_RED, string);

		giveplayerid = GetPlayerId(tmp2);
		if (giveplayerid != INVALID_PLAYER_ID) {
        	clan[giveplayerid][0] = 0;

            playercolor[giveplayerid] = playerColors[giveplayerid];
			SetPlayerColor(giveplayerid, playerColors[giveplayerid]);
			tmp3 = dini_Get(PlayerFile(playername[giveplayerid]), "color");
			if (strlen(tmp3)) {
				playercolor[giveplayerid] = HexToInt(tmp3);
				SetPlayerColor(giveplayerid, HexToInt(tmp3));
			}

        	format(string, sizeof(string), "* %s (id: %d) kicked you from clan %s.", playername[playerid],playerid,clan[playerid]);
			SendClientMessage(giveplayerid, COLOR_RED, string);
		}

		return 1;
	}

	if (strcmp(cmd, "/clansetleader", true) == 0) {
		if (!clans) {
		    SendClientMessage(playerid, COLOR_RED, "* Clans are not allowed on this server!");
		    return 1;
		}

		if (!dini_Exists(PlayerFile(playername[playerid])) || !logged[playerid]) {
  		   	SendClientMessage(playerid, COLOR_YELLOW, "* You must be registered and logged in to use this.");
			return 1;
		}

		tmp = dini_Get(PlayerFile(playername[playerid]), "clan");
        format(tmp, sizeof(tmp), "%s%s.clan", DIR_CLANS,EncodeNick(tmp));
		if (!dini_Exists(tmp)) {
		    SendClientMessage(playerid, COLOR_YELLOW, "* You are not in the clan.");
			return 1;
		}

		tmp2 = dini_Get(tmp, "leader");
		if (strlen(tmp2) && strcmp(playername[playerid], tmp2, true) != 0) {
		    SendClientMessage(playerid, COLOR_YELLOW, "* You must be a leader to do it.");
			return 1;
		}

		tmp2 = strtok(cmdtext, idx);
	    if (!strlen(tmp2)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /clansetleader [playername]");
			return 1;
	    }

	    if (strcmp(playername[playerid], tmp2, true) == 0) {
	        SendClientMessage(playerid, COLOR_YELLOW, "* You already a leader.");
	        return 1;
	    }

	    tmp3 = dini_Get(PlayerFile(tmp2), "clan");
	    if (strlen(tmp3) && strcmp(clan[playerid], tmp3, true) != 0) {
	        format(string, sizeof(string), "* %s is not in your clan.", tmp2);
			SendClientMessage(playerid, COLOR_RED, string);
	        return 1;
	    }

		dini_Set(tmp, "leader", tmp2);

        for (new i=0;i<MAX_PLAYERS;i++)
 			if (IsPlayerConnected(i) && strlen(clan[i]) && strcmp(clan[i], clan[playerid], true) == 0 && logged[i] == 1 && i != playerid) {
 		    	format(string, sizeof(string), "* %s (id: %d) changed clan leader to %s.", playername[playerid],playerid,tmp2);
				SendClientMessage(i, COLOR_WHITE, string);
 			}
    	format(string, sizeof(string), "--- %s (id: %d) changed leader of clan %s to %s.", playername[playerid],playerid,clan[playerid],tmp2);
    	WriteLog(string);
    	format(string, sizeof(string), "* You changed clan leader to %s.", tmp2);
		SendClientMessage(playerid, COLOR_WHITE, string);

		return 1;
	}

	if (strcmp(cmd, "/clanallowinvite", true) == 0) {
		if (!clans) {
		    SendClientMessage(playerid, COLOR_RED, "* Clans are not allowed on this server!");
		    return 1;
		}

		if (!dini_Exists(PlayerFile(playername[playerid])) || !logged[playerid]) {
  		   	SendClientMessage(playerid, COLOR_YELLOW, "* You must be registered and logged in to use this.");
			return 1;
		}

		tmp = dini_Get(PlayerFile(playername[playerid]), "clan");
        format(tmp, sizeof(tmp), "%s%s.clan", DIR_CLANS,EncodeNick(tmp));
		if (!dini_Exists(tmp)) {
		    SendClientMessage(playerid, COLOR_YELLOW, "* You are not in the clan.");
			return 1;
		}

		tmp2 = dini_Get(tmp, "leader");
		if (strlen(tmp2) && strcmp(playername[playerid], tmp2, true) != 0) {
		    SendClientMessage(playerid, COLOR_YELLOW, "* You must be a leader to do it.");
			return 1;
		}

		tmp2 = strtok(cmdtext, idx);
		moneys = strval(tmp2);
	    if (!strlen(tmp2) || moneys < 0 || moneys > 1) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /clanallowinvite [0-1]");
			return 1;
	    }

		dini_IntSet(tmp, "allowinvite", moneys);

		if (moneys == 0) {
    		format(string, sizeof(string), "--- %s (id: %d) disallowed members to invite into clan %s.", playername[playerid],playerid,clan[playerid]);
    		WriteLog(string);
			SendClientMessage(playerid, COLOR_RED, "* Now only you can invite players into clan!");
		}
		else {
		    format(string, sizeof(string), "--- %s (id: %d) allowed members to invite into clan %s.", playername[playerid],playerid,clan[playerid]);
    		WriteLog(string);
			SendClientMessage(playerid, COLOR_GREEN, "* Now every clan member can invite players into clan!");
		}

		return 1;
	}

	if (strcmp(cmd, "/clanchatprefix", true) == 0) {
		if (!clans) {
		    SendClientMessage(playerid, COLOR_RED, "* Clans are not allowed on this server!");
		    return 1;
		}

		if (!dini_Exists(PlayerFile(playername[playerid])) || !logged[playerid]) {
  		   	SendClientMessage(playerid, COLOR_YELLOW, "* You must be registered and logged in to use this.");
			return 1;
		}

		tmp = dini_Get(PlayerFile(playername[playerid]), "clan");
        format(tmp, sizeof(tmp), "%s%s.clan", DIR_CLANS,EncodeNick(tmp));
		if (!dini_Exists(tmp)) {
		    SendClientMessage(playerid, COLOR_YELLOW, "* You are not in the clan.");
			return 1;
		}

		tmp2 = dini_Get(tmp, "leader");
		if (strlen(tmp2) && strcmp(playername[playerid], tmp2, true) != 0) {
		    SendClientMessage(playerid, COLOR_YELLOW, "* You must be a leader to do it.");
			return 1;
		}

		tmp2 = strtok(cmdtext, idx);
	    if (!strlen(tmp2)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /clanchatprefix [symbol]");
			return 1;
	    }

		dini_Set(tmp, "clanchatprefix", tmp2[0]);

        for (new i=0;i<MAX_PLAYERS;i++)
 			if (IsPlayerConnected(i) && strlen(clan[i]) && strcmp(clan[i], clan[playerid], true) == 0 && logged[i] == 1 && i != playerid) {
 		    	format(string, sizeof(string), "* %s (id: %d) changed clan chat prefix to %s.", playername[playerid],playerid,tmp2[0]);
				SendClientMessage(i, COLOR_GREY, string);
 			}
   		format(string, sizeof(string), "--- %s (id: %d) changed clan %s chat prefix to %s.", playername[playerid],playerid,clan[playerid],tmp2[0]);
   		WriteLog(string);
   		format(string, sizeof(string), "* Now you must prefix clan chat messages with %s.", tmp2[0]);
		SendClientMessage(playerid, COLOR_GREY, string);

		return 1;
	}

	if (strcmp(cmd, "/clanchangecolor", true) == 0) {
		if (!clans) {
		    SendClientMessage(playerid, COLOR_RED, "* Clans are not allowed on this server!");
		    return 1;
		}

		if (!allowclanchangecolor) {
		    SendClientMessage(playerid, COLOR_RED, "* Clan color change are not allowed on this server!");
		    return 1;
		}

		tmp = dini_Get(FILE_SETTINGS, "respect");
		tmp2 = dini_Get(FILE_SETTINGS, "respecttochangeclancolor");
		if (strval(tmp) == 1 && respect[playerid] < strval(tmp2)) {
			format(string, sizeof(string), "* You need at least %d respect to do it!", strval(tmp2));
			SendClientMessage(playerid, COLOR_RED, string);
			return 1;
		}

		if (!dini_Exists(PlayerFile(playername[playerid])) || !logged[playerid]) {
  		   	SendClientMessage(playerid, COLOR_YELLOW, "* You must be registered and logged in to use this.");
			return 1;
		}

		tmp = dini_Get(PlayerFile(playername[playerid]), "clan");
        format(tmp, sizeof(tmp), "%s%s.clan", DIR_CLANS,EncodeNick(tmp));
		if (!dini_Exists(tmp)) {
		    SendClientMessage(playerid, COLOR_YELLOW, "* You are not in the clan.");
			return 1;
		}

		tmp2 = dini_Get(tmp, "leader");
		if (strlen(tmp2) && strcmp(playername[playerid], tmp2, true) != 0) {
		    SendClientMessage(playerid, COLOR_YELLOW, "* You must be a leader to do it.");
			return 1;
		}

		tmp2 = strtok(cmdtext, idx);
	    if (!strlen(tmp2)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /clanchangecolor [symbol]");
			return 1;
	    }

	    if (strlen(tmp2) != 6) {
		    SendClientMessage(playerid, COLOR_YELLOW, "* Color must be in HEX (6 symbols)!");
			return 1;
		}

        tmp3 = dini_Get(tmp, "bank");
	    if (strval(tmp3) < clanchangecolorcost) {
	        format(string, sizeof(string), "* You need to have €%d in your clanbank to change color!", strval(tmp3));
	        SendClientMessage(playerid, COLOR_RED, string);
			return 1;
		}

		dini_IntSet(tmp, "bank", strval(tmp3)-clanchangecolorcost);

		format(tmp3, sizeof(tmp3), "%sFF", tmp2);
		dini_Set(tmp, "color", tmp3);

		playercolor[playerid] = HexToInt(tmp3);
		SetPlayerColor(playerid, HexToInt(tmp3));

        for (new i=0;i<MAX_PLAYERS;i++)
 			if (IsPlayerConnected(i) && strlen(clan[i]) && strcmp(clan[i], clan[playerid], true) == 0 && logged[i] == 1 && i != playerid) {
                playercolor[i] = HexToInt(tmp3);
				SetPlayerColor(i, HexToInt(tmp3));

				format(string, sizeof(string), "* %s (id: %d) changed clan color to %s.", playername[playerid],playerid,tmp2);
				SendClientMessage(i, HexToInt(tmp3), string);
 			}
        format(string, sizeof(string), "--- %s (id: %d) changed clan %s color to %s.", playername[playerid],playerid,clan[playerid],tmp2);
   		WriteLog(string);
		format(string, sizeof(string), "* Changed clan color to %s!", tmp2);
		SendClientMessage(playerid, HexToInt(tmp3), string);

		return 1;
	}

	if (strcmp(cmd, "/clanstats", true) == 0) {
		if (!clans) {
		    SendClientMessage(playerid, COLOR_RED, "* Clans are not allowed on this server!");
		    return 1;
		}

		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
		    tmp = dini_Get(PlayerFile(playername[playerid]), "clan");
			if (!strlen(tmp)) {
		    	SendClientMessage(playerid, COLOR_YELLOW, "* You are not in the clan.");
				return 1;
			}
			format(tmp3, sizeof(tmp3), "%s%s.clan", DIR_CLANS,EncodeNick(tmp));

	        if (dini_Exists(tmp3)) {
				format(string, sizeof(string), "* %s clan statistic:", tmp);
				SendClientMessage(playerid, COLOR_ORANGE, string);
				tmp = dini_Get(tmp3, "leader");
				format(string, sizeof(string), "* Leader: %s.", tmp);
				SendClientMessage(playerid, COLOR_WHITE, string);

				tmp = dini_Get(tmp3, "members");
				format(string, sizeof(string), "* Members: %d.", strval(tmp));
				SendClientMessage(playerid, COLOR_YELLOW, string);

				tmp = dini_Get(tmp3, "kills");
				tmp2 = dini_Get(tmp3, "deaths");
				string = dini_Get(tmp3, "suicides");
				format(string, sizeof(string), "* Kills: %d. Deaths: %d. Suicides: %d.", strval(tmp),strval(tmp2),strval(string));
				SendClientMessage(playerid, COLOR_GREEN, string);

				tmp = dini_Get(tmp3, "bank");
                format(string, sizeof(string), "* Clan bank: %d.", strval(tmp));
				SendClientMessage(playerid, COLOR_LIGHTBLUE, string);

				tmp = dini_Get(tmp3, "color");
				if (HexToInt(tmp) != 0) {
					format(string, sizeof(string), "* Color: %s.", tmp);
					SendClientMessage(playerid, HexToInt(tmp), string);
				}

				tmp = dini_Get(tmp3, "clanchatprefix");
				if (!strlen(tmp)) tmp = clanchatprefix;
				format(string, sizeof(string), "* Chat prefix: %s.", tmp);
				SendClientMessage(playerid, COLOR_GREY, string);

				tmp = dini_Get(tmp3, "registered");
				if (strlen(tmp)) {
					format(string, sizeof(string), "* Registration date: %s.", tmp);
					SendClientMessage(playerid, COLOR_BLUE, string);
				}
			}
			else {
				tmp = dini_Get(PlayerFile(playername[playerid]), "clan");
		    	format(string, sizeof(string), "* Clan %s not exists!", tmp);
				SendClientMessage(playerid, COLOR_RED, string);
				return 1;
			}
		}
		else {
			if (!statsofotherclans && !PlayerAccess(playerid)) {
			    SendClientMessage(playerid, COLOR_RED, "* You cannot see stats of other clans on this server!");
			    return 1;
			}
		    format(tmp3, sizeof(tmp3), "%s%s.clan", DIR_CLANS,EncodeNick(tmp));
		    if (dini_Exists(tmp3)) {
				format(string, sizeof(string), "* %s clan statistic:", tmp);
				SendClientMessage(playerid, COLOR_ORANGE, string);

				tmp = dini_Get(tmp3, "leader");
				format(string, sizeof(string), "* Leader: %s.", tmp);
				SendClientMessage(playerid, COLOR_WHITE, string);

				tmp = dini_Get(tmp3, "members");
				format(string, sizeof(string), "* Members: %d.", strval(tmp));
				SendClientMessage(playerid, COLOR_YELLOW, string);

				tmp = dini_Get(tmp3, "kills");
				tmp2 = dini_Get(tmp3, "deaths");
				string = dini_Get(tmp3, "suicides");
				format(string, sizeof(string), "* Kills: %d. Deaths: %d. Suicides: %d.", strval(tmp),strval(tmp2),strval(string));
				SendClientMessage(playerid, COLOR_GREEN, string);

				if (statsmoneyofotherclans || PlayerAccess(playerid) >= 1) {
			    	tmp = dini_Get(tmp3, "bank");
                	format(string, sizeof(string), "* Clan bank: %d.", strval(tmp));
					SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
				}

				tmp = dini_Get(tmp3, "color");
				if (HexToInt(tmp) != 0) {
					format(string, sizeof(string), "* Color: %s.", tmp);
					SendClientMessage(playerid, HexToInt(tmp), string);
				}

				tmp = dini_Get(tmp3, "registered");
				if (strlen(tmp)) {
					format(string, sizeof(string), "* Registration date: %s.", tmp);
					SendClientMessage(playerid, COLOR_BLUE, string);
				}
			}
		    else {
		    	format(string, sizeof(string), "* Clan %s not exists!", tmp);
				SendClientMessage(playerid, COLOR_RED, string);
				return 1;
			}
		}

		return 1;
	}

	if (strcmp(cmd, "/clanbank", true) == 0) {
		if (!clans) {
		    SendClientMessage(playerid, COLOR_RED, "* Clans are not allowed on this server!");
		    return 1;
		}

		if (!clanbank) {
		    SendClientMessage(playerid, COLOR_RED, "* Clanbank are not allowed on this server!");
		    return 1;
		}

		if (dini_Exists(PlayerFile(playername[playerid])) && !logged[playerid]) {
  		   	SendClientMessage(playerid, COLOR_YELLOW, "* You must be logged in to use this.");
			return 1;
		}

	    if (IsPlayerInCheckpoint(playerid) == 0 || (getCheckpointType(playerid) != CP_BANK && getCheckpointType(playerid) != CP_BANK2)) {
	        SendClientMessage(playerid, COLOR_YELLOW, "* You must be at a bank area to use this. ATMs are located in convenience stores.");
			return 1;
		}

	    tmp = strtok(cmdtext, idx);
	    if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /clanbank [amount]");
			return 1;
	    }
	    moneys = strval(tmp);

		tmp = dini_Get(PlayerFile(playername[playerid]), "clan");
		if (!strlen(tmp)) {
		    SendClientMessage(playerid, COLOR_YELLOW, "* You must be in a clan to do it.");
			return 1;
		}

		if (moneys < 1) {
			SendClientMessage(playerid, COLOR_YELLOW, "* Hey what are you trying to pull here?");
			return 1;
		}

		if (moneys > GetPlayerMoney(playerid)) {
			SendClientMessage(playerid, COLOR_RED, "* You don't have enough money!");
			return 1;
	    }

		format(tmp2, sizeof(tmp2), "%s%s.clan", DIR_CLANS,EncodeNick(tmp));
		if (dini_Exists(tmp2)) {
		    GiveMoney(playerid, -moneys);
		    tmp3 = dini_Get(tmp2, "bank");
		    if (moneys+strval(tmp3) > MAX_VALUE) moneys = moneys+strval(tmp3)-MAX_VALUE;
		    dini_IntSet(tmp2, "bank", strval(tmp3)+moneys);
		}
		else {
		    format(string, sizeof(string), "* Clan %s not exists!", tmp);
			SendClientMessage(playerid, COLOR_RED, string);
			return 1;
		}

		tmp2 = dini_Get(tmp2, "bank");
		for (new i=0;i<MAX_PLAYERS;i++)
 			if (IsPlayerConnected(i) && strlen(clan[i]) && strcmp(clan[i], tmp, true) == 0 && logged[i] == 1 && i != playerid) {
 		    	format(string, sizeof(string), "* %s (id: %d) deposited €%d in clanbank %s, balance is €%d.", playername[playerid],playerid,moneys,tmp,strval(tmp2));
    			SendClientMessage(i, COLOR_YELLOW, string);
 			}

		format(string, sizeof(string), "--- %s (id: %d) deposited €%d in clanbank %s, balance is €%d.", playername[playerid],playerid,moneys,tmp,strval(tmp2));
		WriteLog(string);
		format(string, sizeof(string), "* You have deposited €%d to clanbank %s, balance is €%d.", moneys,tmp,strval(tmp2));
		SendClientMessage(playerid, COLOR_YELLOW, string);

		return 1;
	}

	if (strcmp(cmd, "/clanget", true) == 0) {
		if (!clans) {
		    SendClientMessage(playerid, COLOR_RED, "* Clans are not allowed on this server!");
		    return 1;
		}

		if (!clanbank) {
		    SendClientMessage(playerid, COLOR_RED, "* Clanbank are not allowed on this server!");
		    return 1;
		}

		if (dini_Exists(PlayerFile(playername[playerid])) && !logged[playerid]) {
  		   	SendClientMessage(playerid, COLOR_YELLOW, "* You must be logged in to use this.");
			return 1;
		}

	    if (IsPlayerInCheckpoint(playerid) == 0 || (getCheckpointType(playerid) != CP_BANK && getCheckpointType(playerid) != CP_BANK2)) {
	        SendClientMessage(playerid, COLOR_YELLOW, "* You must be at a bank area to use this. ATMs are located in convenience stores.");
			return 1;
		}

	    tmp = strtok(cmdtext, idx);
	    if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /clanget [amount]");
			return 1;
	    }
	    moneys = strval(tmp);

	    if (moneys < 1) {
			SendClientMessage(playerid, COLOR_YELLOW, "* Hey what are you trying to pull here?");
			return 1;
		}

		tmp = dini_Get(PlayerFile(playername[playerid]), "clan");
		if (!strlen(tmp)) {
		    SendClientMessage(playerid, COLOR_YELLOW, "* You must be in a clan to do it.");
			return 1;
		}

		format(tmp2, sizeof(tmp2), "%s%s.clan", DIR_CLANS,EncodeNick(tmp));
        tmp3 = dini_Get(tmp2, "bank");
	    if (moneys > strval(tmp3)) moneys = strval(tmp3);

		if (dini_Exists(tmp2)) {
		    GiveMoney(playerid, moneys);
		    dini_IntSet(tmp2, "bank", strval(tmp3)-moneys);
		}
		else {
		    format(string, sizeof(string), "* Clan %s not exists!", tmp);
			SendClientMessage(playerid, COLOR_RED, string);
			return 1;
		}

		tmp3 = dini_Get(tmp2, "bank");
		for (new i=0;i<MAX_PLAYERS;i++)
 			if (IsPlayerConnected(i) && strlen(clan[i]) && strcmp(clan[i], tmp, true) == 0 && logged[i] == 1 && i != playerid) {
 		    	format(string, sizeof(string), "* %s (id: %d) withdrawn €%d from clanbank %s, balance is €%d.", playername[playerid],playerid,moneys,tmp,strval(tmp3));
    			SendClientMessage(i, COLOR_YELLOW, string);
 			}

		format(string, sizeof(string), "--- %s (id: %d) withdrawn €%d from clanbank %s, balance is €%d.", playername[playerid],playerid,moneys,tmp,strval(tmp3));
		WriteLog(string);
		format(string, sizeof(string), "* You have withdrawn €%d from clanbank %s, balance is €%d.", moneys,tmp,strval(tmp3));
		SendClientMessage(playerid, COLOR_YELLOW, string);

		return 1;
   	}

	if (strcmp(cmd, "/clanbalance", true) == 0) {
		if (!clans) {
		    SendClientMessage(playerid, COLOR_RED, "* Clans are not allowed on this server!");
		    return 1;
		}

		if (!clanbank) {
		    SendClientMessage(playerid, COLOR_RED, "* Clanbank are not allowed on this server!");
		    return 1;
		}

		tmp = dini_Get(PlayerFile(playername[playerid]), "clan");
		if (!strlen(tmp)) {
		    SendClientMessage(playerid, COLOR_YELLOW, "* You must be in a clan to do it.");
			return 1;
		}
		format(tmp2, sizeof(tmp2), "%s%s.clan", DIR_CLANS,EncodeNick(tmp));

        if (dini_Exists(tmp2)) {
			tmp3 = dini_Get(tmp2, "bank");
	       	format(string, sizeof(string), "* You have €%d in the clanbank %s.", strval(tmp3),tmp);
			SendClientMessage(playerid, COLOR_YELLOW, string);
		}
		else {
		    format(string, sizeof(string), "* Clan %s not exists!", tmp);
			SendClientMessage(playerid, COLOR_RED, string);
		}

		return 1;
	}

	if (strcmp(cmd, "/bank", true) == 0) {
		if (!enablebank) {
		    SendClientMessage(playerid, COLOR_RED, "* Bank are not allowed on this server!");
		    return 1;
		}

		if (dini_Exists(PlayerFile(playername[playerid])) && !logged[playerid]) {
  		   	SendClientMessage(playerid, COLOR_YELLOW, "* You must be logged in to use this.");
			return 1;
		}

	    if (IsPlayerInCheckpoint(playerid) == 0 || (getCheckpointType(playerid) != CP_BANK && getCheckpointType(playerid) != CP_BANK2)) {
	        SendClientMessage(playerid, COLOR_YELLOW, "* You must be at a bank area to use this. ATMs are located in convenience stores.");
			return 1;
		}

	    tmp = strtok(cmdtext, idx);
	    if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /bank [amount]");
			return 1;
	    }
	    moneys = strval(tmp);

	    if (moneys < 1) {
			SendClientMessage(playerid, COLOR_YELLOW, "* Hey what are you trying to pull here?");
			return 1;
		}
		if (GetPlayerMoney(playerid) <= 0) {
			SendClientMessage(playerid, COLOR_RED, "* You don't have enough money!");
			return 1;
	    }
	    if (moneys > GetPlayerMoney(playerid)) moneys = GetPlayerMoney(playerid);
	    if (moneys+bank[playerid] > MAX_VALUE) moneys = MAX_VALUE-bank[playerid];

		GiveMoney(playerid, -moneys);
		bank[playerid] += moneys;

		format(string, sizeof(string), "--- %s (id: %d) deposited €%d, balance is €%d.", playername[playerid],playerid,moneys,bank[playerid]);
		WriteLog(string);
		format(string, sizeof(string), "* You have deposited €%d, your current balance is €%d.", moneys,bank[playerid]);
		SendClientMessage(playerid, COLOR_YELLOW, string);

		return 1;
	}

	if (strcmp(cmd, "/get", true) == 0) {
		if (!enablebank) {
		    SendClientMessage(playerid, COLOR_RED, "* Bank are not allowed on this server!");
		    return 1;
		}

		if (dini_Exists(PlayerFile(playername[playerid])) && !logged[playerid]) {
  		   	SendClientMessage(playerid, COLOR_YELLOW, "* You must be logged in to use this.");
			return 1;
		}

	    if (IsPlayerInCheckpoint(playerid) == 0 || (getCheckpointType(playerid) != CP_BANK && getCheckpointType(playerid) != CP_BANK2)) {
	        SendClientMessage(playerid, COLOR_YELLOW, "* You must be at a bank area to use this. ATMs are located in convenience stores.");
			return 1;
		}

	    tmp = strtok(cmdtext, idx);
	    if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /get [amount]");
			return 1;
	    }
	    moneys = strval(tmp);

	    if (moneys < 1) {
			SendClientMessage(playerid, COLOR_YELLOW, "* Hey what are you trying to pull here?");
			return 1;
		}

	    if (moneys > bank[playerid]) moneys = bank[playerid];

		GiveMoney(playerid, moneys);
		bank[playerid] -= moneys;

		format(string, sizeof(string), "--- %s (id: %d) withdrawn €%d, balance is €%d.", playername[playerid],playerid,moneys,bank[playerid]);
		WriteLog(string);
		format(string, sizeof(string), "* You have withdrawn €%d, your current balance is €%d.", moneys,bank[playerid]);
		SendClientMessage(playerid, COLOR_YELLOW, string);

		return 1;
   	}

	if (strcmp(cmd, "/balance", true) == 0) {
		if (!enablebank) {
		    SendClientMessage(playerid, COLOR_RED, "* Bank are not allowed on this server!");
		    return 1;
		}

		format(string, sizeof(string), "* You have €%d in the bank.", bank[playerid]);
		SendClientMessage(playerid, COLOR_YELLOW, string);

		return 1;
		}

	if (strcmp(cmd, "/send", true) == 0) {
		if (!send) {
		    SendClientMessage(playerid, COLOR_RED, "* Sending are not allowed on this server!");
		    return 1;
		}

		tmp = strtok(cmdtext, idx);
  		if (dini_Exists(PlayerFile(playername[playerid])) && !logged[playerid]) {
  		    SendClientMessage(playerid, COLOR_YELLOW, "* You must be logged in to use this.");
			return 1;
		}

		if (jailed[playerid] == 1) {
		    SendClientMessage(playerid, COLOR_RED, "* You jailed and cannot send money.");
		    return 1;
		}

		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /send [playerid] [amount]");
			return 1;
		}
		giveplayerid = strval(tmp);

		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /send [playerid] [amount]");
			return 1;
		}
 		moneys = strval(tmp);

		if (IsPlayerConnected(giveplayerid)) {
			if (moneys > GetPlayerMoney(playerid)) moneys = GetPlayerMoney(playerid);
			if (moneys > 0 && GetPlayerMoney(playerid) >= moneys) {
				SwapMoney(playerid, giveplayerid, moneys);

				format(string, sizeof(string), "--- %s (id: %d) sent €%d to %s (id: %d).", playername[playerid],playerid,moneys,playername[giveplayerid],giveplayerid);
				WriteLog(string);
				format(string, sizeof(string), "* You have sent %s (id: %d), €%d.", playername[giveplayerid],giveplayerid,moneys);
				SendClientMessage(playerid, COLOR_YELLOW, string);
				format(string, sizeof(string), "* You have recieved €%d from %s (id: %d).", moneys,playername[playerid],playerid);
				SendClientMessage(giveplayerid, COLOR_YELLOW, string);
			}
			else SendClientMessage(playerid, COLOR_YELLOW, "* Invalid transaction amount.");
		}
		else {
			format(string, sizeof(string), "* %d is not an active player.", giveplayerid);
			SendClientMessage(playerid, COLOR_YELLOW, string);
		}
		return 1;
	}

	if (strcmp(cmd, "/transact", true) == 0) {
		if (!enablebank) {
		    SendClientMessage(playerid, COLOR_RED, "* Bank are not allowed on this server!");
		    return 1;
		}

		if (!transact) {
		    SendClientMessage(playerid, COLOR_RED, "* Transact are not allowed on this server!");
		    return 1;
		}

	    if (IsPlayerInCheckpoint(playerid) == 0 || (getCheckpointType(playerid) != CP_BANK && getCheckpointType(playerid) != CP_BANK2)) {
	        SendClientMessage(playerid, COLOR_YELLOW, "* You must be at a bank area to use this. ATMs are located in convenience stores.");
			return 1;
		}

  		if (dini_Exists(PlayerFile(playername[playerid])) && !logged[playerid]) {
  		    SendClientMessage(playerid, COLOR_YELLOW, "* You must be logged in to use this.");
			return 1;
		}

        tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /transact [playerid] [amount]");
			return 1;
		}
		giveplayerid = strval(tmp);

		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /transact [playerid] [amount]");
			return 1;
		}
 		moneys = strval(tmp);

 		if (moneys+bank[giveplayerid] > MAX_VALUE) moneys = moneys+bank[giveplayerid]-MAX_VALUE;

		if (IsPlayerConnected(giveplayerid)) {
		    if (moneys > bank[playerid]) moneys = bank[playerid];
			if (moneys > 0 && bank[playerid] >= moneys) {
				bank[playerid] -= moneys;
				bank[giveplayerid] += moneys;
				format(string, sizeof(string), "--- %s (id: %d) transacted €%d to %s (id: %d) bank.", playername[playerid],playerid,moneys,playername[giveplayerid],giveplayerid);
				WriteLog(string);
				format(string, sizeof(string), "* You have transacted €%d to %s (id: %d) bank.", moneys,playername[giveplayerid],giveplayerid);
				SendClientMessage(playerid, COLOR_YELLOW, string);
				format(string, sizeof(string), "* You have recieved transaction of €%d from %s (id: %d) in bank.", moneys,playername[playerid],playerid);
				SendClientMessage(giveplayerid, COLOR_YELLOW, string);
			}
			else SendClientMessage(playerid, COLOR_YELLOW, "* Invalid transaction amount.");
		}
		else {
			format(string, sizeof(string), "* %d is not an active player.", giveplayerid);
			SendClientMessage(playerid, COLOR_YELLOW, string);
		}
		return 1;
	}

	if (strcmp(cmd, "/hitman", true) == 0) {
		if (!enablebounty) {
		    SendClientMessage(playerid, COLOR_RED, "* Bounty are not allowed on this server!");
		    return 1;
		}

		if (respectrequired && respect[playerid] < respecttosetbounty) {
			format(string, sizeof(string), "* You need at least %d respect to do it!", respecttosetbounty);
			SendClientMessage(playerid, COLOR_RED, string);
			return 1;
		}

		tmp = strtok(cmdtext, idx);

		if (dini_Exists(PlayerFile(playername[playerid])) && !logged[playerid]) {
  		    SendClientMessage(playerid, COLOR_YELLOW, "* You must be logged in to use this.");
			return 1;
		}

		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /hitman [playerid] [amount]");
			return 1;
		}
		giveplayerid = strval(tmp);

		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /hitman [playerid] [amount]");
			return 1;
		}
 		moneys = strval(tmp);

	    if (moneys > GetPlayerMoney(playerid)) {
			SendClientMessage(playerid, COLOR_RED, "* You don't have enough money!");
			return 1;
	    }
	    if (moneys < 1) {
			SendClientMessage(playerid, COLOR_YELLOW, "* Hey what are you trying to pull here?");
			return 1;
		}
		if (!IsPlayerConnected(giveplayerid)) {
			format(string, sizeof(string), "* %d is not an active player.", giveplayerid);
			SendClientMessage(playerid, COLOR_YELLOW, string);
			return 1;
		}

		bounty[giveplayerid] += moneys;
		GiveMoney(playerid, -moneys);

		format(string, sizeof(string), "--- %s (id: %d) put €%d on %s (id: %d) head (total: €%d).", playername[playerid],playerid,moneys,playername[giveplayerid],giveplayerid, bounty[giveplayerid]);
		WriteLog(string);

		format(string, sizeof(string), "* %s has a €%d bounty put on his head from %s (total: €%d).", playername[giveplayerid],moneys,playername[playerid],bounty[giveplayerid]);
		SendClientMessageToAll(COLOR_ORANGE, string);

		return 1;
	}

	if (strcmp(cmd, "/bounty", true) == 0) {
		if (!enablebounty) {
		    SendClientMessage(playerid, COLOR_RED, "* Bounty are not allowed on this server!");
		    return 1;
		}

		tmp = strtok(cmdtext, idx);

		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /bounty [playerid]");
			return 1;
		}
		giveplayerid = strval(tmp);

		if (IsPlayerConnected(giveplayerid)) {
			format(string, sizeof(string), "* Player %s (id: %d) has a €%d bounty on his head.", playername[giveplayerid],giveplayerid,bounty[giveplayerid]);
			SendClientMessage(playerid, COLOR_YELLOW, string);
		}
		else {
			format(string, sizeof(string), "* %d is not an active player.", giveplayerid);
			SendClientMessage(playerid, COLOR_YELLOW, string);
		}

		return 1;
	}

	if (strcmp(cmd, "/bwmelee", true) == 0) {
		if (!spawnweapons) {
		    SendClientMessage(playerid, COLOR_RED, "* Spawn weapons are not allowed on this server!");
		    return 1;
		}

		if (respectrequired && respect[playerid] < respecttospawnweapons) {
			format(string, sizeof(string), "* You need at least %d respect to do it!", respecttospawnweapons);
			SendClientMessage(playerid, COLOR_RED, string);
			return 1;
		}

		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /bwmelee [weaponid]");
			return 1;
		}
		weaponid = strval(tmp);

		if (weaponid < 0 || weaponid >= WEAP_MELEE){
			SendClientMessage(playerid, COLOR_RED, "* Invalid weapon id.");
			return 1;
		}

		if (IsPlayerInCheckpoint(playerid) == 0 || (playerCheckpoint[playerid] != CP_AMMU && getCheckpointType(playerid) != CP_AMMU2)) {
			SendClientMessage(playerid, COLOR_YELLOW, "* You need to be in an Ammunation to purchase weapons.");
			return 1;
		}

		if (GetPlayerMoney(playerid) < weaponCostMelee[weaponid]) {
			SendClientMessage(playerid, COLOR_RED, "* You don't have enough money!");
			return 1;
		}

		GivePlayerWeapon(playerid, weaponIDsMelee[weaponid], 1);
		dini_IntSet(PlayerFile(playername[playerid]), "weapon1", weaponIDsMelee[weaponid]);
		GiveMoney(playerid, -weaponCostMelee[weaponid]);

		format(string, sizeof(string), "--- %s (id: %d) purchased %s for €%d.", playername[playerid],playerid,weaponNamesMelee[weaponid],weaponCostMelee[weaponid]);
		WriteLog(string);
		format(string, sizeof(string), "* You purchased %s on your spawn for €%d.", weaponNamesMelee[weaponid],weaponCostMelee[weaponid]);
		SendClientMessage(playerid, COLOR_GREEN, string);

		return 1;
	}

	if (strcmp(cmd, "/bwpistol", true) == 0) {
	    if (!spawnweapons) {
		    SendClientMessage(playerid, COLOR_RED, "* Spawn weapons are not allowed on this server!");
		    return 1;
		}

		if (respectrequired && respect[playerid] < respecttospawnweapons) {
			format(string, sizeof(string), "* You need at least %d respect to do it!", respecttospawnweapons);
			SendClientMessage(playerid, COLOR_RED, string);
			return 1;
		}

		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /bwpistol [weaponid] [ammo]");
			return 1;
		}
		weaponid = strval(tmp);

		if (weaponid < 0 || weaponid >= WEAP_PISTOLS){
			SendClientMessage(playerid, COLOR_RED, "* Invalid weapon id.");
			return 1;
		}

		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /bwpistol [weaponid] [ammo]");
			return 1;
		}
		moneys = strval(tmp);

		if (IsPlayerInCheckpoint(playerid) == 0 || (playerCheckpoint[playerid] != CP_AMMU && getCheckpointType(playerid) != CP_AMMU2)) {
			SendClientMessage(playerid, COLOR_YELLOW, "* You need to be in an Ammunation to purchase weapons.");
			return 1;
		}

		if (GetPlayerMoney(playerid) < weaponCostPistols[weaponid]*moneys) {
			SendClientMessage(playerid, COLOR_RED, "* You don't have enough money!");
			return 1;
		}

		if (moneys < 1) {
			SendClientMessage(playerid, COLOR_YELLOW, "* Hey what are you trying to pull here?");
			return 1;
		}

        tmp = dini_Get(PlayerFile(playername[playerid]), "ammo2");
        if (strval(tmp)+moneys > spawnweaponsammolimit) {
            SendClientMessage(playerid, COLOR_RED, "* You reached ammo limit!");
			moneys = spawnweaponsammolimit-strval(tmp);
        }
        if (moneys == 0) return 1;

		GivePlayerWeapon(playerid, weaponIDsPistols[weaponid], moneys);
		dini_IntSet(PlayerFile(playername[playerid]), "weapon2", weaponIDsPistols[weaponid]);
		dini_IntSet(PlayerFile(playername[playerid]), "ammo2", strval(tmp)+moneys);
		GiveMoney(playerid, -weaponCostPistols[weaponid]*moneys);

		format(string, sizeof(string), "--- %s (id: %d) purchased %s (ammo: %d) for €%d.", playername[playerid],playerid,weaponNamesPistols[weaponid],moneys,weaponCostPistols[weaponid]*moneys);
		WriteLog(string);
		format(string, sizeof(string), "* You purchased %s (ammo: %d) on your spawn for €%d.", weaponNamesPistols[weaponid],moneys,weaponCostPistols[weaponid]*moneys);
		SendClientMessage(playerid, COLOR_GREEN, string);

		return 1;
	}

	if (strcmp(cmd, "/bwshotgun", true) == 0) {
	    if (!spawnweapons) {
		    SendClientMessage(playerid, COLOR_RED, "* Spawn weapons are not allowed on this server!");
		    return 1;
		}

		if (respectrequired && respect[playerid] < respecttospawnweapons) {
			format(string, sizeof(string), "* You need at least %d respect to do it!", respecttospawnweapons);
			SendClientMessage(playerid, COLOR_RED, string);
			return 1;
		}

		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /bwshotgun [weaponid] [ammo]");
			return 1;
		}
		weaponid = strval(tmp);

		if (weaponid < 0 || weaponid >= WEAP_SHOTGUNS){
			SendClientMessage(playerid, COLOR_RED, "* Invalid weapon id.");
			return 1;
		}

		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /bwshotgun [weaponid] [ammo]");
			return 1;
		}
		moneys = strval(tmp);

		if (IsPlayerInCheckpoint(playerid) == 0 || (playerCheckpoint[playerid] != CP_AMMU && getCheckpointType(playerid) != CP_AMMU2)) {
			SendClientMessage(playerid, COLOR_YELLOW, "* You need to be in an Ammunation to purchase weapons.");
			return 1;
		}

		if (GetPlayerMoney(playerid) < weaponCostShotguns[weaponid]*moneys) {
			SendClientMessage(playerid, COLOR_RED, "* You don't have enough money!");
			return 1;
		}

		if (moneys < 1) {
			SendClientMessage(playerid, COLOR_YELLOW, "* Hey what are you trying to pull here?");
			return 1;
		}

        tmp = dini_Get(PlayerFile(playername[playerid]), "ammo3");
        if (strval(tmp)+moneys > spawnweaponsammolimit) {
            SendClientMessage(playerid, COLOR_RED, "* You reached ammo limit!");
			moneys = spawnweaponsammolimit-strval(tmp);
        }
        if (moneys == 0) return 1;

		GivePlayerWeapon(playerid, weaponIDsShotguns[weaponid], moneys);
		dini_IntSet(PlayerFile(playername[playerid]), "weapon3", weaponIDsShotguns[weaponid]);
		tmp = dini_Get(PlayerFile(playername[playerid]), "ammo3");
		dini_IntSet(PlayerFile(playername[playerid]), "ammo3", strval(tmp)+moneys);
		GiveMoney(playerid, -weaponCostShotguns[weaponid]*moneys);

		format(string, sizeof(string), "--- %s (id: %d) purchased %s (ammo: %d) for €%d.", playername[playerid],playerid,weaponNamesShotguns[weaponid],moneys,weaponCostShotguns[weaponid]*moneys);
		WriteLog(string);
		format(string, sizeof(string), "* You purchased %s (ammo: %d) on your spawn for €%d.", weaponNamesShotguns[weaponid],moneys,weaponCostShotguns[weaponid]*moneys);
		SendClientMessage(playerid, COLOR_GREEN, string);

		return 1;
	}

	if (strcmp(cmd, "/bwsmg", true) == 0) {
	    if (!spawnweapons) {
		    SendClientMessage(playerid, COLOR_RED, "* Spawn weapons are not allowed on this server!");
		    return 1;
		}

		if (respectrequired && respect[playerid] < respecttospawnweapons) {
			format(string, sizeof(string), "* You need at least %d respect to do it!", respecttospawnweapons);
			SendClientMessage(playerid, COLOR_RED, string);
			return 1;
		}

		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /bwsmg [weaponid] [ammo]");
			return 1;
		}
		weaponid = strval(tmp);

		if (weaponid < 0 || weaponid >= WEAP_SMGS){
			SendClientMessage(playerid, COLOR_RED, "* Invalid weapon id.");
			return 1;
		}

		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /bwsmg [weaponid] [ammo]");
			return 1;
		}
		moneys = strval(tmp);

		if (IsPlayerInCheckpoint(playerid) == 0 || (playerCheckpoint[playerid] != CP_AMMU && getCheckpointType(playerid) != CP_AMMU2)) {
			SendClientMessage(playerid, COLOR_YELLOW, "* You need to be in an Ammunation to purchase weapons.");
			return 1;
		}

		if (GetPlayerMoney(playerid) < weaponCostSMGs[weaponid]*moneys) {
			SendClientMessage(playerid, COLOR_RED, "* You don't have enough money!");
			return 1;
		}

		if (moneys < 1) {
			SendClientMessage(playerid, COLOR_YELLOW, "* Hey what are you trying to pull here?");
			return 1;
		}

		tmp = dini_Get(PlayerFile(playername[playerid]), "ammo4");
        if (strval(tmp)+moneys > spawnweaponsammolimit) {
            SendClientMessage(playerid, COLOR_RED, "* You reached ammo limit!");
			moneys = spawnweaponsammolimit-strval(tmp);
        }
        if (moneys == 0) return 1;

		GivePlayerWeapon(playerid, weaponIDsSMGs[weaponid], moneys);
		dini_IntSet(PlayerFile(playername[playerid]), "weapon4", weaponIDsSMGs[weaponid]);
		tmp = dini_Get(PlayerFile(playername[playerid]), "ammo4");
		dini_IntSet(PlayerFile(playername[playerid]), "ammo4", strval(tmp)+moneys);
		GiveMoney(playerid, -weaponCostSMGs[weaponid]*moneys);

		format(string, sizeof(string), "--- %s (id: %d) purchased %s (ammo: %d) for €%d.", playername[playerid],playerid,weaponNamesSMGs[weaponid],moneys,weaponCostSMGs[weaponid]*moneys);
		WriteLog(string);
		format(string, sizeof(string), "* You purchased %s (ammo: %d) on your spawn for €%d.", weaponNamesSMGs[weaponid],moneys,weaponCostSMGs[weaponid]*moneys);
		SendClientMessage(playerid, COLOR_GREEN, string);

		return 1;
	}

	if (strcmp(cmd, "/bwrifle", true) == 0) {
	    if (!spawnweapons) {
		    SendClientMessage(playerid, COLOR_RED, "* Spawn weapons are not allowed on this server!");
		    return 1;
		}

		if (respectrequired && respect[playerid] < respecttospawnweapons) {
			format(string, sizeof(string), "* You need at least %d respect to do it!", respecttospawnweapons);
			SendClientMessage(playerid, COLOR_RED, string);
			return 1;
		}

		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /bwrifle [weaponid] [ammo]");
			return 1;
		}
		weaponid = strval(tmp);

		if (weaponid < 0 || weaponid >= WEAP_RIFLES){
			SendClientMessage(playerid, COLOR_RED, "* Invalid weapon id.");
			return 1;
		}

		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /bwrifle [weaponid] [ammo]");
			return 1;
		}
		moneys = strval(tmp);

		if (IsPlayerInCheckpoint(playerid) == 0 || (playerCheckpoint[playerid] != CP_AMMU && getCheckpointType(playerid) != CP_AMMU2)) {
			SendClientMessage(playerid, COLOR_YELLOW, "* You need to be in an Ammunation to purchase weapons.");
			return 1;
		}

		if (GetPlayerMoney(playerid) < weaponCostRifles[weaponid]*moneys) {
			SendClientMessage(playerid, COLOR_RED, "* You don't have enough money!");
			return 1;
		}

		if (moneys < 1) {
			SendClientMessage(playerid, COLOR_YELLOW, "* Hey what are you trying to pull here?");
			return 1;
		}

		tmp = dini_Get(PlayerFile(playername[playerid]), "ammo5");
        if (strval(tmp)+moneys > spawnweaponsammolimit) {
            SendClientMessage(playerid, COLOR_RED, "* You reached ammo limit!");
			moneys = spawnweaponsammolimit-strval(tmp);
        }
        if (moneys == 0) return 1;

		GivePlayerWeapon(playerid, weaponIDsRifles[weaponid], moneys);
		dini_IntSet(PlayerFile(playername[playerid]), "weapon5", weaponIDsRifles[weaponid]);
		tmp = dini_Get(PlayerFile(playername[playerid]), "ammo5");
		dini_IntSet(PlayerFile(playername[playerid]), "ammo5", strval(tmp)+moneys);
		GiveMoney(playerid, -weaponCostRifles[weaponid]*moneys);

		format(string, sizeof(string), "--- %s (id: %d) purchased %s (ammo: %d) for €%d.", playername[playerid],playerid,weaponNamesRifles[weaponid],moneys,weaponCostRifles[weaponid]*moneys);
		WriteLog(string);
		format(string, sizeof(string), "* You purchased %s (ammo: %d) on your spawn for €%d.", weaponNamesRifles[weaponid],moneys,weaponCostRifles[weaponid]*moneys);
		SendClientMessage(playerid, COLOR_GREEN, string);

		return 1;
	}

	if (strcmp(cmd, "/bwrifle2", true) == 0) {
	    if (!spawnweapons) {
		    SendClientMessage(playerid, COLOR_RED, "* Spawn weapons are not allowed on this server!");
		    return 1;
		}

		if (respectrequired && respect[playerid] < respecttospawnweapons) {
			format(string, sizeof(string), "* You need at least %d respect to do it!", respecttospawnweapons);
			SendClientMessage(playerid, COLOR_RED, string);
			return 1;
		}

		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /bwrifle2 [weaponid] [ammo]");
			return 1;
		}
		weaponid = strval(tmp);

		if (weaponid < 0 || weaponid >= WEAP_RIFLES2){
			SendClientMessage(playerid, COLOR_RED, "* Invalid weapon id.");
			return 1;
		}

		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /bwrifle2 [weaponid] [ammo]");
			return 1;
		}
		moneys = strval(tmp);

		if (IsPlayerInCheckpoint(playerid) == 0 || (playerCheckpoint[playerid] != CP_AMMU && getCheckpointType(playerid) != CP_AMMU2)) {
			SendClientMessage(playerid, COLOR_YELLOW, "* You need to be in an Ammunation to purchase weapons.");
			return 1;
		}

		if (GetPlayerMoney(playerid) < weaponCostRifles2[weaponid]*moneys) {
			SendClientMessage(playerid, COLOR_RED, "* You don't have enough money!");
			return 1;
		}

		if (moneys < 1) {
			SendClientMessage(playerid, COLOR_YELLOW, "* Hey what are you trying to pull here?");
			return 1;
		}

		tmp = dini_Get(PlayerFile(playername[playerid]), "ammo6");
        if (strval(tmp)+moneys > spawnweaponsammolimit) {
            SendClientMessage(playerid, COLOR_RED, "* You reached ammo limit!");
			moneys = spawnweaponsammolimit-strval(tmp);
        }
        if (moneys == 0) return 1;

		GivePlayerWeapon(playerid, weaponIDsRifles2[weaponid], moneys);
		dini_IntSet(PlayerFile(playername[playerid]), "weapon6", weaponIDsRifles2[weaponid]);
		tmp = dini_Get(PlayerFile(playername[playerid]), "ammo6");
		dini_IntSet(PlayerFile(playername[playerid]), "ammo6", strval(tmp)+moneys);
		GiveMoney(playerid, -weaponCostRifles2[weaponid]*moneys);

		format(string, sizeof(string), "--- %s (id: %d) purchased %s (ammo: %d) for €%d.", playername[playerid],playerid,weaponNamesRifles2[weaponid],moneys,weaponCostRifles2[weaponid]*moneys);
		WriteLog(string);
		format(string, sizeof(string), "* You purchased %s (ammo: %d) on your spawn for €%d.", weaponNamesRifles2[weaponid],moneys,weaponCostRifles2[weaponid]*moneys);
		SendClientMessage(playerid, COLOR_GREEN, string);

		return 1;
	}

	if (strcmp(cmd, "/bwgift", true) == 0) {
	    if (!spawnweapons) {
		    SendClientMessage(playerid, COLOR_RED, "* Spawn weapons are not allowed on this server!");
		    return 1;
		}

		if (respectrequired && respect[playerid] < respecttospawnweapons) {
			format(string, sizeof(string), "* You need at least %d respect to do it!", respecttospawnweapons);
			SendClientMessage(playerid, COLOR_RED, string);
			return 1;
		}

		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /bwgift [weaponid]");
			return 1;
		}
		weaponid = strval(tmp);

		if (weaponid < 0 || weaponid >= WEAP_GIFTS){
			SendClientMessage(playerid, COLOR_RED, "* Invalid weapon id.");
			return 1;
		}

		if (IsPlayerInCheckpoint(playerid) == 0 || (playerCheckpoint[playerid] != CP_AMMU && getCheckpointType(playerid) != CP_AMMU2)) {
			SendClientMessage(playerid, COLOR_YELLOW, "* You need to be in an Ammunation to purchase weapons.");
			return 1;
		}

		if (GetPlayerMoney(playerid) < weaponCostGifts[weaponid]) {
			SendClientMessage(playerid, COLOR_RED, "* You don't have enough money!");
			return 1;
		}

		GivePlayerWeapon(playerid, weaponIDsGifts[weaponid], 1);
		dini_IntSet(PlayerFile(playername[playerid]), "weapon7", weaponIDsGifts[weaponid]);
		GiveMoney(playerid, -weaponCostGifts[weaponid]);

		format(string, sizeof(string), "--- %s (id: %d) purchased %s for €%d.", playername[playerid],playerid,weaponNamesGifts[weaponid],weaponCostGifts[weaponid]);
		WriteLog(string);
		format(string, sizeof(string), "* You purchased %s on your spawn for €%d.", weaponNamesGifts[weaponid],weaponCostGifts[weaponid]);
		SendClientMessage(playerid, COLOR_GREEN, string);

		return 1;
	}

	if (strcmp(cmd, "/bwspray", true) == 0) {
	    if (!spawnweapons) {
		    SendClientMessage(playerid, COLOR_RED, "* Spawn weapons are not allowed on this server!");
		    return 1;
		}

		if (respectrequired && respect[playerid] < respecttospawnweapons) {
			format(string, sizeof(string), "* You need at least %d respect to do it!", respecttospawnweapons);
			SendClientMessage(playerid, COLOR_RED, string);
			return 1;
		}

		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /bwspray [weaponid] [ammo]");
			return 1;
		}
		weaponid = strval(tmp);

		if (weaponid < 0 || weaponid >= WEAP_SPRAYS){
			SendClientMessage(playerid, COLOR_RED, "* Invalid weapon id.");
			return 1;
		}

		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /bwspray [weaponid] [ammo]");
			return 1;
		}
		moneys = strval(tmp);

		if (IsPlayerInCheckpoint(playerid) == 0 || (playerCheckpoint[playerid] != CP_AMMU && getCheckpointType(playerid) != CP_AMMU2)) {
			SendClientMessage(playerid, COLOR_YELLOW, "* You need to be in an Ammunation to purchase weapons.");
			return 1;
		}

		if (GetPlayerMoney(playerid) < weaponCostSprays[weaponid]*moneys) {
			SendClientMessage(playerid, COLOR_RED, "* You don't have enough money!");
			return 1;
		}

		if (moneys < 1) {
			SendClientMessage(playerid, COLOR_YELLOW, "* Hey what are you trying to pull here?");
			return 1;
		}

		tmp = dini_Get(PlayerFile(playername[playerid]), "ammo8");
        if (strval(tmp)+moneys > spawnweaponsammolimit) {
            SendClientMessage(playerid, COLOR_RED, "* You reached ammo limit!");
			moneys = spawnweaponsammolimit-strval(tmp);
        }
        if (moneys == 0) return 1;

		GivePlayerWeapon(playerid, weaponIDsSprays[weaponid], moneys);
		dini_IntSet(PlayerFile(playername[playerid]), "weapon8", weaponIDsSprays[weaponid]);
		tmp = dini_Get(PlayerFile(playername[playerid]), "ammo8");
		dini_IntSet(PlayerFile(playername[playerid]), "ammo8", strval(tmp)+moneys);
		GiveMoney(playerid, -weaponCostSprays[weaponid]*moneys);

		format(string, sizeof(string), "--- %s (id: %d) purchased %s (ammo: %d) for €%d.", playername[playerid],playerid,weaponNamesSprays[weaponid],moneys,weaponCostSprays[weaponid]*moneys);
		WriteLog(string);
		format(string, sizeof(string), "* You purchased %s (ammo: %d) on your spawn for €%d.", weaponNamesSprays[weaponid],moneys,weaponCostSprays[weaponid]*moneys);
		SendClientMessage(playerid, COLOR_GREEN, string);

		return 1;
	}

	if (strcmp(cmd, "/weaplist", true) == 0) {
	    if (!spawnweapons) {
		    SendClientMessage(playerid, COLOR_RED, "* Spawn weapons are not allowed on this server!");
		    return 1;
		}

        SendClientMessage(playerid, COLOR_GREY, "* Available weapons:");
		format(string, sizeof(string), "0. %s €%d", weaponNamesMelee[0],weaponCostMelee[0]);
		for (new i=1;i<WEAP_MELEE/2;i++) {
            format(tmp, sizeof(tmp), " *** %d. %s €%d", i,weaponNamesMelee[i],weaponCostMelee[i]);
			strcat(string, tmp);
  	    }
  	    format(string, sizeof(string), "* /bwmelee: %s", string);
		SendClientMessage(playerid, COLOR_GREEN, string);

		format(string, sizeof(string), "%d. %s €%d", WEAP_MELEE/2,weaponNamesMelee[WEAP_MELEE/2],weaponCostMelee[WEAP_MELEE/2]);
		for (new i=1+WEAP_MELEE/2;i<WEAP_MELEE;i++) {
            format(tmp, sizeof(tmp), " *** %d. %s €%d", i,weaponNamesMelee[i],weaponCostMelee[i]);
			strcat(string, tmp);
  	    }
  	    format(string, sizeof(string), "* /bwmelee: %s", string);
		SendClientMessage(playerid, COLOR_GREEN, string);

		format(string, sizeof(string), "0. %s €%d", weaponNamesPistols[0],weaponCostPistols[0]);
		for (new i=1;i<WEAP_PISTOLS;i++) {
            format(tmp, sizeof(tmp), " *** %d. %s €%d", i,weaponNamesPistols[i],weaponCostPistols[i]);
			strcat(string, tmp);
  	    }
  	    format(string, sizeof(string), "* /bwpistol: %s", string);
		SendClientMessage(playerid, COLOR_GREEN, string);

		format(string, sizeof(string), "0. %s €%d", weaponNamesShotguns[0],weaponCostShotguns[0]);
		for (new i=1;i<WEAP_SHOTGUNS;i++) {
            format(tmp, sizeof(tmp), " *** %d. %s €%d", i,weaponNamesShotguns[i],weaponCostShotguns[i]);
			strcat(string, tmp);
  	    }
  	    format(string, sizeof(string), "* /bwshotgun: %s", string);
		SendClientMessage(playerid, COLOR_GREEN, string);

		format(string, sizeof(string), "0. %s €%d", weaponNamesSMGs[0],weaponCostSMGs[0]);
		for (new i=1;i<WEAP_SMGS;i++) {
            format(tmp, sizeof(tmp), " *** %d. %s €%d", i,weaponNamesSMGs[i],weaponCostSMGs[i]);
			strcat(string, tmp);
  	    }
  	    format(string, sizeof(string), "* /bwsmg: %s", string);
		SendClientMessage(playerid, COLOR_GREEN, string);

		format(string, sizeof(string), "0. %s €%d", weaponNamesRifles[0],weaponCostRifles[0]);
		for (new i=1;i<WEAP_RIFLES;i++) {
            format(tmp, sizeof(tmp), " *** %d. %s €%d", i,weaponNamesRifles[i],weaponCostRifles[i]);
			strcat(string, tmp);
  	    }
  	    format(tmp, sizeof(tmp), " * /bwrifle2: 0. %s €%d", weaponNamesRifles2[0],weaponCostRifles2[0]);
        strcat(string, tmp);
		for (new i=1;i<WEAP_RIFLES2;i++) {
            format(tmp, sizeof(tmp), " *** %d. %s €%d", i,weaponNamesRifles2[i],weaponCostRifles2[i]);
			strcat(string, tmp);
  	    }
  	    format(string, sizeof(string), "* /bwrifle: %s", string);
		SendClientMessage(playerid, COLOR_GREEN, string);

		format(string, sizeof(string), "0. %s €%d", weaponNamesGifts[0],weaponCostGifts[0]);
		for (new i=1;i<WEAP_GIFTS;i++) {
            format(tmp, sizeof(tmp), " *** %d. %s €%d", i,weaponNamesGifts[i],weaponCostGifts[i]);
			strcat(string, tmp);
  	    }
  	    format(string, sizeof(string), "* /bwgift: %s", string);
		SendClientMessage(playerid, COLOR_GREEN, string);

		format(string, sizeof(string), "0. %s €%d", weaponNamesSprays[0],weaponCostSprays[0]);
		for (new i=1;i<WEAP_SPRAYS;i++) {
            format(tmp, sizeof(tmp), " *** %d. %s €%d", i,weaponNamesSprays[i],weaponCostSprays[i]);
			strcat(string, tmp);
  	    }
  	    format(string, sizeof(string), "* /bwspray: %s", string);
		SendClientMessage(playerid, COLOR_GREEN, string);

	    return 1;
	}

	if (strcmp(cmd, "/reload", true) == 0) {
		if (!spawnweapons) {
		    SendClientMessage(playerid, COLOR_RED, "* Spawn weapons are not allowed on this server!");
		    return 1;
		}

		if (respectrequired && respect[playerid] < respecttospawnweapons) {
			format(string, sizeof(string), "* You need at least %d respect to do it!", respecttospawnweapons);
			SendClientMessage(playerid, COLOR_RED, string);
			return 1;
		}

		if (IsPlayerInCheckpoint(playerid) == 0 || (playerCheckpoint[playerid] != CP_AMMU && getCheckpointType(playerid) != CP_AMMU2)) {
			SendClientMessage(playerid, COLOR_YELLOW, "* You need to be in an Ammunation to reload weapons.");
			return 1;
		}

		if (GetPlayerMoney(playerid) < reloadcost) {
			SendClientMessage(playerid, COLOR_RED, "* You don't have enough money!");
			return 1;
		}

		GiveMoney(playerid, -reloadcost);

		ResetPlayerWeapons(playerid);
		GivePlayerWeapon(playerid, 5, 1);
		GivePlayerWeapon(playerid, 24, 300);

		if (dini_Exists(PlayerFile(playername[playerid]))) {
	        tmp = dini_Get(PlayerFile(playername[playerid]), "weapon1");
			if (strval(tmp) != 0) GivePlayerWeapon(playerid, strval(tmp), 1);
			tmp = dini_Get(PlayerFile(playername[playerid]), "weapon2");
			tmp2 = dini_Get(PlayerFile(playername[playerid]), "ammo2");
			if (strval(tmp) != 0 && strval(tmp2) != 0) GivePlayerWeapon(playerid, strval(tmp), strval(tmp2));
			tmp = dini_Get(PlayerFile(playername[playerid]), "weapon3");
			tmp2 = dini_Get(PlayerFile(playername[playerid]), "ammo3");
			if (strval(tmp) != 0 && strval(tmp2) != 0) GivePlayerWeapon(playerid, strval(tmp), strval(tmp2));
			tmp = dini_Get(PlayerFile(playername[playerid]), "weapon4");
			tmp2 = dini_Get(PlayerFile(playername[playerid]), "ammo4");
			if (strval(tmp) != 0 && strval(tmp2) != 0) GivePlayerWeapon(playerid, strval(tmp), strval(tmp2));
			tmp = dini_Get(PlayerFile(playername[playerid]), "weapon5");
			tmp2 = dini_Get(PlayerFile(playername[playerid]), "ammo5");
			if (strval(tmp) != 0 && strval(tmp2) != 0) GivePlayerWeapon(playerid, strval(tmp), strval(tmp2));
			tmp = dini_Get(PlayerFile(playername[playerid]), "weapon6");
			tmp2 = dini_Get(PlayerFile(playername[playerid]), "ammo6");
			if (strval(tmp) != 0 && strval(tmp2) != 0) GivePlayerWeapon(playerid, strval(tmp), strval(tmp2));
			tmp = dini_Get(PlayerFile(playername[playerid]), "weapon7");
			if (strval(tmp) != 0) GivePlayerWeapon(playerid, strval(tmp), 1);
			tmp = dini_Get(PlayerFile(playername[playerid]), "weapon8");
			tmp2 = dini_Get(PlayerFile(playername[playerid]), "ammo8");
			if (strval(tmp) != 0 && strval(tmp2) != 0) GivePlayerWeapon(playerid, strval(tmp), strval(tmp2));
		}

		SendClientMessage(playerid, COLOR_GREEN, "* Your weapons reloaded!");

		return 1;
	}

    if (strcmp(cmd, "/buy", true) == 0) {
		new property = 255;

		if (!properties) {
		    SendClientMessage(playerid, COLOR_RED, "* Properties are not allowed on this server!");
		    return 1;
		}

		if (respectrequired && respect[playerid] < respecttobuyprops) {
		    format(string, sizeof(string), "* You need at least %d respect to do it!", respecttobuyprops);
			SendClientMessage(playerid, COLOR_RED, string);
			return 1;
		}

		if (dini_Exists(PlayerFile(playername[playerid])) && !logged[playerid]) {
  		   	SendClientMessage(playerid, COLOR_YELLOW, "* You must be logged in to use this.");
			return 1;
		}

		if (IsPlayerInCheckpoint(playerid)) {
			switch (playerCheckpoint[playerid]) {
				case CP_DRAGON:{
					property = P_DRAGON;
				}
				case CP_SEXSHOP:{
					property = P_SEXSHOP;
				}
				case CP_BAR:{
					property = P_BAR;
				}
				case CP_CALIGULA:{
					property = P_CALIGULA;
				}
				case CP_ZIP:{
					property = P_ZIP;
				}
				case CP_BINCO:{
					property = P_BINCO;
				}
				case CP_TATOO:{
					property = P_TATOO;
				}
				case CP_BOTIQUE:{
					property = P_BOTIQUE;
                   	}
				case CP_JIZZY:{
				    property = P_JIZZY;
				}
				case CP_PIZZA:{
				    property = P_PIZZA;
			 	}
				case CP_VICTIM:{
					property = P_VICTIM;
				}
				case CP_STRIPCLUB:{
					property = P_STRIPCLUB;
				}
				case CP_WANGCARS:{
					property = P_WANGCARS;
				}
				case CP_EMERALD:{
					property = P_EMERALD;
				}
				case CP_VISAGE:{
					property = P_VISAGE;
				}
				case CP_SUBURBAN:{
					property = P_SUBURBAN;
				}
				case CP_PROLAPS:{
					property = P_PROLAPS;
				}
				case CP_BURGER:{
					property = P_BURGER;
				}
				case CP_CLUCKIN:{
					property = P_CLUCKIN;
				}
				case CP_CLUB:{
					property = P_CLUB;
				}
				case CP_DS:{
					property = P_DS;
				}
				case CP_ZOMBO:{
					property = P_ZOMBO;
				}
			}

			if (property == 255) {
				SendClientMessage(playerid, COLOR_YELLOW, "* You need to be in a property checkpoint to /buy it.");
				return 1;
			}

			if (GetPlayerMoney(playerid) < propertyValues[property]) {
				SendClientMessage(playerid, COLOR_RED, "* You don't have enough money!");
				return 1;
			}

			if (propertyBuyAble[property] == 0) {
			    SendClientMessage(playerid, COLOR_RED, "* This property is unavailable to /buy.");
				return 1;
			}

			if (strlen(propertyowner[property])) {
				if (strcmp(propertyowner[property], playername[playerid], true) == 0) {
					SendClientMessage(playerid, COLOR_RED, "* You already own this property.");
					return 1;
				}

				if (propertyReBuyAble[property] == 0) {
				    SendClientMessage(playerid, COLOR_RED, "* You cannot rebuy this property.");
					return 1;
				}

				if (IsPlayerConnected(GetPlayerId(propertyowner[property]))) {
					GiveMoney(GetPlayerId(propertyowner[property]), propertyValues[property]);
					format(string, sizeof(string), "* Your property, the %s (id: %d), has been bought out by %s (id: %d).", propertyNames[property],property,playername[playerid],playerid);
					SendClientMessage(GetPlayerId(propertyowner[property]), COLOR_RED, string);
				}
				else if (dini_Exists(PlayerFile(propertyowner[property]))) {
			        tmp = dini_Get(PlayerFile(propertyowner[property]), "money");
		        	if (strval(tmp)+propertyValues[property] < maxmoney) dini_IntSet(PlayerFile(propertyowner[property]), "money", strval(tmp)+propertyValues[property]);
					else {
					    tmp = dini_Get(PlayerFile(propertyowner[property]), "bank");
                        if (strval(tmp)+propertyValues[property] <= MAX_VALUE) dini_IntSet(PlayerFile(propertyowner[property]), "bank", strval(tmp)+propertyValues[property]);
					}
			    }
			}

			GiveMoney(playerid, -propertyValues[property]);

            valstr(tmp, property);
            if (!dini_Exists(FILE_PROPS)) dini_Create(FILE_PROPS);
			dini_Set(FILE_PROPS, tmp, playername[playerid]);
			propertyowner[property] = playername[playerid];

			format(string, sizeof(string), "--- %s (id: %d) bought %s (id: %d) for €%d.", playername[playerid],playerid,propertyNames[property],property,propertyValues[property]);
			WriteLog(string);

			format(string, sizeof(string), "* You have purchased the %s (id: %d) for €%d!", propertyNames[property],property,propertyValues[property]);
			SendClientMessage(playerid, COLOR_GREEN, string);

		}
		else {
			SendClientMessage(playerid, COLOR_YELLOW, "* You need to be in a property checkpoint to /buy it.");
			return 1;
		}

		return 1;
	}

	if (strcmp(cmd, "/sell", true) == 0) {
		new property = 255;

		if (dini_Exists(PlayerFile(playername[playerid])) && !logged[playerid]) {
  		   	SendClientMessage(playerid, COLOR_YELLOW, "* You must be logged in to use this.");
			return 1;
		}

		if (IsPlayerInCheckpoint(playerid)) {
			switch (playerCheckpoint[playerid]) {
				case CP_DRAGON:{
					property = P_DRAGON;
				}
				case CP_SEXSHOP:{
					property = P_SEXSHOP;
				}
				case CP_BAR:{
					property = P_BAR;
				}
				case CP_CALIGULA:{
					property = P_CALIGULA;
				}
				case CP_ZIP:{
					property = P_ZIP;
				}
				case CP_BINCO:{
					property = P_BINCO;
				}
				case CP_TATOO:{
					property = P_TATOO;
				}
				case CP_BOTIQUE:{
					property = P_BOTIQUE;
                   	}
				case CP_JIZZY:{
				    property = P_JIZZY;
				}
				case CP_PIZZA:{
				    property = P_PIZZA;
			 	}
				case CP_VICTIM:{
					property = P_VICTIM;
				}
				case CP_STRIPCLUB:{
					property = P_STRIPCLUB;
				}
				case CP_WANGCARS:{
					property = P_WANGCARS;
				}
				case CP_EMERALD:{
					property = P_EMERALD;
				}
				case CP_VISAGE:{
					property = P_VISAGE;
				}
				case CP_SUBURBAN:{
					property = P_SUBURBAN;
				}
				case CP_PROLAPS:{
					property = P_PROLAPS;
				}
				case CP_BURGER:{
					property = P_BURGER;
				}
				case CP_CLUCKIN:{
					property = P_CLUCKIN;
				}
				case CP_CLUB:{
					property = P_CLUB;
				}
				case CP_DS:{
					property = P_DS;
				}
				case CP_ZOMBO:{
					property = P_ZOMBO;
				}
			}

			if (property == 255) {
				SendClientMessage(playerid, COLOR_YELLOW, "* You need to be in a property checkpoint to /sell it.");
				return 1;
			}

			valstr(tmp, property);
			if (strlen(propertyowner[property]) && strcmp(propertyowner[property], playername[playerid], true) == 0) {
			    dini_Unset(FILE_PROPS, tmp);
			    propertyowner[property][0] = 0;
				GiveMoney(playerid, propertyValues[property]);

				format(string, sizeof(string), "--- %s (id: %d) sold %s (id: %d) for €%d.", playername[playerid],playerid,propertyNames[property],property,propertyValues[property]);
				WriteLog(string);
				format(string, sizeof(string), "* You sold %s (id: %d) for €%d.", propertyNames[property],property,propertyValues[property]);
				SendClientMessage(playerid, COLOR_YELLOW, string);
			}
			else {
			    SendClientMessage(playerid, COLOR_RED, "* This is not your property.");
				return 1;
			}
		}
		else {
			SendClientMessage(playerid, COLOR_YELLOW, "* You need to be in a property checkpoint to /sell it.");
			return 1;
		}

		return 1;
	}

	if (strcmp(cmd, "/proplist", true) == 0) {
		SendClientMessage(playerid, COLOR_GREY, "* Available properties:");
		for (new i=0;i<MAX_PROPERTIES;i++) {
	        format(string, sizeof(string), "* %d. %s", i,propertyNames[i]);

	        if (i+1 < MAX_PROPERTIES) {
	            format(tmp, sizeof(tmp), " *** %d. %s", i+1,propertyNames[i+1]);
				strcat(string, tmp);
				i++;
			}
			if (i+1 < MAX_PROPERTIES) {
	            format(tmp, sizeof(tmp), " *** %d. %s", i+1,propertyNames[i+1]);
				strcat(string, tmp);
				i++;
			}
	        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
  	    }

		return 1;
	}

	if (strcmp(cmd, "/propinfo", true) == 0) {
		tmp = strtok(cmdtext, idx);
	    if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /propinfo [propid]");
			return 1;
		}
		moneys = strval(tmp);

		if (moneys < 0 || moneys >= MAX_PROPERTIES) {
			SendClientMessage(playerid, COLOR_YELLOW, "* Invalid property id.");
			return 1;
		}

		SendClientMessage(playerid, COLOR_GREEN, "* Property info:");
		if (strlen(propertyowner[moneys])) format(string, sizeof(string), "* %s (id: %d). Owner: %s.", propertyNames[moneys],moneys,propertyowner[moneys]);
		else format(string, sizeof(string), "* %s (id: %d). Owner: None.", propertyNames[moneys],moneys);
		SendClientMessage(playerid, COLOR_YELLOW, string);
		if (propertyBuyAble[moneys] == 0) SendClientMessage(playerid, COLOR_RED, "* This property is unavailable to /buy.");
		if (propertyReBuyAble[moneys] == 0) SendClientMessage(playerid, COLOR_RED, "* You cannot rebuy this property.");

		return 1;
	}

	if (strcmp(cmd, "/myprops", true) == 0) {
		SendClientMessage(playerid, COLOR_GREY, "* Owned properties:");
		for (new i=0;i<MAX_PROPERTIES;i++) {
	        if (strlen(propertyowner[i]) && strcmp(propertyowner[i], playername[playerid], true) == 0) {
				format(tmp, sizeof(tmp), "* %d. %s ", i,propertyNames[i]);
				strcat(string, tmp);
				if (strlen(string) >= MAX_STRING/3) {
					SendClientMessage(playerid, COLOR_YELLOW, string);
					string[0] = 0;
				}
			}

	        if (i+1 < MAX_PROPERTIES && strlen(propertyowner[i+1]) && strcmp(propertyowner[i+1], playername[playerid], true) == 0) {
	            format(tmp, sizeof(tmp), "* %d. %s ", i+1,propertyNames[i+1]);
                strcat(string, tmp);
	            if (strlen(string) >= MAX_STRING/3) {
					SendClientMessage(playerid, COLOR_YELLOW, string);
					string[0] = 0;
				}
			}
			else if (i+1 >= MAX_PROPERTIES && strlen(string)) {
				SendClientMessage(playerid, COLOR_YELLOW, string);
				string[0] = 0;
			}
			i++;

			if (i+1 < MAX_PROPERTIES && strlen(propertyowner[i+1]) && strcmp(propertyowner[i+1], playername[playerid], true) == 0) {
	            format(tmp, sizeof(tmp), "* %d. %s ", i+1,propertyNames[i+1]);
				strcat(string, tmp);
				if (strlen(string) >= MAX_STRING/3) {
					SendClientMessage(playerid, COLOR_YELLOW, string);
					string[0] = 0;
				}
			}
			else if (i+1 >= MAX_PROPERTIES && strlen(string)) {
				SendClientMessage(playerid, COLOR_YELLOW, string);
				string[0] = 0;
			}
			i++;

			if (i+1 >= MAX_PROPERTIES && strlen(string)) SendClientMessage(playerid, COLOR_YELLOW, string);
  	    }

		return 1;
	}

	if (strcmp(cmd, "/buycar", true) == 0) {
		if (!carbuy) {
		    SendClientMessage(playerid, COLOR_RED, "* Car buying are not allowed on this server!");
		    return 1;
		}

		if (respectrequired && respect[playerid] < respecttobuycars) {
			format(string, sizeof(string), "* You need at least %d respect to do it!", respecttobuycars);
			SendClientMessage(playerid, COLOR_RED, string);
			return 1;
		}

		if (dini_Exists(PlayerFile(playername[playerid])) && !logged[playerid]) {
  		   	SendClientMessage(playerid, COLOR_YELLOW, "* You must be logged in to use this.");
			return 1;
		}

		if (!IsPlayerInAnyVehicle(playerid)) {
			SendClientMessage(playerid, COLOR_YELLOW, "* You need to be in a car to buy it.");
			return 1;
		}
		moneys = GetPlayerVehicleID(playerid);

		if (GetPlayerMoney(playerid) < carValues[moneys]) {
			SendClientMessage(playerid, COLOR_RED, "* You don't have enough money!");
			return 1;
		}

		if (carBuyAble[moneys] == 0) {
		    SendClientMessage(playerid, COLOR_RED, "* This car is unavailable to buy.");
			return 1;
		}

		tmp = dini_Get(PlayerFile(playername[playerid]), "cars");
		if (strval(tmp) >= maxcars) {
			SendClientMessage(playerid, COLOR_RED, "* Sorry, car limit reached!");
			SendClientMessage(playerid, COLOR_YELLOW, "* If you want to buy other cars, sell yours.");
			return 1;
		}

		if (strlen(carowner[moneys])) {
			if (strcmp(carowner[moneys], playername[playerid], true) == 0) {
				SendClientMessage(playerid, COLOR_YELLOW, "* You already own this car.");
				return 1;
			}
			else {
			    if (dini_Exists(PlayerFile(carowner[moneys]))) {
			        format(string, sizeof(string), "* This car owned by the %s, you cannot buy it until owner will sell it.", carowner[moneys]);
					SendClientMessage(playerid, COLOR_RED, string);
					return 1;
			    }
			}
		}

		GiveMoney(playerid, -carValues[moneys]);

        tmp = dini_Get(PlayerFile(playername[playerid]), "cars");
        dini_IntSet(PlayerFile(playername[playerid]), "cars", strval(tmp)+1);

		valstr(tmp, moneys);
		if (!dini_Exists(FILE_CARS)) dini_Create(FILE_CARS);
		dini_Set(FILE_CARS, tmp, playername[playerid]);
		carowner[moneys] = playername[playerid];

		format(string, sizeof(string), "--- %s (id: %d) bought car %s (id: %d) for €%d.", playername[playerid],playerid,GetVehicleName(moneys),moneys,carValues[moneys]);
		WriteLog(string);

		format(string, sizeof(string), "* You have purchased a car %s (id: %d) for €%d!", GetVehicleName(moneys),moneys,carValues[moneys]);
		SendClientMessage(playerid, COLOR_GREEN, string);

		SetVehicleParamsForPlayer(moneys, playerid, 1, 0);

		return 1;
	}

	if (strcmp(cmd, "/sellcar", true) == 0) {
		if (dini_Exists(PlayerFile(playername[playerid])) && !logged[playerid]) {
  		   	SendClientMessage(playerid, COLOR_YELLOW, "* You must be logged in to use this.");
			return 1;
		}

		if (!IsPlayerInAnyVehicle(playerid)) {
			SendClientMessage(playerid, COLOR_YELLOW, "* You need to be in a car to sell it.");
			return 1;
		}
		moneys = GetPlayerVehicleID(playerid);

		valstr(tmp, moneys);
		tmp2 = dini_Get(FILE_CARS, tmp);
		if (strlen(tmp2) && strcmp(tmp2, playername[playerid], true) == 0) {
		    dini_Unset(FILE_CARS, tmp);
		    carowner[moneys][0] = 0;

		    SetVehicleParamsForPlayer(moneys, playerid, 0, 0);

		    tmp = dini_Get(PlayerFile(playername[playerid]), "cars");
        	if (strval(tmp) > 0) dini_IntSet(PlayerFile(playername[playerid]), "cars", strval(tmp)-1);

			GiveMoney(playerid, carValues[moneys]);

			format(string, sizeof(string), "--- %s (id: %d) sold car %s (id: %d) for €%d.", playername[playerid],playerid,GetVehicleName(moneys),moneys,carValues[moneys]);
			WriteLog(string);
			format(string, sizeof(string), "* You sold car %s (id: %d) for €%d.", GetVehicleName(moneys),moneys,carValues[moneys]);
			SendClientMessage(playerid, COLOR_YELLOW, string);
		}
		else {
		    SendClientMessage(playerid, COLOR_RED, "* This is not your car.");
			return 1;
		}

		return 1;
	}

	if (strcmp(cmd, "/carinfo", true) == 0) {
		tmp = strtok(cmdtext, idx);
	    if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /carinfo [vehicleid]");
			return 1;
		}
		moneys = strval(tmp);

		if (moneys < 1 || moneys > MAX_VEHICLES) {
			SendClientMessage(playerid, COLOR_YELLOW, "* Invalid vehicle id.");
			return 1;
		}

		SendClientMessage(playerid, COLOR_GREEN, "* Car info:");
		if (strlen(carowner[moneys])) format(string, sizeof(string), "* %s (id: %d). Owner: %s.", GetVehicleName(moneys),moneys,carowner[moneys]);
		else format(string, sizeof(string), "* %s (id: %d). Owner: None.", GetVehicleName(moneys),moneys);
		SendClientMessage(playerid, COLOR_YELLOW, string);
		format(string, sizeof(string), "* Price: €%d.", carValues[moneys]);
		SendClientMessage(playerid, COLOR_YELLOW, string);
		if (carBuyAble[moneys] == 0) SendClientMessage(playerid, COLOR_RED, "* This car is unavailable to buy.");
		if (admincar[moneys] == 1) SendClientMessage(playerid, COLOR_RED, "* This car is restricted to admins only.");

		return 1;
	}

	if (strcmp(cmd, "/mycars", true) == 0) {
		SendClientMessage(playerid, COLOR_GREY, "* Owned cars:");
		for (new i=0;i<MAX_VEHICLES;i++) {
	        if (strlen(carowner[i]) && strcmp(carowner[i], playername[playerid], true) == 0) {
				format(tmp, sizeof(tmp), "* %d. %s ", i,GetVehicleName(i));
				strcat(string, tmp);
				if (strlen(string) >= MAX_STRING/3) {
					SendClientMessage(playerid, COLOR_YELLOW, string);
					string[0] = 0;
				}
			}

	        if (i+1 < MAX_VEHICLES && strlen(carowner[i+1]) && strcmp(carowner[i+1], playername[playerid], true) == 0) {
	            format(tmp, sizeof(tmp), "* %d. %s ", i+1,GetVehicleName(i+1));
                strcat(string, tmp);
	            if (strlen(string) >= MAX_STRING/3) {
					SendClientMessage(playerid, COLOR_YELLOW, string);
					string[0] = 0;
				}
			}
			else if (i+1 >= MAX_VEHICLES && strlen(string)) {
				SendClientMessage(playerid, COLOR_YELLOW, string);
				string[0] = 0;
			}
			i++;

			if (i+1 < MAX_VEHICLES && strlen(carowner[i+1]) && strcmp(carowner[i+1], playername[playerid], true) == 0) {
	            format(tmp, sizeof(tmp), "* %d. %s ", i+1,GetVehicleName(i+1));
				strcat(string, tmp);
				if (strlen(string) >= MAX_STRING/3) {
					SendClientMessage(playerid, COLOR_YELLOW, string);
					string[0] = 0;
				}
			}
			else if (i+1 >= MAX_VEHICLES && strlen(string)) {
				SendClientMessage(playerid, COLOR_YELLOW, string);
				string[0] = 0;
			}
			i++;

			if (i+1 >= MAX_VEHICLES && strlen(string)) SendClientMessage(playerid, COLOR_YELLOW, string);
  	    }

		return 1;
	}

	if (strcmp(cmd, "/bringmycar", true) == 0) {
		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /bringmycar [vehicleid]");
			return 1;
		}
 		moneys = strval(tmp);

		if (!strlen(carowner[moneys]) || strcmp(carowner[moneys], playername[playerid], true) != 0) {
		    SendClientMessage(playerid, COLOR_RED, "* This is not your car.");
			return 1;
		}

		GetPlayerPos(playerid, x,y,z);
		SetVehiclePos(moneys, x+3,y+3,z);

		format(string, sizeof(string), "--- %s (id: %d) teleported his car %s (id: %d) to himself.", playername[playerid],playerid,GetVehicleName(moneys),moneys);
		WriteLog(string);
		format(string, sizeof(string), "* You teleported your car %s (id: %d) to yourself.", GetVehicleName(moneys),moneys);
		SendClientMessage(playerid, COLOR_YELLOW, string);

		return 1;
	}

	if (strcmp(cmdtext, "/close", true) == 0 || strcmp(cmdtext, "/lock", true) == 0) {
		if (!locking) {
		    SendClientMessage(playerid, COLOR_RED, "* Locking are not allowed on this server!");
		    return 1;
		}

		if (IsPlayerInAnyVehicle(playerid)) {
			if (GetPlayerState(playerid) != PLAYER_STATE_DRIVER) {
				SendClientMessage(playerid, COLOR_RED, "* Only the driver can lock the car!");
				return 1;
			}

			for (new i=0;i<MAX_PLAYERS;i++)
				if (i != playerid) SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid), i, 0, 1);

			SendClientMessage(playerid, COLOR_GREY, "* Your car is now locked.");
		}
		else SendClientMessage(playerid, COLOR_YELLOW, "* You must be in a car to do it.");

		return 1;
	}


	if (strcmp(cmdtext, "/open", true) == 0 || strcmp(cmdtext, "/unlock", true) == 0) {
	    if (!locking) {
		    SendClientMessage(playerid, COLOR_RED, "* Locking are not allowed on this server!");
		    return 1;
		}

		if (IsPlayerInAnyVehicle(playerid)) {
			if (GetPlayerState(playerid) != PLAYER_STATE_DRIVER) {
				SendClientMessage(playerid, COLOR_RED, "* Only the driver can open the car!");
				return 1;
			}

			for (new i=0;i<MAX_PLAYERS;i++)
				if (i != playerid) SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid), i, 0, 0);

			SendClientMessage(playerid, COLOR_GREY, "* Your car is now opened.");
		}
		else SendClientMessage(playerid, COLOR_YELLOW, "* You must be in a car to do it.");

		return 1;
	}

	if (strcmp(cmd, "/kp", true) == 0) {
		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /kp [playerid]");
			return 1;
		}
		giveplayerid = strval(tmp);

		if (!IsPlayerInAnyVehicle(playerid)) {
			SendClientMessage(playerid, COLOR_YELLOW, "* You need to be in a car to do it.");
			return 1;
		}
		moneys = GetPlayerVehicleID(playerid);

		if (GetVehicleDriver(moneys) != playerid) {
			SendClientMessage(playerid, COLOR_RED, "* Only the driver can kick passengers!");
			return 1;
		}

		if (IsPlayerConnected(giveplayerid)) {
			if (IsPlayerInVehicle(giveplayerid, moneys)) {
				RemovePlayerFromVehicle(giveplayerid);

				format(string, sizeof(string), "* You kicked %s (id: %d) from car.", playername[giveplayerid],giveplayerid);
				SendClientMessage(playerid, COLOR_GREY, string);
				format(string, sizeof(string), "* %s (id: %d) kicked you from car.", playername[playerid],playerid);
				SendClientMessage(giveplayerid, COLOR_RED, string);
			}
			else {
			    format(string, sizeof(string), "* %s (id: %d) not in your car.", playername[giveplayerid],giveplayerid);
				SendClientMessage(playerid, COLOR_YELLOW, string);
			}
		}
		else {
			format(string, sizeof(string), "* %d is not an active player.", giveplayerid);
			SendClientMessage(playerid, COLOR_YELLOW, string);
		}

		return 1;
	}

	if (strcmp(cmd, "/spectate", true) == 0) {
		if (!spectators) {
		    SendClientMessage(playerid, COLOR_RED, "* Spectators are not allowed on this server!");
		    return 1;
		}

		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			format(string, sizeof(string), "* USAGE: /spectate [playerid] [dist 5-%d] [camid 0-2]", spectatormaxdist);
			SendClientMessage(playerid, COLOR_WHITE, string);
			return 1;
		}
		giveplayerid = strval(tmp);

		tmp = strtok(cmdtext, idx);
		moneys = strval(tmp);
		if (!strlen(tmp) || moneys < 5 || moneys > spectatormaxdist) {
		    format(string, sizeof(string), "* USAGE: /spectate [playerid] [dist 5-%d] [camid 0-2]", spectatormaxdist);
			SendClientMessage(playerid, COLOR_WHITE, string);
			return 1;
		}

		tmp = strtok(cmdtext, idx);
		weaponid = strval(tmp);
		if (!strlen(tmp) || weaponid < 0 || weaponid > 2) {
			format(string, sizeof(string), "* USAGE: /spectate [playerid] [dist 5-%d] [camid 0-2]", spectatormaxdist);
			SendClientMessage(playerid, COLOR_WHITE, string);
			return 1;
		}

		if (IsPlayerConnected(giveplayerid)) {
		    if (spectator[giveplayerid][0] != INVALID_PLAYER_ID) {
		    	format(string, sizeof(string), "* %s (id: %d) is spectator and cannot be watched.", playername[giveplayerid],giveplayerid);
				SendClientMessage(playerid, COLOR_RED, string);
				return 1;
			}
			if (GetPlayerState(playerid) == PLAYER_STATE_NONE || GetPlayerState(playerid) == PLAYER_STATE_WASTED) {
                format(string, sizeof(string), "* %s (id: %d) is not spawned.", playername[giveplayerid],giveplayerid);
				SendClientMessage(playerid, COLOR_RED, string);
				return 1;
			}
			if (giveplayerid == playerid) {
				SendClientMessage(playerid, COLOR_RED, "* You cannot watch yourself!");
				return 1;
			}

            if (GetPlayerState(playerid) != PLAYER_STATE_NONE && GetPlayerState(playerid) != PLAYER_STATE_WASTED && spectator[playerid][0] == INVALID_PLAYER_ID) {
                GetPlayerPos(playerid, x,y,z);
				spectlastpos[playerid][0] = x;
				spectlastpos[playerid][1] = y;
				spectlastpos[playerid][2] = z;
				FreezePlayer(playerid);
            }
            else spectlastpos[playerid][0] = spectlastpos[playerid][1] = spectlastpos[playerid][2] = 0;
		    spectator[playerid][0] = giveplayerid;
		    spectator[playerid][1] = moneys;
		    spectator[playerid][2] = weaponid;

            format(string, sizeof(string), "~g~Spectator mode on! ~n~~r~Watching: ~w~%s (id: %d).", playername[giveplayerid],giveplayerid);
			GameTextForPlayer(playerid, string, 3000, 5);
		}
		else {
		    format(string, sizeof(string), "* %d is not an active player.", giveplayerid);
			SendClientMessage(playerid, COLOR_YELLOW, string);
		}

		return 1;
    }

    if (strcmp(cmd, "/spectateoff", true) == 0) {
 		if (spectator[playerid][0] == INVALID_PLAYER_ID) {
			SendClientMessage(playerid, COLOR_RED, "* You are not spectator.");
			return 1;
 		}

 		spectator[playerid][1] = 0;

 		SetSpawnInfo(playerid,0,classmodel[lastclass[playerid]],2024.9572,-1561.3475,10.8203,225.9489,0,0,5,1,24,300);
		SpawnPlayer(playerid);
		FreezePlayer(playerid, true);

		return 1;
    }

    if (strcmp(cmd, "/para", true) == 0) {
		if (!parachute) {
		    SendClientMessage(playerid, COLOR_RED, "* Parachute are not allowed on this server!");
		    return 1;
		}

		if (GetPlayerState(playerid) == PLAYER_STATE_NONE || GetPlayerState(playerid) == PLAYER_STATE_WASTED) return 1;

	    if (GetPlayerMoney(playerid) > 499) {
			GiveMoney(playerid, -500);
			GivePlayerWeapon(playerid, 46, 1);
			SendClientMessage(playerid, COLOR_YELLOW, "* Parachute purchased.");
			format(string, sizeof(string), "--- %s (id: %d) purchased parachute.", playername[playerid],playerid);
			WriteLog(string);
		}
		else SendClientMessage(playerid, COLOR_RED, "* You don't have enough money!");

		return 1;
	}

    if (strcmp(cmd, "/skydive", true) == 0) {
		if (!skydive) {
		    SendClientMessage(playerid, COLOR_RED, "* Skydive are not allowed on this server!");
		    return 1;
		}

		if (GetPlayerState(playerid) == PLAYER_STATE_NONE || GetPlayerState(playerid) == PLAYER_STATE_WASTED) return 1;

		if (jailed[playerid] == 1) {
		    SendClientMessage(playerid, COLOR_RED, "* You jailed and cannot skydive.");
		    return 1;
		}

		tmp = strtok(cmdtext, idx);
		moneys = strval(tmp);
	    if (!strlen(tmp) || 100 > moneys || moneys > maxskydive) {
	        format(string, sizeof(string), "* USAGE: /skydive [100-%d]", maxskydive);
			SendClientMessage(playerid, COLOR_WHITE, string);
			return 1;
		}

		if (GetPlayerMoney(playerid) > 499+moneys){
			GiveMoney(playerid, -500-moneys);
			GivePlayerWeapon(playerid, 46, 1);
			GetPlayerPos(playerid, x,y,z);
			if (allowcarskydive && IsPlayerInAnyVehicle(playerid)) SetVehiclePos(GetPlayerVehicleID(playerid), x,y,z+moneys);
			else {
				RemovePlayerFromVehicle(playerid);
				SetPlayerPos(playerid, x,y,z+moneys);
			}

			format(string, sizeof(string), "--- %s (id: %d) skydived by %d.", playername[playerid],playerid,moneys);
			WriteLog(string);
			GameTextForPlayer(playerid, "~r~SKYDIVE!", 3000, 5);
		}
		else SendClientMessage(playerid, COLOR_RED, "* You don't have enough money!");

		return 1;
	}

	if (strcmp(cmd, "/flytols", true) == 0) {
		if (!airports) {
		    SendClientMessage(playerid, COLOR_RED, "* Airports are not allowed on this server!");
		    return 1;
		}

		if (respectrequired && respect[playerid] < respecttoairports) {
			format(string, sizeof(string), "* You need at least %d respect to do it!", respecttoairports);
			SendClientMessage(playerid, COLOR_RED, string);
			return 1;
		}

		if (dini_Exists(PlayerFile(playername[playerid])) && !logged[playerid]) {
  		   	SendClientMessage(playerid, COLOR_YELLOW, "* You must be logged in to use this.");
			return 1;
		}

		if (IsPlayerInCheckpoint(playerid) == 0 || (playerCheckpoint[playerid] != CP_AIR2 && playerCheckpoint[playerid] != CP_AIR3)) {
			SendClientMessage(playerid, COLOR_YELLOW, "* You need to be in an Airport (San Fierro or Las Venturas) to fly to Los Santos.");
			return 1;
		}

		if (GetPlayerMoney(playerid) < airportticket) {
			SendClientMessage(playerid, COLOR_RED, "* You don't have enough money!");
			return 1;
		}

        GiveMoney(playerid, -airportticket);

        RemovePlayerFromVehicle(playerid);
        SetPlayerPos(playerid, checkpoints[CP_AIR1][0], checkpoints[CP_AIR1][1], checkpoints[CP_AIR1][2]);

		format(string, sizeof(string), "--- %s (id: %d) flew to Los Santos.", playername[playerid],playerid);
		WriteLog(string);
		SendClientMessage(playerid, COLOR_GREEN, "* Welcome to Los Santos!");

		return 1;
	}

	if (strcmp(cmd, "/flytosf", true) == 0) {
	    if (!airports) {
		    SendClientMessage(playerid, COLOR_RED, "* Airports are not allowed on this server!");
		    return 1;
		}

		if (respectrequired && respect[playerid] < respecttoairports) {
			format(string, sizeof(string), "* You need at least %d respect to do it!", respecttoairports);
			SendClientMessage(playerid, COLOR_RED, string);
			return 1;
		}

		if (dini_Exists(PlayerFile(playername[playerid])) && !logged[playerid]) {
  		   	SendClientMessage(playerid, COLOR_YELLOW, "* You must be logged in to use this.");
			return 1;
		}

		if (IsPlayerInCheckpoint(playerid) == 0 || (playerCheckpoint[playerid] != CP_AIR1 && playerCheckpoint[playerid] != CP_AIR3)) {
			SendClientMessage(playerid, COLOR_YELLOW, "* You need to be in an Airport (Los Santos or Las Venturas) to fly to San Fierro.");
			return 1;
		}

		if (GetPlayerMoney(playerid) < airportticket) {
			SendClientMessage(playerid, COLOR_RED, "* You don't have enough money!");
			return 1;
		}

        GiveMoney(playerid, -airportticket);

        RemovePlayerFromVehicle(playerid);
        SetPlayerPos(playerid, checkpoints[CP_AIR2][0], checkpoints[CP_AIR2][1], checkpoints[CP_AIR2][2]);

		format(string, sizeof(string), "--- %s (id: %d) flew to San Fierro.", playername[playerid],playerid);
		WriteLog(string);
		SendClientMessage(playerid, COLOR_GREEN, "* Welcome to San Fierro!");

		return 1;
	}

	if (strcmp(cmd, "/flytolv", true) == 0) {
	    if (!airports) {
		    SendClientMessage(playerid, COLOR_RED, "* Airports are not allowed on this server!");
		    return 1;
		}

		if (respectrequired && respect[playerid] < respecttoairports) {
			format(string, sizeof(string), "* You need at least %d respect to do it!", respecttoairports);
			SendClientMessage(playerid, COLOR_RED, string);
			return 1;
		}

		if (dini_Exists(PlayerFile(playername[playerid])) && !logged[playerid]) {
  		   	SendClientMessage(playerid, COLOR_YELLOW, "* You must be logged in to use this.");
			return 1;
		}

		if (IsPlayerInCheckpoint(playerid) == 0 || (playerCheckpoint[playerid] != CP_AIR1 && playerCheckpoint[playerid] != CP_AIR2)) {
			SendClientMessage(playerid, COLOR_YELLOW, "* You need to be in an Airport (Los Santos or San Fierro) to fly to Las Venturas.");
			return 1;
		}

		if (GetPlayerMoney(playerid) < airportticket) {
			SendClientMessage(playerid, COLOR_RED, "* You don't have enough money!");
			return 1;
		}

        GiveMoney(playerid, -airportticket);

        RemovePlayerFromVehicle(playerid);
        SetPlayerPos(playerid, checkpoints[CP_AIR3][0], checkpoints[CP_AIR3][1], checkpoints[CP_AIR3][2]);

		format(string, sizeof(string), "--- %s (id: %d) flew to Las Venturas.", playername[playerid],playerid);
		WriteLog(string);
		SendClientMessage(playerid, COLOR_GREEN, "* Welcome to Las Venturas!");

		return 1;
	}

	if (strcmp(cmd, "/setspawn", true) == 0) {
	    tmp = dini_Get(FILE_SETTINGS, "spawnchange");
		if (!allowspawnchange) {
		    SendClientMessage(playerid, COLOR_RED, "* Spawn change are not allowed on this server!");
		    return 1;
		}

		if (respectrequired && respect[playerid] < respecttospawnchange) {
			format(string, sizeof(string), "* You need at least %d respect to do it!", respecttospawnchange);
			SendClientMessage(playerid, COLOR_RED, string);
			return 1;
		}

		if (dini_Exists(PlayerFile(playername[playerid])) && !logged[playerid]) {
  		   	SendClientMessage(playerid, COLOR_YELLOW, "* You must be logged in to use this.");
			return 1;
		}

		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /setspawn [spawnid]");
			return 1;
		}
		moneys = strval(tmp);

		if (moneys < 0 || moneys >= MAX_SPAWNS) {
			SendClientMessage(playerid, COLOR_RED, "* Invalid location id.");
			return 1;
		}

		if (IsPlayerInCheckpoint(playerid) == 0 || playerCheckpoint[playerid] != CP_SPRES) {
			SendClientMessage(playerid, COLOR_YELLOW, "* You need to be in a Spawn Residence to change your spawn location.");
			return 1;
		}

		if (GetPlayerMoney(playerid) < spawnchangecost) {
			SendClientMessage(playerid, COLOR_RED, "* You don't have enough money!");
			return 1;
		}

        GiveMoney(playerid, -spawnchangecost);

		dini_IntSet(PlayerFile(playername[playerid]), "spawn", moneys);

		format(string, sizeof(string), "--- %s (id: %d) changed his spawn location to %s (id: %d).", playername[playerid],playerid,SpawnNames[moneys],moneys);
		WriteLog(string);
		format(string, sizeof(string), "* You changed your spawn location to %s (id: %d).", SpawnNames[moneys],moneys);
		SendClientMessage(playerid, COLOR_GREY, string);

		return 1;
	}

	if (strcmp(cmd, "/spawnlist", true) == 0) {
        SendClientMessage(playerid, COLOR_GREY, "* Available spawn locations:");
	    for (new i=0;i<MAX_SPAWNS;i++) {
	        format(string, sizeof(string), "* %d. %s", i,SpawnNames[i]);

	        if (i+1 < MAX_SPAWNS) {
	            format(tmp, sizeof(tmp), " *** %d. %s", i+1,SpawnNames[i+1]);
				strcat(string, tmp);
				i++;
			}
			if (i+1 < MAX_SPAWNS) {
	            format(tmp, sizeof(tmp), " *** %d. %s", i+1,SpawnNames[i+1]);
				strcat(string, tmp);
				i++;
			}
	        SendClientMessage(playerid, COLOR_WHITE, string);
  	    }

		return 1;
	}

	if (strcmp(cmd, "/getid", true) == 0) {
	    tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /getid [playername]");
			return 1;
		}

	    giveplayerid = GetPlayerId(tmp);
	    if (giveplayerid != INVALID_PLAYER_ID) {
	        format(string, sizeof(string), "* %s's id is: %d.", tmp,giveplayerid);
	        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
	    }
		else {
		    format(string, sizeof(string), "* %s is not an active player.", tmp);
			SendClientMessage(playerid, COLOR_YELLOW, string);
		}

	    return 1;
	}

	if (strcmp(cmd, "/carid", true) == 0) {
        if (!IsPlayerInAnyVehicle(playerid)) {
			SendClientMessage(playerid, COLOR_YELLOW, "* You need to be in a car.");
			return 1;
		}

		format(string, sizeof(string), "* You are in vehicle id: %d.", GetPlayerVehicleID(playerid));
		SendClientMessage(playerid, COLOR_LIGHTBLUE, string);

		return 1;
	}

	if (strcmp(cmd, "/getpos", true) == 0) {
	    new Float:a;

		GetPlayerPos(playerid, x,y,z);
		GetPlayerFacingAngle(playerid, a);

		format(string, sizeof(string), "* Your position: %f %f %f %f", x,y,z,a);
		SendClientMessage(playerid, COLOR_GREY, string);

		return 1;
	}

	if (strcmp(cmd, "/time", true) == 0) {
	    format(tmp, sizeof(tmp), "~w~Current time: ~r~%d:00~w~.", worldTime);
		GameTextForPlayer(playerid, tmp, 3000, 5);

	    return 1;
	}

	if (strcmp(cmd, "/testcolor", true) == 0) {
        if (respecttochangeowncolor < respecttochangeclancolor) moneys = respecttochangeowncolor;
        else moneys = respecttochangeclancolor;
		if (respectrequired && respect[playerid] < moneys) {
			format(string, sizeof(string), "* You need at least %d respect to do it!", moneys);
			SendClientMessage(playerid, COLOR_RED, string);
			return 1;
		}

		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /testcolor [color]");
			return 1;
		}

		if (strlen(tmp) != 6) {
		    SendClientMessage(playerid, COLOR_YELLOW, "* Color must be in HEX (6 symbols)!");
			return 1;
		}

		format(string, sizeof(string), "* This is color %s", tmp);
		format(tmp, sizeof(tmp), "%sFF", tmp);
		SendClientMessage(playerid, HexToInt(tmp), string);

		return 1;
	}

	if (strcmp(cmd, "/totalstats", true) == 0) {
		SendClientMessage(playerid, COLOR_ORANGE, "* Total server statistic:");

		tmp = dini_Get(FILE_TOTALSTAT, "users");
		tmp2 = dini_Get(FILE_TOTALSTAT, "lastuser");
		tmp3 = dini_Get(FILE_TOTALSTAT, "lastregdate");
		format(string, sizeof(string), "* Users registered: %d. Last registered: %s (date: %s).", strval(tmp),tmp2,tmp3);
		SendClientMessage(playerid, COLOR_WHITE, string);

		tmp = dini_Get(FILE_TOTALSTAT, "clans");
		tmp2 = dini_Get(FILE_TOTALSTAT, "lastclan");
		tmp3 = dini_Get(FILE_TOTALSTAT, "lastclanregdate");
		format(string, sizeof(string), "* Clans registered: %d. Last registered: %s (date: %s).", strval(tmp),tmp2,tmp3);
		SendClientMessage(playerid, COLOR_WHITE, string);

		tmp = dini_Get(FILE_TOTALSTAT, "kills");
		tmp2 = dini_Get(FILE_TOTALSTAT, "deaths");
		tmp3 = dini_Get(FILE_TOTALSTAT, "suicides");
		format(string, sizeof(string), "* Kills: %d. Deaths: %d. Suicides: %d.", strval(tmp),strval(tmp2),strval(tmp3));
		SendClientMessage(playerid, COLOR_GREEN, string);

		tmp = dini_Get(FILE_TOTALSTAT, "moneyreceived");
		tmp2 = dini_Get(FILE_TOTALSTAT, "moneylost");
		format(string, sizeof(string), "* Money received: %d. Money spent/lost: %d.", strval(tmp),strval(tmp2));
		SendClientMessage(playerid, COLOR_LIGHTBLUE, string);

		tmp = dini_Get(FILE_TOTALSTAT, "kicks");
		tmp2 = dini_Get(FILE_TOTALSTAT, "bans");
		format(string, sizeof(string), "* Players kicked: %d. Players banned: %d.", strval(tmp),strval(tmp2));
		SendClientMessage(playerid, COLOR_RED, string);

		return 1;
	}

	if (strcmp(cmd, "/report", true) == 0) {
		if (!reporting) {
		    SendClientMessage(playerid, COLOR_RED, "* Reports are not allowed on this server!");
		    return 1;
		}

		if (reporttimeout[playerid] > 0) {
		    SendClientMessage(playerid, COLOR_YELLOW, "* Wait some time after reporting again.");
		    return 1;
		}

	    strmid(tmp, cmdtext, 7, strlen(cmdtext));
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /report [text]");
			return 1;
		}

		if (dini_Exists(PlayerFile(playername[playerid])) && !logged[playerid]) {
  		   	SendClientMessage(playerid, COLOR_YELLOW, "* You must be logged in to use this.");
			return 1;
		}

		new h, m, s;
		new day, month, year;
		new File:f = fopen(FILE_REPORT, io_append);

		gettime(h,m,s);
		getdate(year,month,day);

		format(string, sizeof(string), "--- %s (id: %d) sent report:%s", playername[playerid],playerid,day,month,year,h,m,s,tmp);
		WriteLog(string);
		format(string, sizeof(string), "* Report from %s (id: %d):%s", playername[playerid],playerid,tmp);
		SendAdminMessage(COLOR_LIGHTBLUE, string);

		format(string, sizeof(string), "From %s (id: %d) at %d/%d/%d in %d:%d:%d:%s", playername[playerid],playerid,day,month,year,h,m,s,tmp);
		fwrite(f, string);
		fwrite(f, "\r\n");
		fclose(f);

		reporttimeout[playerid] = reportingtimeout;

		SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Your report sent to admins.");

		return 1;
	}

	if (strcmp(cmd, "/vote", true) == 0) {
		if (!votekick && !voteban) {
		    SendClientMessage(playerid, COLOR_RED, "* Votes are not allowed on this server!");
		    return 1;
		}

		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /vote [playerid]");
			return 1;
		}
		giveplayerid = strval(tmp);

		if (playerid == giveplayerid) {
		    SendClientMessageToAll(COLOR_YELLOW, "* You can't vote for yourself!");
			return 1;
		}

		if (!votes[playerid]) {
			format(string, sizeof(string), "* Vote for %d is inactive.", giveplayerid);
			SendClientMessageToAll(COLOR_YELLOW, string);
			return 1;
		}

		if (voted[playerid][giveplayerid]) {
		    format(string, sizeof(string), "* You already voted for %s (id: %d).", playername[giveplayerid],giveplayerid);
			SendClientMessageToAll(COLOR_YELLOW, string);
			return 1;
		}

	    votes[giveplayerid]++;
	    voted[playerid][giveplayerid] = 1;

	    format(string, sizeof(string), "--- %s (id: %d) voted for %s (id: %d).", playername[playerid],playerid,playername[giveplayerid],giveplayerid);
		WriteLog(string);
		format(string, sizeof(string), "* %s (id: %d) voted for %s (id: %d).", playername[playerid],playerid,playername[giveplayerid],giveplayerid);
		SendClientMessageToAll(COLOR_YELLOW, string);

		return 1;
	}

	if (strcmp(cmd, "/votekick", true) == 0) {
		if (!votekick) {
		    SendClientMessage(playerid, COLOR_RED, "* Kick voting are not allowed on this server!");
		    return 1;
		}

		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /votekick [playerid]");
			return 1;
		}
		giveplayerid = strval(tmp);

		if (playerid == giveplayerid) {
		    SendClientMessageToAll(COLOR_YELLOW, "* You can't vote for yourself!");
			return 1;
		}

		if (!IsPlayerConnected(giveplayerid)) {
		    format(string, sizeof(string), "* %d is not an active player.", giveplayerid);
			SendClientMessage(playerid, COLOR_YELLOW, string);
		    return 1;
		}

		if (votes[giveplayerid]) {
			format(string, sizeof(string), "* Vote to kick %s (id: %d) already active.", playername[giveplayerid],giveplayerid);
			SendClientMessageToAll(COLOR_YELLOW, string);
			return 1;
		}

		if (GetPlayers() < votekickminplayers) {
			SendClientMessage(playerid, COLOR_RED, "* Not enough players to start a vote!");
		    return 1;
		}

	    votetime[giveplayerid] = votekicktime;
	    votes[giveplayerid]++;
	    voted[playerid][giveplayerid] = 1;
	    votetype[giveplayerid] = 1;

	    format(string, sizeof(string), "--- %s (id: %d) called a vote to kick %s (id: %d).", playername[playerid],playerid,playername[giveplayerid],giveplayerid);
		WriteLog(string);
		format(string, sizeof(string), "* %s (id: %d) called a vote to kick %s (id: %d). You can vote in next %d seconds by typing /vote %d", playername[playerid],playerid,playername[giveplayerid],giveplayerid,votekicktime,giveplayerid);
		SendClientMessageToAll(COLOR_ORANGE, string);

		return 1;
	}

	if (strcmp(cmd, "/voteban", true) == 0) {
		if (!voteban) {
		    SendClientMessage(playerid, COLOR_RED, "* Ban voting are not allowed on this server!");
		    return 1;
		}

		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /voteban [playerid]");
			return 1;
		}
		giveplayerid = strval(tmp);

		if (votes[giveplayerid]) {
			format(string, sizeof(string), "* Vote to ban %s (id: %d) already active.", playername[giveplayerid],giveplayerid);
			SendClientMessageToAll(COLOR_YELLOW, string);
			return 1;
		}

		if (GetPlayers() < votebanminplayers) {
			SendClientMessage(playerid, COLOR_RED, "* Not enough players to start a vote!");
		    return 1;
		}

	    votetime[giveplayerid] = votebantime;
	    votes[giveplayerid]++;
	    voted[playerid][giveplayerid] = 1;
	    votetype[giveplayerid] = 2;

	    format(string, sizeof(string), "--- %s (id: %d) called a vote to ban %s (id: %d).", playername[playerid],playerid,playername[giveplayerid],giveplayerid);
		WriteLog(string);
		format(string, sizeof(string), "* %s (id: %d) called a vote to ban %s (id: %d). You can vote in next %d seconds by typing /vote %d", playername[playerid],playerid,playername[giveplayerid],giveplayerid,votekicktime,giveplayerid);
		SendClientMessageToAll(COLOR_RED, string);

		return 1;
	}

	if (strcmp(cmd, "/motd", true) == 0) {
    	if (strlen(motdstring1)) SendClientMessage(playerid, HexToInt(motdcolor), motdstring1);
    	if (strlen(motdstring2)) SendClientMessage(playerid, HexToInt(motdcolor), motdstring2);
    	if (strlen(motdstring3)) SendClientMessage(playerid, HexToInt(motdcolor), motdstring3);
    	if (strlen(motdstring4)) SendClientMessage(playerid, HexToInt(motdcolor), motdstring4);

    	return 1;
	}

	if (strcmp(cmd, "/credits", true) == 0) {
        SendClientMessage(playerid, COLOR_GREY,"* Credits:");
		SendClientMessage(playerid, COLOR_GREY,"* Major features developed by ProRaiL.");
		SendClientMessage(playerid, COLOR_GREY,"* It was based on LVDMod by Sintax, which also was based on default LVDM by Jax.");
		SendClientMessage(playerid, COLOR_GREY,"* DINI and DUTILS made by DracoBlue.");
		SendClientMessage(playerid, COLOR_GREY,"* Some vehicle funtions by Sacky.");
		SendClientMessage(playerid, COLOR_GREY,"* Car locking system idea by StyleWarz.");
		SendClientMessage(playerid, COLOR_GREY,"* Spectator mode elements from testakross.");
		SendClientMessage(playerid, COLOR_GREY,"* Thanks to everyone who used/using this gamemode,");
        SendClientMessage(playerid, COLOR_GREY,"* reporting about bugs, giving new ideas and all...");
        SendClientMessage(playerid, COLOR_GREY,"* Personal thanks to Barmaley for moral support ;)");

		return 1;
	}

	if (!enableadminscript) return 0;

	if (strcmp(cmd, "/adminhelp", true) == 0 && PlayerAccess(playerid) >= 1) {
	    SendClientMessage(playerid, COLOR_GREY,"* Available admin commands:");
	    switch (PlayerAccess(playerid)) {
	        case 1: {
				SendClientMessage(playerid, COLOR_ORANGE,"* MONEY: /getmoney /getbank");
				SendClientMessage(playerid, COLOR_ORANGE,"* PLAYER: /kick /ban /(un)mute /(un)jail /(un)freeze");
				SendClientMessage(playerid, COLOR_ORANGE,"* PLAYER: /(dis)arm");
        		SendClientMessage(playerid, COLOR_ORANGE,"* PLAYER: /(get,from)car");
        		SendClientMessage(playerid, COLOR_ORANGE,"* OTHER: /ann");
	        }
	        case 2: {
				SendClientMessage(playerid, COLOR_ORANGE,"* MONEY: /(give,set,get)money /(set,get)bank /setbounty /setrespect");
				SendClientMessage(playerid, COLOR_ORANGE,"* PROPERTY: /setpropowner");
				SendClientMessage(playerid, COLOR_ORANGE,"* CAR: /setcarowner");
				SendClientMessage(playerid, COLOR_ORANGE,"* PLAYER: /kick /ban /(un)mute /(un)jail /(un)freeze /heal");
				SendClientMessage(playerid, COLOR_ORANGE,"* PLAYER: /giveweapon /weaponids /(dis)arm /setcolor /setscore");
        		SendClientMessage(playerid, COLOR_ORANGE,"* PLAYER: /tp(to,carto,tocar) /locs /(get,in,from)car");
        		SendClientMessage(playerid, COLOR_ORANGE,"* OTHER: /ann /settime");
	        }
	        case 3: {
	            SendClientMessage(playerid, COLOR_ORANGE,"* ACCOUNT: /globalsave");
				SendClientMessage(playerid, COLOR_ORANGE,"* CLAN: /(reg,del)clan /(un)setclan /getclan");
				SendClientMessage(playerid, COLOR_ORANGE,"* MONEY: /(give,set,get)money /(set,get)bank /setbounty /setrespect");
				SendClientMessage(playerid, COLOR_ORANGE,"* PROPERTY: /setpropowner /prop(re)buyable /loadpropowners");
				SendClientMessage(playerid, COLOR_ORANGE,"* CAR: /setcarowner /carbuyable /admincar /loadcarowners");
				SendClientMessage(playerid, COLOR_ORANGE,"* PLAYER: /kick /ban /(un)mute /(un)jail /(un)freeze /heal /god /murder");
				SendClientMessage(playerid, COLOR_ORANGE,"* PLAYER: /giveweapon /weaponids /(dis)arm /setcolor /setscore");
        		SendClientMessage(playerid, COLOR_ORANGE,"* PLAYER: /tp(to,carto,tocar) /locs /(get,in,from)car");
        		SendClientMessage(playerid, COLOR_ORANGE,"* OTHER: /(un)setsettings /getsettings /loadsettings");
        		SendClientMessage(playerid, COLOR_ORANGE,"* OTHER: /ann /settime /resettotalstats");
	        }
	        case 4: {
	            SendClientMessage(playerid, COLOR_ORANGE,"* ACCOUNT: /(reg,del)user /globalsave /(un)setuser /getuser /hash");
				SendClientMessage(playerid, COLOR_ORANGE,"* CLAN: /(reg,del)clan /(un)setclan /getclan");
				SendClientMessage(playerid, COLOR_ORANGE,"* MONEY: /(give,set,get)money /(set,get)bank /setbounty /setrespect");
				SendClientMessage(playerid, COLOR_ORANGE,"* PROPERTY: /setpropowner /prop(re)buyable /loadpropowners");
				SendClientMessage(playerid, COLOR_ORANGE,"* CAR: /setcarowner /carbuyable /admincar /loadcarowners");
				SendClientMessage(playerid, COLOR_ORANGE,"* PLAYER: /kick /ban /(un)mute /(un)jail /(un)freeze /heal /god /(s)murder");
				SendClientMessage(playerid, COLOR_ORANGE,"* PLAYER: /giveweapon /weaponids /(dis)arm /setcolor /setscore");
        		SendClientMessage(playerid, COLOR_ORANGE,"* PLAYER: /tp(to,carto,tocar) /locs /(get,in,from)car");
        		SendClientMessage(playerid, COLOR_ORANGE,"* OTHER: /(un)setsettings /getsettings /loadsettings");
        		SendClientMessage(playerid, COLOR_ORANGE,"* OTHER: /ann /settime /resettotalstats /gmx");
        		SendClientMessage(playerid, COLOR_ORANGE,"* NEW!!!: /Leave /Invisible");
	        }
		}

		return 1;
	}

	if (strcmp(cmd, "/reguser", true) == 0 && PlayerAccess(playerid) >= 4) {
		tmp = strtok(cmdtext, idx);
	    if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /reguser [playername] [password]");
			return 1;
		}

        tmp2 = strtok(cmdtext, idx);
        if (!strlen(tmp2)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /reguser [playername] [password]");
			return 1;
		}
		if (20 < strlen(tmp2) || strlen(tmp2) < 5) {
			SendClientMessage(playerid, COLOR_YELLOW, "* Password length must be 5-20 symbols.");
			return 1;
		}

		if (!dini_Exists(PlayerFile(tmp))) {
			new day, month, year;
			getdate(year,month,day);

			dini_Create(PlayerFile(tmp));
			format(tmp2, sizeof(tmp2), "%d.%d.%d", day,month,year);
  			dini_Set(PlayerFile(playername[playerid]), "registered", tmp2);
			dini_IntSet(PlayerFile(tmp), "password", num_hash(tmp2));

			if (!dini_Exists(FILE_TOTALSTAT)) dini_Create(FILE_TOTALSTAT);
			tmp3 = dini_Get(FILE_TOTALSTAT, "users");
			dini_IntSet(FILE_TOTALSTAT, "users", strval(tmp3)+1);
			dini_Set(FILE_TOTALSTAT, "lastuser", tmp);
			dini_Set(FILE_TOTALSTAT, "lastregdate", tmp2);

			format(string, sizeof(string), "--- %s (id: %d) created account %s.", playername[playerid],playerid,tmp);
			WriteLog(string);
			format(string, sizeof(string), "* Account named %s created. Password: %s.", tmp,tmp2);
			SendClientMessage(playerid, COLOR_GREEN, string);
		}
		else {
			format(string, sizeof(string), "* Account %s already registered.", tmp);
			SendClientMessage(playerid, COLOR_RED, string);
		}

		return 1;
	}

	if (strcmp(cmd, "/deluser", true) == 0 && PlayerAccess(playerid) >= 4) {
	    tmp = strtok(cmdtext, idx);
	    if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /deluser [playername]");
			return 1;
		}

		if (dini_Exists(PlayerFile(tmp))) {
			dini_Remove(PlayerFile(tmp));

			tmp3 = dini_Get(FILE_TOTALSTAT, "users");
			dini_IntSet(FILE_TOTALSTAT, "users", strval(tmp3)-1);

			format(string, sizeof(string), "--- %s (id: %d) deleted account %s.", playername[playerid],playerid,tmp);
			WriteLog(string);
			format(string, sizeof(string), "* Account %s deleted.", tmp);
			SendClientMessage(playerid, COLOR_RED, string);
		}
		else {
			format(string, sizeof(string), "* %s no such account.", tmp);
			SendClientMessage(playerid, COLOR_RED, string);
		}

		return 1;
	}

	if (strcmp(cmd, "/globalsave", true) == 0 && PlayerAccess(playerid) >= 3) {
  		format(string, sizeof(string), "--- %s (id: %d) requested global save.", playername[playerid],playerid);
		WriteLog(string);
		GlobalPlayerSave();
   		SendClientMessage(playerid, COLOR_GREEN, "* Global save done.");

	    return 1;
	}

	if (strcmp(cmd, "/setuser", true) == 0 && PlayerAccess(playerid) >= 4) {
		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /setuser [playername] [key] [value]");
			return 1;
		}

		tmp2 = strtok(cmdtext, idx);
		if (!strlen(tmp2)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /setuser [playername] [key] [value]");
			return 1;
		}

 		strmid(tmp3, cmdtext, 11+strlen(tmp)+strlen(tmp2), strlen(cmdtext));
		if (!strlen(tmp3)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /setuser [playername] [key] [value]");
			return 1;
		}

		if (dini_Exists(PlayerFile(tmp))) {
		    dini_Set(PlayerFile(tmp), tmp2, tmp3);

		    format(string, sizeof(string), "--- %s (id: %d) sets %s parameters: %s=%s.", playername[playerid],playerid,tmp,tmp2,tmp3);
			WriteLog(string);
			format(string, sizeof(string), "* You set parameters of %s: %s=%s.", tmp,tmp2,tmp3);
			SendClientMessage(playerid, COLOR_YELLOW, string);
		}
		else {
		    format(string, sizeof(string), "* %s no such account.", tmp);
			SendClientMessage(playerid, COLOR_RED, string);
		}

		return 1;
	}

	if (strcmp(cmd, "/unsetuser", true) == 0 && PlayerAccess(playerid) >= 4) {
		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /unsetuser [playername] [key]");
			return 1;
		}

		tmp2 = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /unsetuser [playername] [key]");
			return 1;
		}

		if (dini_Exists(PlayerFile(tmp))) {
		    dini_Unset(PlayerFile(tmp), tmp2);

			format(string, sizeof(string), "* You unset parameters of %s: %s.", tmp,tmp2);
			SendClientMessage(playerid, COLOR_YELLOW, string);
		}
		else {
		    format(string, sizeof(string), "* %s no such account.", tmp);
			SendClientMessage(playerid, COLOR_RED, string);
		}

		return 1;
	}

	if (strcmp(cmd, "/getuser", true) == 0 && PlayerAccess(playerid) >= 4) {
		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /getuser [playername] [key]");
			return 1;
		}

		tmp2 = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /getuser [playername] [key]");
			return 1;
		}

		if (dini_Exists(PlayerFile(tmp))) {
		    tmp3 = dini_Get(PlayerFile(tmp), tmp2);

			format(string, sizeof(string), "* Parameters of %s: %s=%s.", tmp,tmp2,tmp3);
			SendClientMessage(playerid, COLOR_YELLOW, string);
		}
		else {
		    format(string, sizeof(string), "* %s no such account.", tmp);
			SendClientMessage(playerid, COLOR_RED, string);
		}

		return 1;
	}

	if (strcmp(cmd, "/hash", true) == 0 && PlayerAccess(playerid) >= 4) {
	    tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /hash [string]");
			return 1;
		}

		format(string, sizeof(string), "* %s -- %d", tmp,num_hash(tmp));
		SendClientMessage(playerid, COLOR_WHITE, string);

		return 1;
	}

	if (strcmp(cmd, "/regclan", true) == 0 && PlayerAccess(playerid) >= 3) {
		tmp = strtok(cmdtext, idx);
	    if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /regclan [clanname]");
			return 1;
		}

		format(tmp2, sizeof(tmp2), "%s%s.clan", DIR_CLANS,EncodeNick(tmp));
		if (!dini_Exists(tmp2)) {
			new day, month, year;
			getdate(year,month,day);

			dini_Create(tmp2);

			if (!dini_Exists(FILE_TOTALSTAT)) dini_Create(FILE_TOTALSTAT);
			tmp3 = dini_Get(FILE_TOTALSTAT, "clans");
			dini_IntSet(FILE_TOTALSTAT, "clans", strval(tmp3)+1);
			dini_Set(FILE_TOTALSTAT, "lastclan", tmp);
			format(tmp3, sizeof(tmp2), "%d.%d.%d", day,month,year);
  			dini_Set(tmp2, "registered", tmp3);
			dini_Set(FILE_TOTALSTAT, "lastclanregdate", tmp3);

			format(string, sizeof(string), "--- %s (id: %d) created clan %s.", playername[playerid],playerid,tmp);
			WriteLog(string);
			format(string, sizeof(string), "* Clan %s created.", tmp);
			SendClientMessage(playerid, COLOR_GREEN, string);
		}
		else {
			format(string, sizeof(string), "* Clan %s already registered.", tmp);
			SendClientMessage(playerid, COLOR_RED, string);
		}

		return 1;
	}

	if (strcmp(cmd, "/delclan", true) == 0 && PlayerAccess(playerid) >= 3) {
	    tmp = strtok(cmdtext, idx);
	    if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /delclan [clanname]");
			return 1;
		}

        format(tmp2, sizeof(tmp2), "%s%s.clan", DIR_CLANS,EncodeNick(tmp));
		if (dini_Exists(tmp2)) {
			dini_Remove(tmp2);

			tmp3 = dini_Get(FILE_TOTALSTAT, "clans");
			dini_IntSet(FILE_TOTALSTAT, "clans", strval(tmp3)-1);

			format(string, sizeof(string), "--- %s (id: %d) deleted clan %s.", playername[playerid],playerid,tmp);
			WriteLog(string);
			format(string, sizeof(string), "* Clan %s deleted.", tmp);
			SendClientMessage(playerid, COLOR_RED, string);
		}
		else {
			format(string, sizeof(string), "* %s no such clan.", tmp);
			SendClientMessage(playerid, COLOR_RED, string);
		}

		return 1;
	}

	if (strcmp(cmd, "/setclan", true) == 0 && PlayerAccess(playerid) >= 3) {
		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /setclan [clanname] [key] [value]");
			return 1;
		}

		tmp2 = strtok(cmdtext, idx);
		if (!strlen(tmp2)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /setclan [clanname] [key] [value]");
			return 1;
		}

 		strmid(tmp3, cmdtext, 11+strlen(tmp)+strlen(tmp2), strlen(cmdtext));
		if (!strlen(tmp3)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /setclan [clanname] [key] [value]");
			return 1;
		}

		format(string, sizeof(string), "%s%s.clan", DIR_CLANS,EncodeNick(tmp));
		if (dini_Exists(string)) {
		    dini_Set(string, tmp2, tmp3);

		    format(string, sizeof(string), "--- %s (id: %d) sets clan %s parameters: %s=%s.", playername[playerid],playerid,tmp,tmp2,tmp3);
			WriteLog(string);
			format(string, sizeof(string), "* You set parameters of clan %s: %s=%s.", tmp,tmp2,tmp3);
			SendClientMessage(playerid, COLOR_YELLOW, string);
		}
		else {
		    format(string, sizeof(string), "* Clan %s not exists!", tmp);
			SendClientMessage(playerid, COLOR_RED, string);
		}

		return 1;
	}

	if (strcmp(cmd, "/unsetclan", true) == 0 && PlayerAccess(playerid) >= 3) {
		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /unsetclan [clanname] [key]");
			return 1;
		}

		tmp2 = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /unsetclan [clanname] [key]");
			return 1;
		}

        format(string, sizeof(string), "%s%s.clan", DIR_CLANS,EncodeNick(tmp));
		if (dini_Exists(string)) {
		    dini_Unset(string, tmp2);

			format(string, sizeof(string), "* You unset parameters of clan %s: %s.", tmp,tmp2);
			SendClientMessage(playerid, COLOR_YELLOW, string);
		}
		else {
		    format(string, sizeof(string), "* Clan %s not exists!", tmp);
			SendClientMessage(playerid, COLOR_RED, string);
		}

		return 1;
	}

	if (strcmp(cmd, "/getclan", true) == 0 && PlayerAccess(playerid) >= 3) {
		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /getclan [clanname] [key]");
			return 1;
		}

		tmp2 = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /getclan [clanname] [key]");
			return 1;
		}

        format(string, sizeof(string), "%s%s.clan", DIR_CLANS,EncodeNick(tmp));
		if (dini_Exists(string)) {
		    tmp3 = dini_Get(string, tmp2);

			format(string, sizeof(string), "* Parameters of clan %s: %s=%s.", tmp,tmp2,tmp3);
			SendClientMessage(playerid, COLOR_YELLOW, string);
		}
		else {
		    format(string, sizeof(string), "* Clan %s not exists!", tmp);
			SendClientMessage(playerid, COLOR_RED, string);
		}

		return 1;
	}

	if (strcmp(cmd, "/givemoney", true) == 0 && PlayerAccess(playerid) >= 2) {
		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /givemoney [playerid] [amount]");
			return 1;
		}
		giveplayerid = strval(tmp);

		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /givemoney [playerid] [amount]");
			return 1;
		}
 		moneys = strval(tmp);

		if (IsPlayerConnected(giveplayerid)) {
			GiveMoney(giveplayerid, moneys);

			format(string, sizeof(string), "--- %s (id: %d) maded €%d for %s (id: %d).", playername[playerid],playerid,moneys,playername[giveplayerid],giveplayerid);
			WriteLog(string);
			format(string, sizeof(string), "* You have made money for %s (id: %d), €%d.", playername[giveplayerid],giveplayerid, moneys);
			SendClientMessage(playerid, COLOR_YELLOW, string);
			format(string, sizeof(string), "* You have granted €%d from %s (id: %d).", moneys, playername[playerid], playerid);
			SendClientMessage(giveplayerid, COLOR_YELLOW, string);
		}
		else {
			format(string, sizeof(string), "* %d is not an active player.", giveplayerid);
			SendClientMessage(playerid, COLOR_YELLOW, string);
		}

		return 1;
	}

	if (strcmp(cmd, "/setmoney", true) == 0 && PlayerAccess(playerid) >= 2) {
		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /setmoney [playerid] [amount]");
			return 1;
		}
		giveplayerid = strval(tmp);

		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /setmoney [playerid] [amount]");
			return 1;
		}
 		moneys = strval(tmp);

		if (IsPlayerConnected(giveplayerid)) {
			GiveMoney(giveplayerid, -GetPlayerMoney(giveplayerid)+moneys);

			format(string, sizeof(string), "--- %s (id: %d) sets %s (id: %d) money to €%d.", playername[playerid],playerid,playername[giveplayerid],giveplayerid,moneys);
			WriteLog(string);
			format(string, sizeof(string), "* You set money of %s (id: %d) to €%d.", playername[giveplayerid],giveplayerid,moneys);
			SendClientMessage(playerid, COLOR_YELLOW, string);
			format(string, sizeof(string), "* Your money is now €%d, set by %s (id: %d).", moneys,playername[playerid],playerid);
			SendClientMessage(giveplayerid, COLOR_YELLOW, string);
		}
		else {
		    format(string, sizeof(string), "* %d is not an active player.", giveplayerid);
			SendClientMessage(playerid, COLOR_YELLOW, string);
		}

		return 1;
	}

	if (strcmp(cmd, "/getmoney", true) == 0 && PlayerAccess(playerid) >= 1) {
		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /getmoney [playerid]");
			return 1;
		}
		giveplayerid = strval(tmp);

		if (IsPlayerConnected(giveplayerid)) {
			format(string, sizeof(string), "* Money of %s (id: %d) is €%d.", playername[giveplayerid],giveplayerid,GetPlayerMoney(giveplayerid));
			SendClientMessage(playerid, COLOR_YELLOW, string);
		}
		else {
            format(string, sizeof(string), "* %d is not an active player.", giveplayerid);
			SendClientMessage(playerid, COLOR_YELLOW, string);
		}

		return 1;
	}

 	if (strcmp(cmd, "/setbank", true) == 0 && PlayerAccess(playerid) >= 2) {
		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /setbank [playerid] [amount]");
			return 1;
		}
		giveplayerid = strval(tmp);

		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /setbank [playerid] [amount]");
			return 1;
		}
 		moneys = strval(tmp);

		if (IsPlayerConnected(giveplayerid)) {
			bank[giveplayerid] = moneys;
			format(string, sizeof(string), "--- %s (id: %d) sets %s (id: %d) bank balance to €%d.", playername[playerid],playerid,playername[giveplayerid],giveplayerid,moneys);
			WriteLog(string);
			format(string, sizeof(string), "* You set balance of %s (id: %d) to €%d in bank.", playername[giveplayerid],giveplayerid,moneys);
			SendClientMessage(playerid, COLOR_YELLOW, string);
			format(string, sizeof(string), "* Your bank balance is now €%d, set by %s (id: %d).", moneys,playername[playerid],playerid);
			SendClientMessage(giveplayerid, COLOR_YELLOW, string);
		}
		else {
		    format(string, sizeof(string), "* %d is not an active player.", giveplayerid);
			SendClientMessage(playerid, COLOR_YELLOW, string);
		}

		return 1;
	}

	if (strcmp(cmd, "/getbank", true) == 0 && PlayerAccess(playerid) >= 1) {
		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /getbank [playerid]");
			return 1;
		}
		giveplayerid = strval(tmp);

		if (IsPlayerConnected(giveplayerid)) {
			format(string, sizeof(string), "* Balance of %s (id: %d) is €%d.", playername[giveplayerid],giveplayerid,bank[giveplayerid]);
			SendClientMessage(playerid, COLOR_YELLOW, string);
		}
		else {
            format(string, sizeof(string), "* %d is not an active player.", giveplayerid);
			SendClientMessage(playerid, COLOR_YELLOW, string);
		}

		return 1;
	}

	if (strcmp(cmd, "/setbounty", true) == 0 && PlayerAccess(playerid) >= 2) {
		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /setbounty [playerid] [amount]");
			return 1;
		}
		giveplayerid = strval(tmp);

		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /setbounty [playerid] [amount]");
			return 1;
		}
 		moneys = strval(tmp);

		if (IsPlayerConnected(giveplayerid)) {
			bounty[giveplayerid] = moneys;
			format(string, sizeof(string), "--- %s (id: %d) sets %s (id: %d) bounty to €%d.", playername[playerid],playerid,playername[giveplayerid],giveplayerid,moneys);
			WriteLog(string);
			format(string, sizeof(string), "* You set bounty on %s (id: %d) to €%d.", playername[giveplayerid],giveplayerid,moneys);
			SendClientMessage(playerid, COLOR_YELLOW, string);
			format(string, sizeof(string), "* Your bounty is now €%d, set by %s (id: %d).", moneys,playername[playerid],playerid);
			SendClientMessage(giveplayerid, COLOR_YELLOW, string);
		}
		else {
		    format(string, sizeof(string), "* %d is not an active player.", giveplayerid);
			SendClientMessage(playerid, COLOR_YELLOW, string);
		}

		return 1;
	}

	if (strcmp(cmd, "/setrespect", true) == 0 && PlayerAccess(playerid) >= 2) {
		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /setrespect [playerid] [amount]");
			return 1;
		}
		giveplayerid = strval(tmp);

		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /setrespect [playerid] [amount]");
			return 1;
		}
 		moneys = strval(tmp);

		if (IsPlayerConnected(giveplayerid)) {
			respect[giveplayerid] = moneys;
			format(string, sizeof(string), "--- %s (id: %d) sets %s (id: %d) respect to %d.", playername[playerid],playerid,playername[giveplayerid],giveplayerid,moneys);
			WriteLog(string);
			format(string, sizeof(string), "* You set respect on %s (id: %d) to %d.", playername[giveplayerid],giveplayerid,moneys);
			SendClientMessage(playerid, COLOR_YELLOW, string);
			format(string, sizeof(string), "* Your respect is now %d, set by %s (id: %d).", moneys,playername[playerid],playerid);
			SendClientMessage(giveplayerid, COLOR_YELLOW, string);
		}
		else {
		    format(string, sizeof(string), "* %d is not an active player.", giveplayerid);
			SendClientMessage(playerid, COLOR_YELLOW, string);
		}

		return 1;
	}

	if (strcmp(cmd, "/setpropowner", true) == 0 && PlayerAccess(playerid) >= 2) {
		tmp = strtok(cmdtext, idx);
	    if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /setpropowner [propid] [playername]");
			return 1;
		}
		moneys = strval(tmp);

		tmp = strtok(cmdtext, idx);
	    if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /setpropowner [propid] [playername]");
			return 1;
		}

		if (!dini_Exists(PlayerFile(tmp))) {
		    format(string, sizeof(string), "--- %s (id: %d) resets property %s (id: %d) owner.", playername[playerid],playerid,propertyNames[moneys],moneys);
			WriteLog(string);

			format(string, sizeof(string), "* You reset owner of %s (id: %d).", propertyNames[moneys],moneys);
       		SendClientMessage(playerid, COLOR_YELLOW, string);

		    return 1;
		}

		valstr(tmp2, moneys);
		if (!dini_Exists(FILE_PROPS)) dini_Create(FILE_PROPS);
		dini_Set(FILE_PROPS, tmp2, tmp);
		propertyowner[moneys] = tmp;

		format(string, sizeof(string), "--- %s (id: %d) sets property %s (id: %d) owner to %s.", playername[playerid],playerid,propertyNames[moneys],moneys,tmp);
		WriteLog(string);

		format(string, sizeof(string), "* You set owner of %s (id: %d) to %s.", propertyNames[moneys],moneys,tmp);
        SendClientMessage(playerid, COLOR_YELLOW, string);

		return 1;
	}

	if (strcmp(cmd, "/propbuyable", true) == 0 && PlayerAccess(playerid) >= 3) {
		tmp = strtok(cmdtext, idx);
	    if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /propbuyable [propid] [0-1]");
			return 1;
		}
		moneys = strval(tmp);

		if (moneys < 0 || moneys >= MAX_PROPERTIES) {
			SendClientMessage(playerid, COLOR_YELLOW, "* Invalid property id.");
			return 1;
		}

		tmp = strtok(cmdtext, idx);
		weaponid = strval(tmp);
	    if (!strlen(tmp) || weaponid < 0 || weaponid > 1) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /propbuyable [propid] [0-1]");
			return 1;
		}

		propertyBuyAble[moneys] = weaponid;
		format(string, sizeof(string), "--- %s (id: %d) sets property %s (id: %d) buyable state to %d.", playername[playerid],playerid,propertyNames[moneys],moneys,weaponid);
		WriteLog(string);

		if (moneys == 0) {
			format(string, sizeof(string), "* You made property %s (id: %d) non-buyable.", propertyNames[moneys],moneys);
            SendClientMessage(playerid, COLOR_RED, string);
		}
		else {
			format(string, sizeof(string), "* You made property %s (id: %d) buyable.", propertyNames[moneys],moneys);
            SendClientMessage(playerid, COLOR_GREEN, string);
		}

		return 1;
	}

	if (strcmp(cmd, "/proprebuyable", true) == 0 && PlayerAccess(playerid) >= 3) {
		tmp = strtok(cmdtext, idx);
	    if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /proprebuyable [propid] [0-1]");
			return 1;
		}
		moneys = strval(tmp);

		if (moneys < 0 || moneys >= MAX_PROPERTIES) {
			SendClientMessage(playerid, COLOR_YELLOW, "* Invalid property id.");
			return 1;
		}

		tmp = strtok(cmdtext, idx);
		weaponid = strval(tmp);
	    if (!strlen(tmp) || weaponid < 0 || weaponid > 1) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /proprebuyable [propid] [0-1]");
			return 1;
		}

		propertyReBuyAble[moneys] = weaponid;
		format(string, sizeof(string), "--- %s (id: %d) sets property %s (id: %d) rebuyable state to %d.", playername[playerid],playerid,propertyNames[moneys],moneys,weaponid);
		WriteLog(string);

		if (moneys == 0) {
			format(string, sizeof(string), "* You made property %s (id: %d) non-rebuyable.", propertyNames[moneys],moneys);
            SendClientMessage(playerid, COLOR_RED, string);
		}
		else {
			format(string, sizeof(string), "* You made property %s (id: %d) rebuyable.", propertyNames[moneys],moneys);
            SendClientMessage(playerid, COLOR_GREEN, string);
		}

		return 1;
	}

	if (strcmp(cmd, "/loadpropowners", true) == 0 && PlayerAccess(playerid) >= 3) {
  		format(string, sizeof(string), "--- %s (id: %d) requested to load properties file.", playername[playerid],playerid);
		WriteLog(string);
		LoadPropertyOwners();
   		SendClientMessage(playerid, COLOR_GREEN, "* Properties file loaded.");

	    return 1;
	}

	if (strcmp(cmd, "/setcarowner", true) == 0 && PlayerAccess(playerid) >= 2) {
		tmp = strtok(cmdtext, idx);
	    if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /setcarowner [vehicleid] [playername]");
			return 1;
		}
		moneys = strval(tmp);

		tmp = strtok(cmdtext, idx);
	    if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /setcarowner [vehicleid] [playername]");
			return 1;
		}

		if (!dini_Exists(PlayerFile(tmp))) {
		    format(string, sizeof(string), "--- %s (id: %d) resets car %s (id: %d) owner.", playername[playerid],playerid,GetVehicleName(moneys),moneys);
			WriteLog(string);

			format(string, sizeof(string), "* You reset owner of car %s (id: %d).", GetVehicleName(moneys),moneys);
        	SendClientMessage(playerid, COLOR_YELLOW, string);

		    return 1;
		}

		valstr(tmp2, moneys);
		if (!dini_Exists(FILE_CARS)) dini_Create(FILE_CARS);
		dini_Set(FILE_CARS, tmp2, tmp);
		carowner[moneys] = tmp;

		format(string, sizeof(string), "--- %s (id: %d) sets car %s (id: %d) owner to %s.", playername[playerid],playerid,GetVehicleName(moneys),moneys,tmp);
		WriteLog(string);

		format(string, sizeof(string), "* You set owner of car %s (id: %d) to %s.", GetVehicleName(moneys),moneys,tmp);
        SendClientMessage(playerid, COLOR_YELLOW, string);

		return 1;
	}

	if (strcmp(cmd, "/carbuyable", true) == 0 && PlayerAccess(playerid) >= 3) {
		tmp = strtok(cmdtext, idx);
	    if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /carbuyable [vehicleid] [0-1]");
			return 1;
		}
		moneys = strval(tmp);

		if (moneys < 0 || moneys > MAX_VEHICLES) {
			SendClientMessage(playerid, COLOR_YELLOW, "* Invalid vehicle id.");
			return 1;
		}

		tmp = strtok(cmdtext, idx);
		weaponid = strval(tmp);
	    if (!strlen(tmp) || weaponid < 0 || weaponid > 1) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /carbuyable [vehicleid] [0-1]");
			return 1;
		}

		carBuyAble[moneys] = weaponid;
		format(string, sizeof(string), "--- %s (id: %d) sets car %s (id: %d) buyable state to %d.", playername[playerid],playerid,GetVehicleName(moneys),moneys,weaponid);
		WriteLog(string);

		if (moneys == 0) {
			format(string, sizeof(string), "* You made car %s (id: %d) non-buyable.", GetVehicleName(moneys),moneys);
            SendClientMessage(playerid, COLOR_RED, string);
		}
		else {
			format(string, sizeof(string), "* You made car %s (id: %d) buyable.", GetVehicleName(moneys),moneys);
            SendClientMessage(playerid, COLOR_GREEN, string);
		}

		return 1;
	}

	if (strcmp(cmd, "/admincar", true) == 0 && PlayerAccess(playerid) >= 3) {
		tmp = strtok(cmdtext, idx);
	    if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /admincar [vehicleid] [0-1]");
			return 1;
		}
		moneys = strval(tmp);

		if (moneys < 1 || moneys > MAX_VEHICLES) {
			SendClientMessage(playerid, COLOR_YELLOW, "* Invalid vehicle id.");
			return 1;
		}

		tmp = strtok(cmdtext, idx);
		weaponid = strval(tmp);
	    if (!strlen(tmp) || weaponid < 0 || weaponid > 1) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /admincar [vehicleid] [0-1]");
			return 1;
		}

		admincar[moneys] = weaponid;

		format(string, sizeof(string), "--- %s (id: %d) sets car %s (id: %d) admin flag to %d.", playername[playerid],playerid,GetVehicleName(moneys),moneys,weaponid);
		WriteLog(string);

		if (weaponid == 0) {
			format(string, sizeof(string), "* Car %s (id: %d) can be used by everyone now.", GetVehicleName(moneys),moneys);
            SendClientMessage(playerid, COLOR_GREEN, string);
		}
        else {
			format(string, sizeof(string), "* Car %s (id: %d) can be used only by admins now.", GetVehicleName(moneys),moneys);
        	SendClientMessage(playerid, COLOR_RED, string);
		}

		return 1;
	}

	if (strcmp(cmd, "/loadcarowners", true) == 0 && PlayerAccess(playerid) >= 3) {
  		format(string, sizeof(string), "--- %s (id: %d) requested to load cars file.", playername[playerid],playerid);
		WriteLog(string);
		LoadVehicleOwners();
   		SendClientMessage(playerid, COLOR_GREEN, "* Vehicles file loaded.");

	    return 1;
	}

	if (strcmp(cmd, "/kick", true) == 0 && PlayerAccess(playerid) >= 1) {
		tmp = strtok(cmdtext, idx);

		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /kick [playerid] [reason]");
			return 1;
		}
		giveplayerid = strval(tmp);

		strmid(tmp, cmdtext, 6+strlen(tmp), strlen(cmdtext));
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /kick [playerid] [reason]");
			return 1;
		}

		if (IsPlayerConnected(giveplayerid)) KickPlayer(giveplayerid, playername[playerid], tmp);
		else {
			format(string, sizeof(string), "* %d is not an active player.", giveplayerid);
			SendClientMessage(playerid, COLOR_YELLOW, string);
		}

		return 1;
	}

	if (strcmp(cmd, "/ban", true) == 0 && PlayerAccess(playerid) >= 1) {
		tmp = strtok(cmdtext, idx);

		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /ban [playerid] [reason]");
			return 1;
		}
		giveplayerid = strval(tmp);

		strmid(tmp, cmdtext, 5+strlen(tmp), strlen(cmdtext));
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /ban [playerid] [reason]");
			return 1;
		}

		if (IsPlayerConnected(giveplayerid)) BanPlayer(giveplayerid, playername[playerid], tmp);
		else {
			format(string, sizeof(string), "* %d is not an active player.", giveplayerid);
			SendClientMessage(playerid, COLOR_YELLOW, string);
		}

		return 1;
	}

	if (strcmp(cmd, "/mute", true) == 0 && PlayerAccess(playerid) >= 1) {
		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /mute [playerid] [duration] [reason]");
			return 1;
		}
		giveplayerid = strval(tmp);

		tmp2 = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /mute [playerid] [duration] [reason]");
			return 1;
		}
		moneys = strval(tmp2);

		strmid(tmp, cmdtext, 7+strlen(tmp)+strlen(tmp2), strlen(cmdtext));
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /mute [playerid] [duration] [reason]");
			return 1;
		}

        if (IsPlayerConnected(giveplayerid)) MutePlayer(giveplayerid, playername[playerid], tmp, moneys);
		else {
			format(string, sizeof(string), "* %d is not an active player.", giveplayerid);
			SendClientMessage(playerid, COLOR_YELLOW, string);
		}

		return 1;
	}

	if (strcmp(cmd, "/unmute", true) == 0 && PlayerAccess(playerid) >= 1) {
		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /unmute [playerid] [reason]");
			return 1;
		}
		giveplayerid = strval(tmp);

		strmid(tmp, cmdtext, 8+strlen(tmp), strlen(cmdtext));
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /unmute [playerid] [reason]");
			return 1;
		}

        if (IsPlayerConnected(giveplayerid)) MutePlayer(giveplayerid, playername[playerid], tmp, 0, true);
		else {
			format(string, sizeof(string), "* %d is not an active player.", giveplayerid);
			SendClientMessage(playerid, COLOR_YELLOW, string);
		}

		return 1;
	}

    if (strcmp(cmd, "/jail", true) == 0 && PlayerAccess(playerid) >= 1) {
		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /jail [playerid] [duration] [reason]");
			return 1;
		}
		giveplayerid = strval(tmp);

		tmp2 = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /jail [playerid] [duration] [reason]");
			return 1;
		}
		moneys = strval(tmp2);

		strmid(tmp, cmdtext, 7+strlen(tmp)+strlen(tmp2), strlen(cmdtext));
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /jail [playerid] [duration] [reason]");
			return 1;
		}

        if (IsPlayerConnected(giveplayerid)) JailPlayer(giveplayerid, playername[playerid], tmp, moneys);
		else {
			format(string, sizeof(string), "* %d is not an active player.", giveplayerid);
			SendClientMessage(playerid, COLOR_YELLOW, string);
		}

		return 1;
	}

	if (strcmp(cmd, "/unjail", true) == 0 && PlayerAccess(playerid) >= 1) {
		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /unjail [playerid] [reason]");
			return 1;
		}
		giveplayerid = strval(tmp);

		strmid(tmp, cmdtext, 8+strlen(tmp), strlen(cmdtext));
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /unjail [playerid] [reason]");
			return 1;
		}

        if (IsPlayerConnected(giveplayerid)) JailPlayer(giveplayerid, playername[playerid], tmp, 0, true);
		else {
			format(string, sizeof(string), "* %d is not an active player.", giveplayerid);
			SendClientMessage(playerid, COLOR_YELLOW, string);
		}

		return 1;
	}

	if (strcmp(cmd, "/freeze", true) == 0 && PlayerAccess(playerid) >= 1) {
		tmp = strtok(cmdtext, idx);

		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /freeze [playerid]");
			return 1;
		}
		giveplayerid = strval(tmp);

		if (IsPlayerConnected(giveplayerid)) {
			FreezePlayer(giveplayerid);
			format(string, sizeof(string), "--- %s (id: %d) freezes %s (id: %d).", playername[playerid],playerid,playername[giveplayerid],giveplayerid);
			WriteLog(string);
			format(string, sizeof(string), "* %s (id: %d) frozen.", playername[giveplayerid],giveplayerid);
			SendClientMessage(playerid, COLOR_YELLOW, string);
			format(string, sizeof(string), "* You frozen by %s (id: %d).", playername[playerid],playerid);
			SendClientMessage(giveplayerid, COLOR_YELLOW, string);
			GameTextForPlayer(giveplayerid, "~w~Frozen!", 3000, 5);
		}
		else {
			format(string, sizeof(string), "* %d is not an active player.", giveplayerid);
			SendClientMessage(playerid, COLOR_YELLOW, string);
		}

		return 1;
	}

	if (strcmp(cmd, "/unfreeze", true) == 0 && PlayerAccess(playerid) >= 1) {
		tmp = strtok(cmdtext, idx);

		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /unfreeze [playerid]");
			return 1;
		}
		giveplayerid = strval(tmp);

		if (IsPlayerConnected(giveplayerid)) {
			FreezePlayer(giveplayerid, true);
			format(string, sizeof(string), "--- %s (id: %d) unfreezes %s (id: %d).", playername[playerid],playerid,playername[giveplayerid],giveplayerid);
			WriteLog(string);
			format(string, sizeof(string), "* %s (id: %d) unfrozen.", playername[giveplayerid],giveplayerid);
			SendClientMessage(playerid, COLOR_YELLOW, string);
			format(string, sizeof(string), "* You unfrozen by %s (id: %d).", playername[playerid],playerid);
			SendClientMessage(giveplayerid, COLOR_YELLOW, string);
			GameTextForPlayer(giveplayerid, "~y~Unfrozen!", 3000, 5);
		}
		else {
			format(string, sizeof(string), "* %d is not an active player.", giveplayerid);
			SendClientMessage(playerid, COLOR_YELLOW, string);
		}

		return 1;
	}

	if (strcmp(cmd, "/heal", true) == 0 && PlayerAccess(playerid) >= 2) {
		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /heal [playerid]");
			return 1;
		}
		giveplayerid = strval(tmp);

		if (IsPlayerConnected(giveplayerid)) {
			SetPlayerHealth(giveplayerid, 100.0);
			god[playerid] = 0;
			format(string, sizeof(string), "--- %s (id: %d) healed %s (id: %d).", playername[playerid],playerid,playername[giveplayerid],giveplayerid);
			WriteLog(string);
			format(string, sizeof(string), "* %s (id: %d) healed.", playername[giveplayerid],giveplayerid);
			SendClientMessage(playerid, COLOR_YELLOW, string);
			format(string, sizeof(string), "* You healed by %s (id: %d).", playername[playerid],playerid);
			SendClientMessage(giveplayerid, COLOR_YELLOW, string);
			GameTextForPlayer(giveplayerid, "~g~Healed!", 3000, 5);
		}
		else {
			format(string, sizeof(string), "* %d is not an active player.", giveplayerid);
			SendClientMessage(playerid, COLOR_YELLOW, string);
		}

		return 1;
	}

	if (strcmp(cmd, "/god", true) == 0 && PlayerAccess(playerid) >= 3) {
		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /god [playerid]");
			return 1;
		}
		giveplayerid = strval(tmp);

		if (IsPlayerConnected(giveplayerid)) {
			god[giveplayerid] = 1;
			SetPlayerHealth(giveplayerid, 99999);
			format(string, sizeof(string), "--- %s (id: %d) invincibled %s (id: %d).", playername[playerid],playerid,playername[giveplayerid],giveplayerid);
			WriteLog(string);
			format(string, sizeof(string), "* %s (id: %d) is now invincible.", playername[giveplayerid],giveplayerid);
			SendClientMessage(playerid, COLOR_YELLOW, string);
			format(string, sizeof(string), "* %s (id: %d) made you invincible.", playername[playerid],playerid);
			SendClientMessage(giveplayerid, COLOR_YELLOW, string);
			GameTextForPlayer(giveplayerid, "~w~GODMODE!", 3000, 5);
		}
		else {
			format(string, sizeof(string), "* %d is not an active player.", giveplayerid);
			SendClientMessage(playerid, COLOR_YELLOW, string);
		}

		return 1;
	}

	if (strcmp(cmd, "/murder", true) == 0 && PlayerAccess(playerid) >= 3) {
		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /murder [playerid]");
			return 1;
		}
		giveplayerid = strval(tmp);

		if (IsPlayerConnected(giveplayerid)) {
			SetPlayerHealth(giveplayerid, 0.0);
			god[giveplayerid] = 0;

			format(string, sizeof(string), "--- %s (id: %d) murdered %s (id: %d).", playername[playerid],playerid,playername[giveplayerid],giveplayerid);
			WriteLog(string);
			format(string, sizeof(string), "* %s (id: %d) murdered %s (id: %d).", playername[playerid],playerid,playername[giveplayerid],giveplayerid);
			SendClientMessageToAll(COLOR_RED, string);
			GameTextForPlayer(giveplayerid, "~r~Oh dear you're dead!", 3000, 5);
		}
		else {
			format(string, sizeof(string), "* %d is not an active player.", giveplayerid);
			SendClientMessage(playerid, COLOR_YELLOW, string);
		}

		return 1;
	}

	if (strcmp(cmd, "/smurder", true) == 0 && PlayerAccess(playerid) >= 4) {
		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /smurder [playerid]");
			return 1;
		}
		giveplayerid = strval(tmp);

		if (IsPlayerConnected(giveplayerid)) {
			SetPlayerHealth(giveplayerid, 0.0);
			god[giveplayerid] = 0;

			format(string, sizeof(string), "--- %s (id: %d) silently murdered %s (id: %d).", playername[playerid],playerid,playername[giveplayerid],giveplayerid);
			WriteLog(string);
   			format(string, sizeof(string), "* Silent death for %s (id: %d)!", playername[giveplayerid],giveplayerid);
			SendClientMessage(playerid, COLOR_ORANGE, string);
		}
		else {
			format(string, sizeof(string), "* %d is not an active player.", giveplayerid);
			SendClientMessage(playerid, COLOR_YELLOW, string);
		}

		return 1;
	}

	if (strcmp(cmd, "/giveweapon", true) == 0 && PlayerAccess(playerid) >= 2) {
		tmp = strtok(cmdtext, idx);

		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /giveweapon [playerid] [weaponid] [ammo]");
			return 1;
		}
		giveplayerid = strval(tmp);

		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /giveweapon [playerid] [weaponid] [ammo]");
			return 1;
		}
 		weaponid = strval(tmp);

 		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /giveweapon [playerid] [weaponid] [ammo]");
			return 1;
		}
 		moneys = strval(tmp);

		if (IsPlayerConnected(giveplayerid)) {
			GivePlayerWeapon(giveplayerid, weaponid, moneys);

			format(string, sizeof(string), "--- %s (id: %d) gave weapon (id: %d) (ammo: %d) to %s (id: %d).", playername[playerid],playerid,weaponid,moneys,playername[giveplayerid],giveplayerid);
			WriteLog(string);
			format(string, sizeof(string), "* You given weapon (id: %d) (ammo: %d) to %s (id: %d).", weaponid,moneys,playername[giveplayerid],giveplayerid);
			SendClientMessage(playerid, COLOR_YELLOW, string);
			format(string, sizeof(string), "* You have granted weapon (id: %d) (ammo: %d) from %s (id: %d).", weaponid,moneys,playername[playerid],playerid);
			SendClientMessage(giveplayerid, COLOR_YELLOW, string);
		}
		else {
			format(string, sizeof(string), "* %d is not an active player.", giveplayerid);
			SendClientMessage(playerid, COLOR_YELLOW, string);
		}

		return 1;
	}

	if (strcmp(cmd, "/weaponids", true) == 0 && PlayerAccess(playerid) >= 2) {
		SendClientMessage(playerid, COLOR_GREY,"* 0. Unarmed *** 1. Brass Knuckles *** 2. Golf Club *** 3. Night Stick *** 4. Knife");
		SendClientMessage(playerid, COLOR_GREY,"* 5. Bat *** 6. Shovel *** 7. Pool Cue *** 8. Katana *** 9. Chainsaw");
		SendClientMessage(playerid, COLOR_GREY,"* 10. Dildo1 *** 11. Dildo2 *** 12. Dildo3 *** 13. Dildo4 *** 14. Flowers *** 15. Cane");
		SendClientMessage(playerid, COLOR_GREY,"* 16. Grenades *** 17. Tear Gas *** 18. Molotovs *** 22. Pistol *** 23. Silenced Pistol");
        SendClientMessage(playerid, COLOR_GREY,"* 24. Desert Eagle *** 25. Shotgun *** 26. Sawn-off *** 27. Combat Shotgun *** 28. Micro Uzi");
        SendClientMessage(playerid, COLOR_GREY,"* 29. MP5 *** 30. AK47 *** 31. M4 *** 32. Tec9 *** 33. Rifle *** 34. Sniper Rifle *** 35. RPG");
        SendClientMessage(playerid, COLOR_GREY,"* 36. Missile Launcher *** 37. Flame Thrower *** 38. Minigun *** 39. Satchel Charges");
        SendClientMessage(playerid, COLOR_GREY,"* 40. Detonator *** 41. Spray *** 42. Fire Extinguisher *** 43. Camera");
        SendClientMessage(playerid, COLOR_GREY,"* 44. Nightvision Goggles *** 45. Thermal Goggles *** 46. Parachute");

		return 1;
	}

	if (strcmp(cmd, "/arm", true) == 0 && PlayerAccess(playerid) >= 1) {
		tmp = strtok(cmdtext, idx);

		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /arm [playerid]");
			return 1;
		}
		giveplayerid = strval(tmp);

		if (IsPlayerConnected(giveplayerid)) {
			tmp = dini_Get(PlayerFile(playername[giveplayerid]), "weapon1");
			if (strval(tmp) != 0) GivePlayerWeapon(giveplayerid, strval(tmp), 1);
			tmp = dini_Get(PlayerFile(playername[giveplayerid]), "weapon2");
			tmp2 = dini_Get(PlayerFile(playername[giveplayerid]), "ammo2");
			if (strval(tmp) != 0 && strval(tmp2) != 0) GivePlayerWeapon(giveplayerid, strval(tmp), strval(tmp2));
			tmp = dini_Get(PlayerFile(playername[giveplayerid]), "weapon3");
			tmp2 = dini_Get(PlayerFile(playername[giveplayerid]), "ammo3");
			if (strval(tmp) != 0 && strval(tmp2) != 0) GivePlayerWeapon(giveplayerid, strval(tmp), strval(tmp2));
			tmp = dini_Get(PlayerFile(playername[giveplayerid]), "weapon4");
			tmp2 = dini_Get(PlayerFile(playername[giveplayerid]), "ammo4");
			if (strval(tmp) != 0 && strval(tmp2) != 0) GivePlayerWeapon(giveplayerid, strval(tmp), strval(tmp2));
			tmp = dini_Get(PlayerFile(playername[giveplayerid]), "weapon5");
			tmp2 = dini_Get(PlayerFile(playername[giveplayerid]), "ammo5");
			if (strval(tmp) != 0 && strval(tmp2) != 0) GivePlayerWeapon(giveplayerid, strval(tmp), strval(tmp2));
			tmp = dini_Get(PlayerFile(playername[giveplayerid]), "weapon6");
			tmp2 = dini_Get(PlayerFile(playername[giveplayerid]), "ammo6");
			if (strval(tmp) != 0 && strval(tmp2) != 0) GivePlayerWeapon(giveplayerid, strval(tmp), strval(tmp2));
			tmp = dini_Get(PlayerFile(playername[giveplayerid]), "weapon7");
			if (strval(tmp) != 0) GivePlayerWeapon(giveplayerid, strval(tmp), 1);
			tmp = dini_Get(PlayerFile(playername[giveplayerid]), "weapon8");
			tmp2 = dini_Get(PlayerFile(playername[giveplayerid]), "ammo8");
			if (strval(tmp) != 0 && strval(tmp2) != 0) GivePlayerWeapon(giveplayerid, strval(tmp), strval(tmp2));

			format(string, sizeof(string), "--- %s (id: %d) gave %s (id: %d) his spawn weapons.", playername[playerid],playerid,playername[giveplayerid],giveplayerid);
			WriteLog(string);
			format(string, sizeof(string), "* Gave spawn weapons to %s (id: %d).", playername[giveplayerid],giveplayerid);
			SendClientMessage(playerid, COLOR_YELLOW, string);
			format(string, sizeof(string), "* %s (id: %d) gave you your spawn weapons.", playername[playerid],playerid);
			SendClientMessage(giveplayerid, COLOR_RED, string);
		}
		else {
			format(string, sizeof(string), "* %d is not an active player.", giveplayerid);
			SendClientMessage(playerid, COLOR_YELLOW, string);
		}

		return 1;
	}

	if (strcmp(cmd, "/disarm", true) == 0 && PlayerAccess(playerid) >= 1) {
		tmp = strtok(cmdtext, idx);

		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /disarm [playerid]");
			return 1;
		}
		giveplayerid = strval(tmp);

		if (IsPlayerConnected(giveplayerid)) {
			ResetPlayerWeapons(giveplayerid);

			format(string, sizeof(string), "--- %s (id: %d) removed weapons from %s (id: %d).", playername[playerid],playerid,playername[giveplayerid],giveplayerid);
			WriteLog(string);
			format(string, sizeof(string), "* Removed all weapons from %s (id: %d).", playername[giveplayerid],giveplayerid);
			SendClientMessage(playerid, COLOR_YELLOW, string);
			format(string, sizeof(string), "* %s (id: %d) removed all your weapons.", playername[playerid],playerid);
			SendClientMessage(giveplayerid, COLOR_RED, string);
		}
		else {
			format(string, sizeof(string), "* %d is not an active player.", giveplayerid);
			SendClientMessage(playerid, COLOR_YELLOW, string);
		}

		return 1;
	}

	if (strcmp(cmd, "/setcolor", true) == 0 && PlayerAccess(playerid) >= 2) {
		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /setcolor [playerid] [color]");
			return 1;
		}
		giveplayerid = strval(tmp);

		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /setcolor [playerid] [color]");
			return 1;
		}

		if (IsPlayerConnected(giveplayerid)) {
		    SetPlayerColor(giveplayerid, HexToInt(tmp));
		    playercolor[giveplayerid] = HexToInt(tmp);

			format(string, sizeof(string), "--- %s (id: %d) sets %s (id: %d) color to %s.", playername[playerid],playerid,playername[giveplayerid],giveplayerid,tmp);
			WriteLog(string);
			format(string, sizeof(string), "* You set %s (id: %d) color to %s.", playername[giveplayerid],giveplayerid,tmp);
			SendClientMessage(playerid, COLOR_GREEN, string);
			format(string, sizeof(string), "* %s (id: %d) sets your color to %s.", playername[playerid],playerid,tmp);
			SendClientMessage(giveplayerid, COLOR_GREEN, string);
		}
		else {
			format(string, sizeof(string), "* %d is not an active player.", giveplayerid);
			SendClientMessage(playerid, COLOR_YELLOW, string);
		}

		return 1;
	}

	if (strcmp(cmd, "/setscore", true) == 0 && PlayerAccess(playerid) >= 2) {
		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /setcolor [playerid] [score]");
			return 1;
		}
		giveplayerid = strval(tmp);

		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /setcolor [playerid] [score]");
			return 1;
		}
		moneys = strval(tmp);

		if (IsPlayerConnected(giveplayerid)) {
		    SetPlayerScore(giveplayerid, moneys);

			format(string, sizeof(string), "--- %s (id: %d) sets %s (id: %d) score to %d.", playername[playerid],playerid,playername[giveplayerid],giveplayerid,moneys);
			WriteLog(string);
			format(string, sizeof(string), "* You set %s (id: %d) score to %d.", playername[giveplayerid],giveplayerid,moneys);
			SendClientMessage(playerid, COLOR_GREEN, string);
			format(string, sizeof(string), "* %s (id: %d) sets your score to %d.", playername[playerid],playerid,moneys);
			SendClientMessage(giveplayerid, COLOR_GREEN, string);
		}
		else {
			format(string, sizeof(string), "* %d is not an active player.", giveplayerid);
			SendClientMessage(playerid, COLOR_YELLOW, string);
		}

		return 1;
	}

	if (strcmp(cmd, "/tp", true) == 0 && PlayerAccess(playerid) >= 2) {
		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /tp [playerid] [locid]");
			return 1;
		}
		giveplayerid = strval(tmp);

		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /tp [playerid] [locid]");
			return 1;
		}
 		moneys = strval(tmp);

 		if (moneys < 0 || moneys >= MAX_LOCS) {
 			SendClientMessage(playerid, COLOR_YELLOW, "* Invalid location id.");
			return 1;
		}

		if (IsPlayerConnected(giveplayerid)) {
		    SetPlayerInterior(giveplayerid, 0);
			if (IsPlayerInAnyVehicle(giveplayerid)) SetVehiclePos(GetPlayerVehicleID(giveplayerid), TLocs[moneys][0],TLocs[moneys][1],TLocs[moneys][2]);
			else SetPlayerPos(giveplayerid, TLocs[moneys][0],TLocs[moneys][1],TLocs[moneys][2]);

			format(string, sizeof(string), "--- %s (id: %d) teleported %s (id: %d) to %s (id: %d).", playername[playerid],playerid,playername[giveplayerid],giveplayerid,TLocNames[moneys],moneys);
			WriteLog(string);
			format(string, sizeof(string), "* You teleported %s (id: %d) to %s (id: %d).", playername[giveplayerid],giveplayerid,TLocNames[moneys],moneys);
			SendClientMessage(playerid, COLOR_YELLOW, string);
			format(string, sizeof(string), "* You teleported to %s (id: %d) by %s (id: %d).", TLocNames[moneys],moneys,playername[playerid],playerid);
			SendClientMessage(giveplayerid, COLOR_YELLOW, string);
		}
		else {
			format(string, sizeof(string), "* %d is not an active player.", giveplayerid);
			SendClientMessage(playerid, COLOR_YELLOW, string);
		}

		return 1;
	}

	if (strcmp(cmd, "/tpto", true) == 0 && PlayerAccess(playerid) >= 2) {
		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /tpto [playerid] [playerid]");
			return 1;
		}
		giveplayerid = strval(tmp);

		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /tpto [playerid] [playerid]");
			return 1;
		}
 		moneys = strval(tmp);

		if (IsPlayerConnected(giveplayerid) && IsPlayerConnected(moneys)) {
			GetPlayerPos(moneys, x,y,z);
			SetPlayerInterior(giveplayerid, 0);
			if (IsPlayerInAnyVehicle(giveplayerid)) SetVehiclePos(GetPlayerVehicleID(giveplayerid), x,y,z);
			else SetPlayerPos(giveplayerid, x,y,z);

			format(string, sizeof(string), "--- %s (id: %d) teleported %s (id: %d) to %s (id: %d)", playername[playerid],playerid,playername[giveplayerid],giveplayerid,playername[moneys],moneys);
			WriteLog(string);
			format(string, sizeof(string), "* You teleported %s (id: %d) to %s (id: %d).", playername[giveplayerid],giveplayerid,playername[moneys],moneys);
			SendClientMessage(playerid, COLOR_YELLOW, string);
			format(string, sizeof(string), "* You teleported to %s (id: %d) by %s (id: %d).", playername[moneys],moneys,playername[playerid],playerid);
			SendClientMessage(giveplayerid, COLOR_YELLOW, string);
		}
		if (!IsPlayerConnected(giveplayerid)) {
			format(string, sizeof(string), "* %d is not an active player.", giveplayerid);
			SendClientMessage(playerid, COLOR_YELLOW, string);
		}
		if (!IsPlayerConnected(moneys)) {
			format(string, sizeof(string), "* %d is not an active player.", moneys);
			SendClientMessage(playerid, COLOR_YELLOW, string);
		}

		return 1;
	}

	if (strcmp(cmd, "/tpcarto", true) == 0 && PlayerAccess(playerid) >= 2) {
		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /tpcarto [playerid] [vehicleid]");
			return 1;
		}
		giveplayerid = strval(tmp);

		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /tpcarto [playerid] [vehicleid]");
			return 1;
		}
 		moneys = strval(tmp);

		if (IsPlayerConnected(giveplayerid)) {
			GetPlayerPos(giveplayerid, x,y,z);
			SetVehiclePos(moneys, x+3,y+3,z);

			format(string, sizeof(string), "--- %s (id: %d) teleported car %s (id: %d) to %s (id: %d).", playername[playerid],playerid,GetVehicleName(moneys),moneys,playername[giveplayerid],giveplayerid);
			WriteLog(string);
			format(string, sizeof(string), "* You teleported car %s (id: %d) to %s (id: %d).", GetVehicleName(moneys),moneys,playername[giveplayerid],giveplayerid);
			SendClientMessage(playerid, COLOR_YELLOW, string);
		}
		else {
			format(string, sizeof(string), "* %d is not an active player.", giveplayerid);
			SendClientMessage(playerid, COLOR_YELLOW, string);
		}

		return 1;
	}

	if (strcmp(cmd, "/tptocar", true) == 0 && PlayerAccess(playerid) >= 2) {
		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /tptocar [playerid] [vehicleid]");
			return 1;
		}
		giveplayerid = strval(tmp);

		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /tptocar [playerid] [vehicleid]");
			return 1;
		}
 		moneys = strval(tmp);

		if (IsPlayerConnected(giveplayerid)) {
		    GetVehiclePos(moneys, x,y,z);
			SetPlayerInterior(giveplayerid, 0);
			if (IsPlayerInAnyVehicle(giveplayerid)) SetVehiclePos(GetPlayerVehicleID(giveplayerid), x+3,y+3,z);
			else SetPlayerPos(giveplayerid, x+3,y+3,z);

			format(string, sizeof(string), "--- %s (id: %d) teleported %s (id: %d) to car %s (id: %d).", playername[playerid],playerid,playername[giveplayerid],giveplayerid,GetVehicleName(moneys),moneys);
			WriteLog(string);
			format(string, sizeof(string), "* You teleported %s (id: %d) to car %s (id: %d).", playername[giveplayerid],giveplayerid,GetVehicleName(moneys),moneys);
			SendClientMessage(playerid, COLOR_YELLOW, string);
			format(string, sizeof(string), "* You teleported by %s (id: %d) to car %s (id: %d).", playername[playerid],playerid,GetVehicleName(moneys),moneys);
			SendClientMessage(giveplayerid, COLOR_YELLOW, string);
		}
		else {
			format(string, sizeof(string), "* %d is not an active player.", giveplayerid);
			SendClientMessage(playerid, COLOR_YELLOW, string);
		}

		return 1;
	}

	if (strcmp(cmd, "/locs", true) == 0 && PlayerAccess(playerid) >= 2) {
	    SendClientMessage(playerid, COLOR_GREY, "* Available teleport locations:");
	    for (new i=0;i<MAX_LOCS;i++) {
	        format(string, sizeof(string), "* %d. %s", i,TLocNames[i]);

	        if (i+1 < MAX_LOCS) {
	            format(tmp, sizeof(tmp), " *** %d. %s", i+1,TLocNames[i+1]);
				strcat(string, tmp);
				i++;
			}
			if (i+1 < MAX_LOCS) {
	            format(tmp, sizeof(tmp), " *** %d. %s", i+1,TLocNames[i+1]);
				strcat(string, tmp);
				i++;
			}
	        SendClientMessage(playerid, COLOR_WHITE, string);
  	    }

		return 1;
	}

	if (strcmp(cmd, "/getcar", true) == 0 && PlayerAccess(playerid) >= 1) {
		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /getcar [playerid]");
			return 1;
		}
		giveplayerid = strval(tmp);

		if (IsPlayerConnected(giveplayerid)) {
			if (IsPlayerInAnyVehicle(playerid)) {
			    format(string, sizeof(string), "* %s (id: %d) in vehicle (id: %d).", playername[giveplayerid],giveplayerid,GetPlayerVehicleID(giveplayerid));
				SendClientMessage(playerid, COLOR_YELLOW, string);
			}
			else {
			    format(string, sizeof(string), "* %s (id: %d) is on foot.", playername[giveplayerid],giveplayerid);
				SendClientMessage(playerid, COLOR_YELLOW, string);
			}
		}
		else {
			format(string, sizeof(string), "* %d is not an active player.", giveplayerid);
			SendClientMessage(playerid, COLOR_YELLOW, string);
		}

		return 1;
	}

	if (strcmp(cmd, "/incar", true) == 0 && PlayerAccess(playerid) >= 2) {
		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /incar [playerid] [vehicleid] [seatid]");
			return 1;
		}
		giveplayerid = strval(tmp);

		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /incar [playerid] [vehicleid] [seatid]");
			return 1;
		}
 		moneys = strval(tmp);

 		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /incar [playerid] [vehicleid] [seatid]");
			return 1;
		}
 		weaponid = strval(tmp);

		if (IsPlayerConnected(giveplayerid)) {
			PutPlayerInVehicle(giveplayerid, moneys, weaponid);

			format(string, sizeof(string), "--- %s (id: %d) put %s (id: %d) into car %s (id: %d) at seat (id: %d).", playername[playerid],playerid,playername[giveplayerid],giveplayerid,GetVehicleName(moneys),moneys,weaponid);
			WriteLog(string);
			format(string, sizeof(string), "* You put %s (id: %d) into car %s (id: %d) at seat (id: %d).", playername[giveplayerid],giveplayerid,GetVehicleName(moneys),moneys,weaponid);
			SendClientMessage(playerid, COLOR_YELLOW, string);
			format(string, sizeof(string), "* %s (id: %d) put you into car %s (id: %d) at seat (id: %d).", playername[playerid],playerid,GetVehicleName(moneys),moneys,weaponid);
			SendClientMessage(giveplayerid, COLOR_YELLOW, string);
		}
		else {
			format(string, sizeof(string), "* %d is not an active player.", giveplayerid);
			SendClientMessage(playerid, COLOR_YELLOW, string);
		}

		return 1;
	}

	if (strcmp(cmd, "/fromcar", true) == 0 && PlayerAccess(playerid) >= 1) {
		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /fromcar [playerid]");
			return 1;
		}
		giveplayerid = strval(tmp);

		if (IsPlayerConnected(giveplayerid)) {
			if (IsPlayerInAnyVehicle(playerid)) {
				RemovePlayerFromVehicle(giveplayerid);

			    format(string, sizeof(string), "--- %s (id: %d) removed %s (id: %d) from car.", playername[playerid],playerid,playername[giveplayerid],giveplayerid);
				WriteLog(string);
				format(string, sizeof(string), "* You removed %s (id: %d) from car.", playername[giveplayerid],giveplayerid);
				SendClientMessage(playerid, COLOR_YELLOW, string);
				format(string, sizeof(string), "* %s (id: %d) removed you from car.", playername[playerid],playerid);
				SendClientMessage(giveplayerid, COLOR_YELLOW, string);
			}
			else {
			    format(string, sizeof(string), "* %s (id: %d) is on foot.", playername[giveplayerid],giveplayerid);
				SendClientMessage(playerid, COLOR_YELLOW, string);
			}
		}
		else {
			format(string, sizeof(string), "* %d is not an active player.", giveplayerid);
			SendClientMessage(playerid, COLOR_YELLOW, string);
		}

		return 1;
	}

	if (strcmp(cmd, "/setsettings", true) == 0 && PlayerAccess(playerid) >= 3) {
		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /setsettings [key] [value]");
			return 1;
		}

		strmid(tmp2, cmdtext, 14+strlen(tmp), strlen(cmdtext));
		if (!strlen(tmp2)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /setsettings [key] [value]");
			return 1;
		}

	    dini_Set(FILE_SETTINGS, tmp, tmp2);

	    format(string, sizeof(string), "--- %s (id: %d) changes server settings: %s=%s.", playername[playerid],playerid,tmp,tmp2);
		WriteLog(string);
		format(string, sizeof(string), "* You change server settings: %s=%s.", tmp,tmp2);
		SendClientMessage(playerid, COLOR_YELLOW, string);

		return 1;
	}

	if (strcmp(cmd, "/unsetsettings", true) == 0 && PlayerAccess(playerid) >= 3) {
		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /unsetsettings [key]");
			return 1;
		}

		dini_Unset(FILE_SETTINGS, tmp);

		format(string, sizeof(string), "* You unset server settings: %s.", tmp);
		SendClientMessage(playerid, COLOR_YELLOW, string);

		return 1;
	}

	if (strcmp(cmd, "/getsettings", true) == 0 && PlayerAccess(playerid) >= 3) {
		tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /getsettings [key]");
			return 1;
		}

	    tmp2 = dini_Get(FILE_SETTINGS, tmp);

		format(string, sizeof(string), "* Settings is: %s=%s.", tmp,tmp2);
		SendClientMessage(playerid, COLOR_YELLOW, string);

		return 1;
	}

	if (strcmp(cmd, "/loadsettings", true) == 0 && PlayerAccess(playerid) >= 3) {
  		format(string, sizeof(string), "--- %s (id: %d) requested to load settings file.", playername[playerid],playerid);
		WriteLog(string);
		LoadSettings();
   		SendClientMessage(playerid, COLOR_GREEN, "* Settings file loaded.");

	    return 1;
	}

	if (strcmp(cmd, "/ann", true) == 0 && PlayerAccess(playerid) >= 1) {
	    tmp = strtok(cmdtext, idx);
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /ann [time] [text]");
			return 1;
		}
		moneys = strval(tmp);

		strmid(tmp, cmdtext, 5+strlen(tmp), strlen(cmdtext));
		if (!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /ann [time] [text]");
			return 1;
		}

		format(string, sizeof(string), "--- %s (id: %d) announced:%s for a %d seconds.", playername[playerid],playerid,tmp,moneys);
		WriteLog(string);
		GameTextForAll(tmp, moneys*1000, 5);

		return 1;
	}

	if (strcmp(cmd, "/settime", true) == 0 && PlayerAccess(playerid) >= 2) {
		tmp = strtok(cmdtext, idx);
		moneys = strval(tmp);
		if (!strlen(tmp) || moneys < 0 || moneys > 23) {
			SendClientMessage(playerid, COLOR_WHITE, "* USAGE: /settime [0-23]");
			return 1;
		}

		worldTime = moneys;
		SetWorldTime(moneys);

		format(string, sizeof(string), "--- %s (id: %d) sets world time to %d:00.", playername[playerid],playerid,moneys);
		WriteLog(string);
		format(string, sizeof(string), "* World time set to %d:00 by %s (id: %d).", moneys,playername[playerid],playerid);
		SendClientMessageToAll(COLOR_LIGHTBLUE, string);

		return 1;
	}

	if (strcmp(cmd, "/resettotalstats", true) == 0 && PlayerAccess(playerid) >= 3) {
  		format(string, sizeof(string), "--- %s (id: %d) requested to reset total statistic.", playername[playerid],playerid);
		WriteLog(string);

		tmp = dini_Get(FILE_TOTALSTAT, "users");
		dini_Remove(FILE_TOTALSTAT);
		dini_Create(FILE_TOTALSTAT);
		dini_IntSet(FILE_TOTALSTAT, "users", strval(tmp));

   		SendClientMessage(playerid, COLOR_ORANGE, "* Resetting total statistic.");

	    return 1;
	}

	if (strcmp(cmd, "/gmx", true) == 0 && PlayerAccess(playerid) >= 4) {
		format(string, sizeof(string), "--- %s (id: %d) requested gamemode exit.", playername[playerid],playerid);
		WriteLog(string);
		GameTextForAll("~r~Freeroam gamemode exiting...", 5000, 5);

		OnGameModeExit();

	    return 1;
	}

		}
		else return 0;
	}

	return 0;
}

public OnPlayerEnterCheckpoint(playerid)
{
if(getCheckpointType(playerid)>= 0 && getCheckpointType(playerid)<= 15)
      {
	  if(IsPlayerInAnyVehicle(playerid))
	   {
       SendClientMessage(playerid,COLOR_WHITE,"Stay in the checkpoint to refill your car with petrol");
       FuelRefill(playerid);
	   }
	   else
	   {
	   SendClientMessage(playerid, COLOR_RED, "Your not in a vehicle");
	   }
	   return 1;
	new string[MAX_STRING];

	switch (getCheckpointType(playerid)) {
		case CP_BANK, CP_BANK2: {
		    if (enablebank) {
				SendClientMessage(playerid, COLOR_YELLOW, "* You are at an ATM. To store money use /bank, to withdraw");
				SendClientMessage(playerid, COLOR_YELLOW, "* money use /get, and /balance to see your balance.");
				SendClientMessage(playerid, COLOR_YELLOW, "* Also you can /transact money to another player's bank.");
				if (strlen(clan[playerid])) SendClientMessage(playerid, COLOR_YELLOW, "* More of it, you can use clan bank: /clanbank /clanget /clanbalance.");
			}
			else SendClientMessage(playerid, COLOR_RED, "* Bank are not allowed on this server.");
		}

		case CP_ROOF: {
            if (rooftop) {
				SendClientMessage(playerid, COLOR_YELLOW, "* You can hold the roof area to gain money.");
	            if (antirooftopkill) SendClientMessage(playerid, COLOR_RED, "* If you kill another player here you will be punished!");
			}
			else SendClientMessage(playerid, COLOR_RED, "* Roof holding are not allowed on this server.");
		}

		case CP_PORT: {
            if (portship) {
				SendClientMessage(playerid, COLOR_YELLOW, "* You can hold the cargo ship area to gain money.");
	            if (antiportshipkill) SendClientMessage(playerid, COLOR_RED, "* If you kill another player here you will be punished!");
			}
			else SendClientMessage(playerid, COLOR_RED, "* Cargo ship holding are not allowed on this server.");
		}

		case CP_PIRATE: {
            if (pirateship) {
				SendClientMessage(playerid, COLOR_YELLOW, "* You can hold the pirate ship area to gain money.");
	            if (antipirateshipkill) SendClientMessage(playerid, COLOR_RED, "* If you kill another player here you will be punished!");
			}
			else SendClientMessage(playerid, COLOR_RED, "* Pirate ship holding are not allowed on this server.");
		}

		case CP_AMMU, CP_AMMU2: {
		    if (spawnweapons) {
				SendClientMessage(playerid, COLOR_GREEN, "* You can purchase weapons here so that you have them every time you spawn.");
				SendClientMessage(playerid, COLOR_YELLOW, "* Type /bw(melee,pistol,shotgun,smg,rifle,rifle2,gift,spray) and /weaplist for a list of weapons.");
			}
			else SendClientMessage(playerid, COLOR_RED, "* Spawn weapons are not allowed on this server.");
		}

		case CP_SPRES: {
		    if (allowspawnchange) {
			    format(string, sizeof(string), "* You can change here you default spawn location for €%d.", spawnchangecost);
				SendClientMessage(playerid, COLOR_ORANGE, string);
				SendClientMessage(playerid, COLOR_YELLOW, "* Type /setspawn to change location and /spawnlist to see available locations.");
			}
			else SendClientMessage(playerid, COLOR_RED, "* Spawn change are not allowed on this server.");
		}

		case CP_AIR1: {
		    if (airports) {
		    	format(string, sizeof(string), "* You can fly to another airport from here for €%d.", airportticket);
				SendClientMessage(playerid, COLOR_WHITE, string);
				SendClientMessage(playerid, COLOR_YELLOW, "* Type /flytosf or /flytolv to fly to San Fierro or Las Venturas.");
			}
			else SendClientMessage(playerid, COLOR_RED, "* Airports are not allowed on this server.");
		}

		case CP_AIR2: {
		    if (airports) {
		    	format(string, sizeof(string), "* You can fly to another airport from here for €%d.", airportticket);
				SendClientMessage(playerid, COLOR_WHITE, string);
				SendClientMessage(playerid, COLOR_YELLOW, "* Type /flytols or /flytolv to fly to Los Santos or Las Venturas.");
			}
			else SendClientMessage(playerid, COLOR_RED, "* Airports are not allowed on this server.");
		}

		case CP_AIR3: {
		    if (airports) {
		    	format(string, sizeof(string), "* You can fly to another airport from here for €%d.", airportticket);
				SendClientMessage(playerid, COLOR_WHITE, string);
				SendClientMessage(playerid, COLOR_YELLOW, "* Type /flytols or /flytosf to fly to Los Santos or San Fierro.");
			}
			else SendClientMessage(playerid, COLOR_RED, "* Airports are not allowed on this server.");
		}
	}

	if (getCheckpointType(playerid) >= P_OFFSET) {
		format(string, sizeof(string), "* You can buy the %s for €%d with /buy.", propertyNames[playerCheckpoint[playerid]-P_OFFSET], propertyValues[playerCheckpoint[playerid]-P_OFFSET]);
		SendClientMessage(playerid, COLOR_YELLOW, string);
		format(string, sizeof(string), "* You will earn €%d regularly.", propertyEarnings[playerCheckpoint[playerid]-P_OFFSET]);
		SendClientMessage(playerid, COLOR_YELLOW, string);

		if (strlen(propertyowner[playerCheckpoint[playerid]-P_OFFSET])) {
		    if (strcmp(propertyowner[playerCheckpoint[playerid]-P_OFFSET], playername[playerid], true) == 0) SendClientMessage(playerid, COLOR_GREEN, "* You own this property and can /sell it.");
			else {
				format(string, sizeof(string), "* This property is currently owned by %s.", propertyowner[playerCheckpoint[playerid]-P_OFFSET]);
				SendClientMessage(playerid, COLOR_RED, string);
			}
		}
	}
}

public OnPlayerEnterCheckpoint(playerid)
{
	printf("OnPlayerEnterCheckpoint(%d)", playerid);
	//(The next 13 lines (the return should always be at the end) is Relevant code!)
     if(getCheckpointType(playerid)>= 0 && getCheckpointType(playerid)<= 15)
      {
	  if(IsPlayerInAnyVehicle(playerid))
	   {
       SendClientMessage(playerid,COLOR_WHITE,"Stay in the checkpoint to refill your car with petrol");
       FuelRefill(playerid);
	   }
	   else
	   {
	   SendClientMessage(playerid, COLOR_RED, "Your not in a vehicle");
	   }
	   return 1;
	  }
	  return 1;
}


public OnGameModeInit()
{
	SetGameModeText(GAMEMODETEXT);

	LoadSettings();

	ShowPlayerMarkers(1);
	ShowNameTags(1);

	AddPlayerClass2(255,2024.9572,-1561.3475,10.8203,225.9489,0,0,5,1,24,300); // piratenschip
	AddPlayerClass2(256,2024.9572,-1561.3475,10.8203,225.9489,0,0,5,1,24,300); // piratenschip
	AddPlayerClass2(257,2024.9572,-1561.3475,10.8203,225.9489,0,0,5,1,24,300); // piratenschip
	AddPlayerClass2(258,2024.9572,-1561.3475,10.8203,225.9489,0,0,5,1,24,300); // piratenschip
	AddPlayerClass2(259,2024.9572,-1561.3475,10.8203,225.9489,0,0,5,1,24,300); // piratenschip
	AddPlayerClass2(260,2024.9572,-1561.3475,10.8203,225.9489,0,0,5,1,24,300); // piratenschip
	AddPlayerClass2(261,2024.9572,-1561.3475,10.8203,225.9489,0,0,5,1,24,300); // piratenschip
	AddPlayerClass2(262,2024.9572,-1561.3475,10.8203,225.9489,0,0,5,1,24,300); // piratenschip
	AddPlayerClass2(263,2024.9572,-1561.3475,10.8203,225.9489,0,0,5,1,24,300); // piratenschip
	AddPlayerClass2(264,2024.9572,-1561.3475,10.8203,225.9489,0,0,5,1,24,300); // piratenschip
	AddPlayerClass2(274,2024.9572,-1561.3475,10.8203,225.9489,0,0,5,1,24,300); // piratenschip
	AddPlayerClass2(276,2024.9572,-1561.3475,10.8203,225.9489,0,0,5,1,24,300); // piratenschip
	AddPlayerClass2(1,2024.9572,-1561.3475,10.8203,225.9489,0,0,5,1,24,300); // piratenschip
	AddPlayerClass2(2,2024.9572,-1561.3475,10.8203,225.9489,0,0,5,1,24,300); // piratenschip
	AddPlayerClass2(290,2024.9572,-1561.3475,10.8203,225.9489,0,0,5,1,24,300); // piratenschip
	AddPlayerClass2(291,2024.9572,-1561.3475,10.8203,225.9489,0,0,5,1,24,300); // piratenschip
	AddPlayerClass2(292,2024.9572,-1561.3475,10.8203,225.9489,0,0,5,1,24,300); // piratenschip
	AddPlayerClass2(293,2024.9572,-1561.3475,10.8203,225.9489,0,0,5,1,24,300); // piratenschip
	AddPlayerClass2(294,2024.9572,-1561.3475,10.8203,225.9489,0,0,5,1,24,300); // piratenschip
	AddPlayerClass2(295,2024.9572,-1561.3475,10.8203,225.9489,0,0,5,1,24,300); // piratenschip
	AddPlayerClass2(296,2024.9572,-1561.3475,10.8203,225.9489,0,0,5,1,24,300); // piratenschip
	AddPlayerClass2(297,2024.9572,-1561.3475,10.8203,225.9489,0,0,5,1,24,300); // piratenschip
	AddPlayerClass2(298,2024.9572,-1561.3475,10.8203,225.9489,0,0,5,1,24,300); // piratenschip
	AddPlayerClass2(299,2024.9572,-1561.3475,10.8203,225.9489,0,0,5,1,24,300); // piratenschip
	AddPlayerClass2(277,2024.9572,-1561.3475,10.8203,225.9489,0,0,5,1,24,300); // piratenschip
	AddPlayerClass2(278,2024.9572,-1561.3475,10.8203,225.9489,0,0,5,1,24,300); // piratenschip
	AddPlayerClass2(288,2024.9572,-1561.3475,10.8203,225.9489,0,0,5,1,24,300); // piratenschip
	AddPlayerClass2(47,2024.9572,-1561.3475,10.8203,225.9489,0,0,5,1,24,300); // piratenschip
	AddPlayerClass2(48,2024.9572,-1561.3475,10.8203,225.9489,0,0,5,1,24,300); // piratenschip
	AddPlayerClass2(49,2024.9572,-1561.3475,10.8203,225.9489,0,0,5,1,24,300); // piratenschip
	AddPlayerClass2(50,2024.9572,-1561.3475,10.8203,225.9489,0,0,5,1,24,300); // piratenschip
	AddPlayerClass2(51,2024.9572,-1561.3475,10.8203,225.9489,0,0,5,1,24,300); // piratenschip
	AddPlayerClass2(52,2024.9572,-1561.3475,10.8203,225.9489,0,0,5,1,24,300); // piratenschip
	AddPlayerClass2(53,2024.9572,-1561.3475,10.8203,225.9489,0,0,5,1,24,300); // piratenschip
	AddPlayerClass2(54,2024.9572,-1561.3475,10.8203,225.9489,0,0,5,1,24,300); // piratenschip

	AddStaticVehicle(VehicleModels[1] = 520,308.916595,2050.874755,18.077295,270.407623,-1,-1); // AREA69: hydra, admin
	AddStaticVehicle(VehicleModels[2] = 520,309.414733,2014.734252,18.077312,270.407623,-1,-1); // AREA69: hydra2, admin
	AddStaticVehicle(VehicleModels[3] = 432,275.426055,2023.657714,18.077314,270.407623,-1,-1); // AREA69: tank, admin
	AddStaticVehicle(VehicleModels[4] = 432,276.186492,1989.556884,18.077262,270.407623,-1,-1); // AREA69: tank2, admin
	AddStaticVehicle(VehicleModels[5] = 432,277.646118,1930.885375,17.633720,290.701843,-1,-1); // AREA69: tank3, admin
	AddStaticVehicle(VehicleModels[6] = 432,287.510223,1919.879760,17.633928,310.330780,-1,-1); // AREA69: tank4, admin
	AddStaticVehicle(VehicleModels[7] = 425,310.683746,1989.564819,18.077268,270.407623,-1,-1); // AREA69: apache, admin
	AddStaticVehicle(VehicleModels[8] = 425,310.850677,1955.599975,18.077287,270.407623,-1,-1); // AREA69: apache2, admin
	AddStaticVehicle(VehicleModels[9] = 425,-1597.365234,273.877563,6.867180,42.643947,-1,-1); // SF: apache, admin
	AddStaticVehicle(VehicleModels[10] = 425,-1617.882324,295.408874,6.861485,218.112289,-1,-1); // SF: apache2, admin
	AddStaticVehicle(VehicleModels[11] = 520,-1458.541625,502.069915,18.270027,268.422821,-1,-1); // SF: hydra, admin
	AddStaticVehicle(VehicleModels[12] = 520,-1412.698486,517.065429,18.242687,177.492568,-1,-1); // SF: hydra2, admin
	AddStaticVehicle(VehicleModels[13] = 432,-1268.783569,442.748016,6.860581,2.061478,-1,-1); // SF: tank, admin
	AddStaticVehicle(VehicleModels[14] = 432,-1278.667846,442.949920,6.860582,2.061478,-1,-1); // SF: tank2, admin
	AddStaticVehicle(VehicleModels[15] = 430,-1441.388305,507.799285,-0.638619,89.273460,-1,-1); // SF: police boat, admin
	AddStaticVehicle(VehicleModels[16] = 430,-1449.357543,495.369750,-0.626648,89.273460,-1,-1); // SF: police boat2, admin
	AddStaticVehicle(VehicleModels[17] = 430,-2325.241455,2316.690917,-0.651492,179.618728,-1,-1); // TIERRA: police boat, admin
	AddStaticVehicle(VehicleModels[18] = 430,-2315.219970,2319.696044,-0.565795,179.618728,-1,-1); // TIERRA: police boat2, admin
	AddStaticVehicle(VehicleModels[19] = 470,280.484863,1944.309082,17.634271,1.202479,-1,-1); // AREA69: hummer
	AddStaticVehicle(VehicleModels[20] = 470,272.740478,1944.250122,17.633594,356.502410,-1,-1); // AREA69: hummer2
	AddStaticVehicle(VehicleModels[21] = 470,272.490112,1966.951293,17.633651,181.034149,-1,-1); // AREA69: hummer3
	AddStaticVehicle(VehicleModels[22] = 470,280.234008,1967.140380,17.633558,181.034149,-1,-1); // AREA69: hummer4
	AddStaticVehicle(VehicleModels[23] = 470,-1230.155517,460.143707,6.867185,87.073043,-1,-1); // SF: hummer
	AddStaticVehicle(VehicleModels[24] = 470,-1227.964233,450.607696,6.867186,87.073043,-1,-1); // SF: hummer2
	AddStaticVehicle(VehicleModels[25] = 510,-2337.604736,-1590.500854,483.397430,213.041320,-1,-1); // bike, chilliad top
	AddStaticVehicle(VehicleModels[26] = 510,-2341.358154,-1597.719604,483.423583,213.041320,-1,-1); // bike2, chilliad top
	AddStaticVehicle(VehicleModels[27] = 444,-2341.694091,-1651.592407,483.473785,275.708496,-1,-1); // monster, chilliad top
	AddStaticVehicle(VehicleModels[28] = 411,-2351.701904,-1640.483276,483.475738,275.708496,-1,-1); // infernus, chilliad top
	AddStaticVehicle(VehicleModels[29] = 510,-2381.939697,-2225.404785,33.289062,18.792921,-1,-1); // bike, chilliad
	AddStaticVehicle(VehicleModels[30] = 510,-2385.802734,-2226.824951,33.289062,18.792921,-1,-1); // bike2, chilliad
	AddStaticVehicle(VehicleModels[31] = 510,-2391.391357,-2228.884765,33.289062,18.792921,-1,-1); // bike3, chilliad
	AddStaticVehicle(VehicleModels[32] = 510,-2398.850830,-2228.842285,33.289062,342.759246,-1,-1); // bike4, chilliad
	AddStaticVehicle(VehicleModels[33] = 468,-2401.300537,-2178.669677,33.289062,273.303100,-1,-1); // sanchez, chilliad
	AddStaticVehicle(VehicleModels[34] = 468,-2401.379638,-2182.682128,33.289062,269.647521,-1,-1); // sanchez2, chilliad
	AddStaticVehicle(VehicleModels[35] = 487,365.392913,2536.256835,16.842477,357.792510,-1,-1); // maverick, abandoned airport
	AddStaticVehicle(VehicleModels[36] = 487,381.689910,2537.281250,16.722169,357.792510,-1,-1); // maverick2, abandoned airport
	AddStaticVehicle(VehicleModels[37] = 513,347.538909,2539.168701,17.209739,178.918121,-1,-1); // stuntplane, abandoned airport
	AddStaticVehicle(VehicleModels[38] = 476,291.091552,2540.102783,17.524913,182.985824,-1,-1); // rustler, abandoned airport
	AddStaticVehicle(VehicleModels[39] = 476,325.412109,2538.599609,17.236595,181.296646,-1,-1); // rustler2, abandoned airport
	AddStaticVehicle(VehicleModels[40] = 470,-18.387449,2329.593750,24.140625,89.704833,-1,-1); // hummer, snake farm
	AddStaticVehicle(VehicleModels[41] = 541,-33.938152,2343.136962,24.140625,140.266143,-1,-1); // bullet, snake farm
	AddStaticVehicle(VehicleModels[42] = 468,-668.513977,2306.300292,135.719741,88.474899,-1,-1); // sanchez, del diablo
	AddStaticVehicle(VehicleModels[43] = 460,-803.357360,2235.944335,42.269950,93.766456,-1,-1); // skimmer, del diablo
	AddStaticVehicle(VehicleModels[44] = 460,-931.568298,2645.142333,42.243167,138.150695,-1,-1); // skimmer, tierra-del diablo
	AddStaticVehicle(VehicleModels[45] = 446,-2218.782226,2426.467285,1.777505,326.969146,-1,-1); // squalo, tierra
	AddStaticVehicle(VehicleModels[46] = 484,-2238.385498,2406.583740,1.489661,314.385986,-1,-1); // marquis, tierra
	AddStaticVehicle(VehicleModels[47] = 446,-2230.117187,2447.936523,1.747819,221.681762,-1,-1); // squalo2, tierra
	AddStaticVehicle(VehicleModels[48] = 484,-2343.547851,2310.573242,-0.415950,175.924087,-1,-1); // marquis2, tierra
	AddStaticVehicle(VehicleModels[49] = 487,-2227.693115,2326.645751,7.546875,359.225799,-1,-1); // maverick, tierra
	AddStaticVehicle(VehicleModels[50] = 579,-2251.458984,2329.877685,4.812500,90.093292,-1,-1); // huntley, tierra
	AddStaticVehicle(VehicleModels[51] = 451,-2272.213867,2318.493652,4.820213,270.969299,-1,-1); // turismo, tierra
	AddStaticVehicle(VehicleModels[52] = 463,-2252.385498,2294.020751,4.812500,91.137596,-1,-1); // freeway, tierra
	AddStaticVehicle(VehicleModels[53] = 463,-290.850311,1754.323730,42.396678,90.132286,-1,-1); // freeway, regular tom
	AddStaticVehicle(VehicleModels[54] = 420,-290.708282,1770.091064,42.394744,90.132286,-1,-1); // taxi, regular tom
	AddStaticVehicle(VehicleModels[55] = 468,-301.772003,1758.203247,42.393470,90.132286,-1,-1); // sanchez, regular tom
	AddStaticVehicle(VehicleModels[56] = 451,-88.291526,1339.402465,10.372681,6.053716,-1,-1); // turismo, lil' probe inn
	AddStaticVehicle(VehicleModels[57] = 470,-81.920898,1339.818603,10.628737,184.133209,-1,-1); // hummer, lil' probe inn
	AddStaticVehicle(VehicleModels[58] = 484,2098.658935,-106.482780,-0.600182,209.200180,-1,-1); // marquis, palomino creek
	AddStaticVehicle(VehicleModels[59] = 484,2121.002197,-136.178909,-0.530208,69.767333,-1,-1); // marquis2, palomino creek
	AddStaticVehicle(VehicleModels[60] = 603,2414.740234,87.508499,26.472085,89.426437,-1,-1); // phoenix, palomino creek
	AddStaticVehicle(VehicleModels[61] = 522,2411.767578,95.978248,26.470821,89.426437,-1,-1); // nrg500, palomino creek
	AddStaticVehicle(VehicleModels[62] = 444,2379.833496,77.562286,27.134160,268.028076,-1,-1); // monster, palomino creek
	AddStaticVehicle(VehicleModels[63] = 405,-2190.164794,-2267.796875,30.625000,142.171356,-1,-1); // sentinel, angel pine
	AddStaticVehicle(VehicleModels[64] = 541,-2195.879882,-2260.998535,30.648677,137.471298,-1,-1); // bullet, angel pine
	AddStaticVehicle(VehicleModels[65] = 568,-369.329559,2231.882080,42.484375,103.231079,-1,-1); // bandito, ghost town
	AddStaticVehicle(VehicleModels[66] = 568,-363.992370,2213.629882,42.484375,103.753318,-1,-1); // bandito2, ghost town
	AddStaticVehicle(VehicleModels[67] = 568,-395.796936,2236.770507,42.429687,283.921661,-1,-1); // bandito3, ghost town
	AddStaticVehicle(VehicleModels[68] = 568,-382.607543,2259.619140,42.484375,5.911314,-1,-1); // bandito4, ghost town
	AddStaticVehicle(VehicleModels[69] = 568,-416.910400,2233.916992,42.429687,277.991668,-1,-1); // bandito5, ghost town
	AddStaticVehicle(VehicleModels[70] = 568,-398.347290,2261.123291,42.149196,208.721084,-1,-1); // bandito6, ghost town
	AddStaticVehicle(VehicleModels[71] = 567,2508.271728,-1671.876831,13.472004,343.261352,-1,-1); // savanna, groove
	AddStaticVehicle(VehicleModels[72] = 536,2498.190429,-1657.042114,13.470195,90.840141,-1,-1); // blade, groove
	AddStaticVehicle(VehicleModels[73] = 534,2492.743408,-1682.575561,13.429898,266.830688,-1,-1); // remington, groove
	AddStaticVehicle(VehicleModels[74] = 566,2470.245605,-1670.447265,13.409618,195.285583,-1,-1); // tahoma, groove
	AddStaticVehicle(VehicleModels[75] = 535,2496.384277,-1752.760375,13.556780,177.785034,-1,-1); // slamvan, groove
	AddStaticVehicle(VehicleModels[76] = 566,2732.877685,-1875.963134,9.687812,181.370925,-1,-1); // tahoma, stadium
	AddStaticVehicle(VehicleModels[77] = 494,2747.740234,-1851.318481,9.426599,181.370925,-1,-1); // hotring, stadium
	AddStaticVehicle(VehicleModels[78] = 494,2757.989257,-1874.187988,9.795801,359.972595,-1,-1); // hotring2, stadium
	AddStaticVehicle(VehicleModels[79] = 536,2792.855712,-1874.994628,9.943517,359.972595,-1,-1); // blade, stadium
	AddStaticVehicle(VehicleModels[80] = 567,2781.097900,-1838.706909,9.885111,218.449081,-1,-1); // savanna, stadium
	AddStaticVehicle(VehicleModels[81] = 534,2758.369384,-1847.635864,9.804676,204.348953,-1,-1); // remington, stadium
	AddStaticVehicle(VehicleModels[82] = 535,2741.670166,-1851.825439,9.535882,181.707702,-1,-1); // slamvan, stadium
	AddStaticVehicle(VehicleModels[83] = 444,2830.155273,-1677.368164,10.054565,132.096160,-1,-1); // monster, stadium
	AddStaticVehicle(VehicleModels[84] = 444,2801.831542,-1701.052612,10.005957,308.086700,-1,-1); // monster2, stadium
	AddStaticVehicle(VehicleModels[85] = 534,2784.493408,-1994.684570,13.475089,246.556671,-1,-1); // remington, lowride tuning
	AddStaticVehicle(VehicleModels[86] = 536,2684.948974,-2016.398803,13.643289,359.264953,-1,-1); // blade, lowride tuning
	AddStaticVehicle(VehicleModels[87] = 535,2684.692382,-1990.780639,13.646361,182.044448,-1,-1); // slamvan, lowride tuning
	AddStaticVehicle(VehicleModels[88] = 420,1711.650756,-2324.216064,13.551554,269.441864,-1,-1); // taxi, airport
	AddStaticVehicle(VehicleModels[89] = 420,1665.381835,-2324.713623,13.552021,269.441864,-1,-1); // taxi2, airport
	AddStaticVehicle(VehicleModels[90] = 437,1667.462158,-2313.786132,13.551368,89.795684,-1,-1); // coach, airport
	AddStaticVehicle(VehicleModels[91] = 411,1699.108276,-2313.940429,13.552107,89.795684,-1,-1); // infernus, airport
	AddStaticVehicle(VehicleModels[92] = 420,1568.040771,-1308.742675,17.233423,271.008514,-1,-1); // taxi, highest building
	AddStaticVehicle(VehicleModels[93] = 429,1641.256591,-1308.748046,15.925581,268.397399,-1,-1); // banshee, highest building
	AddStaticVehicle(VehicleModels[94] = 510,1872.655395,-1370.268554,13.143711,118.818565,-1,-1); // bike, skate park
	AddStaticVehicle(VehicleModels[95] = 510,1869.644287,-1370.213989,13.126401,118.818565,-1,-1); // bike2, skate park
	AddStaticVehicle(VehicleModels[96] = 510,1884.219726,-1405.479736,13.181259,118.818565,-1,-1); // bike3, skate park
	AddStaticVehicle(VehicleModels[97] = 510,1880.149658,-1409.227539,13.216518,118.818565,-1,-1); // bike4, skate park
	AddStaticVehicle(VehicleModels[98] = 510,1872.350708,-1442.108520,13.174273,118.818565,-1,-1); // bike5, skate park
	AddStaticVehicle(VehicleModels[99] = 510,1900.267333,-1437.164306,13.181340,118.818565,-1,-1); // bike6, skate park
	AddStaticVehicle(VehicleModels[100] = 481,1908.420166,-1411.914916,13.178990,118.818565,-1,-1); // bmx, skate park
	AddStaticVehicle(VehicleModels[101] = 481,1907.233032,-1407.245971,13.173214,118.818565,-1,-1); // bmx2, skate park
	AddStaticVehicle(VehicleModels[102] = 481,1921.558471,-1380.091064,13.178217,118.818565,-1,-1); // bmx3, skate park
	AddStaticVehicle(VehicleModels[103] = 481,1946.747192,-1363.604492,18.181610,118.818565,-1,-1); // bmx4,skate park
	AddStaticVehicle(VehicleModels[104] = 481,1946.913330,-1378.226318,18.186988,118.818565,-1,-1); // bmx5, skate park
	AddStaticVehicle(VehicleModels[105] = 481,1964.590820,-1414.604003,13.179961,118.818565,-1,-1); // bmx6, skate park
	AddStaticVehicle(VehicleModels[106] = 566,1940.884399,-1456.107910,12.991683,89.610244,-1,-1); // tahoma, skate park
	AddStaticVehicle(VehicleModels[107] = 429,1053.456665,-1034.502685,31.423595,89.610244,-1,-1); // banshee, transfender
	AddStaticVehicle(VehicleModels[108] = 405,1013.520507,-1012.537170,31.708337,181.000000,-1,-1); // sentinel, transfender
	AddStaticVehicle(VehicleModels[109] = 451,1001.348388,-940.755126,41.788661,279.178649,-1,-1); // turismo, near transfender
	AddStaticVehicle(VehicleModels[110] = 579,334.113189,-1809.571044,4.087253,359.601654,-1,-1); // huntley, near lighthouse
	AddStaticVehicle(VehicleModels[111] = 463,324.737152,-1788.546264,4.393498,359.601654,-1,-1); // freeway, near lighthouse
	AddStaticVehicle(VehicleModels[112] = 409,1247.725585,-783.471374,90.085632,359.601654,-1,-1); // limo, maddog's house
	AddStaticVehicle(VehicleModels[113] = 522,1254.935302,-804.836975,84.140625,185.744110,-1,-1); // nrg500, maddog's house
	AddStaticVehicle(VehicleModels[114] = 451,1249.247192,-805.835266,83.749488,185.744110,-1,-1); // turismo, maddog's house
	AddStaticVehicle(VehicleModels[115] = 510,1304.015258,-799.198974,83.748863,185.744110,-1,-1); // bike, maddog's house
	AddStaticVehicle(VehicleModels[116] = 510,1306.724731,-798.651855,83.749397,185.744110,-1,-1); // bike2, maddog's house
	AddStaticVehicle(VehicleModels[117] = 487,1291.400268,-788.189575,96.066223,178.911087,-1,-1); // maverick, maddog's house
	AddStaticVehicle(VehicleModels[118] = 487,1544.485107,-1353.309570,329.079376,88.565765,-1,-1); // maverick, highest building
	AddStaticVehicle(VehicleModels[119] = 592,2095.696044,-2453.770996,14.881821,115.721580,-1,-1); // andromada, airport
	AddStaticVehicle(VehicleModels[120] = 519,1889.981323,-2625.425292,14.468682,0.831613,-1,-1); // shamal, airport
	AddStaticVehicle(VehicleModels[121] = 519,1822.739990,-2625.407470,14.465737,0.831613,-1,-1); // shamal2, airport
	AddStaticVehicle(VehicleModels[122] = 487,1765.561645,-2285.195556,26.972785,179.955551,-1,-1); // maverick, airport roof
	AddStaticVehicle(VehicleModels[123] = 487,1893.925292,-2362.608154,13.724821,268.211975,-1,-1); // maverick, airport
	AddStaticVehicle(VehicleModels[124] = 487,1896.880737,-2393.708007,13.707169,268.211975,-1,-1); // maverick2, airport
	AddStaticVehicle(VehicleModels[125] = 511,1866.585327,-2452.850585,14.476523,177.344436,-1,-1); // beagle, airport
	AddStaticVehicle(VehicleModels[126] = 446,185.443557,-1959.474243,-0.649883,148.806472,-1,-1); // squalo, lighthouse
	AddStaticVehicle(VehicleModels[127] = 484,126.917098,-1946.867919,-0.374050,169.695602,-1,-1); // marquis, lighthouse
	AddStaticVehicle(VehicleModels[128] = 437,-1988.006835,122.636528,27.195436,0.646167,-1,-1); // coach, sf spawn
	AddStaticVehicle(VehicleModels[129] = 420,-1988.263916,137.390533,27.195379,0.646167,-1,-1); // taxi, sf spawn
	AddStaticVehicle(VehicleModels[130] = 437,-1988.393920,159.715362,27.195358,0.646167,-1,-1); // coach2, sf spawn
	AddStaticVehicle(VehicleModels[131] = 405,-2030.232299,170.149993,28.492267,88.682136,-1,-1); // sentinel, sf spawn
	AddStaticVehicle(VehicleModels[132] = 463,-1994.953613,153.707763,27.265382,180.292343,-1,-1); // freeway, sf spawn
	AddStaticVehicle(VehicleModels[133] = 559,-1958.224243,283.824645,35.125030,88.682136,-1,-1); // jester, wang cars
	AddStaticVehicle(VehicleModels[134] = 560,-1958.264160,257.458740,35.126186,88.682136,-1,-1); // sultan, wang cars
	AddStaticVehicle(VehicleModels[135] = 565,-1958.235595,269.055938,35.125049,88.682136,-1,-1); // flash, wang cars
	AddStaticVehicle(VehicleModels[136] = 558,-1946.239868,273.248382,35.124137,126.420036,-1,-1); // uranus, wang cars
	AddStaticVehicle(VehicleModels[137] = 562,-1945.723754,261.494903,35.125038,126.420036,-1,-1); // elegy, wang cars
	AddStaticVehicle(VehicleModels[138] = 561,-1957.823730,303.767089,35.125000,178.540130,-1,-1); // stratum, wang cars
	AddStaticVehicle(VehicleModels[139] = 411,-1946.863159,271.981842,40.708148,126.420036,-1,-1); // infernus, wang cars
	AddStaticVehicle(VehicleModels[140] = 429,-1951.868652,257.720153,40.710639,51.714515,-1,-1); // banshee, wang cars
	AddStaticVehicle(VehicleModels[141] = 541,-1954.807739,302.309509,40.706912,51.714515,-1,-1); // bullet, wang cars
	AddStaticVehicle(VehicleModels[142] = 415,-1928.437500,272.364959,40.707439,182.010284,-1,-1); // cheetah, wang cars
	AddStaticVehicle(VehicleModels[143] = 522,-1955.965820,270.604034,40.705856,51.714515,-1,-1); // nrg500, wang cars
	AddStaticVehicle(VehicleModels[144] = 562,-1991.749267,250.251296,34.830955,270.788909,-1,-1); // elegy2, wang cars outside
	AddStaticVehicle(VehicleModels[145] = 565,-1992.691284,242.951843,34.877296,304.733642,-1,-1); // flash2, wang cars outside
	AddStaticVehicle(VehicleModels[146] = 559,-1990.424316,256.568267,34.876731,268.699981,-1,-1); // jester2, wang cars outside
	AddStaticVehicle(VehicleModels[147] = 560,-1987.968872,273.272949,34.881099,268.699981,-1,-1); // sultan2, wang cars outside
	AddStaticVehicle(VehicleModels[148] = 558,-1989.861328,267.581817,34.832061,268.699981,-1,-1); // uranus2, wang cars outside
	AddStaticVehicle(VehicleModels[149] = 561,-1986.123535,305.845245,34.829902,267.529724,-1,-1); // stratum2, wang cars outside
	AddStaticVehicle(VehicleModels[150] = 409,-2413.227539,330.654052,34.628456,149.632156,-1,-1); // limo, unknown hotel
	AddStaticVehicle(VehicleModels[151] = 561,-2691.739257,204.967361,3.992252,356.956329,-1,-1); // stratum, wheel archangels
	AddStaticVehicle(VehicleModels[152] = 559,-2750.383789,208.198669,6.682340,134.487518,-1,-1); // jester, wheel archangels
	AddStaticVehicle(VehicleModels[153] = 562,-2749.878417,199.077453,6.742459,267.529724,-1,-1); // elegy, wheel archangels
	AddStaticVehicle(VehicleModels[154] = 565,-2711.269775,237.089630,3.907922,180.443511,-1,-1); // flash, wheel archangels
	AddStaticVehicle(VehicleModels[155] = 560,-2758.983398,242.062744,6.803471,180.443511,-1,-1); // sultan, wheel archangels
	AddStaticVehicle(VehicleModels[156] = 558,-2772.394775,243.307342,6.843787,240.499618,-1,-1); // uranus, wheel archangels
	AddStaticVehicle(VehicleModels[157] = 579,-1933.256225,723.479858,45.024925,267.529724,-1,-1); // huntley, zombotech
	AddStaticVehicle(VehicleModels[158] = 409,-1752.967163,954.754211,24.398433,88.868247,-1,-1); // limo, big hotel
	AddStaticVehicle(VehicleModels[159] = 405,-1757.347045,937.482238,24.398557,88.868247,-1,-1); // sentinel, big hotel
	AddStaticVehicle(VehicleModels[160] = 411,-1687.391479,983.300048,17.242288,267.529724,-1,-1); // infernus, big hotel carpark
	AddStaticVehicle(VehicleModels[161] = 562,-1703.040893,1007.599914,17.242303,267.529724,-1,-1); // elegy, big hotel carpark
	AddStaticVehicle(VehicleModels[162] = 565,-1687.456420,1032.682128,17.242244,267.529724,-1,-1); // flash, big hotel carpark
	AddStaticVehicle(VehicleModels[163] = 470,-1735.975585,1048.894897,17.242244,267.529724,-1,-1); // hummer, big hotel carpark
	AddStaticVehicle(VehicleModels[164] = 409,-2628.139160,1376.486206,6.782814,181.151153,-1,-1); // limo, jizzy's club
	AddStaticVehicle(VehicleModels[165] = 575,-2644.265380,1365.290039,6.817193,267.529724,-1,-1); // pimpride, kizzy's club
	AddStaticVehicle(VehicleModels[166] = 575,-2619.358398,1351.085571,6.812737,267.529724,-1,-1); // pimpride2, jizzy's club
	AddStaticVehicle(VehicleModels[167] = 429,-2645.491943,1343.717529,6.822276,267.529724,-1,-1); // banshee, jizzy's club
	AddStaticVehicle(VehicleModels[168] = 603,-2725.415283,-313.331359,6.817165,314.319030,-1,-1); // phoenix, golf club
	AddStaticVehicle(VehicleModels[169] = 494,-2136.442382,-413.836608,35.335937,331.550384,-1,-1); // hotring, stadium
	AddStaticVehicle(VehicleModels[170] = 494,-2151.104980,-417.272796,35.335937,329.461456,-1,-1); // hotring2, stadium
	AddStaticVehicle(VehicleModels[171] = 444,-2179.691894,-405.812286,35.335937,296.746673,-1,-1); // monster, stadium
	AddStaticVehicle(VehicleModels[172] = 444,-2197.463378,-401.155120,35.335937,289.435607,-1,-1); // monster2, stadium
	AddStaticVehicle(VehicleModels[173] = 437,-1411.227783,-306.985351,13.743740,43.097671,-1,-1); // coach, airport
	AddStaticVehicle(VehicleModels[174] = 420,-1435.206420,-286.098266,13.750932,57.720035,-1,-1); // taxi, airport
	AddStaticVehicle(VehicleModels[175] = 409,-1455.437744,-275.677398,13.747797,72.864616,-1,-1); // limo, airport
	AddStaticVehicle(VehicleModels[176] = 592,-1701.016235,-265.394104,15.341145,354.963867,-1,-1); // andromada, airport
	AddStaticVehicle(VehicleModels[177] = 511,-1209.361083,-145.649398,14.609336,134.553268,-1,-1); // beagle, airport
	AddStaticVehicle(VehicleModels[178] = 511,-1248.873413,-98.829742,14.610277,136.290405,-1,-1); // beagle2, airport
	AddStaticVehicle(VehicleModels[179] = 476,-1355.667846,-488.939208,14.721556,191.129409,-1,-1); // rustler, airport
	AddStaticVehicle(VehicleModels[180] = 476,-1374.470581,-499.131835,14.722295,220.415512,-1,-1); // rustler2, airport
	AddStaticVehicle(VehicleModels[181] = 519,-1441.641479,-527.045227,13.851557,206.369308,-1,-1); // shamal, airport
	AddStaticVehicle(VehicleModels[182] = 519,-1197.877197,-489.765319,15.505352,0.403875,-1,-1); // shamal2, airport
	AddStaticVehicle(VehicleModels[183] = 519,-1341.134155,-254.411453,15.055130,321.639617,-1,-1); // shamal3, airport
	AddStaticVehicle(VehicleModels[184] = 513,-1371.164794,-232.422882,15.361908,315.399383,-1,-1); // stuntplane, airport
	AddStaticVehicle(VehicleModels[185] = 487,-1223.380615,-11.450272,14.325543,43.178798,-1,-1); // maverick, airport
	AddStaticVehicle(VehicleModels[186] = 487,-1184.949829,24.777215,14.317563,43.407588,-1,-1); // maverick2, airport
	AddStaticVehicle(VehicleModels[187] = 497,-1679.678100,705.883666,30.778308,89.390419,-1,-1); // maverick, police
	AddStaticVehicle(VehicleModels[188] = 597,-1599.237548,651.741638,6.867180,0.948505,-1,-1); // copcarsf, police
	AddStaticVehicle(VehicleModels[189] = 597,-1612.036743,673.664123,6.867136,0.948505,-1,-1); // copcarsf2, police
	AddStaticVehicle(VehicleModels[190] = 523,-1600.240478,673.808593,6.867183,0.948505,-1,-1); // copbike, police
	AddStaticVehicle(VehicleModels[191] = 446,-1476.129394,689.226196,-0.485586,0.493452,-1,-1); // squalo, pier
	AddStaticVehicle(VehicleModels[192] = 484,-2669.801269,1517.935424,-0.275589,272.658996,-1,-1); // marquis, jizzy's club
	AddStaticVehicle(VehicleModels[193] = 405,2039.596069,989.328796,10.295320,180.314346,-1,-1); // sentinel, four dragons
	AddStaticVehicle(VehicleModels[194] = 409,2039.656982,1007.443542,10.296631,180.314346,-1,-1); // limo four dragons
	AddStaticVehicle(VehicleModels[195] = 579,2039.693115,1026.868652,10.296627,180.314346,-1,-1); // huntley, four dragons
	AddStaticVehicle(VehicleModels[196] = 429,2142.191650,1009.703125,10.447128,90.274818,-1,-1); // banshee, come-a-lot carpark
	AddStaticVehicle(VehicleModels[197] = 451,2162.398925,1019.110290,10.443939,90.274818,-1,-1); // turismo, come-a-lot carpark
	AddStaticVehicle(VehicleModels[198] = 522,2132.899658,1025.654663,10.444864,90.274818,-1,-1); // nrg500, come-a-lot carpark
	AddStaticVehicle(VehicleModels[199] = 415,2129.067626,987.905029,10.443796,179.550155,-1,-1); // cheetah, come-a-lot carpark
	AddStaticVehicle(VehicleModels[200] = 470,2151.482666,987.559631,10.444905,179.550155,-1,-1); // hummer, come-a-lot carpark
	AddStaticVehicle(VehicleModels[201] = 463,2179.584472,987.593444,10.443536,179.550155,-1,-1); // freeway, come-a-lot carpark
	AddStaticVehicle(VehicleModels[202] = 420,2173.489746,1120.728515,12.242666,331.703735,-1,-1); // taxi, come-a-lot
	AddStaticVehicle(VehicleModels[203] = 541,2164.366210,1125.695800,12.215419,151.872085,-1,-1); // bullet, come-a-lot
	AddStaticVehicle(VehicleModels[204] = 420,1688.895874,1297.567382,10.443607,1.285193,-1,-1); // taxi, airport carpark
	AddStaticVehicle(VehicleModels[205] = 468,1682.776611,1286.805664,10.445253,1.285193,-1,-1); // sanchez, airport carpark
	AddStaticVehicle(VehicleModels[206] = 603,1641.291137,1293.195678,10.444892,90.274818,-1,-1); // phoenix, airport carpark
	AddStaticVehicle(VehicleModels[207] = 463,1641.098388,1308.132812,10.443476,90.274818,-1,-1); // freeway, airport carpark
	AddStaticVehicle(VehicleModels[208] = 579,1657.025024,1315.002075,10.444993,1.285193,-1,-1); // huntley, airport carpark
	AddStaticVehicle(VehicleModels[209] = 411,1682.506225,1306.266601,10.445305,1.285193,-1,-1); // infernus, airport carpark
	AddStaticVehicle(VehicleModels[210] = 405,1704.984619,1316.355712,10.445046,1.285193,-1,-1); // sentinel, airport carpark
	AddStaticVehicle(VehicleModels[211] = 437,1717.394897,1421.525634,10.188687,1.285193,-1,-1); // coach, airport
	AddStaticVehicle(VehicleModels[212] = 437,1722.739379,1362.037475,10.190397,195.031494,-1,-1); // coach2, airport
	AddStaticVehicle(VehicleModels[213] = 420,1709.749511,1453.892089,10.371703,163.697830,-1,-1); // taxi, airport
	AddStaticVehicle(VehicleModels[214] = 409,1706.409423,1437.938598,10.294870,178.320190,-1,-1); // limo, airport
	AddStaticVehicle(VehicleModels[215] = 603,1719.755615,1486.248535,10.365176,161.608932,-1,-1); // phoenix, airport
	AddStaticVehicle(VehicleModels[216] = 541,1315.929687,1279.149169,10.591428,0.966100,-1,-1); // bullet, airport
	AddStaticVehicle(VehicleModels[217] = 522,2151.231933,1658.718627,10.581486,308.354736,-1,-1); // nrg500, caligula
	AddStaticVehicle(VehicleModels[218] = 409,2161.649658,1676.672241,10.372273,350.132904,-1,-1); // limo, caligula
	AddStaticVehicle(VehicleModels[219] = 541,2157.348632,1696.161987,10.374128,51.755706,-1,-1); // bullet, caligula
	AddStaticVehicle(VehicleModels[220] = 603,1946.088867,1783.537231,12.337818,0.055199,-1,-1); // phoenix, visage carpark
	AddStaticVehicle(VehicleModels[221] = 468,1942.595092,1783.688598,18.529111,0.055199,-1,-1); // sanchez, visage carpark
	AddStaticVehicle(VehicleModels[222] = 409,2032.808715,1915.900146,12.086155,182.312469,-1,-1); // limo, visage
	AddStaticVehicle(VehicleModels[223] = 522,2171.291748,1981.390625,10.652043,85.700424,-1,-1); // nrg500, 24/7
	AddStaticVehicle(VehicleModels[224] = 468,2185.672363,1983.296752,10.651988,85.700424,-1,-1); // sanchez, 24/7
	AddStaticVehicle(VehicleModels[225] = 429,2155.706542,1990.145874,10.503583,4.708708,-1,-1); // banshee, 24/7
	AddStaticVehicle(VehicleModels[226] = 575,2103.307373,2062.841308,10.652011,268.143188,-1,-1); // pimpride, sexshop
	AddStaticVehicle(VehicleModels[227] = 598,2273.390136,2459.636230,10.652032,4.708708,-1,-1); // copcarlv, police
	AddStaticVehicle(VehicleModels[228] = 598,2256.091064,2477.603027,10.651975,4.708708,-1,-1); // copcarlv, police
	AddStaticVehicle(VehicleModels[229] = 523,2290.771484,2459.315917,10.651760,4.708708,-1,-1); // copbike, police
	AddStaticVehicle(VehicleModels[230] = 603,2084.917968,2468.940917,10.651998,4.708708,-1,-1); // phoenix, lv spawn
	AddStaticVehicle(VehicleModels[231] = 451,2057.200683,2479.755615,10.651876,4.708708,-1,-1); // turismo, lv spawn
	AddStaticVehicle(VehicleModels[232] = 468,2050.339599,2468.993164,10.651879,4.708708,-1,-1); // sanchez, lv spawn
	AddStaticVehicle(VehicleModels[233] = 405,2095.780517,2410.660888,10.652066,269.524353,-1,-1); // sentinel, lv spawn
	AddStaticVehicle(VehicleModels[234] = 409,2111.381591,2408.747802,10.652055,358.302978,-1,-1); // limo, lv spawn
	AddStaticVehicle(VehicleModels[235] = 522,2078.251220,2398.913574,19.253601,270.046600,-1,-1); // nrg500, lv spawn
	AddStaticVehicle(VehicleModels[236] = 579,2069.044677,2398.864990,43.056270,270.046569,-1,-1); // huntley, lv spawn
	AddStaticVehicle(VehicleModels[237] = 429,2069.182128,2419.445556,49.355075,268.479919,-1,-1); // banshee, lv spawn
	AddStaticVehicle(VehicleModels[238] = 487,2093.283203,2414.930175,74.735298,89.032043,-1,-1); // maverick, lv spawn
	AddStaticVehicle(VehicleModels[239] = 487,1640.225708,1561.949707,10.992483,356.736297,-1,-1); // maverick, airport
	AddStaticVehicle(VehicleModels[240] = 487,1615.734252,1617.077026,10.990406,180.038040,-1,-1); // maverick2, airport
	AddStaticVehicle(VehicleModels[241] = 487,1677.961791,1628.124511,10.443318,180.038040,-1,-1); // maverick3, airport
	AddStaticVehicle(VehicleModels[242] = 476,1282.985839,1324.883300,8.504996,275.047485,-1,-1); // rustler, airport
	AddStaticVehicle(VehicleModels[243] = 476,1283.512573,1361.314941,8.498472,270.669982,-1,-1); // rustler2, airport
	AddStaticVehicle(VehicleModels[244] = 513,1285.779418,1386.591796,11.372993,272.105621,-1,-1); // stuntplane, airport
	AddStaticVehicle(VehicleModels[245] = 513,1285.326171,1400.409423,11.371158,243.254516,-1,-1); // stuntplane2, airport
	AddStaticVehicle(VehicleModels[246] = 592,1476.931762,1812.065551,12.008720,179.320114,-1,-1); // andromada, airport
	AddStaticVehicle(VehicleModels[247] = 519,1357.259399,1756.228149,11.740676,270.028991,-1,-1); // shamal, airport
	AddStaticVehicle(VehicleModels[248] = 519,1357.539916,1714.223388,11.738903,270.225067,-1,-1); // shamal2, airport
	AddStaticVehicle(VehicleModels[249] = 446,2305.199218,536.081298,-0.628143,179.834197,-1,-1); // squalo, pier
	AddStaticVehicle(VehicleModels[250] = 446,2283.724609,535.046875,-0.555356,179.479019,-1,-1); // squalo2, pier
	AddStaticVehicle(VehicleModels[251] = 484,2342.670654,532.404663,-0.534494,175.337890,-1,-1); // marquis, pier
	AddStaticVehicle(VehicleModels[252] = 484,2376.879394,532.082946,-0.636098,175.347259,-1,-1); // marquis2, pier
	AddStaticVehicle(VehicleModels[253] = 460,1628.562622,572.349182,1.498929,89.113136,-1,-1); // skimmer, pier2
	AddStaticVehicle(VehicleModels[254] = 460,2294.283935,519.330322,1.507890,89.005836,-1,-1); // skimmer, pier

	for (new i=1;i<=18;i++) {
	    admincar[i] = 1;
	    carBuyAble[i] = 0;
	}
	for (new i=19;i<=MAX_VEHICLES;i++) {
	    admincar[i] = 0;
	    carBuyAble[i] = 1;
	}
			for(new c=0;c<MAX_CARS;c++)
	 {
	 Petrol[c] = AMOUNT;
	 }

	for (new i=1;i<=MAX_VEHICLES;i++) {
	    if (strcmp(GetVehicleName(i), "Phoenix")) carValues[i] = 700000;
		if (strcmp(GetVehicleName(i), "Sentinel")) carValues[i] = 700000;
		if (strcmp(GetVehicleName(i), "Stretch")) carValues[i] = 800000;
		if (strcmp(GetVehicleName(i), "Infernus")) carValues[i] = 1000000;
		if (strcmp(GetVehicleName(i), "Cheetah")) carValues[i] = 900000;
		if (strcmp(GetVehicleName(i), "Taxi")) carValues[i] = 600000;
		if (strcmp(GetVehicleName(i), "Hunter")) carValues[i] = 1000000;
		if (strcmp(GetVehicleName(i), "Banshee")) carValues[i] = 900000;
		if (strcmp(GetVehicleName(i), "Predator")) carValues[i] = 3000000;
		if (strcmp(GetVehicleName(i), "Rhino")) carValues[i] = 5000000;
		if (strcmp(GetVehicleName(i), "Coach")) carValues[i] = 700000;
		if (strcmp(GetVehicleName(i), "Monster")) carValues[i] = 1000000;
		if (strcmp(GetVehicleName(i), "Squalo")) carValues[i] = 1000000;
		if (strcmp(GetVehicleName(i), "Turismo")) carValues[i] = 1000000;
		if (strcmp(GetVehicleName(i), "Skimmer")) carValues[i] = 700000;
		if (strcmp(GetVehicleName(i), "Freeway")) carValues[i] = 700000;
		if (strcmp(GetVehicleName(i), "Sanchez")) carValues[i] = 600000;
		if (strcmp(GetVehicleName(i), "Patriot")) carValues[i] = 800000;
		if (strcmp(GetVehicleName(i), "Rustler")) carValues[i] = 1000000;
		if (strcmp(GetVehicleName(i), "BMX")) carValues[i] = 400000;
		if (strcmp(GetVehicleName(i), "Marquis")) carValues[i] = 800000;
		if (strcmp(GetVehicleName(i), "Maverick")) carValues[i] = 800000;
		if (strcmp(GetVehicleName(i), "Huntley")) carValues[i] = 700000;
		if (strcmp(GetVehicleName(i), "Hotring")) carValues[i] = 800000;
		if (strcmp(GetVehicleName(i), "Mountain Bike")) carValues[i] = 500000;
		if (strcmp(GetVehicleName(i), "Beagle")) carValues[i] = 800000;
		if (strcmp(GetVehicleName(i), "Stuntplane")) carValues[i] = 800000;
		if (strcmp(GetVehicleName(i), "Shamal")) carValues[i] = 800000;
		if (strcmp(GetVehicleName(i), "Hydra")) carValues[i] = 5000000;
		if (strcmp(GetVehicleName(i), "NRG500")) carValues[i] = 800000;
		if (strcmp(GetVehicleName(i), "HPV1000")) carValues[i] = 500000;
		if (strcmp(GetVehicleName(i), "Remington")) carValues[i] = 700000;
		if (strcmp(GetVehicleName(i), "Slamvan")) carValues[i] = 600000;
		if (strcmp(GetVehicleName(i), "Blade")) carValues[i] = 600000;
		if (strcmp(GetVehicleName(i), "Bullet")) carValues[i] = 1000000;
		if (strcmp(GetVehicleName(i), "Uranus")) carValues[i] = 600000;
		if (strcmp(GetVehicleName(i), "Jester")) carValues[i] = 700000;
		if (strcmp(GetVehicleName(i), "Sultan")) carValues[i] = 700000;
		if (strcmp(GetVehicleName(i), "Stratum")) carValues[i] = 700000;
		if (strcmp(GetVehicleName(i), "Elegy")) carValues[i] = 800000;
		if (strcmp(GetVehicleName(i), "Flash")) carValues[i] = 700000;
		if (strcmp(GetVehicleName(i), "Tahoma")) carValues[i] = 600000;
		if (strcmp(GetVehicleName(i), "Savanna")) carValues[i] = 600000;
		if (strcmp(GetVehicleName(i), "Bandito")) carValues[i] = 700000;
		if (strcmp(GetVehicleName(i), "Broadway")) carValues[i] = 600000;
		if (strcmp(GetVehicleName(i), "Andromada")) carValues[i] = 800000;
		if (strcmp(GetVehicleName(i), "LSPD Police Car")) carValues[i] = 600000;
		if (strcmp(GetVehicleName(i), "SFPD Police Car")) carValues[i] = 600000;
		if (strcmp(GetVehicleName(i), "LVPD Police Car")) carValues[i] = 600000;
	}

	LoadVehicleOwners();
	LoadPropertyOwners();

    AddStaticPickup(370,15,213.8414,1874.6965,17.6406);		// jetpack area69
    AddStaticPickup(370,15,2318.2705,-1637.8952,18.5078);	// jetpack ls
    AddStaticPickup(370,15,-2209.4707,294.1174,35.1172);	// jetpack sf
    AddStaticPickup(370,15,2096.8235,1158.7990,24.5625);	// jetpack lv


    SetTimer("CheckFuel", TIME, 1);
    SetTimer("checkpointUpdate", 1100, 1)
	SetTimer("checkpointUpdate", 1000, 1);
	SetTimer("TimeUpdate", 100000, 1);
	SetTimer("HoldAreasScoreUpdate", 2000, 1);
	SetTimer("GlobalPlayerSave", 1800000, 1);
	SetTimer("PropertyScoreUpdate", 150000, 1);
	SetTimer("VehicleStatusUpdate", 10000, 1);
	SetTimer("MoneyScan", 1000, 1);
	SetTimer("MoneyCheck", 1000, 1);
	SetTimer("HealthScan", 1000, 1);
	SetTimer("ColorCheck", 1000, 1);
	SetTimer("IdleCheck", 60000, 1);
	SetTimer("SpectatorUpdate", 100, 1);
	SetTimer("ReportTimeoutUpdate", 60000, 1);
	SetTimer("VoteKickBanUpdate", 1000, 1);

	return 1;
}

public OnGameModeExit()
{
    WriteLog("");
    WriteLog("");
	WriteLog("*** Freeroam gamemode exiting...");

	GlobalPlayerSave();

 	GameModeExit();
}

 //                 THIS IS THE FUEL SCRIPT!!!!!!!!!!!!!!!!!!!!!!!!!

//------------------------------------------------------------------------------*/
//Includes
#include <a_samp>
#include <core>
#include <file>
#include <float>

//------------------------------------------------------------------------------
//Defines

//Colours (Relevant code!)
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_RED 0xAA3333AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_WHITE 0xFFFFFFAA

//Vehicles
#define GROVE_VEHICLE_ONE 567,2509.9382,-1667.7566,13.3356,5.5935,86,86
#define GROVE_VEHICLE_TWO 567,2506.9841,-1677.4115,13.3292,325.3867,86,86
#define GROVE_VEHICLE_THREE 567,2501.5195,-1655.5464,13.3189,69.0657,86,86
#define GROVE_VEHICLE_FOUR 567,2484.7808,-1653.7554,13.2652,86.9443,86,86
#define GROVE_VEHICLE_FIVE 567,2468.3486,-1653.4425,13.2643,91.4342,86,86

//Gang characters
#define CLASS_GROVE_ONE 105,2491.4653,-1670.0663,13.3359,57.6821,0,0,0,0,0,0

//Player class selection
#define CLASS_OUTSIDE_INT playerid,0
#define CLASS_PLAYER_POS playerid,508.7362,-87.4335,998.9609
#define CLASS_CAM_POS playerid,508.7362,-83.4335,998.9609
#define CLASS_CAM_LOOKAT playerid,508.7362,-87.4335,998.9609
#define CLASS_FACE_ANGLE playerid,0.0

//Fuel (Relevant code!)
#define TIME 3000
#define AMOUNT 100

//Gas stations (Relevant code!)
#define CP_STATION1   0
#define CP_STATION2   1
#define CP_STATION3   2
#define CP_STATION4   3
#define CP_STATION5   4
#define CP_STATION6   5
#define CP_STATION7   6
#define CP_STATION8   7
#define CP_STATION9   8
#define CP_STATION10  9
#define CP_STATION11  10
#define CP_STATION12  11
#define CP_STATION13  12
#define CP_STATION14  13
#define CP_STATION15  14
#define CP_STATION16  15


#define MAX_POINTS 16 //(Relevant code!)

//------------------------------------------------------------------------------
//Variables

//Checkpoint vars (Relevant code!)
new playerCheckpoint[MAX_PLAYERS];

//Fuel vars (Relevant code!)
#define MAX_CARS 46 //make sure to change this to your vehicle count
new Petrol[MAX_CARS];

//Coordinate check var (Relevant code!)
new Float:checkCoords[MAX_POINTS][4] = {
{2098.1316,901.7380,2137.7456,963.0146},
{2617.5967,1062.8710,2656.6526,1142.5109},
{501.7475,1626.7821,653.2095,1774.1093},
{-1351.2833,2638.8943,-1265.1661,2738.6450},
{-2450.3767,949.5080,-2400.8530,1069.8329},
{-1715.5112,349.5567,-1658.8451,458.3686},
{-2265.3027,-2586.3762,-2219.1868,-2558.2539},
{-1657.4102,-2763.3518,-1501.5303,-2666.7454},
{1903.7450,-1795.7990,1955.5667,-1759.5187},
{-135.2077,-1199.8291,-43.7008,-1134.7999},
{1336.7378,454.7961,1430.0760,483.9776},
{648.2494,-592.9003,670.9278,-540.8264},
{-1494.2593,1854.1290,-1449.4076,1885.2032},
{2097.0452,2708.1218,2172.7161,2762.7495},
{2187.6587,2462.8057,2215.5042,2495.0332},
{1577.7729,2182.5112,1616.5842,2242.3628}
};

//Checkpoint check var (Relevant code!)
new Float:checkpoints[MAX_POINTS][4] = {
{2109.2126,917.5845,10.8203,5.0},
{2640.1831,1103.9224,10.8203,5.0},
{611.8934,1694.7921,6.7193,5.0},
{-1327.5398,2682.9771,49.7896,5.0},
{-2413.7427,975.9317,45.0031,5.0},
{-1672.3597,414.2950,6.8866,5.0},
{-2244.1365,-2560.6294,31.6276,5.0},
{-1603.0166,-2709.3589,48.2419,5.0},
{1939.3275,-1767.6813,13.2787,5.0},
{-94.7651,-1174.8079,1.9979,5.0},
{1381.6699,462.6467,19.8540,5.0},
{657.8167,-559.6507,16.0630,5.0},
{-1478.2916,1862.8318,32.3617,5.0},
{2147.3054,2744.9377,10.5263,5.0},
{2204.9602,2480.3494,10.5278,5.0},
{1590.9493,2202.2637,10.5247,5.0}
};

//Checkpoint type var (Relevant code!)
new checkpointType[MAX_POINTS] = {
CP_STATION1,
CP_STATION2,
CP_STATION3,
CP_STATION4,
CP_STATION5,
CP_STATION6,
CP_STATION7,
CP_STATION8,
CP_STATION9,
CP_STATION10,
CP_STATION11,
CP_STATION12,
CP_STATION13,
CP_STATION14,
CP_STATION15,
CP_STATION16
};

//------------------------------------------------------------------------------

main()
{
	print("\n----------------------------------");
	print("  Petrol system example");
	print("----------------------------------\n");
}

//------------------------------------------------------------------------------
//Pre made Functions (Relevant code!)
//------------------------------------------------------------------------------

//Check point type function
public getCheckpointType(playerID) {
return checkpointType[playerCheckpoint[playerID]];
}

//IsPlayerInArea function
public isPlayerInArea(playerID, Float:data[4])
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerID, X, Y, Z);
if(X >= data[0] && X <= data[2] && Y >= data[1] && Y <= data[3])
{
return 1;
}
return 0;
}

//Update the players checkpoint function
public checkpointUpdate()
{
for(new i=0; i<MAX_PLAYERS; i++)
{
 if(IsPlayerConnected(i))
  {
  for(new j=0; j < MAX_POINTS; j++)
  {
  if(isPlayerInArea(i, checkCoords[j]))
   {
   if(playerCheckpoint[i]!=j)
    {
    DisablePlayerCheckpoint(i);
    SetPlayerCheckpoint(i, checkpoints[j][0],checkpoints[j][1],checkpoints[j][2],checkpoints[j][3]);
    playerCheckpoint[i] = j;
    }
   }
   else
   {
   if(playerCheckpoint[i]==j)
    {
    DisablePlayerCheckpoint(i);
    playerCheckpoint[i] = 999;
    }
   }
  }
  }
}
}

//Fuel check function
public CheckFuel(playerid)
{
new Ptmess[32];
for(new i=0;i<MAX_PLAYERS;i++)
 {
  if(IsPlayerConnected(i) == 1 && IsPlayerInAnyVehicle(i) == 1)
   {
   if(GetPlayerState(i) == 2)
    {
	 new Vi;
     Vi = GetPlayerVehicleID(i);
     Petrol[Vi]--;

     if(Petrol[Vi] >= 1)
      {
      format(Ptmess, sizeof(Ptmess), "~w~Petrol ->~r~%d", Petrol[Vi]);
      GameTextForPlayer(i, Ptmess, 500, 4);
      }
      else
      {
      RemovePlayerFromVehicle(i);
      SendClientMessage(i, COLOR_RED, "Your vehicle ran out of petrol");
      if(Petrol[Vi] < 0)
	   {
	   Petrol[Vi] = 0;
	   }
      }

      if(Petrol[i] >= 51)
       {
       format(Ptmess, sizeof(Ptmess), "~w~Petrol ->%d", Petrol[Vi]);
       GameTextForPlayer(i, Ptmess, 500, 4);
       }

	 }
    }
 }
}

//Refill fuel function
public FuelRefill(playerid)
{
new VID;
VID = GetPlayerVehicleID(playerid);
if(Petrol[VID] < AMOUNT)
 {
 new FillUp;
 FillUp = AMOUNT - Petrol[VID];
 if(GetPlayerMoney(playerid) >= FillUp)
  {
  Petrol[VID] +=FillUp;
  new mess[64];
  format(mess, sizeof(mess), "You put %d units of petrol in your vehicle", FillUp);
  SendClientMessage(playerid, COLOR_WHITE, mess);
  GivePlayerMoney(playerid, -FillUp);
  return 1;
  }
  else
  {
  SendClientMessage(playerid, COLOR_RED, "You don't have enough money for petrol");
  return 1;
  }
 }
 else
 {
 SendClientMessage(playerid, COLOR_RED, "Your vehicle is allready full with petrol");
 return 1;
 }
return 1;
}


//--------------------------------------------/-----------------/-----------/-----------------/----------------/-----------------/

public OnGameModeInit()
{
	print("GameModeInit()");
	SetGameModeText("Petrol example");
	SetTeamCount(1);

	//T(he next 6 lines are all Relevant code!)
	for(new c=0;c<MAX_CARS;c++)
	 {
	 Petrol[c] = AMOUNT;
	 }
    SetTimer("CheckFuel", TIME, 1);
    SetTimer("checkpointUpdate", 1100, 1);


	//Player classes
	AddPlayerClass(CLASS_GROVE_ONE);

    //Gang vehicles
    AddStaticVehicle(GROVE_VEHICLE_ONE);//lowrider1
    AddStaticVehicle(GROVE_VEHICLE_TWO);//lowrider2
    AddStaticVehicle(GROVE_VEHICLE_THREE);//lowrider3
    AddStaticVehicle(GROVE_VEHICLE_FOUR); //lowrider4
    AddStaticVehicle(GROVE_VEHICLE_FIVE); //lowrider5

    //Misc Vehicles Las santos locations
    AddStaticVehicle(589,2136.1211,-1651.0815,14.9510,324.4133,-1,-1); // club6
    AddStaticVehicle(589,1489.6364,-693.0746,94.6185,185.5987,-1,-1); // club7
    AddStaticVehicle(589,2249.4851,-1914.0034,13.4153,357.4539,-1,-1); // club8
    AddStaticVehicle(444,1936.6619,-1586.9689,13.4371,179.1279,-1,-1); // monster9
    AddStaticVehicle(444,2027.6989,-1914.2828,13.4228,89.8865,-1,-1); // monster10
    AddStaticVehicle(444,421.1412,-1258.9008,51.4480,19.8654,-1,-1); // monster11
    AddStaticVehicle(405,1656.0883,-1610.2926,13.4223,89.4965,-1,-1); // sentine12
    AddStaticVehicle(405,1527.9250,-886.2360,60.9891,43.7325,-1,-1); // sentine14
    AddStaticVehicle(405,2117.7485,-1936.7488,13.2499,90.8089,-1,-1); // sentine15
    AddStaticVehicle(477,1303.5253,-1375.2601,13.5158,179.5273,-1,-1); // zr16
    AddStaticVehicle(477,1278.8453,-1612.8145,13.4213,271.9472,-1,-1); // zr17
    AddStaticVehicle(477,250.0311,-1357.8811,52.9766,284.4956,-1,-1); // zr18
    AddStaticVehicle(567,690.6378,-1570.5453,14.1074,176.1493,-1,-1); // savvana19
    AddStaticVehicle(567,790.0293,-846.9287,60.5091,190.5139,-1,-1); // savanna20
    AddStaticVehicle(567,1394.1243,-1165.7751,23.6963,327.4511,-1,-1); // savvana21
    AddStaticVehicle(567,1839.8982,-1794.5846,13.4195,90.0995,-1,-1); // savanna22
    AddStaticVehicle(494,1803.6584,-1929.4093,13.2542,88.8896,-1,-1); // hotring23
    AddStaticVehicle(494,641.3570,-1697.4269,14.6740,356.5284,-1,-1); // hotring24
    AddStaticVehicle(494,1232.0461,-1020.6094,32.4723,185.6800,-1,-1); // hotring25
    AddStaticVehicle(522,1029.5294,-804.0273,101.7208,22.5352,-1,-1); // nrg26
    AddStaticVehicle(522,1500.8883,-1857.1902,13.4124,178.8091,-1,-1); // nrg27
    AddStaticVehicle(522,2208.5986,-2470.5813,13.4137,226.8823,-1,-1); // nrg28
    AddStaticVehicle(400,1556.3589,-1790.4838,13.4148,268.3885,-1,-1); // landstalker29
    AddStaticVehicle(400,1064.7070,-883.8376,43.1544,91.2749,-1,-1); // landstalker30
    AddStaticVehicle(400,343.9824,-1809.5557,4.3824,0.4509,-1,-1); // landstalker31
    AddStaticVehicle(562,1006.3436,-1366.7042,13.1946,271.0531,-1,-1); // elegy32
    AddStaticVehicle(562,1538.9202,-2211.8491,13.4243,357.1581,-1,-1); // elegy33
    AddStaticVehicle(562,1050.2206,-919.6104,42.5693,1.6929,-1,-1); // elegy34
    AddStaticVehicle(420,1245.1863,-804.7828,84.0068,180.3975,-1,-1); // taxi35
    AddStaticVehicle(420,271.4445,-1738.9562,3.9146,81.3775,-1,-1); // taxi36
    AddStaticVehicle(567,2784.5745,-2416.5857,13.5014,89.0455,-1,-1); // taxi37
    AddStaticVehicle(560,738.5615,-1342.1711,13.3924,267.8369,-1,-1); // sultan38
    AddStaticVehicle(560,1388.6182,-2330.9243,13.4168,178.5179,-1,-1); // sultan39
    AddStaticVehicle(560,1404.1552,-2262.2144,13.4179,0.7490,-1,-1); // sultan40
    AddStaticVehicle(506,1279.9481,-1815.2346,13.2534,89.4371,-1,-1); // super41
    AddStaticVehicle(506,2611.7380,-2365.3013,13.4806,94.1447,-1,-1); // super42
    AddStaticVehicle(506,2485.5547,-2484.9663,13.5213,226.4864,-1,-1); // super43
    AddStaticVehicle(559,169.4632,-1342.7853,69.4868,179.1245,-1,-1); // jester44
    AddStaticVehicle(559,1025.2788,-2018.3020,12.9572,85.0192,-1,-1); // jester45
    AddStaticVehicle(559,1195.8131,-2328.5315,14.4882,32.3352,-1,-1); // jester46
    AddStaticVehicle(481,2491.4653,-1670.0663,13.3359,57.6821,-1,-1); //bmx
	//(47 in LS so far)

    printf("Gamemode intiated successfully");
	return 1;

}

//------------------------------------------------------------------------------

public OnPlayerRequestClass(playerid, classid)
{
	printf("OnPlayerRequestClass(%d, %d)", playerid, classid);
	return 1;
}


//-----------------------------------------------------------------------------
public OnVehicleSpawn(vehicleid)
{
	printf("OnVehicleSpawn(%d)", vehicleid);
	return 1;
}

//------------------------------------------------------------------------------

public OnVehicleDeath(vehicleid, killerid)
{
	printf("OnVehicleDeath(%d, %d)", vehicleid, killerid);
	return 1;
}
//------------------------------------------------------------------------------

public OnPlayerInfoChange(playerid)
{
	printf("OnPlayerInfoChange(%d)");
	return 1;
}

//------------------------------------------------------------------------------

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
	printf("OnPlayerEnterVehicle(%d, %d, %d)", playerid, vehicleid, ispassenger);
	return 1;
}

//------------------------------------------------------------------------------

public OnPlayerExitVehicle(playerid, vehicleid)
{
	printf("OnPlayerExitVehicle(%d, %d)", playerid, vehicleid);
	return 1;
}

//------------------------------------------------------------------------------

public OnPlayerStateChange(playerid, newstate, oldstate)
{
	printf("OnPlayerStateChange(%d, %d, %d)", playerid, newstate, oldstate);
	return 1;
}

//------------------------------------------------------------------------------
public OnPlayerLeaveCheckpoint(playerid)
{
	printf("OnPlayerLeaveCheckpoint(%d)", playerid);
    return 1;
}

//------------------------------------------------------------------------------