/*
  Admin script created by Tomasz 'tommy4' Klapsia.
  For any info about this script please search SA-MP Forum.
  Anyway you can visit my site: http://gtacartel.com or http://tommy4.gtacartel.com
  If you want to contact with me or give me any info about bugs just send an email to admin@gtacartel.com
  By the way, you can join my channels #gtacartel and #gtacartel.com on QuakeNet or #gtacartel.com on GTANet.
  Open scriptfiles/admin/settings.txt to change settings.
  Open scriptfiles/admin/colors.txt to add some new colors.
  You must have
  Version: 1.1
  Working with: SA-MP 0.1b
  All rights reserved. :) Please do not remove copyrights.
*/

// required files
#include <a_samp>
#include <file>
#include <float>
#include <string>
#include <time>

// some colors
const COLOR_WHITE = 0xFFFFFFAA;
const COLOR_LIGHTBLUE = 0x33CCFFAA;
const COLOR_GREY = 0xAFAFAFAA;
const COLOR_INVISIBLE = 0xFFFFFF00;
const COLOR_YELLOW = 0xFFFF00AA;
const COLOR_GREEN = 0x33AA33AA;

// global, static variables
static Float:posx = 0.0;
static Float:posy = 0.0;
static Float:posz = 0.0;
static Float:zangle = 0.0;

static gFreeze = 0;
static gError = 0;

static gFreezed[MAX_PLAYERS];

static gPrefix[256];
static gDefaultHealth[256];
static gDefaultMoney[256];
static gDefaultAmmo[256];
static gLanguage[256];
static gOnCheckpointText[256];
static gPlayerLogins[MAX_PLAYERS][100];

static gLogged[MAX_PLAYERS];

// functions
public FindWeaponID(weapon[])
{
	// this function changing name of the weapon to id
	new weaponid = 0;
	if(strcmp(weapon, "GOLFCLUB", true) == 0 || strval(weapon) == 2)
	{
		weaponid = 2;
	}
	else if(strcmp(weapon, "NITESTICK", true) == 0 || strval(weapon) == 3)
	{
    	weaponid = 3;
	}
	else if(strcmp(weapon, "KNIFE", true) == 0 || strval(weapon) == 4)
	{
	    weaponid = 4;
	}
	else if(strcmp(weapon, "BAT", true) == 0 || strval(weapon) == 5)
	{
	    weaponid = 5;
	}
	else if(strcmp(weapon, "SHOVEL", true) == 0 || strval(weapon) == 6)
	{
	    weaponid = 6;
	}
	else if(strcmp(weapon, "POOLCUE", true) == 0 || strval(weapon) == 7)
	{
	    weaponid = 7;
	}
	else if(strcmp(weapon, "KATANA", true) == 0 || strval(weapon) == 8)
	{
		weaponid = 8;
	}
	else if(strcmp(weapon, "CHAINSAW", true) == 0 || strval(weapon) == 9)
	{
	    weaponid = 9;
	}
	else if(strcmp(weapon, "DILDO", true) == 0 || strval(weapon) == 10)
	{
	    weaponid = 10;
	}
	else if(strcmp(weapon, "DILDO2", true) == 0 || strval(weapon) == 11)
	{
	    weaponid = 11;
	}
	else if(strcmp(weapon, "VIBRATOR", true) == 0 || strval(weapon) == 12)
	{
	    weaponid = 12;
	}
	else if(strcmp(weapon, "VIBRATOR2", true) == 0 || strval(weapon) == 13)
	{
	    weaponid = 13;
	}
	else if(strcmp(weapon, "FLOWERS", true) == 0 || strval(weapon) == 14)
	{
	    weaponid = 14;
	}
	else if(strcmp(weapon, "CANE", true) == 0 || strval(weapon) == 15)
	{
	    weaponid = 15;
	}
	else if(strcmp(weapon, "COLT45", true) == 0 || strval(weapon) == 22)
	{
	    weaponid = 22;
	}
	else if(strcmp(weapon, "SILENCED", true) == 0 || strval(weapon) == 23)
	{
	    weaponid = 23;
	}
	else if(strcmp(weapon, "DEAGLE", true) == 0 || strval(weapon) == 24)
	{
	    weaponid = 24;
	}
	else if(strcmp(weapon, "SHOTGUN", true) == 0 || strval(weapon) == 25)
	{
	    weaponid = 25;
	}
	else if(strcmp(weapon, "SAWNOFF", true) == 0 || strval(weapon) == 26)
	{
	    weaponid = 26;
	}
	else if(strcmp(weapon, "COMBAT", true) == 0 || strval(weapon) == 27)
	{
	    weaponid = 27;
	}
	else if(strcmp(weapon, "UZI", true) == 0 || strval(weapon) == 28)
	{
	    weaponid = 28;
	}
	else if(strcmp(weapon, "MP5", true) == 0 || strval(weapon) == 29)
	{
	    weaponid = 29;
	}
	else if(strcmp(weapon, "AK47", true) == 0 || strval(weapon) == 30)
	{
	    weaponid = 30;
	}
	else if(strcmp(weapon, "M4", true) == 0 || strval(weapon) == 31)
	{
	    weaponid = 31;
	}
	else if(strcmp(weapon, "TEC9", true) == 0 || strval(weapon) == 32)
	{
	    weaponid = 32;
	}
	else if(strcmp(weapon, "FLAMETHROWER", true) == 0 || strval(weapon) == 37)
	{
	    weaponid = 37;
	}
	else if(strcmp(weapon, "MINIGUN", true) == 0 || strval(weapon) == 38)
	{
	    weaponid = 38;
	}
	else if(strcmp(weapon, "SPRAYCAN", true) == 0 || strval(weapon) == 41)
	{
	    weaponid = 41;
	}
	else if(strcmp(weapon, "EXTINGUISHER", true) == 0 || strval(weapon) == 42)
	{
	    weaponid = 42;
	}
	else if(strcmp(weapon, "PARACHUTE", true) == 0 || strval(weapon) == 46)
	{
	    weaponid = 46;
	}
	return weaponid;
}
public CheckSkin(skin)
{
	// checking for incorrect skin ids
	if((skin >= 0 && skin <= 2) ||
	   (skin >= 47 && skin <= 64) ||
	   (skin >= 66 && skin <= 73) ||
	   (skin >= 75 && skin <= 76) ||
	   (skin >= 78 && skin <= 85) ||
	   (skin >= 87 && skin <= 89) ||
	   (skin >= 91 && skin <= 93) ||
	   (skin >= 95 && skin <= 118) ||
	   (skin >= 120 && skin <= 129) ||
	   (skin == 131) ||
	   (skin >= 133 && skin <= 148) ||
	   (skin >= 150 && skin <= 207) ||
	   (skin >= 209 && skin <= 251) ||
	   (skin >= 253 && skin <= 264) ||
	   (skin >= 274 && skin <= 288) ||
	   (skin >= 290 && skin <= 299))
	{
		return 1;
	}
	return 0;
}
public CheckSound(sound)
{
	// checking for incorrect sound ids
	if((sound >= 1000 && sound <= 1189) ||
	   (sound >= 1800 && sound <= 1829) ||
	   (sound >= 2000 && sound <= 2163) ||
	   (sound >= 2200 && sound <= 2214) ||
	   (sound >= 2400 && sound <= 2404) ||
	   (sound >= 2600 && sound <= 2608) ||
	   (sound >= 2800 && sound <= 2813) ||
	   (sound >= 3000 && sound <= 3057) ||
	   (sound >= 3200 && sound <= 3201) ||
	   (sound >= 3400 && sound <= 3401) ||
	   (sound == 3600) ||
	   (sound == 3800) ||
	   (sound >= 4000 && sound <= 4001) ||
	   (sound >= 4200 && sound <= 4203) ||
	   (sound == 4400) ||
	   (sound >= 4600 && sound <= 4604) ||
	   (sound >= 4800 && sound <= 4807) ||
	   (sound >= 5000 && sound <= 5014) ||
	   (sound >= 5200 && sound <= 5206) ||
	   (sound >= 5400 && sound <= 5464) ||
	   (sound >= 5600 && sound <= 5602) ||
	   (sound >= 5800 && sound <= 5856) ||
	   (sound >= 6000 && sound <= 6003) ||
	   (sound >= 6200 && sound <= 6205) ||
	   (sound >= 6400 && sound <= 6402) ||
	   (sound >= 6600 && sound <= 6603) ||
	   (sound >= 6800 && sound <= 6802) ||
	   (sound >= 7000 && sound <= 7066) ||
	   (sound >= 7200 && sound <= 7239) ||
	   (sound >= 7400 && sound <= 7421) ||
	   (sound >= 7600 && sound <= 7612) ||
	   (sound >= 7800 && sound <= 7902) ||
	   (sound >= 8000 && sound <= 8017) ||
	   (sound >= 8200 && sound <= 8278) ||
	   (sound >= 8400 && sound <= 8412) ||
	   (sound >= 8600 && sound <= 8738) ||
	   (sound >= 8800 && sound <= 8840) ||
	   (sound >= 9000 && sound <= 9031) ||
	   (sound >= 9200 && sound <= 9201) ||
	   (sound >= 9400 && sound <= 9451) ||
	   (sound >= 9600 && sound <= 9676) ||
	   (sound >= 9800 && sound <= 9914) ||
	   (sound >= 10000 && sound <= 10015) ||
	   (sound >= 10200 && sound <= 10214) ||
	   (sound >= 10400 && sound <= 10409) ||
	   (sound >= 10600 && sound <= 10663) ||
	   (sound >= 10800 && sound <= 10832) ||
	   (sound >= 11000 && sound <= 11010) ||
	   (sound == 11200) ||
	   (sound >= 11400 && sound <= 11455) ||
	   (sound >= 11600 && sound <= 11655) ||
	   (sound >= 11800 && sound <= 11855) ||
	   (sound >= 12000 && sound <= 12055) ||
	   (sound >= 12200 && sound <= 12201) ||
       (sound >= 12400 && sound <= 12411) ||
	   (sound >= 12600 && sound <= 12605) ||
	   (sound >= 12800 && sound <= 12832) ||
	   (sound >= 13000 && sound <= 13038) ||
	   (sound >= 13200 && sound <= 13216) ||
	   (sound >= 13400 && sound <= 13419) ||
	   (sound >= 13600 && sound <= 13646) ||
	   (sound >= 13800 && sound <= 13803) ||
	   (sound >= 14000 && sound <= 14041) ||
	   (sound == 14200) ||
	   (sound >= 14400 && sound <= 14410) ||
	   (sound == 14600) ||
	   (sound == 14800) ||
	   (sound >= 15000 && sound <= 15028) ||
	   (sound >= 15200 && sound <= 15258) ||
	   (sound >= 15400 && sound <= 15408) ||
	   (sound >= 15600 && sound <= 15603) ||
	   (sound >= 15800 && sound <= 15950) ||
	   (sound >= 16000 && sound <= 16018) ||
	   (sound == 16200) ||
	   (sound >= 16400 && sound <= 16504) ||
	   (sound >= 16600 && sound <= 16614) ||
	   (sound >= 16800 && sound <= 16803) ||
	   (sound >= 17000 && sound <= 17006) ||
	   (sound == 17200) ||
	   (sound >= 17400 && sound <= 17455) ||
	   (sound >= 17600 && sound <= 17622) ||
	   (sound >= 17800 && sound <= 17807) ||
	   (sound >= 18000 && sound <= 18025) ||
	   (sound >= 18200 && sound <= 18216) ||
	   (sound >= 18400 && sound <= 18434) ||
	   (sound >= 18600 && sound <= 18616) ||
	   (sound >= 18800 && sound <= 18807) ||
	   (sound >= 19000 && sound <= 19135) ||
	   (sound >= 19200 && sound <= 19219) ||
	   (sound >= 19400 && sound <= 19403) ||
	   (sound >= 19600 && sound <= 19604) ||
	   (sound == 19800) ||
	   (sound >= 20000 && sound <= 20072) ||
	   (sound >= 20200 && sound <= 20248) ||
	   (sound >= 20400 && sound <= 20424) ||
	   (sound == 20600) ||
	   (sound >= 20800 && sound <= 20804) ||
	   (sound >= 21000 && sound <= 21002) ||
	   (sound >= 21200 && sound <= 21207) ||
	   (sound >= 21400 && sound <= 21456) ||
	   (sound >= 21600 && sound <= 21666) ||
	   (sound >= 21800 && sound <= 21808) ||
	   (sound >= 22000 && sound <= 22039) ||
	   (sound >= 22200 && sound <= 22217) ||
	   (sound >= 22400 && sound <= 22406))
	{
	    return 1;
	}
	else if((sound == 22600) ||
	   (sound >= 22800 && sound <= 22839) ||
	   (sound == 23000) ||
	   (sound >= 23200 && sound <= 23209) ||
	   (sound == 23400) ||
	   (sound == 23600) ||
	   (sound >= 23800 && sound <= 23835) ||
	   (sound >= 24000 && sound <= 24063) ||
	   (sound >= 24200 && sound <= 24219) ||
	   (sound >= 24400 && sound <= 24433) ||
	   (sound == 24600) ||
	   (sound >= 24800 && sound <= 24829) ||
	   (sound >= 25000 && sound <= 25047) ||
	   (sound >= 25200 && sound <= 25319) ||
	   (sound >= 25400 && sound <= 25423) ||
	   (sound >= 25600 && sound <= 25604) ||
	   (sound >= 25800 && sound <= 25801) ||
	   (sound >= 26000 && sound <= 26009) ||
	   (sound >= 26200 && sound <= 26233) ||
	   (sound >= 26400 && sound <= 26412) ||
	   (sound >= 26600 && sound <= 26633) ||
	   (sound >= 26800 && sound <= 26811) ||
	   (sound >= 27000 && sound <= 27018) ||
	   (sound >= 27200 && sound <= 27205) ||
	   (sound >= 27400 && sound <= 27422) ||
	   (sound >= 27600 && sound <= 27621) ||
	   (sound >= 27800 && sound <= 27833) ||
	   (sound == 28000) ||
	   (sound >= 28200 && sound <= 28204) ||
	   (sound >= 28400 && sound <= 28427) ||
	   (sound >= 28600 && sound <= 28622) ||
	   (sound >= 28800 && sound <= 28811) ||
	   (sound >= 29000 && sound <= 29155) ||
	   (sound >= 29200 && sound <= 29217) ||
	   (sound >= 29400 && sound <= 29413) ||
	   (sound >= 29600 && sound <= 29665) ||
	   (sound >= 29800 && sound <= 29825) ||
	   (sound >= 30000 && sound <= 30082) ||
	   (sound >= 30200 && sound <= 30221) ||
	   (sound >= 30400 && sound <= 30416) ||
	   (sound == 30600) ||
	   (sound >= 30800 && sound <= 30803) ||
	   (sound >= 31000 && sound <= 31001) ||
	   (sound >= 31200 && sound <= 31205) ||
	   (sound == 31400) ||
	   (sound >= 31600 && sound <= 31605) ||
	   (sound >= 31800 && sound <= 31810) ||
	   (sound == 32000) ||
	   (sound >= 32200 && sound <= 32201) ||
	   (sound >= 32400 && sound <= 32402) ||
	   (sound == 32600) ||
	   (sound >= 32800 && sound <= 32847) ||
	   (sound >= 33000 && sound <= 33088) ||
	   (sound >= 33200 && sound <= 33304) ||
	   (sound >= 33400 && sound <= 33403) ||
	   (sound >= 33600 && sound <= 33676) ||
	   (sound >= 33800 && sound <= 33889) ||
	   (sound >= 34000 && sound <= 34067) ||
	   (sound >= 34200 && sound <= 34273) ||
	   (sound >= 34400 && sound <= 34415) ||
	   (sound >= 34600 && sound <= 34606) ||
	   (sound >= 34800 && sound <= 34831) ||
	   (sound >= 35000 && sound <= 35075) ||
	   (sound >= 35200 && sound <= 35240) ||
	   (sound >= 35400 && sound <= 35488) ||
	   (sound >= 35600 && sound <= 35733) ||
	   (sound >= 35800 && sound <= 35883) ||
	   (sound == 36000) ||
	   (sound >= 36200 && sound <= 36205) ||
	   (sound >= 36400 && sound <= 36401) ||
	   (sound >= 36600 && sound <= 36604) ||
	   (sound >= 36800 && sound <= 36860) ||
	   (sound >= 37000 && sound <= 37035) ||
	   (sound >= 37200 && sound <= 37245) ||
	   (sound >= 37400 && sound <= 37494) ||
	   (sound >= 37600 && sound <= 37681) ||
	   (sound >= 37800 && sound <= 37873) ||
	   (sound >= 38000 && sound <= 38060) ||
	   (sound >= 38200 && sound <= 38238) ||
	   (sound >= 38400 && sound <= 38471) ||
	   (sound >= 38600 && sound <= 38644) ||
	   (sound >= 38800 && sound <= 38854) ||
	   (sound >= 39000 && sound <= 39078) ||
	   (sound >= 39200 && sound <= 39223) ||
	   (sound >= 39400 && sound <= 39413) ||
	   (sound >= 39600 && sound <= 39667) ||
	   (sound >= 39800 && sound <= 39815) ||
	   (sound == 40000) ||
	   (sound >= 40200 && sound <= 40238) ||
	   (sound >= 40400 && sound <= 40408) ||
	   (sound == 40600) ||
	   (sound >= 40800 && sound <= 40820) ||
	   (sound >= 41000 && sound <= 41042) ||
	   (sound >= 41200 && sound <= 41272) ||
	   (sound >= 41400 && sound <= 41432) ||
	   (sound >= 41600 && sound <= 41604) ||
	   (sound == 41800) ||
	   (sound >= 42000 && sound <= 42011) ||
	   (sound >= 42200 && sound <= 42208) ||
	   (sound >= 42400 && sound <= 42424))
	{
		return 1;
	}
	else if((sound >= 42600 && sound <= 42601) ||
	   (sound >= 42800 && sound <= 42803) ||
	   (sound >= 43000 && sound <= 43001) ||
	   (sound >= 43200 && sound <= 43206) ||
	   (sound >= 43400 && sound <= 43407) ||
	   (sound >= 43600 && sound <= 43664) ||
	   (sound >= 43800 && sound <= 43905) ||
	   (sound >= 44000 && sound <= 44107) ||
	   (sound >= 44200 && sound <= 44247) ||
	   (sound >= 44400 && sound <= 44444) ||
	   (sound >= 44600 && sound <= 44631) ||
	   (sound >= 44800 && sound <= 44820) ||
	   (sound >= 45000 && sound <= 45011) ||
	   (sound >= 45200 && sound <= 45255) ||
	   (sound == 45400))
    {
    	return 1;
	}
	return 0;
}
public CheckWeapon(weapon)
{
	// checking for incorrect weapon ids
	if((weapon >= 1 && weapon <= 17) ||
	   (weapon >= 21 && weapon <= 43) ||
	   (weapon == 46) ||
	   (weapon == 49) ||
	   (weapon >= 53 && weapon <= 54))
	{
		return 1;
	}
	return 0;
}
public Lang(line)
{
	// getting a string from language file
	new file[256];
	new retstr[256];
	new strfile[256];
	new linenum = 0;
	format(file, sizeof(file), "admin/languages/%s.txt", gLanguage);
	if(fexist(file))
	{
	    new File:language = fopen(file, io_read);
	    while(fread(language, strfile, sizeof(strfile), false))
	    {
			linenum = linenum+1;
			if(linenum == line)
			{
			    retstr = strfile;
			    return retstr;
			}
	    }
	}
	retstr = Lang(76);
	return retstr;
}
public strhextodec(color[])
{
	// changing hex string to decimal value
	if(strlen(color) == 10)
	{
	    new hex[9];
	    strmid(hex, color, 2, strlen(color), sizeof(hex));
	    new strn1[4];
	    new strn2[4];
	    new strn3[4];
	    new strn4[4];
	    new strn5[4];
	    new strn6[4];
	    new strn7[4];
	    new strn8[4];
	    strmid(strn1, hex, 7, 8, sizeof(strn1));
	    strmid(strn2, hex, 6, 7, sizeof(strn2));
	    strmid(strn3, hex, 5, 6, sizeof(strn3));
	    strmid(strn4, hex, 4, 5, sizeof(strn4));
	    strmid(strn5, hex, 3, 4, sizeof(strn5));
	    strmid(strn6, hex, 2, 3, sizeof(strn6));
	    strmid(strn7, hex, 1, 2, sizeof(strn7));
	    strmid(strn8, hex, 0, 1, sizeof(strn8));
	    new n1 = strval(strhextostrdec(strn1));
	    new n2 = strval(strhextostrdec(strn2));
	    new n3 = strval(strhextostrdec(strn3));
	    new n4 = strval(strhextostrdec(strn4));
	    new n5 = strval(strhextostrdec(strn5));
	    new n6 = strval(strhextostrdec(strn6));
	    new n7 = strval(strhextostrdec(strn7));
	    new n8 = strval(strhextostrdec(strn8));
	    if(n1 == -1 || n2 == -1 || n3 == -1 || n4 == -1 || n5 == -1 || n6 == -1 || n7 == -1 || n8 == -1)
	    {
	        return 0;
		}
	    n1 = n1 * 1;
		n2 = n2 * 16;
		n3 = n3 * 256;
		n4 = n4 * 4096;
		n5 = n5 * 65536;
		n6 = n6 * 1048576;
		n7 = n7 * 16777216;
		n8 = n8 * 268435456;
		new result;
		result = n1 + n2 + n3 + n4 + n5 + n6 + n7 + n8;
		return result;
	}
	return 0;
}

