All pastes #332921 Raw Edit

sexgod

public cpp v1 · immutable
#332921 ·published 2007-01-30 14:17 UTC
rendered paste body
#include <a_samp>
#include <core>
#include <float>
#include <file>
#include <dini>

#define GAMEMODETEXT "RPG / Real Life / Freeroam / V1.7"

#define FILE_SETTINGS "freeroam/config/settings.ini"
#define FILE_TOTALSTAT "freeroam/save/totalstat.ini"
#define FILE_PROPS "freeroam/save/props.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 2000000000

#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA

#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_RED 0xAA3333AA

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[100] = {
0xFF8C13FF,0xC715FFFF,0x20B2AAFF,0xDC143CFF,0x6495EDFF,0xf0e68cFF,0x778899FF,0xFF1493FF,0xF4A460FF,0xEE82EEFF,0xFFD720FF,
0x8b4513FF,0x4949A0FF,0x148b8bFF,0x14ff7fFF,0x556b2fFF,0x0FD9FAFF,0x10DC29FF,0x534081FF,0x0495CDFF,0xEF6CE8FF,0xBD34DAFF,
0x247C1BFF,0x0C8E5DFF,0x635B03FF,0xCB7ED3FF,0x65ADEBFF,0x5C1ACCFF,0xF2F853FF,0x11F891FF,0x7B39AAFF,0x53EB10FF,0x54137DFF,
0x275222FF,0xF09F5BFF,0x3D0A4FFF,0x22F767FF,0xD63034FF,0x9A6980FF,0xDFB935FF,0x3793FAFF,0x90239DFF,0xE9AB2FFF,0xAF2FF3FF,
0x057F94FF,0xB98519FF,0x388EEAFF,0x028151FF,0xA55043FF,0x0DE018FF,0x93AB1CFF,0x95BAF0FF,0x369976FF,0x18F71FFF,0x4B8987FF,
0x491B9EFF,0x829DC7FF,0xBCE635FF,0xCEA6DFFF,0x20D4ADFF,0x2D74FDFF,0x3C1C0DFF,0x12D6D4FF,0x48C000FF,0x2A51E2FF,0xE3AC12FF,
0xFC42A8FF,0x2FC827FF,0x1A30BFFF,0xB740C2FF,0x42ACF5FF,0x2FD9DEFF,0xFAFB71FF,0x05D1CDFF,0xC471BDFF,0x94436EFF,0xC1F7ECFF,
0xCE79EEFF,0xBD1EF2FF,0x93B7E4FF,0x3214AAFF,0x184D3BFF,0xAE4B99FF,0x7E49D7FF,0x4C436EFF,0xFA24CCFF,0xCE76BEFF,0xA04E0AFF,
0x9F945CFF,0xDCDE3DFF,0x10C9C5FF,0x70524DFF,0x0BE472FF,0x8A2CD7FF,0x6152C2FF,0xCF72A9FF,0xE59338FF,0xEEDC2DFF,0xD8C762FF,
0x3FE65CFF
};
#define LSMAX_SPAWNS 8

new Float:LSSpawnPos[LSMAX_SPAWNS][4] = {
{1686.26,1432.86,10.50,60.40}, // LS SPAWN1
{1686.26,1432.86,10.50,60.40}, // LS SPAWN2
{1686.26,1432.86,10.50,60.40}, // LS SPAWN3
{1686.26,1432.86,10.50,60.40}, // LS SPAWN4
{1686.26,1432.86,10.50,60.40}, // LS SPAWN5
{1686.26,1432.86,10.50,60.40}, // LS SPAWN6
{1686.26,1432.86,10.50,60.40}, // LS SPAWN7
{1686.26,1432.86,10.50,60.40} // LS SPAWN8
};

#define SFMAX_SPAWNS 7

new Float:SFSpawnPos[SFMAX_SPAWNS][4] = {
{1686.26,1432.86,10.50,60.40}, // SF SPAWN1
{1686.26,1432.86,10.50,60.40}, // SF SPAWN2
{1686.26,1432.86,10.50,60.40}, // SF SPAWN3
{1686.26,1432.86,10.50,60.40}, // SF SPAWN4
{1686.26,1432.86,10.50,60.40}, // SF SPAWN5
{1686.26,1432.86,10.50,60.40}, // SF SPAWN6
{1686.26,1432.86,10.50,60.40} // SF SPAWN7
};

#define LVMAX_SPAWNS 6

new Float:LVSpawnPos[LVMAX_SPAWNS][4] = {
{1686.26,1432.86,10.50,60.40}, // LV SPAWN1
{1686.26,1432.86,10.50,60.40}, // LV SPAWN2
{1686.26,1432.86,10.50,60.40}, // LV SPAWN3
{1686.26,1432.86,10.50,60.40}, // LV SPAWN4
{1686.26,1432.86,10.50,60.40}, // LV SPAWN5
{1686.26,1432.86,10.50,60.40} // LV SPAWN6

};

#define MAX_SPAWNS 3

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




#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 CP_BANK 16
#define CP_BANK2 	17
#define CP_PIRATE  18
#define CP_ROOF  19
#define CP_PORT  20
#define CP_AMMU    21
#define CP_AMMU2  22
#define CP_SPRES  23
#define CP_AIR1  24
#define CP_AIR2    25
#define CP_AIR3  26
#define CP_DRAGON  27
#define CP_SEXSHOP  28
#define CP_BAR      29
#define CP_CALIGULA 30
#define CP_ZIP      31
#define CP_BINCO    32
#define CP_TATOO    33
#define CP_BOTIQUE  34
#define CP_JIZZY    35
#define CP_PIZZA    36
#define CP_VICTIM   37
#define CP_STRIPCLUB 38
#define CP_WANGCARS 39
#define CP_EMERALD	40
#define CP_VISAGE   41
#define CP_SUBURBAN 42
#define CP_PROLAPS  43
#define CP_BURGER   44
#define CP_CLUCKIN 45
#define CP_CLUB  46
#define CP_DS		47
#define CP_ZOMBO	48

#define MAX_POINTS 50 //33cp
#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    27

new Float:checkCoords[MAX_POINTS][6] = {
{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},
{-22.2549,-55.6575,1003.5469},
{-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
};

new Float:checkpoints[MAX_POINTS][6] = { //3
{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},
{1280.0591,-1500.0657,10.0469,2.0},
{-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}
};

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,
	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
};

#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] = {
	3000000,
	1000000,
	800000,
	4000000,
	600000,
	600000,
	400000,
	800000,
	3000000,
	600000,
	600000,
	1200000,
	800000,
	2400000,
	4000000,
	600000,
	600000,
	800000,
	400000,
	2000000,
	5000000,
	1600000
};

new propertyEarnings[MAX_PROPERTIES] = {
	7500,
	2500,
	2000,
	10000,
	1500,
	1500,
	1000,
	2000,
	7500,
	1500,
	1500,
	3000,
	2000,
	6000,
	10000,
	1500,
	1500,
	2000,
	1000,
	5000,
	12500,
	4000
};

#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"
};
new Filling[MAX_PLAYERS]; //petrol
#define GasMax 100
#define RunOutTime 4000
#define RefuelWait 5000
enum SavePlayerPosEnum
{
    Float:LastX,
    Float:LastY,
    Float:LastZ
}
new SavePlayerPos[MAX_PLAYERS][SavePlayerPosEnum];

#define CAR_AMOUNT 255//Change to Your Vehicle Amount
new Gas[CAR_AMOUNT];
new Police[MAX_PLAYERS];
new times[24] = {1,2,3,4,5,6,7,8,9,10,11,12};
new curtime = 0;
//new heat[12] = {100,200,300,400,500,600,700,800,900,1000,1100,1200};
//new curheat = 0;
main()
{
		print("\n----------------------------------------------------------");
		print("   Running Freeroam by Jayne, Thanks to everyone who help!");
		print("----------------------------------------------------------\n");
		
		WriteLog("");
		WriteLog("*** Freeroam gamemode loaded!");
		WriteLog("");
	
		worldTime = 12;
}

UnlockPoliceCars(playerid)
{
    SetVehicleParamsForPlayer(1, playerid, 0, 1);
    SetVehicleParamsForPlayer(2, playerid, 0, 1);
    SetVehicleParamsForPlayer(3, playerid, 0, 1);
    SetVehicleParamsForPlayer(4, playerid, 0, 1);
    SetVehicleParamsForPlayer(5, playerid, 0, 1);}
    
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;
  }


public Fill()
 {
  for(new i=0;i<MAX_PLAYERS;i++)
   {
	if(Filling[i] == 1)
	  {
        Gas[GetPlayerVehicleID(i)]++;
      }
   }
  return 1;
 }

public IsPlayerInCube(playerid, xmin, ymin, zmin, xmax, ymax, zmax)
{
   new Float:x, Float:y, Float:z;
   GetPlayerPos(playerid, x, y, z);
   if(x > xmin && y > ymin && z > zmin && x < xmax && y < ymax && z < zmax)return 1;
   return 0;
}
public PayDay(playerid, cash)
{
	GameTextForPlayer(playerid, "Payday, you earn $1500", 700, 1);

   	GivePlayerMoney(playerid, 1500);
}



public CheckGas()
 {
  new string[256];
  for(new i=0;i<MAX_PLAYERS;i++)
   {
      if(IsPlayerConnected(i) && GetPlayerState(i) == PLAYER_STATE_DRIVER)
       {
          if(Gas[GetPlayerVehicleID(i)] >= 1)
	        {
	        new Float:x,Float:y,Float:z;
            new Float:distance,value;
            GetPlayerPos(i, x, y, z);
            //curtime++;
            if(curtime == 24) curtime = 0;
            SetWorldTime(times[curtime]);
            distance = floatsqroot(floatpower(floatabs(floatsub(x,SavePlayerPos[i][LastX])),2)+floatpower(floatabs(floatsub(y,SavePlayerPos[i][LastY])),2)+floatpower(floatabs(floatsub(z,SavePlayerPos[i][LastZ])),2));
            value = floatround(distance * 5600);
            //val = floatround(distance * 3600);
            /*
			if(val >= 90) {
			curheat++;
			}
			if(val < 90) {
			curheat--;
			}*/
            format(string, sizeof(string), "~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~w~MpH:~h~~y~%d ~n~~w~Fuel:~h~~y~%d~b~% ~w~Time:~y~%i:00",floatround(value/3600),Gas[GetPlayerVehicleID(i)],curtime);
	        GameTextForPlayer(i,string,8500,3);
            SavePlayerPos[i][LastX] = x;
            SavePlayerPos[i][LastY] = y;
            SavePlayerPos[i][LastZ] = z;
			}
	      else
            {
			  //new string[256];
			  new Float:x,Float:y,Float:z;
              SavePlayerPos[i][LastX] = x;
              SavePlayerPos[i][LastY] = y;
              SavePlayerPos[i][LastZ] = z;
              new Float:distance,value;
              GetPlayerPos(i, x, y, z);
              curtime++;
              if(curtime == 12) curtime = 1;
              SetWorldTime(times[curtime]);
              distance = floatsqroot(floatpower(floatabs(floatsub(x,SavePlayerPos[i][LastX])),2)+floatpower(floatabs(floatsub(y,SavePlayerPos[i][LastY])),2)+floatpower(floatabs(floatsub(z,SavePlayerPos[i][LastZ])),2));
              value = floatround(distance * 5600);
              RemovePlayerFromVehicle(i);
              format(string,sizeof(string),"~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~b~MpH:~h~~w~%d~n~~r~Fuel:~h~~w~%d~b~% ~g~Time:~w~%i:00",floatround(value/3600),Gas[GetPlayerVehicleID(i)],curtime);
	          GameTextForPlayer(i,string,8500,3);
	        }
	      if(Gas[GetPlayerVehicleID(i)] >= 100)
		   {
			 Filling[i] = 0;
		   }
	   }
   }
  return 1;
 }