public strhextostrdec(hex[4])
{
	// changing hex chars to decimal strings
	new result[4];
	if(strcmp(hex, "F", true) == 0)
	{
	    result = "15";
		return result;
	}
	else if(strcmp(hex, "E", true) == 0)
	{
	    result = "14";
	    return result;
	}
	else if(strcmp(hex, "D", true) == 0)
	{
	    result = "13";
	    return result;
	}
	else if(strcmp(hex, "C", true) == 0)
	{
	    result = "12";
	    return result;
	}
	else if(strcmp(hex, "B", true) == 0)
	{
	    result = "11";
	    return result;
	}
	else if(strcmp(hex, "A", true) == 0)
	{
	    result = "10";
	    return result;
	}
	else if(strcmp(hex, "0", true) == 0 || strcmp(hex, "1", true) == 0 || strcmp(hex, "2", true) == 0 || strcmp(hex, "3", true) == 0 || strcmp(hex, "4", true) == 0 || strcmp(hex, "5", true) == 0 || strcmp(hex, "6", true) == 0 || strcmp(hex, "7", true) == 0 || strcmp(hex, "8", true) == 0 || strcmp(hex, "9", true) == 0)
	{
	    return hex;
	}
	result = "-1";
	return result;
}

CheckText(text[])
{
	// checking text for crashing values
	new len = strlen(text);
	new pos = 0;
	new char1[2];
	new char2[2];
	new char3[2];
	while(pos <= len)
	{
	    strmid(char1, text, pos, pos+1, sizeof(char1));
	    strmid(char2, text, pos+1, pos+2, sizeof(char2));
	    strmid(char3, text, pos+2, pos+3, sizeof(char3));
	    if(strcmp(char1, "~", true) == 0)
	    {
	        if(strcmp(char2, "r", true) == 0 || strcmp(char2, "g", true) == 0 || strcmp(char2, "b", true) == 0 || strcmp(char2, "y", true) == 0 || strcmp(char2, "w", true) == 0 || strcmp(char2, "p", true) == 0 || strcmp(char2, "d", true) == 0 || strcmp(char2, "h", true) == 0 || strcmp(char2, "l", true) == 0 || strcmp(char2, "u", true) == 0 || strcmp(char2, "n", true) == 0)
	        {
	            if(strcmp(char3, "~", true) != 0)
	            {
	                return 0;
				}
				else
				{
				    pos = pos+2;
				}
			}
			else
			{
				return 0;
			}
	    }
	    pos++;
	}
	return 1;
}
// SA-MP functions
public OnFilterScriptInit()
{
	// copyrights:P
	print("\n--------------------------------");
	print("  Admin filterscript by tommy4");
	print("--------------------------------\n");
	// reading prefix from settings.txt
	if(fexist("admin/settings.txt"))
	{
	    new File:settings = fopen("admin/settings.txt", io_read);
	    new strfile[256];
	    new option[256];
	    new value[256];
	    new isset[6];
	    new equal;
	    while(fread(settings, strfile, sizeof(strfile), false) && gError == 0)
	    {
			equal = strfind(strfile, "=", true, 0);
			if(equal != -1)
			{
			    strmid(option, strfile, 0, equal, sizeof(option));
			    strmid(value, strfile, equal+1, strlen(strfile)-2, sizeof(value));
			    if(strlen(option) == 0 || strlen(value) == 0)
			    {
			        gError = 1;
				}
			    if(strcmp(option, "prefix", true) == 0)
			    {
					gPrefix = value;
					isset[0] = 1;
				}
				else if(strcmp(option, "defaulthealth", true) == 0)
				{
					gDefaultHealth = value;
					isset[1] = 1;
				}
				else if(strcmp(option, "defaultmoney", true) == 0)
				{
				    gDefaultMoney = value;
				    isset[2] = 1;
				}
				else if(strcmp(option, "defaultammo", true) == 0)
				{
				    gDefaultAmmo = value;
				    isset[3] = 1;
				}
				else if(strcmp(option, "oncheckpointtext", true) == 0)
				{
				    gOnCheckpointText = value;
				    isset[4] = 1;
				}
				else if(strcmp(option, "language", true) == 0)
				{
				    gLanguage = value;
				    isset[5] = 1;
				}
			}
			else
			{
   				gError = 1;
				print(Lang(77));
			}
	    }
	    if(isset[0] != 1 || isset[1] != 1 || isset[2] != 1 || isset[3] != 1 || isset[4] != 1 || isset[5] != 1)
	    {
	        gError = 1;
	        print(Lang(77));
		}
		fclose(settings);
	}
	else
	{
		gError = 1;
		print(Lang(77));
	}
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
	if(gError == 1)
	{
	    return 0;
	}
	new space;
	new string[256];
	new command[256];
	new prefix[256];
	strmid(prefix, cmdtext, 1, strlen(gPrefix)+1, sizeof(prefix));
	if(strcmp(prefix, gPrefix, true) == 0)
	{
		space = strfind(cmdtext, " ", true, 0);
		if(space == -1)
		{
		    space = strlen(cmdtext);
		}
		strmid(command, cmdtext, strlen(gPrefix)+1, space, sizeof(command));
		if(IsPlayerAdmin(playerid) || gLogged[playerid] == 1)
		{
			new aday;
			new amonth;
			new ayear;
			getdate(ayear, amonth, aday);
			new filename[256];
			format(filename, sizeof(filename), "admin/logs/%02d_%02d_%04d.txt", aday, amonth, ayear);
			if(!fexist(filename))
			{
	  			new File:create = fopen(filename, io_write);
				fclose(create);
			}
			new File:logs = fopen(filename, io_append);
			new log[256];
			new aname[256];
			new ahour;
			new aminute;
			new asecond;
			gettime(ahour, aminute, asecond);
			GetPlayerName(playerid, aname, sizeof(aname));
			format(log, sizeof(log), "[%02d:%02d:%02d] %s[%d]: %s\r\n", ahour, aminute, asecond, aname, playerid, cmdtext);
			fwrite(logs, log);
			fclose(logs);
			if(strcmp(command, "msg", true) == 0)
			{
			    new secondspace = strfind(cmdtext, " ", true, space+1);
			    if(space != strlen(cmdtext) && secondspace != -1)
			    {
				    new strid[3];
				    strmid(strid, cmdtext, space+1, secondspace, sizeof(strid));
				    new id = strval(strid);
				    if(IsPlayerConnected(id))
				    {
					    new msg[256];
					    strmid(msg, cmdtext, secondspace+1, strlen(cmdtext), sizeof(msg));
					    format(string, sizeof(string), "* Admin: %s", msg);
						SendClientMessage(id, COLOR_LIGHTBLUE, string);
						SendClientMessage(playerid, COLOR_WHITE, Lang(3));
					}
					else
					{
						SendClientMessage(playerid, COLOR_WHITE, Lang(1));
					}
				}
				else
				{
				    SendClientMessage(playerid, COLOR_WHITE, Lang(2));
				}
				return 1;
			}
			else if(strcmp(command, "msgall", true) == 0)
			{
			    if(space != strlen(cmdtext))
			    {
					new msg[256];
					strmid(msg, cmdtext, space+1, strlen(cmdtext), sizeof(msg));
					format(string, sizeof(string), "* Admin: %s", msg);
					SendClientMessageToAll(COLOR_LIGHTBLUE, string);
					SendClientMessage(playerid, COLOR_WHITE, Lang(3));
				}
				else
				{
				    SendClientMessage(playerid, COLOR_WHITE, Lang(2));
				}
				return 1;
			}
			else if(strcmp(command, "me", true) == 0)
			{
			    if(space != strlen(cmdtext))
			    {
					new msg[256];
					new nick[MAX_PLAYER_NAME];
					GetPlayerName(playerid, nick, sizeof(nick));
					strmid(msg, cmdtext, space+1, strlen(cmdtext), sizeof(msg));
					format(string, sizeof(string), "* %s %s", nick, msg);
					SendClientMessageToAll(COLOR_GREEN, string);
				}
				else
				{
				    SendClientMessage(playerid, COLOR_WHITE, Lang(2));
				}
				return 1;
			}
			else if(strcmp(command, "text", true) == 0)
			{
			    new secondspace = strfind(cmdtext, " ", true, space+1);
			    if(space != strlen(cmdtext) && secondspace != -1)
			    {
				    new strid[3];
				    strmid(strid, cmdtext, space+1, secondspace, sizeof(strid));
				    new id = strval(strid);
				    if(IsPlayerConnected(id))
				    {
				        new msg[256];
				        strmid(msg, cmdtext, secondspace+1, strlen(cmdtext), sizeof(msg));
				        if(CheckText(msg))
				        {
							GameTextForPlayer(id, msg, 5000, 4);
							SendClientMessage(playerid, COLOR_WHITE, Lang(3));
						}
						else
						{
						    SendClientMessage(playerid, COLOR_WHITE, Lang(271));
						}
					}
					else
					{
						SendClientMessage(playerid, COLOR_WHITE, Lang(1));
					}
				}
				else
				{
		            SendClientMessage(playerid, COLOR_WHITE, Lang(2));
				}
				return 1;
			}
			else if(strcmp(command, "textall", true) == 0)
			{
			    if(space != strlen(cmdtext))
			    {
				    new msg[256];
				    strmid(msg, cmdtext, space+1, strlen(cmdtext), sizeof(msg));
				    if(CheckText(msg))
				    {
						GameTextForAll(msg, 5000, 4);
						SendClientMessage(playerid, COLOR_WHITE, Lang(3));
					}
					else
					{
					    SendClientMessage(playerid, COLOR_WHITE, Lang(271));
					}
				}
				else
				{
					SendClientMessage(playerid, COLOR_WHITE, Lang(2));
				}
				return 1;
			}
			else if(strcmp(command, "uptime", true) == 0)
			{
			    new granularity;
			    new Float:uptime;
			    uptime = float(tickcount(granularity));
			    if(uptime > 60000.0)
			    {
				    new weeks;
					new days;
					new hours;
					new minutes;
					new seconds;
					new miliseconds;
					weeks = floatround((uptime/604800000.0), floatround_floor);
					uptime = uptime-float(weeks*604800000);
					days = floatround((uptime/86400000.0), floatround_floor);
					uptime = uptime-float(days*86400000);
					hours = floatround((uptime/3600000.0), floatround_floor);
					uptime = uptime-float(hours*3600000);
					minutes = floatround((uptime/60000.0), floatround_floor);
					uptime = uptime-float(minutes*60000);
					seconds = floatround((uptime/1000.0), floatround_floor);
					uptime = uptime-float(seconds*1000);
					miliseconds = floatround(uptime, floatround_floor);
					format(string, sizeof(string), Lang(4), weeks, days, hours, minutes, seconds, miliseconds);
					SendClientMessage(playerid, COLOR_WHITE, string);
				}
				else
				{
				    SendClientMessage(playerid, COLOR_WHITE, Lang(5));
				}
			    return 1;
			}
			else if(strcmp(command, "tickcount", true) == 0)
			{
			    new granularity;
			    tickcount(granularity);
			    if(granularity != 0)
			    {
					format(string, sizeof(string), Lang(6), granularity);
					SendClientMessage(playerid, COLOR_WHITE, string);
				}
				else
				{
				    SendClientMessage(playerid, COLOR_WHITE, Lang(7));
				}
				return 1;
			}
			else if(strcmp(command, "maxplayers", true) == 0)
			{
			    new maxplayers = GetMaxPlayers();
			    format(string, sizeof(string), Lang(8), maxplayers);
				SendClientMessage(playerid, COLOR_WHITE, string);
				return 1;
			}
			else if(strcmp(command, "gmx", true) == 0)
			{
				GameModeExit();
				SendClientMessage(playerid, COLOR_WHITE, Lang(3));
				return 1;
			}
			else if(strcmp(command, "worldtime", true) == 0)
			{
			    if(space != strlen(cmdtext))
			    {
				    new secondspace = strfind(cmdtext, " ", true, space+1);
				    if(secondspace == -1)
				    {
				        secondspace = strlen(cmdtext);
	   				}
				    new strhour[3];
				    strmid(strhour, cmdtext, space+1, secondspace, sizeof(strhour));
				    new hour = strval(strhour);
				    if(hour < 24 && hour >= 0)
				    {
						SetWorldTime(hour);
						SendClientMessage(playerid, COLOR_WHITE, Lang(3));
					}
					else
					{
					    SendClientMessage(playerid, COLOR_WHITE, Lang(9));
					}
				}
				else
				{
				    SendClientMessage(playerid, COLOR_WHITE, Lang(2));
				}
				return 1;
			}
			else if(strcmp(command, "kick", true) == 0)
			{
			    if(space != strlen(cmdtext))
			    {
				    new secondspace = strfind(cmdtext, " ", true, space+1);
				    if(secondspace == -1)
				    {
				        secondspace = strlen(cmdtext);
	    			}
				    new strid[3];
				    strmid(strid, cmdtext, space+1, secondspace, sizeof(strid));
				    new id = strval(strid);
				    if(IsPlayerConnected(id) == 1 && IsPlayerAdmin(id) == 0 && gLogged[id] != 1)
				    {
				        Kick(id);
				        SendClientMessage(playerid, COLOR_WHITE, Lang(3));
					}
					else
					{
					    SendClientMessage(playerid, COLOR_WHITE, Lang(10));
					}
				}
				else
				{
				    SendClientMessage(playerid, COLOR_WHITE, Lang(2));
				}
				return 1;
			}
			else if(strcmp(command, "kickall", true) == 0)
			{
				for(new i = 0;i < MAX_PLAYERS;i++)
				{
				    if(IsPlayerConnected(i) == 1 && IsPlayerAdmin(i) == 0 && gLogged[i] != 1)
				    {
				        Kick(i);
					}
				}
				SendClientMessage(playerid, COLOR_WHITE, Lang(3));
				return 1;
			}
			else if(strcmp(command, "ban", true) == 0)
			{
			    if(space != strlen(cmdtext))
			    {
				    new secondspace = strfind(cmdtext, " ", true, space+1);
				    if(secondspace == -1)
				    {
				        secondspace = strlen(cmdtext);
					}
				    new strid[3];
				    strmid(strid, cmdtext, space+1, secondspace, sizeof(strid));
				    new id = strval(strid);
				    if(IsPlayerConnected(id) == 1 && IsPlayerAdmin(id) == 0 && gLogged[id] != 1)
				    {
				        Ban(id);
				        SendClientMessage(playerid, COLOR_WHITE, Lang(3));
					}
					else
					{
					    SendClientMessage(playerid, COLOR_WHITE, Lang(11));
					}
				}
				else
				{
					SendClientMessage(playerid, COLOR_WHITE, Lang(2));
				}
				return 1;
			}
			else if(strcmp(command, "banall", true) == 0)
			{
				for(new i = 0;i < MAX_PLAYERS;i++)
				{
				    if(IsPlayerConnected(i) == 1 && IsPlayerAdmin(i) == 0 && gLogged[i] != 1)
				    {
				        Ban(i);
					}
				}
				SendClientMessage(playerid, COLOR_WHITE, Lang(3));
				return 1;
			}
			else if(strcmp(command, "health", true) == 0)
			{
			    if(space != strlen(cmdtext))
			    {
			    	new secondspace = strfind(cmdtext, " ", true, space+1);
				    new strid[3];
				    new secondspace2;
				    if(secondspace == -1)
				    {
				        secondspace2 = strlen(cmdtext);
					}
					else
					{
					    secondspace2 = secondspace;
					}
				    strmid(strid, cmdtext, space+1, secondspace2, sizeof(strid));
				    new id = strval(strid);
				    if(IsPlayerConnected(id))
				    {
				        new health = strval(gDefaultHealth);
						if(secondspace != -1)
						{
						    new healthstr[256];
						    strmid(healthstr, cmdtext, secondspace+1, strlen(cmdtext), sizeof(healthstr));
							health = strval(healthstr);
						}
						if(health >= 0 && health <= 100)
						{
							SetPlayerHealth(id, float(health));
							SendClientMessage(id, COLOR_WHITE, Lang(12));
							SendClientMessage(playerid, COLOR_WHITE, Lang(3));
						}
						else
						{
						    SendClientMessage(playerid, COLOR_WHITE, Lang(13));
						}
					}
					else
					{
						SendClientMessage(playerid, COLOR_WHITE, Lang(1));
					}
				}
				else
				{
				    SendClientMessage(playerid, COLOR_WHITE, Lang(2));
				}
				return 1;
			}
			else if(strcmp(command, "healthall", true) == 0)
			{
			    new secondspace = strfind(cmdtext, " ", true, space+1);
			    if(secondspace == -1)
			    {
			        secondspace = strlen(cmdtext);
				}
				new health;
				if(space != strlen(cmdtext))
				{
				    new strhealth[256];
				    strmid(strhealth, cmdtext, space+1, secondspace, sizeof(strhealth));
				    health = strval(strhealth);
				}
				else
				{
				    health = strval(gDefaultHealth);
				}
			    if(health >= 0 && health <= 100)
			    {
					for(new i = 0; i < MAX_PLAYERS;i++)
					{
					    if(IsPlayerConnected(i))
					    {
						    SetPlayerHealth(i, float(health));
						    SendClientMessage(i, COLOR_WHITE, Lang(12));
						}
					}
					SendClientMessage(playerid, COLOR_WHITE, Lang(3));
				}
				else
				{
				    SendClientMessage(playerid, COLOR_WHITE, Lang(13));
				}
			    return 1;
			}
			else if(strcmp(command, "remove", true) == 0)
			{
			    if(space != strlen(cmdtext))
			    {
				    new secondspace = strfind(cmdtext, " ", true, space+1);
				    if(secondspace == -1)
				    {
				        secondspace = strlen(cmdtext);
					}
				    new strid[3];
				    strmid(strid, cmdtext, space+1, secondspace, sizeof(strid));
				    new id = strval(strid);
				    if(IsPlayerConnected(id) == 1)
				    {
						if(IsPlayerInAnyVehicle(id))
						{
						    RemovePlayerFromVehicle(id);
						    SendClientMessage(id, COLOR_WHITE, Lang(14));
						    SendClientMessage(playerid, COLOR_WHITE, Lang(3));
						}
						else
						{
						    SendClientMessage(playerid, COLOR_WHITE, Lang(15));
						}
					}
					else
					{
					    SendClientMessage(playerid, COLOR_WHITE, Lang(1));
					}
				}
				else
				{
				    SendClientMessage(playerid, COLOR_WHITE, Lang(2));
				}
				return 1;
			}
			else if(strcmp(command, "removeall", true) == 0)
			{
				for(new i = 0;i < MAX_PLAYERS;i++)
				{
				    if(IsPlayerConnected(i) == 1)
				    {
						if(IsPlayerInAnyVehicle(i))
						{
						    RemovePlayerFromVehicle(i);
						    SendClientMessage(i, COLOR_WHITE, Lang(14));
						}
					}
				}
				SendClientMessage(playerid, COLOR_WHITE, Lang(3));
				return 1;
			}
			else if(strcmp(command, "freeze", true) == 0)
			{
			    if(space != strlen(cmdtext))
			    {
		 		    new secondspace = strfind(cmdtext, " ", true, space+1);
				    if(secondspace == -1)
				    {
				        secondspace = strlen(cmdtext);
					}
				    new strid[3];
				    strmid(strid, cmdtext, space+1, secondspace, sizeof(strid));
				    new id = strval(strid);
				    if(IsPlayerConnected(id) == 1)
				    {
						if(gFreezed[id] != 1)
						{
						    TogglePlayerControllable(id, 0);
						    gFreezed[id] = 1;
						    SendClientMessage(id, COLOR_WHITE, Lang(16));
						    SendClientMessage(playerid, COLOR_WHITE, Lang(3));
						}
						else
						{
						    SendClientMessage(playerid, COLOR_WHITE, Lang(17));
						}
					}
					else
					{
					    SendClientMessage(playerid, COLOR_WHITE, Lang(1));
					}
				}
				else
				{
				    SendClientMessage(playerid, COLOR_WHITE, Lang(2));
				}
				return 1;
			}
			else if(strcmp(command, "freezeall", true) == 0)
			{
			    gFreeze = 1;
	 			for(new i = 0;i < MAX_PLAYERS;i++)
				{
				    if(IsPlayerConnected(i) == 1)
				    {
			            if(gFreezed[i] != 1)
			            {
			                TogglePlayerControllable(i, 0);
			                gFreezed[i] = 1;
			                SendClientMessage(i, COLOR_WHITE, Lang(16));
						}
					}
				}
				SendClientMessage(playerid, COLOR_WHITE, Lang(3));
				return 1;
			}
			else if(strcmp(command, "unfreeze", true) == 0)
			{
			    if(space != strlen(cmdtext))
			    {
		 		    new secondspace = strfind(cmdtext, " ", true, space+1);
				    if(secondspace == -1)
				    {
				        secondspace = strlen(cmdtext);
					}
				    new strid[3];
				    strmid(strid, cmdtext, space+1, secondspace, sizeof(strid));
				    new id = strval(strid);
				    if(IsPlayerConnected(id) == 1)
				    {
						if(gFreezed[id] == 1)
						{
						    TogglePlayerControllable(id, 1);
						    gFreezed[id] = 0;
						    SendClientMessage(id, COLOR_WHITE, Lang(18));
						    SendClientMessage(playerid, COLOR_WHITE, Lang(3));
						}
						else
						{
						    SendClientMessage(playerid, COLOR_WHITE, Lang(19));
						}
					}
					else
					{
					    SendClientMessage(playerid, COLOR_WHITE, Lang(1));
					}
				}
				else
				{
				    SendClientMessage(playerid, COLOR_WHITE, Lang(2));
				}
				return 1;
			}
			else if(strcmp(command, "unfreezeall", true) == 0)
			{
			    gFreeze = 0;
	 			for(new i = 0;i < MAX_PLAYERS;i++)
				{
				    if(IsPlayerConnected(i) == 1)
				    {
			            if(gFreezed[i] == 1)
			            {
			                TogglePlayerControllable(i, 1);
			                gFreezed[i] = 0;
			                SendClientMessage(i, COLOR_WHITE, Lang(18));
						}
					}
				}
				SendClientMessage(playerid, COLOR_WHITE, Lang(3));
				return 1;
			}
			else if(strcmp(command, "givemoney", true) == 0)
			{
			    if(space != strlen(cmdtext))
			    {
				    new secondspace = strfind(cmdtext, " ", true, space+1);
				    new secondspace2;
				    new strid[3];
				    if(secondspace == -1)
				    {
				        secondspace2 = strlen(cmdtext);
					}
					else
					{
					    secondspace2 = secondspace;
					}
				    strmid(strid, cmdtext, space+1, secondspace2, sizeof(strid));
				    new id = strval(strid);
				    if(IsPlayerConnected(id))
				    {
				        new money[256];
				        if(secondspace != -1)
				        {
					        strmid(money, cmdtext, secondspace+1, strlen(cmdtext), sizeof(money));
						}
						else
						{
						    money = gDefaultMoney;
						}
						GivePlayerMoney(id, strval(money));
						SendClientMessage(playerid, COLOR_WHITE, Lang(3));
					}
					else
					{
						SendClientMessage(playerid, COLOR_WHITE, Lang(1));
					}
				}
				else
				{
				    SendClientMessage(playerid, COLOR_WHITE, Lang(2));
				}
				return 1;
			}
			else if(strcmp(command, "givemoneyall", true) == 0)
			{
			    new secondspace = strfind(cmdtext, " ", true, space+1);
			    if(secondspace == -1)
			    {
			        secondspace = strlen(cmdtext);
				}
			    new strmoney[256];
    			if(space == strlen(cmdtext))
			    {
			        strmoney = gDefaultMoney;
				}
				else
				{
				    strmid(strmoney, cmdtext, space+1, secondspace, sizeof(strmoney));
				}
				for(new i = 0; i < MAX_PLAYERS;i++)
				{
	   				if(IsPlayerConnected(i))
				    {
					    GivePlayerMoney(i, strval(strmoney));
					}
				}
				SendClientMessage(playerid, COLOR_WHITE, Lang(3));
			    return 1;
			}
			else if(strcmp(command, "resetmoney", true) == 0)
			{
			    if(space != strlen(cmdtext))
			    {
		 		    new secondspace = strfind(cmdtext, " ", true, space+1);
				    if(secondspace == -1)
				    {
				        secondspace = strlen(cmdtext);
					}
				    new strid[3];
				    strmid(strid, cmdtext, space+1, secondspace, sizeof(strid));
				    new id = strval(strid);
				    if(IsPlayerConnected(id) == 1)
				    {
				        ResetPlayerMoney(id);
				        SendClientMessage(id, COLOR_WHITE, Lang(20));
				        SendClientMessage(playerid, COLOR_WHITE, Lang(3));
					}
					else
					{
					    SendClientMessage(playerid, COLOR_WHITE, Lang(1));
					}
				}
				else
				{
				    SendClientMessage(playerid, COLOR_WHITE, Lang(2));
				}
				return 1;
			}
			else if(strcmp(command, "resetmoneyall", true) == 0)
			{
	 			for(new i = 0;i < MAX_PLAYERS;i++)
				{
				    if(IsPlayerConnected(i) == 1)
				    {
				        ResetPlayerMoney(i);
				        SendClientMessage(i, COLOR_WHITE, Lang(20));
					}
				}
				SendClientMessage(playerid, COLOR_WHITE, Lang(3));
				return 1;
			}
			else if(strcmp(command, "resetweapons", true) == 0)
			{
				if(space != strlen(cmdtext))
				{
		 		    new secondspace = strfind(cmdtext, " ", true, space+1);
				    if(secondspace == -1)
				    {
				        secondspace = strlen(cmdtext);
					}
				    new strid[3];
				    strmid(strid, cmdtext, space+1, secondspace, sizeof(strid));
				    new id = strval(strid);
				    if(IsPlayerConnected(id) == 1)
				    {
				        ResetPlayerWeapons(id);
				        SendClientMessage(id, COLOR_WHITE, Lang(21));
				        SendClientMessage(playerid, COLOR_WHITE, Lang(3));
					}
					else
					{
					    SendClientMessage(playerid, COLOR_WHITE, Lang(1));
					}
				}
				else
				{
				    SendClientMessage(playerid, COLOR_WHITE, Lang(2));
				}
				return 1;
			}
			else if(strcmp(command, "resetweaponsall", true) == 0)
			{
	 			for(new i = 0;i < MAX_PLAYERS;i++)
				{
				    if(IsPlayerConnected(i) == 1)
				    {
				        ResetPlayerWeapons(i);
				        SendClientMessage(i, COLOR_WHITE, Lang(21));
					}
				}
				SendClientMessage(playerid, COLOR_WHITE, Lang(3));
				return 1;
			}
			else if(strcmp(command, "giveweapon", true) == 0)
			{
			    new secondspace = strfind(cmdtext, " ", true, space+1);
			    if(space != strlen(cmdtext) && secondspace != -1)
			    {
				    new thirdspace = strfind(cmdtext, " ", true, secondspace+1);
				    new strid[3];
				    new thirdspace2;
				    if(thirdspace == -1)
				    {
				        thirdspace2 = strlen(cmdtext);
					}
					else
					{
					    thirdspace2 = thirdspace;
					}
				    strmid(strid, cmdtext, space+1, secondspace, sizeof(strid));
				    new id = strval(strid);
				    if(IsPlayerConnected(id))
				    {
				        new weapon[256];
				        new weaponid;
				        strmid(weapon, cmdtext, secondspace+1, thirdspace2, sizeof(weapon));
						weaponid = FindWeaponID(weapon);
						if(weaponid != 0)
						{
							new ammo[256];
							if(thirdspace == -1)
							{
							    ammo = gDefaultAmmo;
							}
							else
							{
								strmid(ammo, cmdtext, thirdspace+1, strlen(cmdtext), sizeof(ammo));
							}
						    GivePlayerWeapon(id, weaponid, strval(ammo));
						    SendClientMessage(playerid, COLOR_WHITE, Lang(3));
						}
						else
						{
						    format(string, sizeof(string), Lang(22), gPrefix);
						    SendClientMessage(playerid, COLOR_WHITE, string);
						}
					}
					else
					{
						SendClientMessage(playerid, COLOR_WHITE, Lang(1));
					}
				}
				else
				{
				    SendClientMessage(playerid, COLOR_WHITE, Lang(2));
				}
				return 1;
			}
			else if(strcmp(command, "giveweaponall", true) == 0)
			{
			    new secondspace = strfind(cmdtext, " ", true, space+1);
			    if(space != strlen(cmdtext))
			    {
				    new weapon[256];
				    new weaponid;
					new secondspace2;
				    if(secondspace == -1)
				    {
				        secondspace2 = strlen(cmdtext);
					}
					else
					{
					    secondspace2 = secondspace;
					}
				    strmid(weapon, cmdtext, space+1, secondspace2, sizeof(weapon));
				    weaponid = FindWeaponID(weapon);
				    if(weaponid != 0)
				    {
				        new ammo[256];
				        if(secondspace != -1)
				        {
					        strmid(ammo, cmdtext, secondspace+1, strlen(cmdtext), sizeof(ammo));
						}
						else
						{
						    ammo = gDefaultAmmo;
						}
				        for(new i = 0; i < MAX_PLAYERS; i++)
				        {
				            if(IsPlayerConnected(i))
				            {
				                GivePlayerWeapon(i, weaponid, strval(ammo));
							}
						}
						SendClientMessage(playerid, COLOR_WHITE, Lang(3));
					}
					else
					{
					    format(string, sizeof(string), Lang(22), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					}
				}
				else
				{
				    SendClientMessage(playerid, COLOR_WHITE, Lang(2));
				}
				return 1;
			}
			else if(strcmp(command, "time", true) == 0)
			{
			    new hour;
			    new minutes;
			    new seconds;
			    gettime(hour, minutes, seconds);
				format(string, sizeof(string), Lang(23), hour, minutes, seconds);
				SendClientMessage(playerid, COLOR_WHITE, string);
				return 1;
			}
			else if(strcmp(command, "date", true) == 0)
			{
			    new year;
			    new month;
			    new day;
			    getdate(year, month, day);
			    format(string, sizeof(string), Lang(24), day, month, year);
			    SendClientMessage(playerid, COLOR_WHITE, string);
			    return 1;
			}
			else if(strcmp(command, "savepos", true) == 0)
			{
			    GetPlayerPos(playerid, posx, posy, posz);
			    GetPlayerFacingAngle(playerid, zangle);
			    SendClientMessage(playerid, COLOR_WHITE, Lang(3));
			    return 1;
			}
			else if(strcmp(command, "teleport", true) == 0)
			{
			    if(space != strlen(cmdtext))
			    {
		  			new secondspace = strfind(cmdtext, " ", true, space+1);
				    if(secondspace == -1)
				    {
				        secondspace = strlen(cmdtext);
					}
				    new strid[3];
				    strmid(strid, cmdtext, space+1, secondspace, sizeof(strid));
				    new id = strval(strid);
				    if(IsPlayerConnected(id) == 1)
				    {
				        SetPlayerInterior(id, 0);
				        if(posx != 0.0 && posy != 0.0 && posz != 0.0)
				        {
				            RemovePlayerFromVehicle(id);
					        SetPlayerPos(id, posx, posy, posz);
					        SetPlayerFacingAngle(id, zangle);
					        SendClientMessage(playerid, COLOR_WHITE, Lang(3));
						}
						else
						{
						    format(string, sizeof(string), Lang(25), gPrefix);
						    SendClientMessage(playerid, COLOR_WHITE, string);
						}
					}
					else
					{
					    SendClientMessage(playerid, COLOR_WHITE, Lang(1));
					}
				}
				else
				{
				    SendClientMessage(playerid, COLOR_WHITE, Lang(2));
				}
				return 1;
			}
			else if(strcmp(command, "teleportall", true) == 0)
			{
			    if(posx != 0.0 && posy != 0.0 && posz != 0.0)
			    {
				 	for(new i = 0;i < MAX_PLAYERS;i++)
					{
					    if(IsPlayerConnected(i) == 1)
					    {
					        RemovePlayerFromVehicle(i);
					        SetPlayerInterior(i, 0);
					        SetPlayerPos(i, posx, posy, posz);
					        SetPlayerFacingAngle(i, zangle);
						}
					}
					SendClientMessage(playerid, COLOR_WHITE, Lang(3));
				}
				else
				{
				    format(string, sizeof(string), Lang(25), gPrefix);
				    SendClientMessage(playerid, COLOR_WHITE, string);
				}
				return 1;
			}
			else if(strcmp(command, "teleportto", true) == 0)
			{
			    new secondspace = strfind(cmdtext, " ", true, space+1);
			    if(space != strlen(cmdtext) && secondspace != -1)
			    {
				    new strid[3];
				    strmid(strid, cmdtext, space+1, secondspace, sizeof(strid));
				    new id = strval(strid);
				    if(IsPlayerConnected(id))
				    {
				        new strdestid[256];
				        strmid(strdestid, cmdtext, secondspace+1, strlen(cmdtext), sizeof(strdestid));
						new destid = strval(strdestid);
						if(IsPlayerConnected(destid))
						{
						    new Float:x;
						    new Float:y;
						    new Float:z;
						    new Float:zang;
						    GetPlayerPos(destid, x, y, z);
						    GetPlayerFacingAngle(destid, zang);
						    RemovePlayerFromVehicle(id);
							SetPlayerInterior(id, 0);
							SetPlayerPos(id, x, y, z);
							SetPlayerFacingAngle(id, zang);
							SendClientMessage(playerid, COLOR_WHITE, Lang(3));
						}
						else
						{
						    SendClientMessage(playerid, COLOR_WHITE, Lang(26));
						}
					}
					else
					{
						SendClientMessage(playerid, COLOR_WHITE, Lang(1));
					}
				}
				else
				{
				    SendClientMessage(playerid, COLOR_WHITE, Lang(2));
				}
				return 1;
			}
			else if(strcmp(command, "teleportallto", true) == 0)
			{
			    if(space != strlen(cmdtext))
			    {
				    new secondspace = strfind(cmdtext, " ", true, space+1);
				    if(secondspace == -1)
				    {
				        secondspace = strlen(cmdtext);
					}
				    new strmoney[256];
				    strmid(strmoney, cmdtext, space+1, secondspace, sizeof(strmoney));
				    new destid = strval(strmoney);
				    if(IsPlayerConnected(destid))
				    {
		    			new Float:x;
						new Float:y;
						new Float:z;
						new Float:zang;
						GetPlayerPos(destid, x, y, z);
						GetPlayerFacingAngle(destid, zang);
						for(new i = 0; i < MAX_PLAYERS;i++)
						{
			   				if(IsPlayerConnected(i))
						    {
							    RemovePlayerFromVehicle(i);
								SetPlayerInterior(i, 0);
								SetPlayerPos(i, x, y, z);
								SetPlayerFacingAngle(i, zang);
							}
						}
						SendClientMessage(playerid, COLOR_WHITE, Lang(3));
					}
					else
					{
					    SendClientMessage(playerid, COLOR_WHITE, Lang(26));
					}
				}
				else
				{
				    SendClientMessage(playerid, COLOR_WHITE, Lang(2));
				}
			    return 1;
			}
			else if(strcmp(command, "skin", true) == 0)
			{
			    new secondspace = strfind(cmdtext, " ", true, space+1);
			    if(space != strlen(cmdtext) && secondspace != -1)
			    {
				    new strid[3];
				    strmid(strid, cmdtext, space+1, secondspace, sizeof(strid));
				    new id = strval(strid);
				    if(IsPlayerConnected(id))
				    {
					    new strskin[256];
					    strmid(strskin, cmdtext, secondspace+1, strlen(cmdtext), sizeof(strskin));
						new skin = strval(strskin);
						if(CheckSkin(skin) == 1)
						{
						    SetPlayerSkin(id, skin);
						    if(IsPlayerInAnyVehicle(id))
							{
								RemovePlayerFromVehicle(id);
							}
							SendClientMessage(playerid, COLOR_WHITE, Lang(3));
						}
						else
						{
						    SendClientMessage(playerid, COLOR_WHITE, Lang(27));
						}
					}
					else
					{
						SendClientMessage(playerid, COLOR_WHITE, Lang(1));
					}
				}
				else
				{
				    SendClientMessage(playerid, COLOR_WHITE, Lang(2));
				}
			    return 1;
			}
			else if(strcmp(command, "skinall", true) == 0)
			{
			    if(space != strlen(cmdtext))
			    {
					new strskin[256];
					strmid(strskin, cmdtext, space+1, strlen(cmdtext), sizeof(strskin));
					new skin = strval(strskin);
					if(CheckSkin(skin) == 1)
					{
						for(new i = 0; i < MAX_PLAYERS; i++)
						{
						    if(IsPlayerConnected(i))
						    {
						        SetPlayerSkin(i, skin);
								if(IsPlayerInAnyVehicle(i))
								{
								    RemovePlayerFromVehicle(i);
								}
							}
						}
						SendClientMessage(playerid, COLOR_WHITE, Lang(3));
					}
					else
					{
					    SendClientMessage(playerid, COLOR_WHITE, Lang(27));
					}
				}
				else
				{
				    SendClientMessage(playerid, COLOR_WHITE, Lang(2));
				}
				return 1;
			}
			else if(strcmp(command, "score", true) == 0)
			{
			    new secondspace = strfind(cmdtext, " ", true, space+1);
			    if(space != strlen(cmdtext) && secondspace != -1)
			    {
				    new strid[3];
				    strmid(strid, cmdtext, space+1, secondspace, sizeof(strid));
				    new id = strval(strid);
				    if(IsPlayerConnected(id))
				    {
					    new strscore[256];
					    strmid(strscore, cmdtext, secondspace+1, strlen(cmdtext), sizeof(strscore));
						new score = strval(strscore);
  						SetPlayerScore(id, score);
						SendClientMessage(playerid, COLOR_WHITE, Lang(3));
					}
					else
					{
						SendClientMessage(playerid, COLOR_WHITE, Lang(1));
					}
				}
				else
				{
				    SendClientMessage(playerid, COLOR_WHITE, Lang(2));
				}
			    return 1;
			}
			else if(strcmp(command, "scoreall", true) == 0)
			{
			    if(space != strlen(cmdtext))
			    {
					new strscore[256];
					strmid(strscore, cmdtext, space+1, strlen(cmdtext), sizeof(strscore));
					new score = strval(strscore);
					for(new i = 0; i < MAX_PLAYERS; i++)
					{
					    if(IsPlayerConnected(i))
					    {
					        SetPlayerScore(i, score);
						}
					}
					SendClientMessage(playerid, COLOR_WHITE, Lang(3));
				}
				else
				{
				    SendClientMessage(playerid, COLOR_WHITE, Lang(2));
				}
				return 1;
			}
			else if(strcmp(command, "teleportveh", true) == 0)
			{
			    if(space != strlen(cmdtext))
			    {
		  			new secondspace = strfind(cmdtext, " ", true, space+1);
				    if(secondspace == -1)
				    {
				        secondspace = strlen(cmdtext);
					}
				    new strid[3];
				    strmid(strid, cmdtext, space+1, secondspace, sizeof(strid));
				    new id = strval(strid);
				    if(IsPlayerConnected(id) == 1)
				    {
				        if(posx != 0.0 && posy != 0.0 && posz != 0.0)
				        {
				            SetPlayerInterior(id, 0);
							if(IsPlayerInAnyVehicle(id))
							{
						        SetVehiclePos(GetPlayerVehicleID(id), posx, posy, posz);
							}
							else
							{
							    SetPlayerPos(id, posx, posy, posz);
							}
					        SendClientMessage(playerid, COLOR_WHITE, Lang(3));
						}
						else
						{
						    format(string, sizeof(string), Lang(25), gPrefix);
						    SendClientMessage(playerid, COLOR_WHITE, string);
						}
					}
					else
					{
					    SendClientMessage(playerid, COLOR_WHITE, Lang(1));
					}
				}
				else
				{
				    SendClientMessage(playerid, COLOR_WHITE, Lang(2));
				}
				return 1;
			}
			else if(strcmp(command, "teleportallveh", true) == 0)
			{
			    if(posx != 0.0 && posy != 0.0 && posz != 0.0)
			    {
				 	for(new i = 0;i < MAX_PLAYERS;i++)
					{
					    if(IsPlayerConnected(i))
					    {
					        SetPlayerInterior(i, 0);
							if(IsPlayerInAnyVehicle(i))
							{
						        SetVehiclePos(GetPlayerVehicleID(i), posx+float(2*i), posy+float(2*i), posz);
							}
							else
							{
							    SetPlayerPos(i, posx+2, posy+2, posz);
							}
						}
					}
					SendClientMessage(playerid, COLOR_WHITE, Lang(3));
				}
				else
				{
				    format(string, sizeof(string), Lang(25), gPrefix);
				    SendClientMessage(playerid, COLOR_WHITE, string);
				}
				return 1;
			}
			else if(strcmp(command, "teleportvehto", true) == 0)
			{
			    new secondspace = strfind(cmdtext, " ", true, space+1);
			    if(space != strlen(cmdtext) && secondspace != -1)
			    {
				    new strid[3];
				    strmid(strid, cmdtext, space+1, secondspace, sizeof(strid));
				    new id = strval(strid);
				    if(IsPlayerConnected(id))
				    {
				        new strdestid[256];
				        strmid(strdestid, cmdtext, secondspace+1, strlen(cmdtext), sizeof(strdestid));
						new destid = strval(strdestid);
						if(IsPlayerConnected(destid))
						{
						    new Float:x;
						    new Float:y;
						    new Float:z;
						    new Float:zang;
						    GetPlayerPos(destid, x, y, z);
						    GetPlayerFacingAngle(destid, zang);
				            SetPlayerInterior(id, 0);
							if(IsPlayerInAnyVehicle(id))
							{
						        SetVehiclePos(GetPlayerVehicleID(id), x, y, z);
						        SetVehicleZAngle(GetPlayerVehicleID(id), zang);
							}
							else
							{
							    SetPlayerPos(id, x, y, z);
							    SetPlayerFacingAngle(id, zang);
							}
							SendClientMessage(playerid, COLOR_WHITE, Lang(3));
						}
						else
						{
						    SendClientMessage(playerid, COLOR_WHITE, Lang(26));
						}
					}
					else
					{
						SendClientMessage(playerid, COLOR_WHITE, Lang(1));
					}
				}
				else
				{
				    SendClientMessage(playerid, COLOR_WHITE, Lang(2));
				}
				return 1;
			}
			else if(strcmp(command, "teleportallvehto", true) == 0)
			{
			    if(space != strlen(cmdtext))
			    {
				    new secondspace = strfind(cmdtext, " ", true, space+1);
				    if(secondspace == -1)
				    {
				        secondspace = strlen(cmdtext);
					}
				    new strmoney[256];
				    strmid(strmoney, cmdtext, space+1, secondspace, sizeof(strmoney));
				    new destid = strval(strmoney);
				    if(IsPlayerConnected(destid))
				    {
		    			new Float:x;
						new Float:y;
						new Float:z;
						new Float:zang;
						GetPlayerPos(destid, x, y, z);
						GetPlayerFacingAngle(destid, zang);
						new j = 0;
						for(new i = 0; i < MAX_PLAYERS;i++)
						{
			   				if(IsPlayerConnected(i))
						    {
						        SetPlayerInterior(i, 0);
								if(IsPlayerInAnyVehicle(i))
								{
							        SetVehiclePos(GetPlayerVehicleID(i), x+float(3*j), y+float(3*j), z);
							        SetVehicleZAngle(GetPlayerVehicleID(i), zang);
								}
								else
								{
								    SetPlayerPos(i, x+3.5, y+3.5, z);
								    SetPlayerFacingAngle(i, zang);
								}
								j++;
							}
						}
						SendClientMessage(playerid, COLOR_WHITE, Lang(3));
					}
					else
					{
					    SendClientMessage(playerid, COLOR_WHITE, Lang(26));
					}
				}
				else
				{
				    SendClientMessage(playerid, COLOR_WHITE, Lang(2));
				}
			    return 1;
			}
			else if(strcmp(command, "setcheckpoint", true) == 0)
			{
			    if(space != strlen(cmdtext))
			    {
		  			new secondspace = strfind(cmdtext, " ", true, space+1);
				    if(secondspace == -1)
				    {
				        secondspace = strlen(cmdtext);
					}
				    new strid[3];
				    strmid(strid, cmdtext, space+1, secondspace, sizeof(strid));
				    new id = strval(strid);
				    if(IsPlayerConnected(id) == 1)
				    {
				        if(posx != 0.0 && posy != 0.0 && posz != 0.0)
				        {
							SetPlayerCheckpoint(id, posx, posy, posz, 10.0);
					        SendClientMessage(playerid, COLOR_WHITE, Lang(3));
						}
						else
						{
						    format(string, sizeof(string), Lang(25), gPrefix);
						    SendClientMessage(playerid, COLOR_WHITE, string);
						}
					}
					else
					{
					    SendClientMessage(playerid, COLOR_WHITE, Lang(1));
					}
				}
				else
				{
				    SendClientMessage(playerid, COLOR_WHITE, Lang(2));
				}
				return 1;
			}
			else if(strcmp(command, "setcheckpointall", true) == 0)
			{
			    if(posx != 0.0 && posy != 0.0 && posz != 0.0)
			    {
				 	for(new i = 0;i < MAX_PLAYERS;i++)
					{
					    if(IsPlayerConnected(i))
					    {
							SetPlayerCheckpoint(i, posx, posy, posz, 10.0);
						}
					}
					SendClientMessage(playerid, COLOR_WHITE, Lang(3));
				}
				else
				{
				    format(string, sizeof(string), Lang(25), gPrefix);
				    SendClientMessage(playerid, COLOR_WHITE, string);
				}
				return 1;
			}
			else if(strcmp(command, "disablecheckpoint", true) == 0)
			{
			    if(space != strlen(cmdtext))
			    {
		  			new secondspace = strfind(cmdtext, " ", true, space+1);
				    if(secondspace == -1)
				    {
				        secondspace = strlen(cmdtext);
					}
				    new strid[3];
				    strmid(strid, cmdtext, space+1, secondspace, sizeof(strid));
				    new id = strval(strid);
				    if(IsPlayerConnected(id) == 1)
				    {
						DisablePlayerCheckpoint(id);
					    SendClientMessage(playerid, COLOR_WHITE, Lang(3));
					}
					else
					{
					    SendClientMessage(playerid, COLOR_WHITE, Lang(1));
					}
				}
				else
				{
				    SendClientMessage(playerid, COLOR_WHITE, Lang(2));
				}
				return 1;
			}
			else if(strcmp(command, "disablecheckpointall", true) == 0)
			{
	 			for(new i = 0;i < MAX_PLAYERS;i++)
				{
					if(IsPlayerConnected(i))
					{
						DisablePlayerCheckpoint(i);
					}
				}
				SendClientMessage(playerid, COLOR_WHITE, Lang(3));
				return 1;
			}
			else if(strcmp(command, "play", true) == 0)
			{
			    new secondspace = strfind(cmdtext, " ", true, space+1);
			    if(space != strlen(cmdtext) && secondspace != -1)
			    {
				    new strid[3];
				    strmid(strid, cmdtext, space+1, secondspace, sizeof(strid));
				    new id = strval(strid);
				    if(IsPlayerConnected(id))
				    {
					    new strsound[256];
					    strmid(strsound, cmdtext, secondspace+1, strlen(cmdtext), sizeof(strsound));
						new sound = strval(strsound);
						if(CheckSound(sound))
						{
						    new Float:x;
						    new Float:y;
						    new Float:z;
						    GetPlayerPos(id, x, y, z);
	  						PlayerPlaySound(id, sound, x, y, z);
							SendClientMessage(playerid, COLOR_WHITE, Lang(3));
						}
						else
						{
							SendClientMessage(playerid, COLOR_WHITE, Lang(30));
						}
					}
					else
					{
						SendClientMessage(playerid, COLOR_WHITE, Lang(1));
					}
				}
				else
				{
				    SendClientMessage(playerid, COLOR_WHITE, Lang(2));
				}
			    return 1;
			}
			else if(strcmp(command, "playall", true) == 0)
			{
			    if(space != strlen(cmdtext))
			    {
					new strsound[256];
					strmid(strsound, cmdtext, space+1, strlen(cmdtext), sizeof(strsound));
					new sound = strval(strsound);
					if(CheckSound(sound))
					{
						new Float:x;
						new Float:y;
						new Float:z;
						for(new i = 0; i < MAX_PLAYERS; i++)
						{
						    if(IsPlayerConnected(i))
						    {
						        GetPlayerPos(i, x, y, z);
						        PlayerPlaySound(i, sound, x, y, z);
							}
						}
						SendClientMessage(playerid, COLOR_WHITE, Lang(3));
					}
					else
					{
					    SendClientMessage(playerid, COLOR_WHITE, Lang(30));
					}
				}
				else
				{
				    SendClientMessage(playerid, COLOR_WHITE, Lang(2));
				}
				return 1;
			}
			else if(strcmp(command, "state", true) == 0)
			{
			    if(space != strlen(cmdtext))
			    {
		  			new secondspace = strfind(cmdtext, " ", true, space+1);
				    if(secondspace == -1)
				    {
				        secondspace = strlen(cmdtext);
					}
				    new strid[3];
				    strmid(strid, cmdtext, space+1, secondspace, sizeof(strid));
				    new id = strval(strid);
				    if(IsPlayerConnected(id) == 1)
				    {
						new pstate = GetPlayerState(id);
						if(pstate == PLAYER_STATE_NONE)
						{
						    SendClientMessage(playerid, COLOR_WHITE, Lang(31));
						}
						else if(pstate == PLAYER_STATE_ONFOOT)
						{
						    SendClientMessage(playerid, COLOR_WHITE, Lang(32));
						}
						else if(pstate == PLAYER_STATE_DRIVER)
						{
						    SendClientMessage(playerid, COLOR_WHITE, Lang(33));
						}
						else if(pstate == PLAYER_STATE_PASSENGER)
						{
						    SendClientMessage(playerid, COLOR_WHITE, Lang(34));
						}
						else if(pstate == PLAYER_STATE_WASTED)
						{
						    SendClientMessage(playerid, COLOR_WHITE, Lang(35));
						}
						else if(pstate == PLAYER_STATE_SPAWNED)
						{
						    SendClientMessage(playerid, COLOR_WHITE, Lang(36));
						}
					}
					else
					{
					    SendClientMessage(playerid, COLOR_WHITE, Lang(1));
					}
				}
				else
				{
				    SendClientMessage(playerid, COLOR_WHITE, Lang(2));
				}
				return 1;
			}
			else if(strcmp(command, "respawnveh", true) == 0)
			{
				if(space != strlen(cmdtext))
				{
		 		    new secondspace = strfind(cmdtext, " ", true, space+1);
				    if(secondspace == -1)
				    {
				        secondspace = strlen(cmdtext);
					}
				    new strid[3];
				    strmid(strid, cmdtext, space+1, secondspace, sizeof(strid));
				    new id = strval(strid);
				    if(IsPlayerConnected(id) == 1)
				    {
				        if(IsPlayerInAnyVehicle(id))
				        {
				            SetVehicleToRespawn(GetPlayerVehicleID(id));
				            SendClientMessage(playerid, COLOR_WHITE, Lang(3));
						}
						else
						{
						    SendClientMessage(playerid, COLOR_WHITE, Lang(37));
						}
					}
					else
					{
					    SendClientMessage(playerid, COLOR_WHITE, Lang(1));
					}
				}
				else
				{
				    SendClientMessage(playerid, COLOR_WHITE, Lang(2));
				}
				return 1;
			}
			else if(strcmp(command, "respawnvehall", true) == 0)
			{
	 			for(new i = 0;i < MAX_PLAYERS;i++)
				{
				    if(IsPlayerConnected(i) == 1)
				    {
				        if(IsPlayerInAnyVehicle(i))
				        {
				            SetVehicleToRespawn(GetPlayerVehicleID(i));
						}
					}
				}
				SendClientMessage(playerid, COLOR_WHITE, Lang(3));
				return 1;
			}
			else if(strcmp(command, "wname", true) == 0)
			{
			    if(space != strlen(cmdtext))
			    {
		  			new secondspace = strfind(cmdtext, " ", true, space+1);
				    if(secondspace == -1)
				    {
				        secondspace = strlen(cmdtext);
					}
				    new strweapon[256];
				    strmid(strweapon, cmdtext, space+1, secondspace, sizeof(strweapon));
				    new weapon = strval(strweapon);
				    if(CheckWeapon(weapon))
				    {
					    GetWeaponName(weapon, strweapon, sizeof(strweapon));
					    format(string, sizeof(string), Lang(81), weapon, strweapon);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					}
					else
					{
					    SendClientMessage(playerid, COLOR_WHITE, Lang(82));
					}
				}
				else
				{
				    SendClientMessage(playerid, COLOR_WHITE, Lang(2));
				}
				return 1;
			}
			else if(strcmp(command, "isadmin", true) == 0)
			{
				if(space != strlen(cmdtext))
				{
		 		    new secondspace = strfind(cmdtext, " ", true, space+1);
				    if(secondspace == -1)
				    {
				        secondspace = strlen(cmdtext);
					}
				    new strid[3];
				    strmid(strid, cmdtext, space+1, secondspace, sizeof(strid));
				    new id = strval(strid);
				    if(IsPlayerConnected(id) == 1)
				    {
		                if(IsPlayerAdmin(id) || gLogged[id])
		                {
		                    SendClientMessage(playerid, COLOR_WHITE, Lang(83));
						}
						else
						{
						    SendClientMessage(playerid, COLOR_WHITE, Lang(84));
						}
					}
					else
					{
					    SendClientMessage(playerid, COLOR_WHITE, Lang(1));
					}
				}
				else
				{
				    SendClientMessage(playerid, COLOR_WHITE, Lang(2));
				}
				return 1;
			}
			else if(strcmp(command, "isinveh", true) == 0)
			{
				if(space != strlen(cmdtext))
				{
		 		    new secondspace = strfind(cmdtext, " ", true, space+1);
				    if(secondspace == -1)
				    {
				        secondspace = strlen(cmdtext);
					}
				    new strid[3];
				    strmid(strid, cmdtext, space+1, secondspace, sizeof(strid));
				    new id = strval(strid);
				    if(IsPlayerConnected(id) == 1)
				    {
		                if(IsPlayerInAnyVehicle(id))
		                {
		                    SendClientMessage(playerid, COLOR_WHITE, Lang(85));
						}
						else
						{
						    SendClientMessage(playerid, COLOR_WHITE, Lang(86));
						}
					}
					else
					{
					    SendClientMessage(playerid, COLOR_WHITE, Lang(1));
					}
				}
				else
				{
				    SendClientMessage(playerid, COLOR_WHITE, Lang(2));
				}
				return 1;
			}
			else if(strcmp(command, "name", true) == 0)
			{
				if(space != strlen(cmdtext))
				{
		 		    new secondspace = strfind(cmdtext, " ", true, space+1);
				    if(secondspace == -1)
				    {
				        secondspace = strlen(cmdtext);
					}
				    new strid[3];
				    strmid(strid, cmdtext, space+1, secondspace, sizeof(strid));
				    new id = strval(strid);
				    if(IsPlayerConnected(id) == 1)
				    {
	                    new name[256];
	                    GetPlayerName(id, name, sizeof(name));
	                    format(string, sizeof(string), Lang(87), id, name);
	                    SendClientMessage(playerid, COLOR_WHITE, string);
					}
					else
					{
					    SendClientMessage(playerid, COLOR_WHITE, Lang(1));
					}
				}
				else
				{
				    SendClientMessage(playerid, COLOR_WHITE, Lang(2));
				}
				return 1;
			}
			else if(strcmp(command, "isincheckpoint", true) == 0)
			{
				if(space != strlen(cmdtext))
				{
		 		    new secondspace = strfind(cmdtext, " ", true, space+1);
				    if(secondspace == -1)
				    {
				        secondspace = strlen(cmdtext);
					}
				    new strid[3];
				    strmid(strid, cmdtext, space+1, secondspace, sizeof(strid));
				    new id = strval(strid);
				    if(IsPlayerConnected(id) == 1)
				    {
		                if(IsPlayerInCheckpoint(id))
		                {
		                    SendClientMessage(playerid, COLOR_WHITE, Lang(88));
						}
						else
						{
						    SendClientMessage(playerid, COLOR_WHITE, Lang(89));
						}
					}
					else
					{
					    SendClientMessage(playerid, COLOR_WHITE, Lang(1));
					}
				}
				else
				{
				    SendClientMessage(playerid, COLOR_WHITE, Lang(2));
				}
				return 1;
			}
			else if(strcmp(command, "isconnected", true) == 0)
			{
				if(space != strlen(cmdtext))
				{
		 		    new secondspace = strfind(cmdtext, " ", true, space+1);
				    if(secondspace == -1)
				    {
				        secondspace = strlen(cmdtext);
					}
				    new strid[3];
				    strmid(strid, cmdtext, space+1, secondspace, sizeof(strid));
				    new id = strval(strid);
				    if(IsPlayerConnected(id) == 1)
				    {
		                SendClientMessage(playerid, COLOR_WHITE, Lang(90));
					}
					else
					{
					    SendClientMessage(playerid, COLOR_WHITE, Lang(91));
					}
				}
				else
				{
				    SendClientMessage(playerid, COLOR_WHITE, Lang(2));
				}
				return 1;
			}
			else if(strcmp(command, "angle", true) == 0)
			{
			    new secondspace = strfind(cmdtext, " ", true, space+1);
			    if(space != strlen(cmdtext) && secondspace != -1)
			    {
				    new strid[3];
				    strmid(strid, cmdtext, space+1, secondspace, sizeof(strid));
				    new id = strval(strid);
				    if(IsPlayerConnected(id))
				    {
				        if(!IsPlayerInAnyVehicle(id))
				        {
					    	new strangle[256];
						    strmid(strangle, cmdtext, secondspace+1, strlen(cmdtext), sizeof(strangle));
							new Float:angle = float(strval(strangle));
							if(angle >= 0.0 && angle <= 360.0)
							{
							    SetPlayerFacingAngle(id, angle);
								SendClientMessage(playerid, COLOR_WHITE, Lang(3));
							}
							else
							{
							    SendClientMessage(playerid, COLOR_WHITE, Lang(92));
							}
						}
						else
						{
						    SendClientMessage(playerid, COLOR_WHITE, Lang(93));
						}
					}
					else
					{
						SendClientMessage(playerid, COLOR_WHITE, Lang(1));
					}
				}
				else
				{
				    SendClientMessage(playerid, COLOR_WHITE, Lang(2));
				}
				return 1;
			}
			if(strcmp(command, "angleall", true) == 0)
			{
			    if(space != strlen(cmdtext))
			    {
					new strangle[256];
					strmid(strangle, cmdtext, space+1, strlen(cmdtext), sizeof(strangle));
					new Float:angle = float(strval(strangle));
					if(angle >= 0.0 && angle <= 360.0)
					{
					    for(new i = 0; i < MAX_PLAYERS; i++)
					    {
					        if(IsPlayerConnected(i) && !IsPlayerInAnyVehicle(i))
					        {
					            SetPlayerFacingAngle(i, angle);
							}
						}
						SendClientMessage(playerid, COLOR_WHITE, Lang(3));
					}
					else
					{
					    SendClientMessage(playerid, COLOR_WHITE, Lang(92));
					}
				}
				else
				{
				    SendClientMessage(playerid, COLOR_WHITE, Lang(2));
				}
				return 1;
			}
			else if(strcmp(command, "vangle", true) == 0)
			{
			    new secondspace = strfind(cmdtext, " ", true, space+1);
			    if(space != strlen(cmdtext) && secondspace != -1)
			    {
				    new strid[3];
				    strmid(strid, cmdtext, space+1, secondspace, sizeof(strid));
				    new id = strval(strid);
				    if(IsPlayerConnected(id))
				    {
				        if(IsPlayerInAnyVehicle(id))
				        {
					    	new strangle[256];
						    strmid(strangle, cmdtext, secondspace+1, strlen(cmdtext), sizeof(strangle));
							new Float:angle = float(strval(strangle));
							if(angle >= 0.0 && angle <= 360.0)
							{
							    new vehicle = GetPlayerVehicleID(id);
							    SetVehicleZAngle(vehicle, angle);
								SendClientMessage(playerid, COLOR_WHITE, Lang(3));
							}
							else
							{
							    SendClientMessage(playerid, COLOR_WHITE, Lang(92));
							}
						}
						else
						{
						    SendClientMessage(playerid, COLOR_WHITE, Lang(37));
						}
					}
					else
					{
						SendClientMessage(playerid, COLOR_WHITE, Lang(1));
					}
				}
				else
				{
				    SendClientMessage(playerid, COLOR_WHITE, Lang(2));
				}
				return 1;
			}
			if(strcmp(command, "vangleall", true) == 0)
			{
			    if(space != strlen(cmdtext))
			    {
					new strangle[256];
					strmid(strangle, cmdtext, space+1, strlen(cmdtext), sizeof(strangle));
					new Float:angle = float(strval(strangle));
					if(angle >= 0.0 && angle <= 360.0)
					{
					    for(new i = 0; i < MAX_PLAYERS; i++)
					    {
					        if(IsPlayerConnected(i) && IsPlayerInAnyVehicle(i))
					        {
					            SetVehicleZAngle(GetPlayerVehicleID(i), angle);
							}
						}
						SendClientMessage(playerid, COLOR_WHITE, Lang(3));
					}
					else
					{
					    SendClientMessage(playerid, COLOR_WHITE, Lang(92));
					}
				}
				else
				{
				    SendClientMessage(playerid, COLOR_WHITE, Lang(2));
				}
				return 1;
			}
			if(strcmp(command, "oncheckpoint", true) == 0)
			{
			    if(space != strlen(cmdtext))
			    {
					new msg[256];
					strmid(msg, cmdtext, space+1, strlen(cmdtext), sizeof(msg));
					gOnCheckpointText = msg;
				}
				else
				{
				    SendClientMessage(playerid, COLOR_WHITE, Lang(2));
				}
				return 1;
			}
   			else if(strcmp(command, "color", true) == 0)
			{
			    new secondspace = strfind(cmdtext, " ", true, space+1);
			    if(space != strlen(cmdtext) && secondspace != -1)
			    {
				    new strid[3];
				    strmid(strid, cmdtext, space+1, secondspace, sizeof(strid));
				    new id = strval(strid);
				    if(IsPlayerConnected(id))
				    {
					    new color[256];
					    strmid(color, cmdtext, secondspace+1, strlen(cmdtext), sizeof(color));
						if(fexist("admin/colors.txt"))
						{
						    new File:colors = fopen("admin/colors.txt", io_read);
						    new strfile[256];
						    new fspace;
						    new error = 0;
						    new strcolor[256];
						    new strvalue[256];
						    new found = 0;
						    while(fread(colors, strfile, sizeof(strfile), false) && error != 1 && found == 0)
						    {
						        fspace = strfind(strfile, " ", true, 0);
						        if(fspace != -1)
						        {
						            strmid(strcolor, strfile, 0, fspace, sizeof(strcolor));
						            strmid(strvalue, strfile, fspace+1, strlen(strfile)-2, sizeof(strvalue));
						            if(strcmp(strcolor, color, true) == 0)
						            {
										found = 1;
						            }
						        }
						        else
						        {
						            error = 1;
								}
						    }
							fclose(colors);
							if(error != 1 && found == 1)
							{
								new pcolor = strhextodec(strvalue);
								SetPlayerColor(id, pcolor);
								SendClientMessage(playerid, COLOR_WHITE, Lang(3));
							}
							else if(error == 1)
							{
							    SendClientMessage(playerid, COLOR_WHITE, Lang(78));
							}
							else
							{
							    SendClientMessage(playerid, COLOR_WHITE, Lang(79));
							}
						}
						else
						{
						    SendClientMessage(playerid, COLOR_WHITE, Lang(80));
						}
					}
					else
					{
						SendClientMessage(playerid, COLOR_WHITE, Lang(1));
					}
				}
				else
				{
				    SendClientMessage(playerid, COLOR_WHITE, Lang(2));
				}
				return 1;
			}
			else if(strcmp(command, "colorall", true) == 0)
			{
				new color[256];
				strmid(color, cmdtext, space+1, strlen(cmdtext), sizeof(color));
				if(fexist("admin/colors.txt"))
				{
				    new File:colors = fopen("admin/colors.txt", io_read);
				    new strfile[256];
				    new fspace;
				    new error = 0;
				    new strcolor[256];
				    new strvalue[256];
				    new found = 0;
				    while(fread(colors, strfile, sizeof(strfile), false) && error != 1 && found == 0)
				    {
				        fspace = strfind(strfile, " ", true, 0);
				        if(fspace != -1)
				        {
				            strmid(strcolor, strfile, 0, fspace, sizeof(strcolor));
				            strmid(strvalue, strfile, fspace+1, strlen(strfile)-2, sizeof(strvalue));
				            if(strcmp(strcolor, color, true) == 0)
				            {
								found = 1;
				            }
				        }
				        else
				        {
				            error = 1;
						}
				    }
					fclose(colors);
					if(error != 1 && found == 1)
					{
						new pcolor = strhextodec(strvalue);
		    			for(new i = 0;i < MAX_PLAYERS;i++)
						{
						    if(IsPlayerConnected(i))
						    {
						        SetPlayerColor(i, pcolor);
							}
						}
						SendClientMessage(playerid, COLOR_WHITE, Lang(3));
					}
					else if(error == 1)
					{
					    SendClientMessage(playerid, COLOR_WHITE, Lang(78));
					}
					else
					{
					    SendClientMessage(playerid, COLOR_WHITE, Lang(79));
					}
				}
				else
				{
				    SendClientMessage(playerid, COLOR_WHITE, Lang(80));
				}
				return 1;
			}
			else if(strcmp(command, "about", true) == 0)
			{
			    SendClientMessage(playerid, COLOR_WHITE, "Info: Admin Script v1.1");
			    SendClientMessage(playerid, COLOR_WHITE, "Author: tommy4");
			    SendClientMessage(playerid, COLOR_WHITE, "E-Mail: admin@gtacartel.com");
			    SendClientMessage(playerid, COLOR_WHITE, "ICQ: 292-081-131");
			    SendClientMessage(playerid, COLOR_WHITE, "[PL] GG: 7527174 || TLEN: tommy_4");
			    SendClientMessage(playerid, COLOR_WHITE, "www: http://tommy4.GTACartel.com");
			    return 1;
			}
			else if(strcmp(command, "weaponlist", true) == 0)
			{
			    SendClientMessage(playerid, COLOR_WHITE, Lang(94));
			    SendClientMessage(playerid, COLOR_WHITE, "GOLFCLUB[2] NITESTICK[3] KNIFE[4] BAT[5] SHOVEL[6] POOLCUE[7] KATANA[8] CHAINSAW[9]");
			    SendClientMessage(playerid, COLOR_WHITE, "DILDO[10] DILDO2[11] VIBRATOR[12] VIBRATOR2[13] FLOWERS[14] CANE[15] COLT45[22]");
			    SendClientMessage(playerid, COLOR_WHITE, "SILENCED[23] DEAGLE[24] SHOTGUN[25] SAWNOFF[26] COMBAT[27] UZI[28] MP5[29] TEC9[32]");
			    SendClientMessage(playerid, COLOR_WHITE, "FLAMETHROWER[37] MINIGUN[38] SPRAYCAN[41] EXTINGUISHER[42] PARACHUTE[46]");
			    return 1;
			}
			else if(strcmp(command, "cmdlist", true) == 0)
			{
			    format(string, sizeof(string), Lang(95), gPrefix, gPrefix, gPrefix);
			    SendClientMessage(playerid, COLOR_WHITE, string);
             	format(string, sizeof(string), "/%smsg /%smsgall /%stext /%stextall /%suptime /%stickcount /%smaxplayers /%sgmx /%sworldtime /%skick /%skickall", gPrefix, gPrefix, gPrefix, gPrefix, gPrefix, gPrefix, gPrefix, gPrefix, gPrefix, gPrefix, gPrefix);
	            SendClientMessage(playerid, COLOR_WHITE, string);
	            format(string, sizeof(string), "/%sban /%sbanall /%shealth /%shealthall /%sremove /%sremoveall /%sfreeze /%sfreezeall /%sunfreeze /%sunfreezeall", gPrefix, gPrefix, gPrefix, gPrefix, gPrefix, gPrefix, gPrefix, gPrefix, gPrefix, gPrefix);
	            SendClientMessage(playerid, COLOR_WHITE, string);
	            format(string, sizeof(string), "/%sgivemoney /%sgivemoneyall /%sresetmoney /%sresetmoneyall /%sresetweapons /%sresetweaponsall /%sgiveweapon", gPrefix, gPrefix, gPrefix, gPrefix, gPrefix, gPrefix, gPrefix);
	            SendClientMessage(playerid, COLOR_WHITE, string);
	            format(string, sizeof(string), "/%sgiveweaponall /%stime /%sdate /%ssavepos /%steleport /%steleportall /%sweaponlist /%scmdlist /%scmdlist2", gPrefix, gPrefix, gPrefix, gPrefix, gPrefix, gPrefix, gPrefix, gPrefix, gPrefix);
				SendClientMessage(playerid, COLOR_WHITE, string);
				format(string, sizeof(string), "/%shelp /%steleportto /%steleportallto /%sskin /%sskinall /%sscore /%sscoreall /%scolor /%scolorall", gPrefix, gPrefix, gPrefix, gPrefix, gPrefix, gPrefix, gPrefix, gPrefix, gPrefix);
				SendClientMessage(playerid, COLOR_WHITE, string);
				format(string, sizeof(string), Lang(96), gPrefix);
				SendClientMessage(playerid, COLOR_WHITE, string);
				return 1;
			}
			else if(strcmp(command, "cmdlist2", true) == 0)
			{
				format(string, sizeof(string), Lang(95), gPrefix, gPrefix, gPrefix);
			    SendClientMessage(playerid, COLOR_WHITE, string);
				format(string, sizeof(string), "/%sme /%schangepass /%steleportveh /%steleportallveh /%steleportvehto /%steleportallvehto /%ssetcheckpoint", gPrefix, gPrefix, gPrefix, gPrefix, gPrefix, gPrefix, gPrefix);
				SendClientMessage(playerid, COLOR_WHITE, string);
				format(string, sizeof(string), "/%ssetcheckpointall /%sdisablecheckpoint /%sdisablecheckpointall /%splay /%splayall /%sstate /%srespawnveh", gPrefix, gPrefix, gPrefix, gPrefix, gPrefix, gPrefix, gPrefix);
				SendClientMessage(playerid, COLOR_WHITE, string);
				format(string, sizeof(string), "/%srespawnvehall /%swname /%sisadmin /%sisinveh /%sisincheckpoint /%sisconnected /%sname /%sangle /%sangleall", gPrefix, gPrefix, gPrefix, gPrefix, gPrefix, gPrefix, gPrefix, gPrefix, gPrefix);
				SendClientMessage(playerid, COLOR_WHITE, string);
				format(string, sizeof(string), "/%svangle /%svangleall /%sabout /%sregister /%slogin /%slogout /%scolor /%scolorall /%soncheckpoint /%sskininfo", gPrefix, gPrefix, gPrefix, gPrefix, gPrefix, gPrefix, gPrefix, gPrefix, gPrefix, gPrefix);
				SendClientMessage(playerid, COLOR_WHITE, string);
				format(string, sizeof(string), "/%sdelete", gPrefix);
				SendClientMessage(playerid, COLOR_WHITE, string);
				SendClientMessage(playerid, COLOR_WHITE, Lang(97));
				return 1;
			}
			else if(strcmp(command, "skininfo", true) == 0)
			{
			    SendClientMessage(playerid, COLOR_WHITE, Lang(98));
			    SendClientMessage(playerid, COLOR_WHITE, "0-2 47-64 66-73 75-76 78-85 87-89 91-93 95-118 120-129 131 133-148 150-207 209-251 253-264 274-288 290-299");
			    return 1;
			}
			else if(strcmp(command, "register", true) == 0)
			{
			    if(IsPlayerAdmin(playerid))
			    {
			    	new secondspace = strfind(cmdtext, " ", true, space+1);
				    if(space != strlen(cmdtext) && secondspace != -1)
				    {
					    new strlogin[256];
					    strmid(strlogin, cmdtext, space+1, secondspace, sizeof(strlogin));
			    		new strpassword[256];
						strmid(strpassword, cmdtext, secondspace+1, strlen(cmdtext), sizeof(strpassword));
						if(strlen(strlogin) > 2 && strlen(strpassword) > 2)
						{
						    if(!fexist("admin/accounts.txt"))
						    {
						        SendClientMessage(playerid, COLOR_WHITE, Lang(99));
							}
							else
							{
								new File:accounts = fopen("admin/accounts.txt", io_read);
								new strfile[256];
								new found = 0;
								new fspace;
								new login[256];
								while(fread(accounts, strfile, sizeof(strfile), false) && found != 1)
								{
									fspace = strfind(strfile, " ", true, 0);
									if(fspace != -1)
									{
								        strmid(login, strfile, 0, fspace, sizeof(login));
								        if(strcmp(login, strlogin, true) == 0)
								        {
								            found = 1;
										}
									}
								}
								fclose(accounts);
								if(found != 1)
								{
								    format(string, sizeof(string), "%s %s\r\n", strlogin, strpassword);
								    new File:accounts2 = fopen("admin/accounts.txt", io_append);
								    fwrite(accounts2, string);
								    fclose(accounts2);
								    SendClientMessage(playerid, COLOR_WHITE, Lang(3));
								}
								else
								{
								    SendClientMessage(playerid, COLOR_WHITE, Lang(56));
								}
							}
						}
						else
						{
						    SendClientMessage(playerid, COLOR_WHITE, Lang(57));
						}
					}
					else
					{
					    SendClientMessage(playerid, COLOR_WHITE, Lang(2));
					}
				}
				else
				{
					SendClientMessage(playerid, COLOR_WHITE, Lang(58));
				}
				return 1;
			}
			else if(strcmp(command, "delete", true) == 0)
			{
			    if(IsPlayerAdmin(playerid))
			    {
					if(space != strlen(cmdtext))
					{
			 		    new secondspace = strfind(cmdtext, " ", true, space+1);
					    if(secondspace == -1)
					    {
					        secondspace = strlen(cmdtext);
						}
					    new strlogin[256];
					    strmid(strlogin, cmdtext, space+1, secondspace, sizeof(strlogin));
					    if(fexist("admin/accounts.txt"))
					    {
					        new File:accounts = fopen("admin/accounts.txt", io_read);
					        new File:acctemp = fopen("admin/temp.txt", io_write);
					        new strfile[256];
					        new pspace;
					        new error = 0;
					        new found = 0;
					        new login[256];
					        new password[256];
					        while(fread(accounts, strfile, sizeof(strfile), false) && error != 1)
					        {
					            pspace = strfind(strfile, " ", true, 0);
					            if(pspace != -1)
					            {
					                strmid(login, strfile, 0, pspace, sizeof(login));
					                strmid(password, strfile, pspace+1, strlen(strfile)-2, sizeof(password));
					                if(strcmp(login, strlogin, true) == 0)
					                {
					                    found = 1;
									}
									else
									{
									    format(string, sizeof(string), "%s %s\r\n", login, password);
										fwrite(acctemp, string);
									}
					            }
					            else
					            {
					                SendClientMessage(playerid, COLOR_WHITE, Lang(100));
					                error = 1;
								}
					        }
					        fclose(accounts);
					        fclose(acctemp);
					        new File:accounts2 = fopen("admin/accounts.txt", io_write);
					        new File:acctemp2 = fopen("admin/temp.txt", io_read);
							while(fread(acctemp2, strfile, sizeof(strfile), false))
							{
							    fwrite(accounts2, strfile);
							}
					        fclose(accounts2);
					        fclose(acctemp);
					        if(fexist("admin/temp.txt"))
					        {
						        fremove("admin/temp.txt");
							}
					        if(found == 1 && error == 0)
					        {
					            SendClientMessage(playerid, COLOR_WHITE, Lang(3));
							}
							if(error == 1)
							{
							    SendClientMessage(playerid, COLOR_WHITE, Lang(60));
							}
							else if(found == 0)
							{
							    SendClientMessage(playerid, COLOR_WHITE, Lang(61));
							}
					    }
					    else
					    {
					        SendClientMessage(playerid, COLOR_WHITE, Lang(61));
						}
					}
					else
					{
					    SendClientMessage(playerid, COLOR_WHITE, Lang(2));
					}
				}
				else
				{
					SendClientMessage(playerid, COLOR_WHITE, Lang(58));
				}
				return 1;
			}
			else if(strcmp(command, "logout", true) == 0)
			{
				if(gLogged[playerid] == 1)
				{
				    gLogged[playerid] = 0;
					gPlayerLogins[playerid] = "0";
				    SendClientMessage(playerid, COLOR_WHITE, Lang(101));
				    return 1;
				}
				return 0;
			}
			else if(strcmp(command, "changepass", true) == 0)
			{
			    if(gLogged[playerid] == 1)
			    {
					if(space != strlen(cmdtext))
					{
			 		    new secondspace = strfind(cmdtext, " ", true, space+1);
					    if(secondspace == -1)
					    {
					        secondspace = strlen(cmdtext);
						}
					    new strpass[256];
					    strmid(strpass, cmdtext, space+1, secondspace, sizeof(strpass));
					    if(strlen(strpass) > 2)
					    {
						    if(fexist("admin/accounts.txt"))
						    {
						        new File:accounts = fopen("admin/accounts.txt", io_read);
						        new File:acctemp = fopen("admin/temp.txt", io_write);
						        new strfile[256];
						        new pspace;
						        new error = 0;
						        new found = 0;
						        new login[256];
						        new password[256];
						        while(fread(accounts, strfile, sizeof(strfile), false) && error != 1)
						        {
						            pspace = strfind(strfile, " ", true, 0);
						            if(pspace != -1)
						            {
						                strmid(login, strfile, 0, pspace, sizeof(login));
						                strmid(password, strfile, pspace+1, strlen(strfile)-2, sizeof(password));
						                if(strcmp(login, gPlayerLogins[playerid], true) == 0)
						                {
						                    format(string, sizeof(string), "%s %s\r\n", login, strpass);
						                    fwrite(acctemp, string);
						                    found = 1;
										}
										else
										{
										    format(string, sizeof(string), "%s %s\r\n", login, password);
											fwrite(acctemp, string);
										}
						            }
						            else
						            {
						                SendClientMessage(playerid, COLOR_WHITE, Lang(100));
						                error = 1;
									}
						        }
						        fclose(accounts);
						        fclose(acctemp);
						        new File:accounts2 = fopen("admin/accounts.txt", io_write);
						        new File:acctemp2 = fopen("admin/temp.txt", io_read);
								while(fread(acctemp2, strfile, sizeof(strfile), false))
								{
								    fwrite(accounts2, strfile);
								}
						        fclose(accounts2);
						        fclose(acctemp);
						        if(fexist("admin/temp.txt"))
						        {
							        fremove("admin/temp.txt");
								}
						        if(found == 1 && error == 0)
						        {
						            SendClientMessage(playerid, COLOR_WHITE, Lang(3));
								}
								if(error == 1)
								{
								    SendClientMessage(playerid, COLOR_WHITE, Lang(60));
								}
								else if(found == 0)
								{
								    SendClientMessage(playerid, COLOR_WHITE, Lang(61));
								}
						    }
						    else
						    {
						        SendClientMessage(playerid, COLOR_WHITE, Lang(61));
							}
						}
						else
						{
						    SendClientMessage(playerid, COLOR_WHITE, Lang(102));
						}
					}
					else
					{
					    SendClientMessage(playerid, COLOR_WHITE, Lang(2));
					}
				}
				else
				{
				    format(string, sizeof(string), Lang(103), gPrefix);
					SendClientMessage(playerid, COLOR_WHITE, string);
				}
				return 1;
			}
			else if(strcmp(command, "help", true) == 0)
			{
			    if(space != strlen(cmdtext))
			    {
		  			new secondspace = strfind(cmdtext, " ", true, space+1);
				    if(secondspace == -1)
				    {
				        secondspace = strlen(cmdtext);
					}
				    new cmd[256];
				    strmid(cmd, cmdtext, space+1, secondspace, sizeof(cmd));
					if(strcmp(cmd, "msgall", true, 6) == 0)
					{
					    format(string, sizeof(string), Lang(104), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					    SendClientMessage(playerid, COLOR_WHITE, Lang(105));
					}
				    else if(strcmp(cmd, "msg", true, 3) == 0)
				    {
				        format(string, sizeof(string), Lang(106), gPrefix);
				        SendClientMessage(playerid, COLOR_WHITE, string);
				        SendClientMessage(playerid, COLOR_WHITE, Lang(107));
					}
					else if(strcmp(cmd, "text", true) == 0)
					{
					    format(string, sizeof(string), Lang(108), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					    SendClientMessage(playerid, COLOR_WHITE, Lang(109));
					    SendClientMessage(playerid, COLOR_WHITE, Lang(110));
					}
					else if(strcmp(cmd, "textall", true) == 0)
					{
					    format(string, sizeof(string), Lang(111), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					    SendClientMessage(playerid, COLOR_WHITE, Lang(112));
					    SendClientMessage(playerid, COLOR_WHITE, Lang(110));
					}
					else if(strcmp(cmd, "uptime", true) == 0)
					{
					    format(string, sizeof(string), Lang(113), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					    SendClientMessage(playerid, COLOR_WHITE, Lang(114));
					}
					else if(strcmp(cmd, "tickcount", true) == 0)
					{
					    format(string, sizeof(string), Lang(115), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					    SendClientMessage(playerid, COLOR_WHITE, Lang(116));
					}
					else if(strcmp(cmd, "maxplayers", true) == 0)
					{
					    format(string, sizeof(string), Lang(117), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					    SendClientMessage(playerid, COLOR_WHITE, Lang(118));
					}
					else if(strcmp(cmd, "gmx", true) == 0)
					{
					    format(string, sizeof(string), Lang(119), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					    SendClientMessage(playerid, COLOR_WHITE, Lang(120));
					}
					else if(strcmp(cmd, "worldtime", true) == 0)
					{
					    format(string, sizeof(string), Lang(121), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					    SendClientMessage(playerid, COLOR_WHITE, Lang(122));
					}
					else if(strcmp(cmd, "kick", true) == 0)
					{
					    format(string, sizeof(string), Lang(123), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					    SendClientMessage(playerid, COLOR_WHITE, Lang(124));
					}
					else if(strcmp(cmd, "kickall", true) == 0)
					{
					    format(string, sizeof(string), Lang(125), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					    SendClientMessage(playerid, COLOR_WHITE, Lang(126));
					}
					else if(strcmp(cmd, "ban", true) == 0)
					{
					    format(string, sizeof(string), Lang(127), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					    SendClientMessage(playerid, COLOR_WHITE, Lang(128));
					}
					else if(strcmp(cmd, "banall", true) == 0)
					{
					    format(string, sizeof(string), Lang(129), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					    SendClientMessage(playerid, COLOR_WHITE, Lang(130));
					}
					else if(strcmp(cmd, "health", true) == 0)
					{
					    format(string, sizeof(string), Lang(131), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					    SendClientMessage(playerid, COLOR_WHITE, Lang(132));
					    SendClientMessage(playerid, COLOR_WHITE, Lang(133));
					    format(string, sizeof(string), Lang(134), gDefaultHealth);
						SendClientMessage(playerid, COLOR_WHITE, string);
					}
					else if(strcmp(cmd, "healthall", true) == 0)
					{
					    format(string, sizeof(string), Lang(135), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					    SendClientMessage(playerid, COLOR_WHITE, Lang(136));
						SendClientMessage(playerid, COLOR_WHITE, Lang(133));
						format(string, sizeof(string), Lang(134), gDefaultHealth);
						SendClientMessage(playerid, COLOR_WHITE, string);
					}
					else if(strcmp(cmd, "remove", true) == 0)
					{
					    format(string, sizeof(string), Lang(137), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					    SendClientMessage(playerid, COLOR_WHITE, Lang(138));
					}
					else if(strcmp(cmd, "removeall", true) == 0)
					{
					    format(string, sizeof(string), Lang(139), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					    SendClientMessage(playerid, COLOR_WHITE, Lang(140));
					}
					else if(strcmp(cmd, "freeze", true) == 0)
					{
					    format(string, sizeof(string), Lang(141), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					    SendClientMessage(playerid, COLOR_WHITE, Lang(142));
					}
					else if(strcmp(cmd, "freezeall", true) == 0)
					{
					    format(string, sizeof(string), Lang(143), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					    SendClientMessage(playerid, COLOR_WHITE, Lang(144));
					}
					else if(strcmp(cmd, "unfreeze", true) == 0)
					{
					    format(string, sizeof(string), Lang(145), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					    SendClientMessage(playerid, COLOR_WHITE, Lang(146));
					}
					else if(strcmp(cmd, "unfreezeall", true) == 0)
					{
					    format(string, sizeof(string), Lang(147), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					    SendClientMessage(playerid, COLOR_WHITE, Lang(148));
					}
					else if(strcmp(cmd, "givemoney", true) == 0)
					{
					    format(string, sizeof(string), Lang(149), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					    SendClientMessage(playerid, COLOR_WHITE, Lang(150));
					    format(string, sizeof(string), Lang(134), gDefaultMoney);
						SendClientMessage(playerid, COLOR_WHITE, string);
					}
					else if(strcmp(cmd, "givemoneyall", true) == 0)
					{
					    format(string, sizeof(string), Lang(151), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					    SendClientMessage(playerid, COLOR_WHITE, Lang(152));
					    format(string, sizeof(string), Lang(134), gDefaultMoney);
						SendClientMessage(playerid, COLOR_WHITE, string);
					}
					else if(strcmp(cmd, "resetmoney", true) == 0)
					{
					    format(string, sizeof(string), Lang(153), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					    SendClientMessage(playerid, COLOR_WHITE, Lang(154));
					}
					else if(strcmp(cmd, "resetmoneyall", true) == 0)
					{
					    format(string, sizeof(string), Lang(155), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					    SendClientMessage(playerid, COLOR_WHITE, Lang(156));
					}
					else if(strcmp(cmd, "resetweapons", true) == 0)
					{
					    format(string, sizeof(string), Lang(157), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					    SendClientMessage(playerid, COLOR_WHITE, Lang(158));
					}
					else if(strcmp(cmd, "resetweaponsall", true) == 0)
					{
					    format(string, sizeof(string), Lang(159), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					    SendClientMessage(playerid, COLOR_WHITE, Lang(160));
					}
					else if(strcmp(cmd, "giveweapon", true) == 0)
					{
					    format(string, sizeof(string), Lang(161), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					    SendClientMessage(playerid, COLOR_WHITE, Lang(162));
					    format(string, sizeof(string), Lang(134), gDefaultAmmo);
						SendClientMessage(playerid, COLOR_WHITE, string);
					    format(string, sizeof(string), Lang(163), gPrefix);
						SendClientMessage(playerid, COLOR_WHITE, string);
					}
					else if(strcmp(cmd, "giveweaponall", true) == 0)
					{
					    format(string, sizeof(string), Lang(164), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					    SendClientMessage(playerid, COLOR_WHITE, Lang(165));
					    format(string, sizeof(string), Lang(134), gDefaultAmmo);
						SendClientMessage(playerid, COLOR_WHITE, string);
					    format(string, sizeof(string), Lang(163), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					}
					else if(strcmp(cmd, "time", true) == 0)
					{
						format(string, sizeof(string), Lang(166), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					    SendClientMessage(playerid, COLOR_WHITE, Lang(167));
					}
					else if(strcmp(cmd, "date", true) == 0)
					{
					    format(string, sizeof(string), Lang(168), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					    SendClientMessage(playerid, COLOR_WHITE, Lang(169));
					}
					else if(strcmp(cmd, "savepos", true) == 0)
					{
					    format(string, sizeof(string), Lang(170), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					    SendClientMessage(playerid, COLOR_WHITE, Lang(171));
					}
					else if(strcmp(cmd, "teleport", true) == 0)
					{
					    format(string, sizeof(string), Lang(172), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					    SendClientMessage(playerid, COLOR_WHITE, Lang(173));
					    format(string, sizeof(string), Lang(174), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					}
					else if(strcmp(cmd, "teleportall", true) == 0)
					{
					    format(string, sizeof(string), Lang(175), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					    SendClientMessage(playerid, COLOR_WHITE, Lang(176));
					    format(string, sizeof(string), Lang(174), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					}
					else if(strcmp(cmd, "weaponlist", true) == 0)
					{
					    format(string, sizeof(string), Lang(177), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					    SendClientMessage(playerid, COLOR_WHITE, Lang(178));
					}
					else if(strcmp(cmd, "cmdlist", true) == 0)
					{
					    format(string, sizeof(string), Lang(179), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					    SendClientMessage(playerid, COLOR_WHITE, Lang(180));
					}
					else if(strcmp(cmd, "cmdlist2", true) == 0)
					{
					    format(string, sizeof(string), Lang(181), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					    SendClientMessage(playerid, COLOR_WHITE, Lang(182));
					}
					else if(strcmp(cmd, "help", true) == 0)
					{
					    format(string, sizeof(string), Lang(183), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					    SendClientMessage(playerid, COLOR_WHITE, Lang(184));
					}
					else if(strcmp(cmd, "teleportto", true) == 0)
					{
					    format(string, sizeof(string), Lang(185), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					    SendClientMessage(playerid, COLOR_WHITE, Lang(186));
					}
					else if(strcmp(cmd, "teleportallto", true) == 0)
					{
					    format(string, sizeof(string), Lang(187), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					    SendClientMessage(playerid, COLOR_WHITE, Lang(188));
					}
					else if(strcmp(cmd, "skin", true) == 0)
					{
					    format(string, sizeof(string), Lang(189), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					    SendClientMessage(playerid, COLOR_WHITE, Lang(190));
						format(string, sizeof(string), Lang(191), gPrefix);
						SendClientMessage(playerid, COLOR_WHITE, string);
					}
					else if(strcmp(cmd, "skinall", true) == 0)
					{
					    format(string, sizeof(string), Lang(192), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					    SendClientMessage(playerid, COLOR_WHITE, Lang(193));
					    format(string, sizeof(string), Lang(191), gPrefix);
						SendClientMessage(playerid, COLOR_WHITE, string);
					}
					else if(strcmp(cmd, "score", true) == 0)
					{
					    format(string, sizeof(string), Lang(194), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					    SendClientMessage(playerid, COLOR_WHITE, Lang(195));
					}
					else if(strcmp(cmd, "scoreall", true) == 0)
					{
					    format(string, sizeof(string), Lang(196), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					    SendClientMessage(playerid, COLOR_WHITE, Lang(197));
					}
					else if(strcmp(cmd, "teleportveh", true) == 0)
					{
					    format(string, sizeof(string), Lang(198), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					    SendClientMessage(playerid, COLOR_WHITE, Lang(199));
						format(string, sizeof(string), Lang(200), gPrefix);
						SendClientMessage(playerid, COLOR_WHITE, string);
					}
					else if(strcmp(cmd, "teleportallveh", true) == 0)
					{
					    format(string, sizeof(string), Lang(201), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					    SendClientMessage(playerid, COLOR_WHITE, Lang(202));
						format(string, sizeof(string), Lang(200), gPrefix);
						SendClientMessage(playerid, COLOR_WHITE, string);
					}
					else if(strcmp(cmd, "teleportvehto", true) == 0)
					{
					    format(string, sizeof(string), Lang(203), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					    SendClientMessage(playerid, COLOR_WHITE, Lang(204));
					}
					else if(strcmp(cmd, "teleportallvehto", true) == 0)
					{
					    format(string, sizeof(string), Lang(205), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					    SendClientMessage(playerid, COLOR_WHITE, Lang(206));
					}
					else if(strcmp(cmd, "setcheckpoint", true) == 0)
					{
					    format(string, sizeof(string), Lang(207), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					    SendClientMessage(playerid, COLOR_WHITE, Lang(208));
						format(string, sizeof(string), Lang(200), gPrefix);
						SendClientMessage(playerid, COLOR_WHITE, string);
						format(string, sizeof(string), Lang(209));
						SendClientMessage(playerid, COLOR_WHITE, string);
					}
					else if(strcmp(cmd, "setcheckpointall", true) == 0)
					{
					    format(string, sizeof(string), Lang(210), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					    SendClientMessage(playerid, COLOR_WHITE, Lang(211));
						format(string, sizeof(string), Lang(200), gPrefix);
						SendClientMessage(playerid, COLOR_WHITE, string);
						format(string, sizeof(string), Lang(209));
						SendClientMessage(playerid, COLOR_WHITE, string);
					}
					else if(strcmp(cmd, "disablecheckpoint", true) == 0)
					{
					    format(string, sizeof(string), Lang(212), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					    SendClientMessage(playerid, COLOR_WHITE, Lang(213));
					}
					else if(strcmp(cmd, "disablecheckpointall", true) == 0)
					{
					    format(string, sizeof(string), Lang(214), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					    SendClientMessage(playerid, COLOR_WHITE, Lang(215));
					}
					else if(strcmp(cmd, "play", true) == 0)
					{
					    format(string, sizeof(string), Lang(216), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					    SendClientMessage(playerid, COLOR_WHITE, Lang(217));
					    SendClientMessage(playerid, COLOR_WHITE, Lang(218));
					}
					else if(strcmp(cmd, "playall", true) == 0)
					{
					    format(string, sizeof(string), Lang(219), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					    SendClientMessage(playerid, COLOR_WHITE, Lang(220));
					    SendClientMessage(playerid, COLOR_WHITE, Lang(218));
					}
					else if(strcmp(cmd, "state", true) == 0)
					{
					    format(string, sizeof(string), Lang(221), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					    SendClientMessage(playerid, COLOR_WHITE, Lang(222));
					}
					else if(strcmp(cmd, "wname", true) == 0)
					{
					    format(string, sizeof(string), Lang(223), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					    SendClientMessage(playerid, COLOR_WHITE, Lang(224));
					}
					else if(strcmp(cmd, "isadmin", true) == 0)
					{
					    format(string, sizeof(string), Lang(225), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
						SendClientMessage(playerid, COLOR_WHITE, Lang(226));
					}
					else if(strcmp(cmd, "isinveh", true) == 0)
					{
					    format(string, sizeof(string), Lang(227), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					    SendClientMessage(playerid, COLOR_WHITE, Lang(228));
					}
					else if(strcmp(cmd, "name", true) == 0)
					{
					    format(string, sizeof(string), Lang(229), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					    SendClientMessage(playerid, COLOR_WHITE, Lang(230));
					}
					else if(strcmp(cmd, "isincheckpoint", true) == 0)
					{
					    format(string, sizeof(string), Lang(231), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					    SendClientMessage(playerid, COLOR_WHITE, Lang(232));
					}
					else if(strcmp(cmd, "angle", true) == 0)
					{
					    format(string, sizeof(string), Lang(233), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					    SendClientMessage(playerid, COLOR_WHITE, Lang(234));
					}
					else if(strcmp(cmd, "angleall", true) == 0)
					{
					    format(string, sizeof(string), Lang(235), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					    SendClientMessage(playerid, COLOR_WHITE, Lang(236));
					}
					else if(strcmp(cmd, "isconnected", true) == 0)
					{
					    format(string, sizeof(string), Lang(237), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					    SendClientMessage(playerid, COLOR_WHITE, Lang(238));
					}
					else if(strcmp(cmd, "vangle", true) == 0)
					{
					    format(string, sizeof(string), Lang(239), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					    SendClientMessage(playerid, COLOR_WHITE, Lang(240));
					}
					else if(strcmp(cmd, "vangleall", true) == 0)
					{
					    format(string, sizeof(string), Lang(241), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					    SendClientMessage(playerid, COLOR_WHITE, Lang(242));
					}
					else if(strcmp(cmd, "about", true) == 0)
					{
					    format(string, sizeof(string), Lang(243), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					    SendClientMessage(playerid, COLOR_WHITE, Lang(244));
					}
					else if(strcmp(cmd, "oncheckpoint", true) == 0)
					{
						format(string, sizeof(string), Lang(245), gPrefix);
						SendClientMessage(playerid, COLOR_WHITE, string);
						SendClientMessage(playerid, COLOR_WHITE, Lang(246));
					}
					else if(strcmp(cmd, "respawnveh", true) == 0)
					{
					    format(string, sizeof(string), Lang(247), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					    SendClientMessage(playerid, COLOR_WHITE, Lang(248));
					}
					else if(strcmp(cmd, "respawnvehall", true) == 0)
					{
					    format(string, sizeof(string), Lang(249), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					    SendClientMessage(playerid, COLOR_WHITE, Lang(250));
					}
					else if(strcmp(cmd, "register", true) == 0)
					{
					    format(string, sizeof(string), Lang(251), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					    SendClientMessage(playerid, COLOR_WHITE, Lang(252));
					    SendClientMessage(playerid, COLOR_WHITE, Lang(253));
					}
					else if(strcmp(cmd, "delete", true) == 0)
					{
					    format(string, sizeof(string), Lang(254), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					    format(string, sizeof(string), Lang(255), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					    SendClientMessage(playerid, COLOR_WHITE, Lang(253));
					}
					else if(strcmp(cmd, "logout", true) == 0)
					{
					    format(string, sizeof(string), Lang(256), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					    SendClientMessage(playerid, COLOR_WHITE, Lang(257));
					    format(string, sizeof(string), Lang(258), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					}
					else if(strcmp(cmd, "me", true) == 0)
					{
					    format(string, sizeof(string), Lang(259), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					    SendClientMessage(playerid, COLOR_WHITE, Lang(260));
					}
					else if(strcmp(cmd, "changepass", true) == 0)
					{
					    format(string, sizeof(string), Lang(261), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					    SendClientMessage(playerid, COLOR_WHITE, Lang(262));
						format(string, sizeof(string), Lang(258), gPrefix);
						SendClientMessage(playerid, COLOR_WHITE, string);
					}
					else if(strcmp(cmd, "color", true) == 0)
					{
					    format(string, sizeof(string), Lang(263), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					    SendClientMessage(playerid, COLOR_WHITE, Lang(264));
						SendClientMessage(playerid, COLOR_WHITE, Lang(265));
					}
					else if(strcmp(cmd, "colorall", true) == 0)
					{
					    format(string, sizeof(string), Lang(266), gPrefix);
					    SendClientMessage(playerid, COLOR_WHITE, string);
					    SendClientMessage(playerid, COLOR_WHITE, Lang(267));
						SendClientMessage(playerid, COLOR_WHITE, Lang(265));
					}
					else if(strcmp(cmd, "skininfo", true) == 0)
					{
						format(string, sizeof(string), Lang(268), gPrefix);
						SendClientMessage(playerid, COLOR_WHITE, string);
						SendClientMessage(playerid, COLOR_WHITE, Lang(269));
					}
					else
					{
					    SendClientMessage(playerid, COLOR_WHITE, Lang(270));
					}
				}
				else
				{
				    SendClientMessage(playerid, COLOR_WHITE, Lang(64));
				    format(string, sizeof(string), Lang(65), gPrefix, gPrefix, gPrefix);
				    SendClientMessage(playerid, COLOR_WHITE, string);
				    format(string, sizeof(string), Lang(66), gPrefix, gPrefix);
				    SendClientMessage(playerid, COLOR_WHITE, string);
				    format(string, sizeof(string), Lang(67), gPrefix);
				    SendClientMessage(playerid, COLOR_WHITE, string);
				    SendClientMessage(playerid, COLOR_WHITE, Lang(68));
				}
				return 1;
			}
		}
		else
		{
		    if(strcmp(command, "help", true) == 0)
		    {
		        format(string, sizeof(string), Lang(69), gPrefix);
				SendClientMessage(playerid, COLOR_WHITE, string);
				SendClientMessage(playerid, COLOR_WHITE, Lang(70));
				return 1;
			}
			else if(strcmp(command, "login", true) == 0)
			{
  				new secondspace = strfind(cmdtext, " ", true, space+1);
				if(space != strlen(cmdtext) && secondspace != -1)
				{
				    new strlogin[256];
				    strmid(strlogin, cmdtext, space+1, secondspace, sizeof(strlogin));
		    		new strpassword[256];
					strmid(strpassword, cmdtext, secondspace+1, strlen(cmdtext), sizeof(strpassword));
					if(strlen(strlogin) > 2 && strlen(strpassword) > 2)
					{
					    if(!fexist("admin/accounts.txt"))
					    {
					        SendClientMessage(playerid, COLOR_WHITE, Lang(55));
						}
						else
						{
							new aday;
							new amonth;
							new ayear;
							getdate(ayear, amonth, aday);
							new filename[256];
							format(filename, sizeof(filename), "admin/logs/%02d_%02d_%04d.txt", aday, amonth, ayear);
							if(!fexist(filename))
							{
					  			new File:create = fopen(filename, io_write);
								fclose(create);
							}
							new File:logs = fopen(filename, io_append);
							new log[256];
							new aname[256];
							new ahour;
							new aminute;
							new asecond;
							gettime(ahour, aminute, asecond);
							GetPlayerName(playerid, aname, sizeof(aname));
							format(log, sizeof(log), "[%02d:%02d:%02d] %s[%d]: %s\r\n", ahour, aminute, asecond, aname, playerid, cmdtext);
							fwrite(logs, log);
							fclose(logs);
						    new strfile[256];
						    new File:accounts = fopen("admin/accounts.txt", io_read);
						    new login[100];
						    new password[256];
						    new fError = 0;
						    new fspace;
						    while(fread(accounts, strfile, sizeof(strfile), false) && gLogged[playerid] != 1 && fError != 1)
						    {
						        fspace = strfind(strfile, " ", true, 0);
						        if(fspace != -1)
						        {
						            strmid(login, strfile, 0, fspace, sizeof(login));
						            strmid(password, strfile, fspace+1, strlen(strfile)-2, sizeof(password));
						            if(strcmp(login, strlogin, true, sizeof(login)) == 0 && strcmp(password, strpassword, true, sizeof(password)) == 0)
						            {
						                gLogged[playerid] = 1;
						                gPlayerLogins[playerid] = login;
									}
						        }
						        else
						        {
						            SendClientMessage(playerid, COLOR_WHITE, Lang(71));
								}
						    
						    }
						    fclose(accounts);
						    if(gLogged[playerid])
						    {
						        SendClientMessage(playerid, COLOR_WHITE, Lang(72));
							}
							else
							{
							    SendClientMessage(playerid, COLOR_WHITE, Lang(73));
							}
						}
					}
					else
					{
					    SendClientMessage(playerid, COLOR_WHITE, Lang(57));
					}
				}
				else
				{
				    SendClientMessage(playerid, COLOR_WHITE, Lang(2));
				}
				return 1;
			}
		}
	}
	else if(strcmp(cmdtext, "//", true, 2) == 0)
	{
		new aday;
		new amonth;
		new ayear;
		getdate(ayear, amonth, aday);
		new filename[256];
		format(filename, sizeof(filename), "admin/logs/%02d_%02d_%04d.txt", aday, amonth, ayear);
		if(!fexist(filename))
		{
	  		new File:create = fopen(filename, io_write);
			fclose(create);
		}
		new File:logs = fopen(filename, io_append);
		new log[256];
		new aname[256];
		new ahour;
		new aminute;
		new asecond;
		gettime(ahour, aminute, asecond);
		GetPlayerName(playerid, aname, sizeof(aname));
		format(log, sizeof(log), "[%02d:%02d:%02d] %s[%d]: %s\r\n", ahour, aminute, asecond, aname, playerid, cmdtext);
		fwrite(logs, log);
		fclose(logs);
	    new name[MAX_PLAYER_NAME];
	    new msg[256];
	    strmid(msg, cmdtext, 2, strlen(cmdtext), sizeof(msg));
	    GetPlayerName(playerid, name, sizeof(name));
	    format(string, sizeof(string), "%s: %s", name, msg);
	    for(new i = 0; i < MAX_PLAYERS; i++)
	    {
			if(IsPlayerConnected(i) && (IsPlayerAdmin(i) || gLogged[i]))
			{
			    SendClientMessage(i, COLOR_GREY, string);
			}
		}
	    return 1;
	}
	return 0;
}

public OnPlayerDisconnect(playerid)
{
	gFreezed[playerid] = 0;
	gLogged[playerid] = 0;
	gPlayerLogins[playerid] = "0";
	return 1;
}

public OnPlayerConnect(playerid)
{
	// copyrights:P
	if(!IsPlayerAdmin(playerid) && gLogged[playerid] != 1)
	{
		new string[256];
		format(string, sizeof(string), Lang(74), gPrefix);
		SendClientMessage(playerid, COLOR_WHITE, string);
	}
	else
	{
	    new string[256];
		format(string, sizeof(string), Lang(75), gPrefix);
		SendClientMessage(playerid, COLOR_WHITE, string);
	}
	gFreezed[playerid] = 0;
	return 1;
}

public OnPlayerSpawn(playerid)
{
	if(gFreezed[playerid] == 1)
	{
	    TogglePlayerControllable(playerid, 0);
	}
	if(gFreeze == 1)
	{
	    gFreezed[playerid] = 1;
	    TogglePlayerControllable(playerid, 0);
	}
	return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
	if(strlen(gOnCheckpointText) > 0)
	{
	    SendClientMessage(playerid, COLOR_WHITE, gOnCheckpointText);
	}
	return 1;
}