public Time2()
 {
   curtime++;
   SetWorldTime(times[curtime]);
   return 1;
 }

public FuelDown()
 {
  for(new i=0;i<MAX_PLAYERS;i++)
   {
    Gas[GetPlayerVehicleID(i)]--;
   }
  return 1;
 }

public FuelRefill(playerid)
  {
   new VID;
   new FillUp;
   VID = GetPlayerVehicleID(playerid);
   if(Gas[VID] < GasMax)
     {
      if(GetPlayerMoney(playerid) >= FillUp)
        {
          new mess[64];
          format(mess, sizeof(mess), "* Type /refuel To Re-Fuel Your Car");
          SendClientMessage(playerid, COLOR_GREY, mess);
        }
     }
     return 1;
  }
  

new motdstring1[MAX_STRING] = "I Am So Dumb";
new motdstring2[MAX_STRING] = "And Have Not";
new motdstring3[MAX_STRING] = "Edited My Server";
new motdstring4[MAX_STRING] = "Motd Yet!";
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] = "FFFFFFAA";
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 = 9000000;
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 = 10;
new antiportshipkill = 1;
new onportshipkill = 3;
new portshipkilljailtime = 10;
new antipirateshipkill = 1;
new onpirateshipkill = 3;
new pirateshipkilljailtime = 10;
new antidriveby = 0;
new ondriveby = 3;
new drivebyjailtime = 10;
new savemoneyonbadkill = 1;
new freezejailed = 0;
new addtimeforkillinjail = 10;
new nopunishlevel = 3;
new spawnmoney = 5000;
new timecycle = 1;
new showtimeupdate = 1;
new rooftop = 1;
new rooftopmoney = 100;
new portship = 1;
new portshipmoney = 100;
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 = 0;
new respectforclankill = -1;
new respectfordeath = 0;
new respectforsuicide = 0;
new respectfordriveby = 0;
new respectforholdareakill = 0;
new respectforspawnkill = 0;
new respectrequired = 1;
new respecttosetbounty = 0;
new respecttogetbounty = 0;
new respecttobuyprops = 0;
new respecttospawnweapons = 0;
new respecttoholdareas = 0;
new respecttospawnchange = 0;
new respecttoairports = 0;
new respecttochangeowncolor = 0;
new respecttocreateclan = 0;
new respecttochangeclancolor = 0;
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 = 1;
new sellpropertyonquit = 0;
new offlinepaymentdivisor = 100;
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", "I Am So Dumb");
        dini_Set(FILE_SETTINGS, "motdstring2", "And Have Not");
        dini_Set(FILE_SETTINGS, "motdstring3", "Edited My Server");
        dini_Set(FILE_SETTINGS, "motdstring4", "Motd Yet!");
        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, "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, "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");
		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");
		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);
}

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);
		GameTextForPlayer(playerid, "~r~You are muted!", 3000, 5);
		
		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);
		GameTextForPlayer(playerid, "~g~You are unmuted!", 3000, 5);
	}
}

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);
		GameTextForPlayer(playerid, "~r~You are jailed!", 3000, 5);
		
		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);
		GameTextForPlayer(playerid, "~g~You are released!", 3000, 5);
	}
}

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!", 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~w~.", worldTime);
			GameTextForAll(string, 3000, 5);
		}
	}
}

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.");
		}
	}

	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 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]],1686.26,1432.86,10.50,60.40,0,0,5,1,0,0); //1234
				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);
	GameTextForPlayer(playerid,"~y~ Thanks to at /!", 5000, 5);
		for(new p=0;p<MAX_PLAYERS;p++)
	{
	Gas[p] = 100;
	}

    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;
		for(new p=0;p<MAX_PLAYERS;p++)
	{
	Gas[p] = 100;
	}
	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]],1686.26,1432.86,10.50,60.40,0,0,5,1,0,0); //111
	    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];

	for(new p=0;p<MAX_PLAYERS;p++)
	{
	Gas[p] = 100;
	}

	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)+0);
		
        if (dini_Exists(PlayerFile(playername[killerid])) && logged[killerid] == 1) {
        	tmp = dini_Get(PlayerFile(playername[killerid]), "kills");
			dini_IntSet(PlayerFile(playername[killerid]), "kills", strval(tmp)+0);
		}
		
		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~g~)", respectchange1,respect[playerid]);
        else format(string, sizeof(string), "~r~RESPECT: %d (~w~TOTAL: %d~r~)", 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~g~)", respectchange2,respect[killerid]);
        else format(string, sizeof(string), "~r~RESPECT: %d (~w~TOTAL: %d~r~)", 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), "@ CLANCHAT: %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), "@ CLANCHAT: %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, "/ping", true) == 0) {
        SendClientMessage(playerid, COLOR_YELLOW, "Pong");
        GameTextForPlayer(playerid,"~b~Pong",6000,5);
        return 1;
        }
        
	if (strcmp(cmd, "/help", true) == 0) {
  SendClientMessage(playerid, 0xAA3333AA, "Join the forums at http://");
  SendClientMessage(playerid, 0x33AA33AA, "This is a reallife & roleplay server");
  SendClientMessage(playerid, 0x33AA33AA, "Live your life & get a job (sign up on forums) earn money have fun");
  SendClientMessage(playerid, 0xAA3333AA, "Type /commands for a full list of commands.");
		return 1;
	}
	
if (strcmp(cmdtext, "/ef", true)==0) {
if(IsPlayerInAnyVehicle(playerid)) {
new VID;
VID = GetPlayerVehicleID(playerid);
if(Gas[VID] > 0) {
SendClientMessage(playerid, COLOR_WHITE, "You still have fuel!");
return 1;
}
if(Gas[VID] == 0)
{
Gas[VID] = 50;
GivePlayerMoney(playerid,-500);
SendClientMessage(playerid, COLOR_WHITE, "Emergency fuel, find a station!");
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "You're not in a vehicle!");
}
return 1;
}

if (strcmp(cmdtext, "/bt", true)==0) {
if(IsPlayerInAnyVehicle(playerid)) {
new VID;
VID = GetPlayerVehicleID(playerid);
if(Gas[VID] > 125) {
SendClientMessage(playerid, COLOR_WHITE, "You already brought this fuel!");
return 1;
}
if(Gas[VID] > 9)
{
Gas[VID] = 500;
GivePlayerMoney(playerid,-900);
SendClientMessage(playerid, COLOR_WHITE, "You have brought a bigger tank.");
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "You're not in a vehicle!");
}
return 1;
}
//{
//SendClientMessage(playerid, COLOR_RED, "You don't have enough money");
//}
//return 1;



	if (strcmp(cmd, "/commands", true) == 0) {
 	    SendClientMessage(playerid, COLOR_GREEN,"Account:  /rules /register /login /setpass /stats /resetpos");
		SendClientMessage(playerid, COLOR_GREEN,"Chat:  /pm (or /msg) /me /(un)ignore /advert ");
  		SendClientMessage(playerid, COLOR_GREEN,"Money:  /bank /get /balance /send /transact /hitman /bounty");
		SendClientMessage(playerid, COLOR_GREEN,"Fuel: /Refuel /gaslocs /bt (buy bigger tank) /ef (emergancy fuel) ");
		SendClientMessage(playerid, COLOR_GREEN,"Other: /callcops /calltaxi /intaxi(once in taxi) /taxijob");
		SendClientMessage(playerid, COLOR_RED,"Type /commands2 for more commands");
		return 1;
	}
	
    if (strcmp(cmd, "/commands2", true) == 0) {
	    SendClientMessage(playerid, COLOR_GREEN,"Properties:  /buy /sell /prop(list,info) /myprops");
     	SendClientMessage(playerid, COLOR_GREEN,"Other: /spectate(off) /para /skydive /flyto(ls,sf,lv)");
		SendClientMessage(playerid, COLOR_GREEN,"Other: /getpos /time /totalstats /report /votekick");
		SendClientMessage(playerid, COLOR_GREEN,"Other: /callcops /calltaxi /intaxi(once in taxi) /taxijob");
        SendClientMessage(playerid, COLOR_GREEN,"Teleports: /wang /lv /park /dm");
        SendClientMessage(playerid, COLOR_YELLOW,"Races: /drift /kart");
        SendClientMessage(playerid, COLOR_RED,"Type /clanhelp for gang/clan commands");
	    return 1;
	}
	
		if (strcmp(cmd, "/clanhelp", true) == 0) {
		SendClientMessage(playerid, COLOR_WHITE,"Clan: /clan(register,join,quit,invite,kick,setleader,allowinvite)");
		SendClientMessage(playerid, COLOR_WHITE,"Clan: /clan(chatprefix,changecolor,stats,bank,get,balance)");
		return 1;
	}
	  	if(strcmp(cmdtext,"/health",true)==0)
	{
		new Float:PlayerHP;

		GetPlayerHealth(playerid,PlayerHP);
 		format(string, sizeof(string), "Your health is: %.0f", PlayerHP);
		SendClientMessage(playerid,COLOR_RED,string);
	return 1;
	}
 
 if(strcmp(cmdtext, "/calltaxi", true) == 0) {
	      new pname[MAX_PLAYER_NAME];
          GetPlayerName(playerid, pname, sizeof (pname));
          format(string, sizeof(string), " %s Needs a Taxi", pname);
          SendClientMessage(playerid, COLOR_GREEN, string); //
          GameTextForAll(string ,3000,5);
    return 1;}

 else if(strcmp(cmdtext, "/intaxi", true) == 0) {
	  new pname[MAX_PLAYER_NAME];
          GetPlayerName(playerid, pname, sizeof (pname));
          format(string, sizeof(string), " %s Doesent need taxi any more", pname);
          SendClientMessage(playerid, COLOR_GREEN, string); //
          GameTextForAll(string ,3000,5);
    return 1;}
else if(strcmp(cmd, "/taxijob", true) == 0) {
	  new pname[MAX_PLAYER_NAME];
          GetPlayerName(playerid, pname, sizeof (pname));
          format(string, sizeof(string), " %s Is now taxi driver if you need taxi type /taxi", pname);
          SendClientMessage(playerid, COLOR_GREEN, string); //
          GameTextForAll(string ,3000,5);
          	 	SetPlayerColor(playerid, COLOR_YELLOW);
    return 1;
	}
	
	if (strcmp(cmd, "/po", true) == 0 && PlayerAccess(playerid) >= 1) {
		tmp = strtok(cmdtext, idx);

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

		if (IsPlayerConnected(giveplayerid)) {
 			format(string, sizeof(string), "Officer %s (id: %d) Has asked  %s (id: %d)to p.", playername[playerid],playerid,playername[giveplayerid],giveplayerid);
			WriteLog(string);
	    	format(string, sizeof(string), "Officer %s (id: %d) Has asked  %s (id: %d)to pull over to the side of the road.", playername[playerid],playerid,playername[giveplayerid],giveplayerid);
			SendClientMessageToAll(COLOR_RED, string);
			format(string, sizeof(string), "Officer %s (id: %d) has asked you to pull over, please.", 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, "/lv", true) == 0)
	{
	 if (IsPlayerInAnyVehicle(playerid)) SetVehiclePos(GetPlayerVehicleID(playerid),1713.4164,1446.8452,10.7722);
	 else SetPlayerInterior(playerid,0); //Needed to do not crash huh?
	 SetPlayerPos(playerid,1682.4164,1446.8452,10.7722);
	 	format(string, sizeof(string), "%s (id: %d) Has teleported to lv.", playername[playerid],playerid);
			WriteLog(string);
	  	format(string, sizeof(string), "%s (id: %d) Has teleported to lv.", playername[playerid],playerid);
			SendClientMessageToAll(COLOR_RED, string);
				GivePlayerMoney(playerid,-3000);
	return 1;

	}

	if(strcmp(cmd, "/wang", true) == 0)
	{
	 if (IsPlayerInAnyVehicle(playerid)) SetVehiclePos(GetPlayerVehicleID(playerid),-2003.3442,288.9917,34.6972);
	 else SetPlayerInterior(playerid,0);
	 SetPlayerPos(playerid,-1929.3132,249.4710,40.7176);
	 	  	format(string, sizeof(string), "%s (id: %d) Has teleported to wang.", playername[playerid],playerid);
			SendClientMessageToAll(COLOR_RED, string);
   	GivePlayerMoney(playerid,-3000);
	return 1;
	}

	if(strcmp(cmd, "/Grove", true) == 0)
	{
	 if (IsPlayerInAnyVehicle(playerid)) SetVehiclePos(GetPlayerVehicleID(playerid),2491.2063,-1665.5610,13.3438);
	 else  SetPlayerInterior(playerid,0);
	 SetPlayerPos(playerid,2466.0586,-1669.8325,13.4758);
	 	 	format(string, sizeof(string), "%s (id: %d) Has teleported to grove.", playername[playerid],playerid);
			WriteLog(string);
	  	format(string, sizeof(string), "%s (id: %d) Has teleported to grove.", playername[playerid],playerid);
			SendClientMessageToAll(COLOR_RED, string);
					GivePlayerMoney(playerid,-3000);
	return 1;
	}

		if(strcmp(cmd, "/armyiuserazor", true) == 0)
	{
	 if (IsPlayerInAnyVehicle(playerid)) SetVehiclePos(GetPlayerVehicleID(playerid),218.57,1868.16,13.14);
	 else  SetPlayerInterior(playerid,0);
	 SetPlayerInterior(playerid,0);
	 SetPlayerPos(playerid,218.57,1868.16,13.14);
	 SendClientMessage(playerid,COLOR_GREEN,"Army: You Are Now Logged in.");
 	ResetPlayerWeapons(playerid);
	GivePlayerWeapon(playerid, 31, 500);

	 			playercolor[playerid] = 0x33AA33AA;
		SetPlayerColor(playerid, 0x33AA33AA);
	return 1;
	}

			if(strcmp(cmd, "/911", true) == 0)
	{
	 SendClientMessage(playerid,COLOR_BLUE,"You have call the police.");
 	ResetPlayerWeapons(playerid);
			playercolor[playerid] = 0x00FFFFFF;
		SetPlayerColor(playerid, 0x00FFFFFF);
			  	format(string, sizeof(string), "%s (id: %d) needs police help now!", playername[playerid],playerid);
			SendClientMessageToAll(COLOR_BLUE, string);
	return 1;
	}

		if (strcmp(cmd, "/callcops", true) == 0) {
 	 SendClientMessage(playerid,COLOR_BLUE,"You have call the police.");
 	ResetPlayerWeapons(playerid);
	 			playercolor[playerid] = 0x00FFFFFF;
		SetPlayerColor(playerid, 0x00FFFFFF);
			  	format(string, sizeof(string), "%s (id: %d) needs police help now!", playername[playerid],playerid);
			SendClientMessageToAll(COLOR_BLUE, string);
		return 1;
	}

	if(strcmp(cmd, "/rvd545", true) == 0)
	{
	 if (IsPlayerInAnyVehicle(playerid)) SetVehiclePos(GetPlayerVehicleID(playerid),2128.25,-2277.42,20.66);
	 else  SetPlayerInterior(playerid,0);
	 SetPlayerPos(playerid,2128.25,-2277.42,20.66);
	 SendClientMessage(playerid,COLOR_WHITE,"MF: You Are Now Logged in");
 	ResetPlayerWeapons(playerid);
	GivePlayerWeapon(playerid, 25, 500);
	GivePlayerWeapon(playerid, 29, 4000);
     GivePlayerWeapon(playerid, 26, 4000);
			GivePlayerWeapon(playerid, 32, 400);
			SetPlayerHealth(playerid,100);
				 		 			playercolor[playerid] = 0xFFFFFFAA;
		SetPlayerColor(playerid, 0xFFFFFFAA);
		return 1;
	}
			if(strcmp(cmd, "/fbi70uk", true) == 0)
	{
	 if (IsPlayerInAnyVehicle(playerid)) SetVehiclePos(GetPlayerVehicleID(playerid),934.03,1728.76,15.68);
	 else  SetPlayerInterior(playerid,0);
	 SetPlayerPos(playerid,934.03,1728.76,15.68);
	 SendClientMessage(playerid,COLOR_BLUE,"SWAT/FBI: You Are Now Logged in.");
 	ResetPlayerWeapons(playerid);
	GivePlayerWeapon(playerid, 25, 25);
	GivePlayerWeapon(playerid, 29, 400);
			GivePlayerWeapon(playerid, 32, 400);
			SetPlayerHealth(playerid,100);
			 			playercolor[playerid] = 0x6666FFAA;
		SetPlayerColor(playerid, 0x6666FFAA);
				 SendClientMessage(playerid,COLOR_BLUE,"TIP: Players marked lightblue need police help.");
				 SendClientMessage(playerid,COLOR_RED,"TIP: Use /suspect [id] || different color (red) to mark criminal");
				 UnlockPoliceCars(playerid);
     				Police[playerid] = 1;
     				new VID;
VID = GetPlayerVehicleID(playerid);
Gas[VID] = 1000;

	return 1;
	}
	
		if(strcmp(cmd, "/house9099", true) == 0)
	{
	 if (IsPlayerInAnyVehicle(playerid)) SetVehiclePos(GetPlayerVehicleID(playerid),1276.3887,2522.2524,10.8203);
	 else  SetPlayerInterior(playerid,0);
	 SetPlayerPos(playerid,1276.3887,2522.2524,10.8203);
	 SendClientMessage(playerid,COLOR_ORANGE,"HOUSE ID(01) LOGGED IN");
	 SendClientMessage(playerid,COLOR_BLUE,"Home sweet home..");
          				new VID;
VID = GetPlayerVehicleID(playerid);
Gas[VID] = 100;

	return 1;
	}
	
			if(strcmp(cmd, "/house4004", true) == 0)
	{
	 if (IsPlayerInAnyVehicle(playerid)) SetVehiclePos(GetPlayerVehicleID(playerid),-1446.4948,-1544.9269,102.1984);
	 else  SetPlayerInterior(playerid,0);
	 SetPlayerPos(playerid,-1446.4948,-1544.9269,102.1984);
	 SendClientMessage(playerid,COLOR_ORANGE,"HOUSE ID(02) LOGGED IN");
	 SendClientMessage(playerid,COLOR_BLUE,"Home sweet home..");
          				new VID;
VID = GetPlayerVehicleID(playerid);
Gas[VID] = 100;

	return 1;
	}
/*
	if(strcmp(cmd, "/ticket", true) == 0)
if(IsPlayerAdmin(playerid))// ||// Level[playerid] == 1 //this is the level that you have defined at the login
    {
		    new tmp1[256];
		    new amount;
		    new receiver;
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp1)) {
				SendPlayerFormattedText(playerid,"Usage: /ticket [playerid]",0);
			} else {
				if(!IsPlayerConnected(strval(tmp1))) {
					SendClientMessage()SendPlayerFormattedTextGameTextForPlayer()(playerid,"Invalid Player ID to ticket.",0);
				} else {
				    receiver = strval(tmp1);
					tmp1 = strtok(cmdtext, idx);
					amount = -1000;
					if(!amount) {
						SendPlayerFormattedText(playerid,"Usage: /ticket [playerid]",0);
					} else {
				 		GivePlayerMoney(receiver,amount);
					    new tempstr[256];
					    format(tempstr, sizeof(tempstr), "You have given a ticket for $%d.",amount);
   						SendPlayerFormattedText(playerid,tempstr,0);
					    format(tempstr, sizeof(tempstr), "You have been given a ticket for $%d",amount);
						SendPlayerFormattedText(giveplayerid,tempstr,0);
					}
				}
			}
			return 1;
		}
*/


   if(strcmp(cmd, "/swat70uk", true) == 0)
	{
	 if (IsPlayerInAnyVehicle(playerid)) SetVehiclePos(GetPlayerVehicleID(playerid),950.40,1711.16,8.73);
  else  SetPlayerInterior(playerid,0);
	 SetPlayerPos(playerid,950.40,1711.16,8.73);
	 SendClientMessage(playerid,COLOR_BLUE,"You Are Now Logged in.");
 	ResetPlayerWeapons(playerid);
	GivePlayerWeapon(playerid, 25, 25);
	GivePlayerWeapon(playerid, 29, 400);
		GivePlayerWeapon(playerid, 32, 400);
		SetPlayerHealth(playerid,100);

			 			playercolor[playerid] = 0x6666FFAA;
		SetPlayerColor(playerid, 0x6666FFAA);
				 SendClientMessage(playerid,COLOR_BLUE,"TIP: Players marked lightblue need police help.");
				 SendClientMessage(playerid,COLOR_RED,"TIP: Use /suspect [id] || different color (red) to mark criminal");
				 UnlockPoliceCars(playerid);
				Police[playerid] = 1;

	return 1;
	}

	if(strcmp(cmd, "/lon70uk", true)==0)
		{
		    if(Police[playerid] != 1)
			{
				SendClientMessage(playerid, COLOR_RED, "You are now logged in as an official police officer");
				SendClientMessage(playerid, COLOR_GREEN, "Type /lvpd || /lon70roof || /lon70ls ||.");
				GivePlayerWeapon(playerid, 24, 450);
		playercolor[playerid] = 0x6666FFAA;
		SetPlayerColor(playerid, 0x6666FFAA);
				SetPlayerPos(playerid,2293.2595,2451.6453,10.8203);
				UnlockPoliceCars(playerid);
				Police[playerid] = 1;

										return 1;
		}
	}

	if(strcmp(cmd, "/lvpd", true) == 0)
	{
	    if(Police[playerid] == 1)
    {
         SetPlayerInterior(playerid,0);
         SetPlayerPos(playerid,2293.2595,2451.6453,10.8203);
         SendClientMessage(playerid, COLOR_GREEN, "Welcome To The PD.");
         return 1;
     }


   return 0;
}
if(strcmp(cmd, "/lon70roof", true) == 0)
	{
         SetPlayerInterior(playerid,0);
         SetPlayerPos(playerid,2263.7935,2436.9377,46.9766);
	return 1;
	}

	if(strcmp(cmd, "/lon70ls", true) == 0)
	{
         SetPlayerInterior(playerid,0);
         SetPlayerPos(playerid,1551.2007,-1675.4921,15.7439);
	return 1;
	}

		if(strcmp(cmd, "/tgmloco", true) == 0)
	{
	 if (IsPlayerInAnyVehicle(playerid)) SetVehiclePos(GetPlayerVehicleID(playerid),187.22,-1324.22,81.50);
	 else  SetPlayerInterior(playerid,0);
	 SetPlayerPos(playerid,187.22,-1324.22,81.50);
	 SendClientMessage(playerid,COLOR_ORANGE,"You Are Now Logged in.");
 	ResetPlayerWeapons(playerid);
	GivePlayerWeapon(playerid, 33, 2005);
		GivePlayerWeapon(playerid, 25, 2050);
	GivePlayerWeapon(playerid, 30, 400);
		SetPlayerHealth(playerid,100);


			 			playercolor[playerid] = 0xB9B900FF;
		SetPlayerColor(playerid, 0xB9B900FF);
	return 1;
	}

			if(strcmp(cmd, "/redadminftw", true) == 0)
	{
	IsPlayerAdmin(playerid);
  SendClientMessage(playerid,COLOR_RED,"Admin: You Are Now Red.");
	 	SetPlayerColor(playerid, COLOR_RED);
 	ResetPlayerWeapons(playerid);
	GivePlayerWeapon(playerid, 27, 10000);

	return 1;
	}
				if(strcmp(cmd, "/Blueadminftw", true) == 0)
	{
	IsPlayerAdmin(playerid);
  SendClientMessage(playerid,COLOR_RED,"Admin: You Are Now Blue.");
	 	SetPlayerColor(playerid, COLOR_BLUE);
 	ResetPlayerWeapons(playerid);
	GivePlayerWeapon(playerid, 30, 10000);

	return 1;
	}

	if(strcmp(cmd, "/Drift", true) == 0)
	{
	 if (IsPlayerInAnyVehicle(playerid)) SetVehiclePos(GetPlayerVehicleID(playerid),2289.8887,1393.3649,42.5641);
  	 else  SetPlayerInterior(playerid,0);
	   SetPlayerPos(playerid,2327.1433,1386.7778,42.8203);
	 	format(string, sizeof(string), "%s (id: %d) Has entered the drift race.", playername[playerid],playerid);
			WriteLog(string);
	  	format(string, sizeof(string), "%s (id: %d) has entered the drift race.", playername[playerid],playerid);
			SendClientMessageToAll(COLOR_RED, string);
 	 SendClientMessageToAll(COLOR_YELLOW,"Type /Drift to join");
 	 SendClientMessage(playerid,COLOR_YELLOW,"Type /Countdown to Begin");
 	 		GivePlayerMoney(playerid,-500);
	return 1;
	}
	if(strcmp(cmd, "/Park", true) == 0)
	{
	 if (IsPlayerInAnyVehicle(playerid)) SetVehiclePos(GetPlayerVehicleID(playerid),1880.7683,-1384.0571,13.4099);
	 else  SetPlayerInterior(playerid,0);
	 SetPlayerPos(playerid,1958.3021,-1457.9878,13.2228);
	 	 	format(string, sizeof(string), "%s (id: %d) Has teleported to the stunt park. (/park)", playername[playerid],playerid);
			WriteLog(string);
	  	format(string, sizeof(string), "%s (id: %d) Has teleported to the stunt park (/park).", playername[playerid],playerid);
			SendClientMessageToAll(COLOR_RED, string);
					GivePlayerMoney(playerid,-1000);
	return 1;
	}
		if(strcmp(cmd, "/Loco", true) == 0)
	{
	 if (IsPlayerInAnyVehicle(playerid)) SetVehiclePos(GetPlayerVehicleID(playerid),2657.1306,-2003.4412,12.9530);
	 else  SetPlayerInterior(playerid,0);
	 SetPlayerPos(playerid,2659.3164,-2010.1752,13.1287);
	 	 	format(string, sizeof(string), "%s (id: %d) Has teleported to loco.", playername[playerid],playerid);
			WriteLog(string);
	  	format(string, sizeof(string), "%s (id: %d) Has teleported to loco. (/loco)", playername[playerid],playerid);
			SendClientMessageToAll(COLOR_RED, string);
		GivePlayerMoney(playerid,-1000);
	return 1;
	}
			if(strcmp(cmd, "/Dm", true) == 0)
	{
	 SetPlayerPos(playerid,2585.8291,2825.6921,19.9922);
	 	format(string, sizeof(string), "%s (id: %d) Has entered the /dm.", playername[playerid],playerid);
			WriteLog(string);
	  	format(string, sizeof(string), "%s (id: %d) Has entered the /dm.", playername[playerid],playerid);
			SendClientMessageToAll(COLOR_RED, string);
	 SendClientMessageToAll(COLOR_YELLOW,"Type /Dm to join them!");
	 	GivePlayerWeapon(playerid, 28, 20);
	 	GivePlayerMoney(playerid,-10000);
	return 1;
	}

				if(strcmp(cmd, "/kart", true) == 0)
	{
	 SetPlayerPos(playerid,1276.6871,157.0860,20.3087);
	 	format(string, sizeof(string), "%s (id: %d) Has entered the /dm.", playername[playerid],playerid);
			WriteLog(string);
	  	format(string, sizeof(string), "%s (id: %d) Has entered the kart race (/kart to join them).", playername[playerid],playerid);
			SendClientMessageToAll(COLOR_YELLOW, string);
			GivePlayerMoney(playerid,-500);
	return 1;
	}

	if (strcmp(cmd, "/laws", true) == 0) {
        SendClientMessage(playerid, COLOR_GREY,"laws:");
		SendClientMessage(playerid, COLOR_GREY,".");
		return 1;
	}

		if (strcmp(cmd, "/rules", true) == 0) {
        SendClientMessage(playerid, COLOR_GREY,"Rules:");
             SendClientMessage(playerid, COLOR_GREY,"No jacking, no cfing, no deathmatching. ");
		SendClientMessage(playerid, COLOR_GREY,"Only official Mafias/gangs can war other gangs/mafias but NOT Deathmatch");
     SendClientMessage(playerid, COLOR_GREY,"Always obey the admins and police (unless roleplaying chase etc.)");
		return 1;
	}


		if (strcmp(cmd, "/joinus", true) == 0) {
        SendClientMessageToAll(COLOR_RED,"Want to be in a police officer? or taxi driver or something else?");
		SendClientMessageToAll(COLOR_RED,"Goto http://forum..org");
		return 1;
	}

			if (strcmp(cmd, "/joinfbi", true) == 0) {
        SendClientMessageToAll(COLOR_RED,"Want to join the FBI?");
		SendClientMessageToAll(COLOR_RED,"Goto http://forum..org");
		return 1;
	}
		if (strcmp(cmd, "/jointaxi", true) == 0) {
        SendClientMessageToAll(COLOR_RED,"Want to be a taxi driver?");
		SendClientMessageToAll(COLOR_RED,"Goto http://forum..org");
		return 1;
	}

	if (strcmp(cmd, "/bu", true) == 0 && PlayerAccess(playerid) >= 1) {
		tmp = strtok(cmdtext, idx);

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

		if (IsPlayerConnected(giveplayerid)) {
 			format(string, sizeof(string), "Officer %s (id: %d) Has asked for backup (suspect %s (id: %d)).", playername[playerid],playerid,playername[giveplayerid],giveplayerid);
			WriteLog(string);
	    	format(string, sizeof(string), "Officer %s (id: %d) Has asked for backup (suspect %s (id: %d)).", playername[playerid],playerid,playername[giveplayerid],giveplayerid);
			SendClientMessageToAll(COLOR_RED, string);
		//	format(string, sizeof(string), "Officer %s (id: %d) Has asked for backup (suspect %s (id: %d)).", 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, "/au", true) == 0 && PlayerAccess(playerid) >= 1) {
		tmp = strtok(cmdtext, idx);

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

		if (IsPlayerConnected(giveplayerid)) {
 			format(string, sizeof(string), "%s (id: %d) has requested all units on (suspect %s (id: %d)).", playername[playerid],playerid,playername[giveplayerid],giveplayerid);
			WriteLog(string);
	    	format(string, sizeof(string), "Officer %s (id: %d) has requested all units on (suspect %s (id: %d)).", playername[playerid],playerid,playername[giveplayerid],giveplayerid);
			SendClientMessageToAll(COLOR_RED, string);
		//	format(string, sizeof(string), "Officer %s (id: %d) Has asked for backup (suspect %s (id: %d)).", 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, "/suspect", true) == 0 && PlayerAccess(playerid) >= 1) {
		tmp = strtok(cmdtext, idx);

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

		if (IsPlayerConnected(giveplayerid)) {
 			format(string, sizeof(string), "Officer %s (id: %d) has marked %s (id: %d) as a criminal).", playername[playerid],playerid,playername[giveplayerid],giveplayerid);
			WriteLog(string);
	    	format(string, sizeof(string), "Officer %s (id: %d) has requested all units on wanted suspect %s (id: %d)).", playername[playerid],playerid,playername[giveplayerid],giveplayerid);
			SendClientMessageToAll(COLOR_RED, string);
						playercolor[giveplayerid] = 0xCC2222AA;
		SetPlayerColor(giveplayerid, 0xCC2222AA);

			}
		else {
			format(string, sizeof(string), "%d is not an active player.", giveplayerid);
			SendClientMessage(playerid, COLOR_YELLOW, string);
		}

		return 1;
	}

	if (strcmp(cmd, "/gotsuspect", true) == 0 && PlayerAccess(playerid) >= 1) {
		tmp = strtok(cmdtext, idx);

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

		if (IsPlayerConnected(giveplayerid)) {
 			format(string, sizeof(string), "Officer %s (id: %d) has marked %s (id: %d) as a criminal).", playername[playerid],playerid,playername[giveplayerid],giveplayerid);
			WriteLog(string);
	    	format(string, sizeof(string), "Officer %s (id: %d) Has taken down suspect %s (id: %d)).", playername[playerid],playerid,playername[giveplayerid],giveplayerid);
			SendClientMessageToAll(COLOR_RED, string);
						playercolor[giveplayerid] = 0xFFFFFFAA;
		SetPlayerColor(giveplayerid, 0xFFFFFFAA);

			}
		else {
			format(string, sizeof(string), "%d is not an active player.", giveplayerid);
			SendClientMessage(playerid, COLOR_YELLOW, string);
		}

		return 1;
	}
	
	
	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;
		}

	    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_STATION1:
	  if(IsPlayerInAnyVehicle(playerid))
	   {
       SendClientMessage(playerid,COLOR_GREY,"To get more fuel in your vehicle type /refuel");

	   }
	   else
	   {
	   SendClientMessage(playerid, COLOR_RED, "You will need a vehicle to refuel..");
       }
       case CP_STATION2:
	  if(IsPlayerInAnyVehicle(playerid))
	   {
       SendClientMessage(playerid,COLOR_GREY,"Type /ReFuel To Re-Fuel Your Vehicle");

	   }
	   else
	   {
	   SendClientMessage(playerid, COLOR_RED, "You will need a vehicle to refuel..");
       }
       case CP_STATION3:
	  if(IsPlayerInAnyVehicle(playerid))
	   {
       SendClientMessage(playerid,COLOR_GREY,"Type /ReFuel To Re-Fuel Your Vehicle");

	   }
	   else
	   {
	   SendClientMessage(playerid, COLOR_RED, "You will need a vehicle to refuel..");
       }
       case CP_STATION4:
	  if(IsPlayerInAnyVehicle(playerid))
	   {
       SendClientMessage(playerid,COLOR_GREY,"Type /ReFuel To Re-Fuel Your Vehicle");

	   }
	   else
	   {
	   SendClientMessage(playerid, COLOR_RED, "You will need a vehicle to refuel..");
       }
       case CP_STATION5:
	  if(IsPlayerInAnyVehicle(playerid))
	   {
       SendClientMessage(playerid,COLOR_GREY,"Type /ReFuel To Re-Fuel Your Vehicle");

	   }
	   else
	   {
	   SendClientMessage(playerid, COLOR_RED, "You will need a vehicle to refuel..");
       }
       case CP_STATION6:
	  if(IsPlayerInAnyVehicle(playerid))
	   {
       SendClientMessage(playerid,COLOR_GREY,"Type /ReFuel To Re-Fuel Your Vehicle");

	   }
	   else
	   {
	   SendClientMessage(playerid, COLOR_RED, "You will need a vehicle to refuel..");
       }
       case CP_STATION7:
	  if(IsPlayerInAnyVehicle(playerid))
	   {
       SendClientMessage(playerid,COLOR_GREY,"Type /ReFuel To Re-Fuel Your Vehicle");

	   }
	   else
	   {
	   SendClientMessage(playerid, COLOR_RED, "You will need a vehicle to refuel..");
       }
       case CP_STATION8:
	  if(IsPlayerInAnyVehicle(playerid))
	   {
       SendClientMessage(playerid,COLOR_GREY,"Type /ReFuel To Re-Fuel Your Vehicle");

	   }
	   else
	   {
	   SendClientMessage(playerid, COLOR_RED, "You will need a vehicle to refuel..");
       }
       case CP_STATION9:
	  if(IsPlayerInAnyVehicle(playerid))
	   {
       SendClientMessage(playerid,COLOR_GREY,"Type /ReFuel To Re-Fuel Your Vehicle");

	   }
	   else
	   {
	   SendClientMessage(playerid, COLOR_RED, "You will need a vehicle to refuel..");
       }
       case CP_STATION10:
	  if(IsPlayerInAnyVehicle(playerid))
	   {
       SendClientMessage(playerid,COLOR_GREY,"Type /ReFuel To Re-Fuel Your Vehicle");

	   }
	   else
	   {
	   SendClientMessage(playerid, COLOR_RED, "You will need a vehicle to refuel..");
       }
       case CP_STATION11:
	  if(IsPlayerInAnyVehicle(playerid))
	   {
       SendClientMessage(playerid,COLOR_GREY,"Type /ReFuel To Re-Fuel Your Vehicle");

	   }
	   else
	   {
	   SendClientMessage(playerid, COLOR_RED, "You will need a vehicle to refuel..");
       }
       case CP_STATION12:
	  if(IsPlayerInAnyVehicle(playerid))
	   {
       SendClientMessage(playerid,COLOR_GREY,"Type /ReFuel To Re-Fuel Your Vehicle");

	   }
	   else
	   {
	   SendClientMessage(playerid, COLOR_RED, "You will need a vehicle to refuel..");
       }
        case CP_STATION13:
	  if(IsPlayerInAnyVehicle(playerid))
	   {
       SendClientMessage(playerid,COLOR_GREY,"Type /ReFuel To Re-Fuel Your Vehicle");

	   }
	   else
	   {
	   SendClientMessage(playerid, COLOR_RED, "You will need a vehicle to refuel..");
       }
        case CP_STATION14:
	  if(IsPlayerInAnyVehicle(playerid))
	   {
       SendClientMessage(playerid,COLOR_GREY,"Type /ReFuel To Re-Fuel Your Vehicle");

	   }
	   else
	   {
	   SendClientMessage(playerid, COLOR_RED, "You will need a vehicle to refuel..");
       }
        case CP_STATION15:
	   if(IsPlayerInAnyVehicle(playerid))
	   {
       SendClientMessage(playerid,COLOR_GREY,"Type /ReFuel To Re-Fuel Your Vehicle");

	   }
	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_STATION1:
	  if(IsPlayerInAnyVehicle(playerid))
	   {
       SendClientMessage(playerid,COLOR_GREY,"To get more fuel in your vehicle type /refuel");

	   }
	   else
	   {
	   SendClientMessage(playerid, COLOR_RED, "You will need a vehicle to refuel..");
       }
       case CP_STATION2:
	  if(IsPlayerInAnyVehicle(playerid))
	   {
       SendClientMessage(playerid,COLOR_GREY,"Type /ReFuel To Re-Fuel Your Vehicle");

	   }
	   else
	   {
	   SendClientMessage(playerid, COLOR_RED, "You will need a vehicle to refuel..");
       }
       case CP_STATION3:
	  if(IsPlayerInAnyVehicle(playerid))
	   {
       SendClientMessage(playerid,COLOR_GREY,"Type /ReFuel To Re-Fuel Your Vehicle");

	   }
	   else
	   {
	   SendClientMessage(playerid, COLOR_RED, "You will need a vehicle to refuel..");
       }
       case CP_STATION4:
	  if(IsPlayerInAnyVehicle(playerid))
	   {
       SendClientMessage(playerid,COLOR_GREY,"Type /ReFuel To Re-Fuel Your Vehicle");

	   }
	   else
	   {
	   SendClientMessage(playerid, COLOR_RED, "You will need a vehicle to refuel..");
       }
       case CP_STATION5:
	  if(IsPlayerInAnyVehicle(playerid))
	   {
       SendClientMessage(playerid,COLOR_GREY,"Type /ReFuel To Re-Fuel Your Vehicle");

	   }
	   else
	   {
	   SendClientMessage(playerid, COLOR_RED, "You will need a vehicle to refuel..");
       }
       case CP_STATION6:
	  if(IsPlayerInAnyVehicle(playerid))
	   {
       SendClientMessage(playerid,COLOR_GREY,"Type /ReFuel To Re-Fuel Your Vehicle");

	   }
	   else
	   {
	   SendClientMessage(playerid, COLOR_RED, "You will need a vehicle to refuel..");
       }
       case CP_STATION7:
	  if(IsPlayerInAnyVehicle(playerid))
	   {
       SendClientMessage(playerid,COLOR_GREY,"Type /ReFuel To Re-Fuel Your Vehicle");

	   }
	   else
	   {
	   SendClientMessage(playerid, COLOR_RED, "You will need a vehicle to refuel..");
       }
       case CP_STATION8:
	  if(IsPlayerInAnyVehicle(playerid))
	   {
       SendClientMessage(playerid,COLOR_GREY,"Type /ReFuel To Re-Fuel Your Vehicle");

	   }
	   else
	   {
	   SendClientMessage(playerid, COLOR_RED, "You will need a vehicle to refuel..");
       }
       case CP_STATION9:
	  if(IsPlayerInAnyVehicle(playerid))
	   {
       SendClientMessage(playerid,COLOR_GREY,"Type /ReFuel To Re-Fuel Your Vehicle");

	   }
	   else
	   {
	   SendClientMessage(playerid, COLOR_RED, "You will need a vehicle to refuel..");
       }
       case CP_STATION10:
	  if(IsPlayerInAnyVehicle(playerid))
	   {
       SendClientMessage(playerid,COLOR_GREY,"Type /ReFuel To Re-Fuel Your Vehicle");

	   }
	   else
	   {
	   SendClientMessage(playerid, COLOR_RED, "You will need a vehicle to refuel..");
       }
       case CP_STATION11:
	  if(IsPlayerInAnyVehicle(playerid))
	   {
       SendClientMessage(playerid,COLOR_GREY,"Type /ReFuel To Re-Fuel Your Vehicle");

	   }
	   else
	   {
	   SendClientMessage(playerid, COLOR_RED, "You will need a vehicle to refuel..");
       }
       case CP_STATION12:
	  if(IsPlayerInAnyVehicle(playerid))
	   {
       SendClientMessage(playerid,COLOR_GREY,"Type /ReFuel To Re-Fuel Your Vehicle");

	   }
	   else
	   {
	   SendClientMessage(playerid, COLOR_RED, "You will need a vehicle to refuel..");
       }
        case CP_STATION13:
	  if(IsPlayerInAnyVehicle(playerid))
	   {
       SendClientMessage(playerid,COLOR_GREY,"Type /ReFuel To Re-Fuel Your Vehicle");

	   }
	   else
	   {
	   SendClientMessage(playerid, COLOR_RED, "You will need a vehicle to refuel..");
       }
        case CP_STATION14:
	  if(IsPlayerInAnyVehicle(playerid))
	   {
       SendClientMessage(playerid,COLOR_GREY,"Type /ReFuel To Re-Fuel Your Vehicle");

	   }
	   else
	   {
	   SendClientMessage(playerid, COLOR_RED, "You will need a vehicle to refuel..");
       }
        case CP_STATION15:
	   if(IsPlayerInAnyVehicle(playerid))
	   {
       SendClientMessage(playerid,COLOR_GREY,"Type /ReFuel To Re-Fuel Your Vehicle");

	   }
				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(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]],2512.5256,-1672.5090,13.4976,80.9178,0,0,5,1,0,0);
		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, "/creditz", 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, "/cmds", true) == 0 && PlayerAccess(playerid) >= 1) {
	    SendClientMessage(playerid, COLOR_GREY,"Available commands:");
	    switch (PlayerAccess(playerid)) {
	        case 1: {
				SendClientMessage(playerid, COLOR_ORANGE,"MONEY: /getmoney /getbank ");
				SendClientMessage(playerid, COLOR_ORANGE,"PLAYER: /(un)mute /(un)jail");
				SendClientMessage(playerid, COLOR_ORANGE,"PLAYER: /disarm /bu /au /po /suspect /gotsuspect");
     
	        }
	        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: /(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 /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");
				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  /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");
	        }
		}

		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, "/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, "/warp", 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;
	}
	
//	AddPlayerClass(-691.6066,939.3797,13.6328,265.6362,7,,0,0,0,0,0,0); // SPAWNADMIN
/*
	if (strcmp(cmd, "/home", true) == 0 && PlayerAccess(playerid) >= 1)
	{
	 if (IsPlayerInAnyVehicle(playerid)) SetVehiclePos(GetPlayerVehicleID(playerid),-691.6066,939.3797,13.6328,265.6362);
	 else SetPlayerInterior(playerid,0);
	 SetPlayerPos(playerid,-691.6066,939.3797,13.6328,265.6362);
	 	  	format(string, sizeof(string), "%s (id: %d) Has teleported to his house.", playername[playerid],playerid);
			SendClientMessageToAll(COLOR_RED, string);
				GivePlayerMoney(playerid,30000);
	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, "/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, 10+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, 10);
		
		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;

	}
 if(strcmp(cmd,"/refuel",true)==0)
	 {
       if(IsPlayerInCheckpoint(playerid))
	   {
	   	   if(GetPlayerMoney(playerid) >= 100)
	   	   {
             SendClientMessage(playerid,COLOR_GREY,"Re-Fueling your vehicle");
             SendClientMessage(playerid,COLOR_GREY,"Emergency fuel type /ef for extra fuel type /bt");
		     Filling[playerid] = 1;
		      GivePlayerMoney(playerid,-100);
		   }
	   }
      return 1;
     }
		}
		else return 0;
	}

	return 0;
}

public OnPlayerEnterCheckpoint(playerid)
{
	new string[MAX_STRING];

	switch (getCheckpointType(playerid)) {
 			case CP_STATION1:
	  if(IsPlayerInAnyVehicle(playerid))
	   {
       SendClientMessage(playerid,COLOR_GREY,"To get more fuel in your vehicle type /refuel");

	   }
	   else
	   {
	   SendClientMessage(playerid, COLOR_RED, "You will need a vehicle to refuel..");
       }
       case CP_STATION2:
	  if(IsPlayerInAnyVehicle(playerid))
	   {
       SendClientMessage(playerid,COLOR_GREY,"Type /ReFuel To Re-Fuel Your Vehicle");

	   }
	   else
	   {
	   SendClientMessage(playerid, COLOR_RED, "You will need a vehicle to refuel..");
       }
       case CP_STATION3:
	  if(IsPlayerInAnyVehicle(playerid))
	   {
       SendClientMessage(playerid,COLOR_GREY,"Type /ReFuel To Re-Fuel Your Vehicle");

	   }
	   else
	   {
	   SendClientMessage(playerid, COLOR_RED, "You will need a vehicle to refuel..");
       }
       case CP_STATION4:
	  if(IsPlayerInAnyVehicle(playerid))
	   {
       SendClientMessage(playerid,COLOR_GREY,"Type /ReFuel To Re-Fuel Your Vehicle");

	   }
	   else
	   {
	   SendClientMessage(playerid, COLOR_RED, "You will need a vehicle to refuel..");
       }
       case CP_STATION5:
	  if(IsPlayerInAnyVehicle(playerid))
	   {
       SendClientMessage(playerid,COLOR_GREY,"Type /ReFuel To Re-Fuel Your Vehicle");

	   }
	   else
	   {
	   SendClientMessage(playerid, COLOR_RED, "You will need a vehicle to refuel..");
       }
       case CP_STATION6:
	  if(IsPlayerInAnyVehicle(playerid))
	   {
       SendClientMessage(playerid,COLOR_GREY,"Type /ReFuel To Re-Fuel Your Vehicle");

	   }
	   else
	   {
	   SendClientMessage(playerid, COLOR_RED, "You will need a vehicle to refuel..");
       }
       case CP_STATION7:
	  if(IsPlayerInAnyVehicle(playerid))
	   {
       SendClientMessage(playerid,COLOR_GREY,"Type /ReFuel To Re-Fuel Your Vehicle");

	   }
	   else
	   {
	   SendClientMessage(playerid, COLOR_RED, "You will need a vehicle to refuel..");
       }
       case CP_STATION8:
	  if(IsPlayerInAnyVehicle(playerid))
	   {
       SendClientMessage(playerid,COLOR_GREY,"Type /ReFuel To Re-Fuel Your Vehicle");

	   }
	   else
	   {
	   SendClientMessage(playerid, COLOR_RED, "You will need a vehicle to refuel..");
       }
       case CP_STATION9:
	  if(IsPlayerInAnyVehicle(playerid))
	   {
       SendClientMessage(playerid,COLOR_GREY,"Type /ReFuel To Re-Fuel Your Vehicle");

	   }
	   else
	   {
	   SendClientMessage(playerid, COLOR_RED, "You will need a vehicle to refuel..");
       }
       case CP_STATION10:
	  if(IsPlayerInAnyVehicle(playerid))
	   {
       SendClientMessage(playerid,COLOR_GREY,"Type /ReFuel To Re-Fuel Your Vehicle");

	   }
	   else
	   {
	   SendClientMessage(playerid, COLOR_RED, "You will need a vehicle to refuel..");
       }
       case CP_STATION11:
	  if(IsPlayerInAnyVehicle(playerid))
	   {
       SendClientMessage(playerid,COLOR_GREY,"Type /ReFuel To Re-Fuel Your Vehicle");

	   }
	   else
	   {
	   SendClientMessage(playerid, COLOR_RED, "You will need a vehicle to refuel..");
       }
       case CP_STATION12:
	  if(IsPlayerInAnyVehicle(playerid))
	   {
       SendClientMessage(playerid,COLOR_GREY,"Type /ReFuel To Re-Fuel Your Vehicle");

	   }
	   else
	   {
	   SendClientMessage(playerid, COLOR_RED, "You will need a vehicle to refuel..");
       }
        case CP_STATION13:
	  if(IsPlayerInAnyVehicle(playerid))
	   {
       SendClientMessage(playerid,COLOR_GREY,"Type /ReFuel To Re-Fuel Your Vehicle");

	   }
	   else
	   {
	   SendClientMessage(playerid, COLOR_RED, "You will need a vehicle to refuel..");
       }
        case CP_STATION14:
	  if(IsPlayerInAnyVehicle(playerid))
	   {
       SendClientMessage(playerid,COLOR_GREY,"Type /ReFuel To Re-Fuel Your Vehicle");

	   }
	   else
	   {
	   SendClientMessage(playerid, COLOR_RED, "You will need a vehicle to refuel..");
       }
        case CP_STATION15:
	   if(IsPlayerInAnyVehicle(playerid))
	   {
       SendClientMessage(playerid,COLOR_GREY,"Type /ReFuel To Re-Fuel Your Vehicle");

	   }
	   
	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 OnGameModeInit()
{
	for(new c=0;c<CAR_AMOUNT;c++)
	 {
	 Gas[c] = GasMax;
	 }

	SetGameModeText(GAMEMODETEXT);
	
	LoadSettings();
	
	ShowPlayerMarkers(1);
	ShowNameTags(1);

	AddPlayerClass2(0,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(7,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(9,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(10,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(11,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(12,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(13,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(14,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(15,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(16,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(17,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(18,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(19,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(20,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(21,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(22,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(23,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(24,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(25,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(26,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(27,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(28,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(29,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(30,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(31,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(32,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(33,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(34,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(35,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(36,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(37,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(38,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(39,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(40,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(41,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(43,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(44,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(45,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(46,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(47,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(48,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(49,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(50,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(51,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(52,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(53,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(54,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(55,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(56,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(57,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(58,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(59,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(60,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(61,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(62,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(63,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(64,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(66,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(67,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(68,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(69,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(70,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(71,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(72,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(73,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(75,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(76,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(77,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(78,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(79,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(80,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(81,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(82,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(83,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(84,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(85,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(87,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(88,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(89,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(90,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(91,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(92,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(93,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(94,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(95,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(96,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(97,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(98,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(99,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(100,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(101,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(102,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(103,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(104,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(105,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(106,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(107,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(108,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(109,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(110,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(111,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(112,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(113,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(114,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(115,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(116,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(117,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(118,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(120,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(121,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(122,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(123,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(124,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(125,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(126,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(127,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(128,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(129,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(130,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(131,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(132,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(133,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(134,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(135,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(136,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(137,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(138,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(139,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(140,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(141,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(142,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(143,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(144,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(145,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(146,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(147,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(148,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(150,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(151,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(152,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(153,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(154,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(155,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(156,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(157,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(158,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(159,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(160,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(161,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(162,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(163,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(164,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(165,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(166,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(167,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(168,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(169,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(170,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(171,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(172,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(173,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(174,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(175,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(176,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(177,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(178,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(179,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(180,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(181,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(182,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(183,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(184,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(185,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(186,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(187,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(188,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(189,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(190,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(191,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(192,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(193,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(194,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(195,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(196,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(197,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(198,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(199,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(200,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(201,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(202,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(203,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(204,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(205,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(206,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(207,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(209,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(210,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(211,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(212,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(213,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(214,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(215,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(216,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(217,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(218,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(219,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(220,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(221,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(222,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(223,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(224,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(225,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(226,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(227,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(228,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(229,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(230,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(231,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(232,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(233,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(234,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(235,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(236,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(237,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(238,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(239,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(240,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(241,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(242,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(243,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(244,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(245,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(246,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(247,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(248,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(249,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(250,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(251,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(252,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(253,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(254,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(255,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(256,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(257,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(258,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(259,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(260,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(261,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(262,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(263,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(264,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(274,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(275,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(276,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(277,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(278,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(279,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(280,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(281,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(282,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(283,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(284,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(285,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(286,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(287,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(288,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(290,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(291,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(292,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(293,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(294,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(295,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(296,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(297,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(298,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	AddPlayerClass2(299,1686.26,1432.86,10.50,60.40,0,0,5,1,0,0);
	
	
		AddStaticVehicleEx(415,967.8975,1758.1031,8.4227,180.8312,0,0,30000); // cheetah 1
	AddStaticVehicleEx(415,962.2867,1758.1473,8.4215,178.4580,0,0,30000); // cheetah 2
	AddStaticVehicleEx(415,956.9672,1758.4175,8.4237,182.5266,0,0,30000); // cheetah 3
	AddStaticVehicleEx(415,953.3786,1758.8081,8.2006,178.2439,0,3,30000); // nrg-500 1
	AddStaticVehicleEx(522,951.7813,1758.9962,8.2109,181.6260,0,3,30000); // NRG-500 2
	AddStaticVehicleEx(522,949.6794,1758.6864,8.2028,150.7260,0,3,30000); // NRG-500 3
	AddStaticVehicleEx(528,954.2235,1708.6558,8.6953,2.7000,0,0,30000); // FBI TRUCK 1
	AddStaticVehicleEx(528,958.7197,1708.7458,8.6998,1.6806,0,0,30000); // FBI TRUCK 2
	AddStaticVehicleEx(601,963.2548,1708.8284,8.4128,0.4137,1,1,30000); // S.W.A.T 1
	AddStaticVehicleEx(601,968.4678,1708.9883,8.4102,0.4075,1,1,30000); // S.W.A.T 2
	AddStaticVehicleEx(487,958.4178,1783.5082,15.9708,273.4265,0,3,30000); // maverick 1
	AddStaticVehicleEx(487,955.3674,1681.3934,15.9678,266.6295,0,3,30000); // Maverick 2
	AddStaticVehicleEx(490,983.9391,1741.5570,8.7800,273.0129,0,0,30000); // FBIRANCHER 1
	AddStaticVehicleEx(490,983.8838,1734.2734,8.7846,91.9244,0,0,30000); // fbi rancher 2
	AddStaticVehicleEx(427,984.0886,1727.9799,8.7867,273.6341,-1,-1,30000); // fbi rancher 3
	AddStaticVehicleEx(427,984.1054,1722.7562,8.7820,91.8531,-1,-1,30000); // fbi rancher 4
	AddStaticVehicleEx(521,989.0392,1723.0341,10.3885,1.7221,0,3,30000); // fbi fcr 1
	AddStaticVehicleEx(521,988.6617,1728.3794,10.3796,1.8759,0,3,300000); // fbi fcr 2
	AddStaticVehicleEx(521,988.9102,1734.7937,10.3848,0.3991,0,3,30000); // fbi fcr 3
	AddStaticVehicleEx(521,989.0438,1742.9000,10.3828,359.591,0,3,30000); // fbi fcr 4
		AddStaticVehicleEx(598,2256.3228,2476.7004,10.5690,359.7502,0,1,30000); // cop
	AddStaticVehicleEx(598,2277.9124,2478.1228,10.5650,356.9259,0,1,30000); // cop
	AddStaticVehicleEx(598,2277.1924,2460.8042,10.5666,175.7085,0,1,30000); // cop
	AddStaticVehicleEx(598,2269.8452,2443.3086,10.5714,178.3194,0,1,600000); // cop
	AddStaticVehicleEx(598,2294.7422,2443.8254,10.5663,359.2516,0,1,600000); // cop
AddStaticVehicle(492,1718.7467,1482.0320,10.5231,162.1943,90,96); //lv
AddStaticVehicle(492,1722.0839,1492.1136,10.5229,162.0782,90,96); //lv
    AddStaticVehicleEx(487,2177.42,-2295.47,13.55,120,0,0,600000);
    AddStaticVehicleEx(522,2173.41,-2267.19,13.37,160,0,0,600000);
        AddStaticVehicleEx(522,2174.34,2266.24,13.37,160,0,0,600000);
            AddStaticVehicleEx(522,2175.51,-2265.40,13.38,160,0,0,600000);
//house 1
AddStaticVehicle(487,1363.6833,-611.9517,109.3095,10.7901,117,1); //
AddStaticVehicle(558,1726.5842,1517.1715,10.3746,176.7004,6,25); //
// Start house
AddStaticVehicle(411,2305.6553,1387.4301,42.5473,359.2477,0,1); // banshee?
AddStaticVehicle(411,2320.6255,1388.7914,43.3064,358.8308,0,1); // drift
AddStaticVehicle(411,2333.4727,1388.7819,43.3041,359.6889,0,1); // kk
AddStaticVehicle(492,2351.7881,1408.3610,42.6021,271.3528,90,96); // car


AddStaticVehicle(593,-677.1278,967.4405,11.7175,88.4944,0,0); //
AddStaticVehicle(461,-702.6029,964.9558,11.9748,137.1809,0,0); // THNIG
AddStaticVehicle(487,-650.5371,945.9083,11.7174,60.9910,0,0); // HELI
AddStaticVehicle(470,-681.9379,957.2219,11.7116,181.0159,0,0); //

	AddStaticVehicleEx(470,220.47,1917.65,17.40,0,86,86,600000); // patriot
	AddStaticVehicleEx(415,983.96,1774.41,8.71,0,0,0,600000); //cheetah black
    AddStaticVehicleEx(421,1309.3965,-872.3938,39.4724,0.0037,112,1,600000); //wash@ls
    AddStaticVehicleEx(487,1543.8565,-1353.3238,329.5724,90.0037,0,0,600000); //maver@ls
    AddStaticVehicleEx(481,652.0965,-571.9538,16.3724,270.0037,0,0,600000); //BMX@unjail
    AddStaticVehicleEx(481,652.0965,-570.7538,16.3724,270.0037,0,0,600000); //BMX@unjail
    AddStaticVehicleEx(558,1253.7965,-805.1438,84.5724,180.0037,6,25,600000); //car@maddog
    AddStaticVehicleEx(492,2508.8865,-1669.0938,14.0724,0.0037,90,96,600000); //grovestr1
    AddStaticVehicleEx(421,2497.7965,-1682.8838,14.0724,90.0037,7,7,600000); //grovestr2
    AddStaticVehicleEx(579,2570.4365,-1030.2338,69.4724,180.0037,3,1,600000); //huntley@ls
    AddStaticVehicleEx(421,2205.8365,-1156.8738,26.0724,90.0037,60,0,600000); //wash@ls
    AddStaticVehicleEx(561,1122.8865,-1882.6438,13.4724,180.0037,9,39,600000); //lsbeach
    AddStaticVehicleEx(429,1457.8365,-2348.0538,13.4724,0.0037,23,0,600000); //lsairport
    AddStaticVehicleEx(445,-1384.0765,-246.2038,5.9724,180.0037,112,0,600000); //sfairport
    AddStaticVehicleEx(439,-1380.0765,-246.2038,5.9724,180.0037,36,1,600000); //sfaiport
    AddStaticVehicleEx(496,-2354.4465,983.2238,50.9724,180.0037,52,9,600000); //@sf
	AddStaticVehicleEx(549,1532.6139,2258.0173,10.5176,359.1516,84,36,600000);
	AddStaticVehicleEx(460,2293.4219,517.5514,1.7537,270.7889,1,3,600000); //
	AddStaticVehicleEx(460,2354.4690,518.5284,1.7450,270.2214,1,3,600000); //
	AddStaticVehicleEx(460,772.4293,2912.5579,1.0753,69.6706,1,3,600000); //
	AddStaticVehicleEx(560,2133.0769,1019.2366,10.5259,90.5265,9,39,600000); //
	AddStaticVehicleEx(560,2196.3340,1856.8469,10.5257,179.8070,21,1,600000); //
	AddStaticVehicleEx(560,2103.4146,2069.1514,10.5249,270.1451,33,0,600000); //
	AddStaticVehicleEx(560,-1993.2465,241.5329,34.8774,310.0117,41,29,600000); //
	AddStaticVehicleEx(559,-1946.2416,273.2482,35.1302,126.4200,60,1,600000); //
	AddStaticVehicleEx(558,-1956.8257,271.4941,35.0984,71.7499,24,1,600000); //
	AddStaticVehicleEx(562,-1952.8894,258.8604,40.7082,51.7172,17,1,600000); //
	AddStaticVehicleEx(411,-1949.8689,266.5759,40.7776,216.4882,112,1,600000); //
	AddStaticVehicleEx(559,-1657.6660,1213.6195,6.9062,282.6953,13,8,600000); //
	AddStaticVehicleEx(560,-1658.3722,1213.2236,13.3806,37.9052,52,39,600000); //
	AddStaticVehicleEx(558,-1660.8994,1210.7589,20.7875,317.6098,36,1,600000); //
	AddStaticVehicleEx(550,-1645.2401,1303.9883,6.8482,133.6013,7,7,600000); //
	AddStaticVehicleEx(460,-1333.1960,903.7660,1.5568,0.5095,46,32,600000); //
	AddStaticVehicleEx(411,113.8611,1068.6182,13.3395,177.1330,116,1,600000); //
	AddStaticVehicleEx(411,612.4678,1694.4126,6.7192,302.5539,75,1,600000); //
	AddStaticVehicleEx(522,661.7609,1720.9894,6.5641,19.1231,6,25,600000); //
	AddStaticVehicleEx(522,660.0554,1719.1187,6.5642,12.7699,8,82,600000); //
	AddStaticVehicleEx(567,711.4207,1947.5208,5.4056,179.3810,90,96,600000); //
	AddStaticVehicleEx(567,1031.8435,1920.3726,11.3369,89.4978,97,96,600000); //
	AddStaticVehicleEx(567,1112.3754,1747.8737,10.6923,270.9278,102,114,600000); //
	AddStaticVehicleEx(567,1641.6802,1299.2113,10.6869,271.4891,97,96,600000); //
	AddStaticVehicleEx(567,2135.8757,1408.4512,10.6867,180.4562,90,96,600000); //
	AddStaticVehicleEx(567,2262.2639,1469.2202,14.9177,91.1919,99,81,600000); //
	AddStaticVehicleEx(567,2461.7380,1345.5385,10.6975,0.9317,114,1,600000); //
	AddStaticVehicleEx(567,2804.4365,1332.5348,10.6283,271.7682,88,64,600000); //
	AddStaticVehicleEx(560,2805.1685,1361.4004,10.4548,270.2340,17,1,600000); //
	AddStaticVehicleEx(506,2853.5378,1361.4677,10.5149,269.6648,7,7,600000); //
	AddStaticVehicleEx(567,2633.9832,2205.7061,10.6868,180.0076,93,64,600000); //
	AddStaticVehicleEx(567,2119.9751,2049.3127,10.5423,180.1963,93,64,600000); //
	AddStaticVehicleEx(567,2785.0261,-1835.0374,9.6874,226.9852,93,64,600000); //
	AddStaticVehicleEx(567,2787.8975,-1876.2583,9.6966,0.5804,99,81,600000); //
	AddStaticVehicleEx(411,2771.2993,-1841.5620,9.4870,20.7678,116,1,600000); ///////miii
    AddStaticVehicleEx(487,-2545.7349,634.8876,27.9889,271.3049,4,4,600000); //
    AddStaticVehicleEx(487,-2591.7341,664.7125,27.9901,91.0542,4,4,600000); //
    AddStaticVehicleEx(411,-2022.3630,-43.6990,35.0829,179.7754,116,1,600000); //
    AddStaticVehicleEx(481,1705.0021,1464.1945,10.4055,240.0284,4,64,600000); //
    AddStaticVehicleEx(481,1704.3240,1460.6266,10.4043,235.1552,29,10,600000); //
	AddStaticVehicleEx(549,1532.6139,2258.0173,10.5176,359.1516,84,36,600000);
	AddStaticVehicleEx(460,2293.4219,517.5514,1.7537,270.7889,1,3,600000); //
 //park  1705.59 1468.93 10.79 0
	AddStaticVehicleEx(522,1969.7039,-1427.6030,13.1170,64.9409,0,0,600000); // nrg2
	AddStaticVehicleEx(522,1971.3477,-1423.8048,13.1231,37.9276,0,0,600000); // nrgspot
	AddStaticVehicleEx(522,1970.7039,-1427.6030,13.1170,64.9409,1,1,600000); // nrg2
	AddStaticVehicleEx(481,1909.7827,-1362.4442,13.1180,156.8242,6,25,600000); // mountainbike
	AddStaticVehicleEx(481,1913.6904,-1362.6309,13.1783,173.9892,6,25,600000); // mountain bike
	AddStaticVehicleEx(571,1862.5336,-1383.4044,13.6260,90.2452,0,0,600000); // gokart
 //Aircraft
	AddStaticVehicleEx(511,1336.5591,1619.3850,10.5841,234.6598,73,73,600000); //Beaglelv
	AddStaticVehicleEx(511,1331.2627,1577.0571,10.5837,239.0417,14,15,600000); //Beaglelv2
	AddStaticVehicleEx(577,1585.3497,1190.4709,10.7407,178.3086,14,115,600000); //at400lv
	AddStaticVehicleEx(593,1277.7241,1361.6198,10.5800,269.3047,68,94,600000); //dodolv
	AddStaticVehicleEx(512,1279.5392,1322.9293,10.5848,270.1408,2,1,600000); //croplv
	AddStaticVehicleEx(487,1611.1862,1628.0591,10.6037,131.5763,117,1,600000); //maverlv
	AddStaticVehicleEx(593,1618.4799,-2620.0817,14.6279,0.7206,22,22,600000); //dodols
	AddStaticVehicleEx(476,1752.5687,-2620.0817,14.6269,0.4681,22,22,600000); //rustls
	AddStaticVehicleEx(593,1888.9487,-2620.0817,14.6269,0.4681,22,22,600000); //dodols
	AddStaticVehicleEx(487,1915.3087,-2248.1352,13.8269,180.4681,22,22,600000); //maverls
	AddStaticVehicleEx(487,1926.3087,-2248.1352,13.8269,180.4681,22,22,600000); //maverls
	AddStaticVehicleEx(487,-1186.7487,26.2052,14.8269,315.4681,22,22,600000); //maversf
	AddStaticVehicleEx(487,-1223.0087,-9.8852,14.8269,315.4681,22,22,600000); //maversf
	AddStaticVehicleEx(593,-1253.4287,-107.4752,14.8269,225.4681,22,22,600000); //dodosf
	AddStaticVehicleEx(512,-1209.6287,-149.1952,14.8269,225.4681,22,22,600000); //cropsf
	AddStaticVehicleEx(476,308.22,2063.22,17.63,0.4681,22,22,600000); //kieranrustler
 //Taxis
	AddStaticVehicleEx(438,1942.5831,1361.5244,8.9289,180.0435,6,1,600000); // taxi
	AddStaticVehicleEx(438,1942.7462,1345.8079,8.9267,180.3112,6,1,600000); // taxi
	AddStaticVehicleEx(438,1942.8987,1336.5459,8.9294,180.3774,6,1,600000); // taxi
	AddStaticVehicleEx(438,1943.0062,1325.4645,8.9273,180.4461,6,1,600000); // taxi
 //Cop Cars

//kartrace
	AddStaticVehicleEx(571,1270.4166,150.0643,19.4953,197.0839,0,0,600000); // kart
	AddStaticVehicleEx(571,1269.3892,154.4089,19.3629,169.9043,0,0,600000); // kart
	AddStaticVehicleEx(571,1273.4836,145.2664,19.6700,219.8932,0,0,600000); // kart
//Loco
    AddStaticVehicleEx(535,2636.5165,-2004.9538,14.0724,90.0037,25,6,600000); //slamvan
    AddStaticVehicleEx(536,2654.1365,-2033.2738,14.3724,270.0037,84,36,600000); //blade
    AddStaticVehicleEx(534,2635.7865,-2001.0938,14.0724,91.0037,99,81,600000); //remming
//Limo Base
	AddStaticVehicleEx(409,1512.7507,-1463.6000,9.3318,180.5081,0,0,600000); //Limo
    AddStaticVehicleEx(409,1519.4132,-1463.6000,9.3318,180.5081,0,0,600000); //Limo
    AddStaticVehicleEx(409,1525.1732,-1463.6000,9.3318,180.5081,0,0,600000); //Limo
 //SPAWN@LV
    AddStaticVehicleEx(462,1696.5965,1475.9538,10.8724,90.0037,-1,-1,600000); //mpoed@spawn
    AddStaticVehicleEx(462,1696.5965,1477.9538,10.8724,90.0037,0,0,600000); //@spawn
    AddStaticVehicleEx(572,1729.5165,1398.1138,10.7724,90.0037,0,0,600000); //lawnmower
 //SPAWNPARKING
    AddStaticVehicleEx(419,1641.8165,1305.2138,10.9724,90.0037,0,0,600000); //car@spawn
	AddStaticVehicleEx(491,1641.8165,1293.2338,10.9724,90.0037,0,0,600000); //car@spawn
	AddStaticVehicleEx(461,1660.2765,1297.4338,10.9724,0.0037,0,0,600000); //bike@spawn
	AddStaticVehicleEx(461,1660.2765,1305.8738,10.9724,180.0037,0,0,600000); //bike@spawn
//Mono's house
	AddStaticVehicleEx(409,323.2465,-1764.1938,4.3724,179.9237,0,0,600000); //Limo
	AddStaticVehicleEx(586,319.8901,-1765.4097,4.1326,179.9237,0,0,600000); //Wayfarer

	AddStaticVehicleEx(550,166.84,-1353.78,69.20,0,13,14,600000);
	AddStaticVehicleEx(545,165.99,-1341.06,69.58,0,13,14,600000);
	AddStaticVehicleEx(545,170.91,-1341.08,69.96,0,13,14,600000);
	AddStaticVehicleEx(487,165.56,-1275.81,70.84,180,13,14,600000);
	AddStaticVehicleEx(545,178.43,-1334.04,79.0,0,13,14,600000);
	AddStaticVehicleEx(545,159.36,-1341.23,69.85,180,13,14,600000);
	
	//
	AddStaticVehicle(461,-677.1278,967.4405,11.7175,88.4944,0,0); // 
AddStaticVehicle(461,-702.6029,964.9558,11.9748,137.1809,0,0); // THNIG
AddStaticVehicle(461,-650.5371,945.9083,11.7174,60.9910,0,0); // HELI
AddStaticVehicle(461,-681.9379,957.2219,11.7116,181.0159,0,0); // 
AddStaticVehicle(461,1275.1030,2532.7144,10.3986,85.5069,0,0); // mortverthouse
AddStaticVehicle(536,1368.3563,2576.4451,10.5578,357.6724,84,36); // voodoo
AddStaticVehicle(429,1275.8669,2527.9175,10.5000,90.2600,23,0); // banshee
AddStaticVehicle(522,-1435.9855,-1541.8541,101.3140,270.9387,0,0); // nrg kieren
AddStaticVehicle(411,-1435.4154,-1538.4767,101.4866,89.4287,0,1); // infurnus

AddStaticVehicle(411,2305.6553,1387.4301,42.5473,359.2477,0,1); // banshee?
AddStaticVehicle(411,2320.6255,1388.7914,43.3064,358.8308,0,1); // drift
AddStaticVehicle(411,2333.4727,1388.7819,43.3041,359.6889,0,1); // kk
AddStaticVehicle(492,2351.7881,1408.3610,42.6021,271.3528,90,96); // car
AddStaticVehicle(525,2142.4917,1397.3590,10.5943,180.7787,0,0); // car
//
AddStaticPickup(353,2,2607.5862,2825.6982,19.9999); // GUN
AddStaticPickup(1242,2,2613.6665,2805.2686,19.9922); // ARMOR
AddStaticPickup(353,2,2585.9312,2805.4758,19.9922); // MP4?
AddStaticPickup(372,2,2555.8521,2832.8374,19.9922); // //dunno
AddStaticPickup(355,2,2563.5918,2847.9858,19.9922); // ak?
AddStaticPickup(1242,2,2613.6262,2848.6221,19.9922); // amor/health



	LoadPropertyOwners();
    AddStaticPickup(370,15,213.8414,1874.6965,17.6406);		// jetpack area69
     AddStaticPickup(1242,2,2613.6665,2805.2686,19.9922); // ARMOR
	SetTimer("checkpointUpdate", 1000, 1);
	SetTimer("TimeUpdate", 60000, 1);
	SetTimer("HoldAreasScoreUpdate", 2000, 1);
	SetTimer("GlobalPlayerSave", 1800000, 1);
	SetTimer("PropertyScoreUpdate", 150000, 1);
	SetTimer("VehicleStatusUpdate", 10000, 1);
	SetTimer("MoneyScan", 10000, 1);
	SetTimer("MoneyCheck", 10000, 1);
	SetTimer("HealthScan", 10000000, 1);
	SetTimer("ColorCheck", 1000, 1);
	SetTimer("IdleCheck", 60000, 1);
	SetTimer("SpectatorUpdate", 100, 1);
	SetTimer("ReportTimeoutUpdate", 60000, 1);
	SetTimer("VoteKickBanUpdate", 1000, 1);
    SetTimer("FuelDown", RunOutTime, 100);
    SetTimer("CheckGas", 500, 1);
    SetTimer("Fill", 500, 1);
SetTimer("PayDay", 360000, 1);
 /*
 
 
 */

	return 1;
}

public OnGameModeExit()
{
    WriteLog("");
    WriteLog("");
	WriteLog("*** Freeroam gamemode exiting...");

	GlobalPlayerSave();

 	GameModeExit();
}