RUNTIME error 6
#1

Hey guyz when i have compiled my script it has a error 6 instruction failed

here is my script :

Код:
new tCP[30];
new UnderAttack[30] = 0;
new CP[30];
new Zone[30];

////////////////////////////////////////////////////////////////////////////////
//                              Los Santos Gang Wars                          //
//                             Scripter: Jack Leslie                          //
//                                                                            //
//              Credits to the creators of such things as:                    //
//              sscanf                                                        //
//              streamer                                                      //
//              dfile                                                         //
//              dcmd                                                          //
//              foreach                                                       //
//                             Project started:                               //
//                              29 August 2011                                //
//                                                                            //
//                          Date of Release (v1.0)                            //
//                              4th Sept 2011                                 //
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
//  The following people helped me with bugs etc.                             //
//                                                                            //
//  PrawkC                                                                    //
//  Jeffrey                                                                   //
//  varthshenon                                                               //
//                                                                            //
//                                                                            //
////////////////////////////////////////////////////////////////////////////////
//============================================================================//
#include <a_samp>
#include <foreach>
#include <streamer>
#include <sscanf>
#include <dfile>



new gTeam[MAX_PLAYERS];
//==================== COLORS =========//
#define COLOR_LIGHTRED 		0xFF6347AA
#define COLOR_GROVES        0x00AA00FF
#define COLOR_BALLAS        0xC2A2DAAA
#define COLOR_VAGOS         0xFFFF00AA
#define COLOR_AZTECAS       0x01FCFFC8
#define COLOR_GREY 			0xAFAFAFAA
#define COLOR_WELCOME       0xFFCFB53B
#define COLOR_FADE1 		0xFFFFFFFF
#define COLOR_FADE2 		0xC8C8C8C8
#define COLOR_FADE3 		0xAAAAAAAA
#define COLOR_FADE4 		0x8C8C8C8C
#define COLOR_FADE5 		0x6E6E6E6E
#define COLOR_WHITE  		0xFFFFFFFF
#define COL_GREEN2         "{33CC00}"
#define COL_WHITE          "{FFFFFF}" 
#define     COLOR_RED       0xFF0000FF
#define COLOR_LIGHTBLUE 	0x33CCFFAA
#define COLOR_LIGHTGREEN 	0x9ACD32AA
#define COLOR_YELLOW 		0xFFFF00AA
#define COLOR_LIGHTYELLOW	0xFFFF91FF
#define COLOR_DBLUE 		0x2641FEAA
#define COLOR_ORANGE   		0xFF830000
//=========== RULES ==================//
#define RULE1 "Rule 1: Try to dont shot your team"
#define RULE2 "Rule 2: Dont try to cheat/hack because we have anticheat"
#define RULE3 "Rule 3: Dont insult,be racist or Flame"
#define RULE4 "Rule 4: Dont C- Slide,Bug and LAG"
//=========== CAPZONE ==================//
#define CAPZONE 0
#define TEAM1 0
#define TEAM2 1
#define NONE  2
//=========== RANDOM MSG =============//
new RandomMSG[][] =
{
    ">> Did you know that gang who has most zones for a long time must be the most teamworking?",
    ">> Write in chat where are you from!!!",
    ">> Try to teamwork to win the enemy gangs and capture zones!"
};
forward SendMSG();
public SendMSG()
{
    new randMSG = random(sizeof(RandomMSG));
    SendClientMessageToAll(COLOR_LIGHTGREEN, RandomMSG[randMSG]);
}
// Wanna add a new random message?
// Just add another ">> Insert random message here" line!
//============================================================================//
stock GetPlayerSpeed(playerid,bool:kmh)
{
    new Float:Vx,Float:Vy,Float:Vz,Float:rtn;
    if(IsPlayerInAnyVehicle(playerid)) GetVehicleVelocity(GetPlayerVehicleID(playerid),Vx,Vy,Vz); else GetPlayerVelocity(playerid,Vx,Vy,Vz);
    rtn = floatsqroot(floatabs(floatpower(Vx + Vy + Vz,2)));
    return kmh?floatround(rtn * 100 * 1.61):floatround(rtn * 100);
}
//============================================================================//
stock CaptureZoneMessage(playerid, messageid)
{
    switch(messageid)
    {
       case 1:
       {
           SendClientMessage(playerid, COLOR_RED,"You cannot capture while in a vehicle!");
       }
       case 2:
       {
           SendClientMessage(playerid, COLOR_RED, "This zone is already being taken over!");
       }
    }
    return 1;
}
//============================================================================//
stock LeavingCAPZONE(playerid)
{
    Captured[playerid][CAPZONE] = 0;
    UnderAttack[CAPZONE] = 0;
    KillTimer(timer[playerid][CAPZONE]);
    CountVar[playerid][CAPZONE] = 25;
    GangZoneStopFlashForAll(Zone[CAPZONE]);
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
       IsPlayerCapturing[i][CAPZONE] = 0;
    }
    SendClientMessage(playerid, COLOR_RED,"*You have failed to capture this zone!");
    return 1;
}
//============================================================================//
stock GetName(playerid)
{
 new pnameid[24];
 GetPlayerName(playerid,pnameid,24);
 return pnameid;
}
//============================================================================//
stock GivePlayerScore(playerid, score) // creating our stock
{
SetPlayerScore(playerid, GetPlayerScore(playerid) + score); // we're defining it as it will SetPlayerScore, since it's not known like GivePlayerMoney, there is just SetPlayerScore for the scores.
return 1;
//============================================================================//
stock LeavingCAPZONE(playerid)
{
    Captured[playerid][CAPZONE] = 0;
    UnderAttack[CAPZONE] = 0;
    KillTimer(timer[playerid][CAPZONE]);
    CountVar[playerid][CAPZONE] = 25;
    GangZoneStopFlashForAll(Zone[CAPZONE]);
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
       IsPlayerCapturing[i][CAPZONE] = 0;
    }
    SendClientMessage(playerid, COLOR_RED,"*You have failed to capture this zone!");
    return 1;
}
//============================================================================//
stock ActiveCAPZONE(playerid)
{
        if(UnderAttack[CAPZONE] == 0)
        {
            if(!IsPlayerInAnyVehicle(playerid))
            {
                UnderAttack[CAPZONE] = 1;
                timer[playerid][CAPZONE] = SetTimerEx("CAPZONETimer", 25000, false,"i",playerid);
                Captured[playerid][CAPZONE] = 0;
                SendClientMessage(playerid, 0xFFFFFFFF,"| Stay in this checkpoint for 25 seconds to capture it! |");
                if(gTeam[playerid] == TEAM1)
                {
                  GangZoneFlashForAll(Zone[CAPZONE], TEAM1_COLOR);
                }
                else if(gTeam[playerid] == TEAM2)
                {
                  GangZoneFlashForAll(Zone[CAPZONE], TEAM2_COLOR);
                }

                //------Message-----
                if(tCP[CAPZONE] == TEAM1)
                {
                  SendClientMessage(playerid, COLOR_WHITE,"This flag is controlled by team 1!");
                  SendClientMessageToAll(STEALTH_BLUE,"*Capture Zone is under attack!");
                }
                else if(tCP[CAPZONE] == TEAM2)
                {
                  SendClientMessage(playerid, COLOR_WHITE,"This flag is controlled by team 2!");
                  SendClientMessageToAll(STEALTH_BLUE,"*Capture Zone is under attack!");
                }

                else if(tCP[CAPZONE] == NONE)
                {
                  SendClientMessage(playerid, COLOR_WHITE,"This flag is not controlled by any team!");
                }
                //---------loop-------//
                for(new i = 0; i < MAX_PLAYERS; i ++)
                {
                   IsPlayerCapturing[i][CAPZONE] = 1;
                }
            }
            else return CaptureZoneMessage(playerid, 1);
        }
        else return CaptureZoneMessage(playerid, 2);
        return 1;
}
//============================================================================//
new vehName[][] =
{
    "Landstalker", "Bravura", "Buffalo", "Linerunner", "Perrenial", "Sentinel", "Dumper", "Firetruck", "Trashmaster",
    "Stretch", "Manana", "Infernus", "Voodoo", "Pony", "Mule", "Cheetah", "Ambulance", "Leviathan", "Moonbeam",
    "Esperanto", "Taxi", "Washington", "Bobcat", "Whoopee", "BF Injection", "Hunter", "Premier", "Enforcer",
    "Securicar", "Banshee", "Predator", "Bus", "Rhino", "Barracks", "Hotknife", "Trailer", "Previon", "Coach",
    "Cabbie", "Stallion", "Rumpo", "RC Bandit", "Romero", "Packer", "Monster", "Admiral", "Squalo", "Seasparrow",
    "Pizzaboy", "Tram", "Trailer", "Turismo", "Speeder", "Reefer", "Tropic", "Flatbed", "Yankee", "Caddy", "Solair",
    "Berkley's RC Van", "Skimmer", "PCJ-600", "Faggio", "Freeway", "RC Baron", "RC Raider", "Glendale", "Oceanic",
    "Sanchez", "Sparrow", "Patriot", "Quad", "Coastguard", "Dinghy", "Hermes", "Sabre", "Rustler", "ZR-350", "Walton",
    "Regina", "Comet", "BMX", "Burrito", "Camper", "Marquis", "Baggage", "Dozer", "Maverick", "News Chopper", "Rancher",
    "FBI Rancher", "Virgo", "Greenwood", "Jetmax", "Hotring", "Sandking", "Blista Compact", "Police Maverick",
    "Boxville", "Benson", "Mesa", "RC Goblin", "Hotring Racer A", "Hotring Racer B", "Bloodring Banger", "Rancher",
    "Super GT", "Elegant", "Journey", "Bike", "Mountain Bike", "Beagle", "Cropduster", "Stunt", "Tanker", "Roadtrain",
    "Nebula", "Majestic", "Buccaneer", "Shamal", "Hydra", "FCR-900", "NRG-500", "HPV1000", "Cement Truck", "Tow Truck",
    "Fortune", "Cadrona", "SWAT Truck", "Willard", "Forklift", "Tractor", "Combine", "Feltzer", "Remington", "Slamvan",
    "Blade", "Streak", "Freight", "Vortex", "Vincent", "Bullet", "Clover", "Sadler", "Firetruck", "Hustler", "Intruder",
    "Primo", "Cargobob", "Tampa", "Sunrise", "Merit", "Utility", "Nevada", "Yosemite", "Windsor", "Monster", "Monster",
    "Uranus", "Jester", "Sultan", "Stratium", "Elegy", "Raindance", "RC Tiger", "Flash", "Tahoma", "Savanna", "Bandito",
    "Freight Flat", "Streak Carriage", "Kart", "Mower", "Dune", "Sweeper", "Broadway", "Tornado", "AT-400", "DFT-30",
    "Huntley", "Stafford", "BF-400", "News Van", "Tug", "Trailer", "Emperor", "Wayfarer", "Euros", "Hotdog", "Club",
    "Freight Box", "Trailer", "Andromada", "Dodo", "RC Cam", "Launch", "LSPD Car", "SFPD Car", "LVPD Car",
    "Police Rancher", "Picador", "S.W.A.T", "Alpha", "Phoenix", "Glendale", "Sadler", "Luggage", "Luggage", "Stairs",
    "Boxville", "Tiller", "Utility Trailer"
};

stock ReturnVehicleModelID(string[])
{
	if(IsNumeric(string))
	{
		new id = strval(string);
		if(id >= 400 && id <= 611)
		{
		    return id;
		}
	}
	for(new i = 0;i < sizeof(vehName);i++)
    {
        if(strfind(vehName[i],string,true) != -1)
        {
            return i + 400;
        }
    }
    return 0;
}
//====================================//
//===========================[DCMD Define]====================================//
#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
//===========================[Neon]===========================================//
//============== TEAMS ==============//
#define TEAM_GROVE 		1
#define TEAM_BALLAS 	2
#define TEAM_AZTECAS 	3
#define TEAM_VAGOS 		4
//==================================//
#define DIALOG_REGISTER 1
#define DIALOG_LOGIN    2
#define PATH "%s.ini"
//=================================//
strtok(const string[], &index)
{
	new length = strlen(string);
	while ((index < length) && (string[index] <= ' '))
	{
		index++;
	}

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

IsNumeric(const string[])
{
	for (new i = 0, j = strlen(string); i < j; i++) { if (string[i] > '9' || string[i] < '0') return 0; }
	return 1;
}
//==============================================================================
ReturnUser(text[], playerid = INVALID_PLAYER_ID)
{
	new pos = 0;
	while (text[pos] < 0x21)
	{
		if (text[pos] == 0) return INVALID_PLAYER_ID;
		pos++;
	}
	new userid = INVALID_PLAYER_ID;
	if (IsNumeric(text[pos]))
	{
		userid = strval(text[pos]);
		if (userid >=0 && userid < MAX_PLAYERS)
		{
			if(!IsPlayerConnected(userid)) { userid = INVALID_PLAYER_ID; }
			else { return userid; }
		}
	}
	new len = strlen(text[pos]);
	new count = 0;
	new name[MAX_PLAYER_NAME];
	for (new i = 0; i < MAX_PLAYERS; i++)
	{
		if (IsPlayerConnected(i))
		{
			GetPlayerName(i, name, sizeof (name));
			if (strcmp(name, text[pos], true, len) == 0)
			{
				if (len == strlen(name)) { return i; }
				else { count++; userid = i; }
			}
		}
	}
	if (count != 1)
	{
		if (playerid != INVALID_PLAYER_ID)
		{
			if (count) { SendClientMessage(playerid, 0xFF0000AA, "Multiple users found, please narrow earch"); }
			else { SendClientMessage(playerid, 0xFF0000AA, "No matching user found"); }
		}
		userid = INVALID_PLAYER_ID;
	}
	return userid;
}
//============================================================================//
stock UserPath(playerid)
{
    new string[128],playername[MAX_PLAYER_NAME];
    GetPlayerName(playerid,playername,sizeof(playername));
    format(string,sizeof(string),PATH,playername);
    return string;
}

enum pInfo
{
    pPassword[130],
    pKills,
    pDeaths, 
    pAdmin,
    pMoney, 
    pScore, 
    pVIP, 
    pOnline,
    pBanned,
    pBanReason[126]
}
new PlayerInfo[MAX_PLAYERS][pInfo]; 
stock udb_hash(buf[]) {
    new length=strlen(buf);
    new s1 = 1;
    new s2 = 0;
    new n;
    for (n=0; n<length; n++)
    {
       s1 = (s1 + buf[n]) % 65521;
       s2 = (s2 + s1)     % 65521;
    }
    return (s2 << 16) + s1;
}

native WP_Hash(buffer[], len, const str[]);


OnPlayerLogin(playerid)
{ 
	new File[126];
    format(File, sizeof(File), "%s.ini", PlayerName(playerid));
	dfile_Open(File);
	PlayerInfo[playerid][pAdmin] = dfile_ReadInt("Admin");
	PlayerInfo[playerid][pVIP] = dfile_ReadInt("VIP");
	PlayerInfo[playerid][pMoney] = dfile_ReadInt("Money");
	PlayerInfo[playerid][pScore] = dfile_ReadInt("Score");
	PlayerInfo[playerid][pKills] = dfile_ReadInt("Kills");
	PlayerInfo[playerid][pDeaths] = dfile_ReadInt("Deaths");
	PlayerInfo[playerid][pOnline] = dfile_ReadInt("Online");
	PlayerInfo[playerid][pBanned] = dfile_ReadInt("Banned");
	format(PlayerInfo[playerid][pBanReason],126,"%s",dfile_ReadString("BanReason"));
	if(PlayerInfo[playerid][pBanned] == 1)
	{
	    new string[128];
	    format(string, sizeof(string), "%s", dfile_ReadString("BanReason"));
		SendClientMessage(playerid, COLOR_LIGHTRED, "This account has been banned:");
		SendClientMessage(playerid, COLOR_LIGHTRED, string);
		Kick(playerid);
		return 0;
	}
	dfile_SaveFile();
	dfile_CloseFile();
	new string[128];
	format(string, sizeof(string), "Welcome back to Los Santos Gang Wars, {FFFFFF}%s!", PlayerName(playerid));
	SendClientMessage(playerid, COLOR_ORANGE, string);
	SendClientMessage(playerid, COLOR_ORANGE, RULE1);
	SendClientMessage(playerid, COLOR_ORANGE, RULE2);
	SendClientMessage(playerid, COLOR_ORANGE, RULE3);
	SendClientMessage(playerid, COLOR_ORANGE, RULE4);
	SetPVarInt(playerid, "Logged", 1);
    return 1; 
} 

OnPlayerLogout(playerid) 
{ 
	new File[126];
    format(File, sizeof(File), "%s.ini", PlayerName(playerid));
    dfile_Delete(File);
	dfile_Create(File);
    dfile_Open(File);
    dfile_WriteInt("Admin", PlayerInfo[playerid][pAdmin]);
	dfile_WriteInt("VIP", PlayerInfo[playerid][pVIP]);
    dfile_WriteInt("Money", PlayerInfo[playerid][pMoney]);
    dfile_WriteInt("Score", PlayerInfo[playerid][pScore]);
    dfile_WriteInt("Kills", PlayerInfo[playerid][pKills]);
    dfile_WriteInt("Deaths", PlayerInfo[playerid][pDeaths]);
    dfile_WriteInt("Online", PlayerInfo[playerid][pOnline]);
    dfile_WriteInt("Banned", PlayerInfo[playerid][pBanned]);
    dfile_WriteString("BanReason", PlayerInfo[playerid][pBanReason]);
	dfile_SaveFile();
	dfile_CloseFile();
    return 1; 
} 

forward Online();
public Online()
{
    foreach (Player, i)
    {
        PlayerInfo[i][pOnline] += 1;
    } 
    return 1;
}

stock GetName(playerid)
{ 
    new
        pName[MAX_PLAYER_NAME]; 

    GetPlayerName(playerid, pName, MAX_PLAYER_NAME); 
    return pName;
} 
//=============================================================================//

ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
{
    if(IsPlayerConnected(playerid))
    {
        new Float:posx, Float:posy, Float:posz;
        new Float:oldposx, Float:oldposy, Float:oldposz;
        new Float:tempposx, Float:tempposy, Float:tempposz;
        GetPlayerPos(playerid, oldposx, oldposy, oldposz);
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i))
            {
                GetPlayerPos(i, posx, posy, posz);
                tempposx = (oldposx -posx);
                tempposy = (oldposy -posy);
                tempposz = (oldposz -posz);
                if(GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i))
                {
                    if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
                    {
                        SendClientMessage(i, col1, string);
                    }
                    else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
                    {
                        SendClientMessage(i, col2, string);
                    }
                    else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
                    {
                        SendClientMessage(i, col3, string);
                    }
                    else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
                    {
                        SendClientMessage(i, col4, string);
                    }
                    else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
                    {
                        SendClientMessage(i, col5, string);
                    }
                }
            }
        }
    }
    return 1;
}

stock PlayerName(playerid)
{
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    return name;
}

SetPlayerToTeamColor(playerid)
{
	if (gTeam[playerid] == TEAM_GROVE)
	{
		SetPlayerColor(playerid, COLOR_GROVES);
	}
	else if (gTeam[playerid] == TEAM_BALLAS)
	{
		SetPlayerColor(playerid, COLOR_BALLAS);
	}
	else if (gTeam[playerid] == TEAM_AZTECAS)
	{
	    SetPlayerColor(playerid, COLOR_AZTECAS);
	}
	else if (gTeam[playerid] == TEAM_VAGOS)
	{
	    SetPlayerColor(playerid, TEAM_VAGOS);
	}
}
//============================================================================//
new BlockingPM[MAX_PLAYER_NAME];
new AntiTeamKill;
new Text:Classtext;
//============================================================================//

main()
{
	print("\n----------------------------------");
	print("East Side Gang Wars ");
	print("----------------------------------\n");
}


public OnGameModeInit()
tCP[CAPZONE] = NONE;
    UnderAttack[CAPZONE] = 0;
    Zone[CAPZONE] = GangZoneCreate(MinX, MinY, MaxX, MaxY);
    CP[CAPZONE] = CreateDynamicCP(X,Y,Z, radius, -1, -1, -1, 100.0);
{
    
	SetGameModeText("LS:GW V1");
	SetTimer("Online",60*1000*60,1);
	DisableInteriorEnterExits();
	SetNameTagDrawDistance(30.0);
	EnableStuntBonusForAll(0);
	AntiTeamKill = 1;
	SetTimer("SendMSG", 120000, true);
	//Grove
	AddPlayerClass(105, 2478.777832, -1661.156738, 13.343750, 269.1425, 24, 150, 29, 150, 26, 150);
	AddPlayerClass(106, 2478.777832, -1661.156738, 13.343750, 269.1425, 24, 150, 29, 150, 30, 150);
	AddPlayerClass(107, 2478.777832, -1661.156738, 13.343750, 269.1425, 24, 150, 28, 150, 31, 150);
	AddPlayerClass(270, 2478.777832, -1661.156738, 13.343750, 269.1425, 24, 150, 32, 150, 33, 150);
	AddPlayerClass(271, 2478.777832, -1661.156738, 13.343750, 269.1425, 24, 150, 28, 150, 34, 150);
	AddPlayerClass(269, 2478.777832, -1661.156738, 13.343750, 269.1425, 24, 150, 32, 150, 26, 150);
	//Ballas
	AddPlayerClass(102, 2002.281616, -1123.249633, 26.577611, 269.1425, 22, 150, 28, 150, 30, 150);
	AddPlayerClass(103, 2002.281616, -1123.249633, 26.577611, 269.1425, 23, 150, 29, 150, 31, 150);
	AddPlayerClass(104, 2002.281616, -1123.249633, 26.577611, 269.1425, 24, 150, 32, 150, 27, 150);
	//Los Aztecas
	AddPlayerClass(114, 2785.370361, -1994.306518, 13.382812, 269.1425, 22, 150, 28, 150, 30, 150);
	AddPlayerClass(115, 2785.370361, -1994.306518, 13.382812, 269.1425, 23, 150, 29, 150, 31, 150);
	AddPlayerClass(116, 2785.370361, -1994.306518, 13.382812, 269.1425, 24, 150, 32, 150, 27, 150);
	//Los Santos Vagos
	AddPlayerClass(108, 1882.914916, -2040.028686, 13.390607, 269.1425, 22, 150, 28, 150, 30, 150);
	AddPlayerClass(109, 1882.914916, -2040.028686, 13.390607, 269.1425, 23, 150, 29, 150, 31, 150);
	AddPlayerClass(110, 1882.914916, -2040.028686, 13.390607, 269.1425, 24, 150, 32, 150, 27, 150);
	//Random Civ. Vehicles
	AddStaticVehicleEx(491, 2105.275878, -1770.154296, 13.180087, 265.294494, -1, -1, 500);
	AddStaticVehicleEx(475, 2297.992919, -1644.905883, 14.556998, 1.695698, -1, -1, 500);
	AddStaticVehicleEx(477, 2293.008056, -1682.595703, 13.689975, 179.120391, -1, -1, 500);
	AddStaticVehicleEx(560, 2280.392333, -1682.886474, 13.910058, 359.340118, -1, -1, 500);
	AddStaticVehicleEx(560, 1803.102905, -1709.444580, 13.242623, 84.428703, -1, -1, 500);
	AddStaticVehicleEx(561, 1841.150146, -1871.250488, 13.200323, 181.468978, -1, -1, 500);
	AddStaticVehicleEx(438, 1778.363891, -1851.501831, 13.420244, 91.089607, -1, -1, 500);
	AddStaticVehicleEx(411, 2056.083251, -1904.144287, 13.273943, 180.404937, -1, -1, 500);
	//Los Aztecas Vehicles
	AddStaticVehicleEx(412, 2774.437744, -1970.958007, 13.273279, 359.451995, 103, 103, 1000);
	AddStaticVehicleEx(412, 2765.600341, -1925.658447, 13.136569, 359.078308, 103, 103, 1000);
	AddStaticVehicleEx(534, 2765.321533, -1971.496215, 13.171584, 181.195007, 103, 103, 1000);
	AddStaticVehicleEx(534, 2773.708007, -1927.072631, 13.143126, 359.762542, 103, 103, 1000);
	AddStaticVehicleEx(535, 2781.219726, -1945.159667, 13.302146, 88.856071, 103, 103, 1000);
	AddStaticVehicleEx(535, 2757.317138, -1944.324096, 13.342521, 266.956451, 103, 103, 1000);
	AddStaticVehicleEx(535, 2774.667724, -1998.889892, 13.183719, 89.137100, 103, 103, 1000);
	AddStaticVehicleEx(535, 2784.859863, -1999.162109, 13.197049, 90.206283, 103, 103, 1000);
	AddStaticVehicleEx(461, 2781.322265, -1965.316406, 13.130114, 358.304229, 103, 103, 1000);
	AddStaticVehicleEx(461, 2781.565429, -1959.327636, 13.147585, 356.990447, 103, 103, 1000);
	AddStaticVehicleEx(461, 2757.778808, -1972.785156, 13.164703, 176.133712, 103, 103, 1000);
	AddStaticVehicleEx(461, 2757.975830, -1964.613891, 13.133111, 356.399139, 103, 103, 1000);
	//Grove Street Vehicles
	AddStaticVehicleEx(492, 2517.226318, -1667.982910, 13.848170, 296.366821, 86, 86, 1000);
	AddStaticVehicleEx(550, 2505.509765, -1678.448974, 13.245240, 329.284942, 86, 86, 1000);
	AddStaticVehicleEx(492, 2506.508056, -1650.795898, 13.503844, 141.985366, 86, 86, 1000);
	AddStaticVehicleEx(550, 2502.604736, -1658.121582, 13.204686, 218.199859, 86, 86, 1000);
	AddStaticVehicleEx(550, 2507.928466, -1667.810302, 13.192440, 181.054763, 86, 86, 1000);
	AddStaticVehicleEx(492, 2473.594238, -1689.461669, 13.314188, 172.784027, 86, 86, 1000);
	AddStaticVehicleEx(481, 2480.985595, -1689.479003, 13.034698, 175.593246, 86, 86, 1000);
	AddStaticVehicleEx(461, 2461.935058, -1672.727661, 13.105950, 21.647302, 86, 86, 1000);
	AddStaticVehicleEx(492, 2489.642333, -1655.281494, 13.140104, 266.579864, 86, 86, 1000);
	//Ballas Vehicles
	AddStaticVehicleEx(566, 1993.671264, -1131.689575, 25.344184, 90.339179, 186, 186, 1000);
	AddStaticVehicleEx(566, 2003.400756, -1131.279418, 25.079097, 270.613555, 186, 186, 1000);
	AddStaticVehicleEx(566, 2012.491210, -1131.612304, 24.822509, 268.841674, 186, 186, 1000);
	AddStaticVehicleEx(482, 1993.543212, -1140.427124, 25.688148, 87.838409, 186, 186, 1000);
	AddStaticVehicleEx(482, 2003.228027, -1140.174560, 25.414991, 272.959838, 186, 186, 1000);
	AddStaticVehicleEx(461, 1997.502563, -1117.487304, 26.378654, 224.148239, 186, 186, 1000);
	AddStaticVehicleEx(461, 1995.538940, -1117.995117, 26.373115, 224.962936, 186, 186, 1000);
	AddStaticVehicleEx(461, 1993.891479, -1118.795532, 26.372270, 240.942932, 186, 186, 1000);
	//Vagos Vehicles
	AddStaticVehicleEx(474, 1878.737426, -2039.166137, 13.274518, 358.497894, 6, 6, 1000);
	AddStaticVehicleEx(474, 1879.482910, -2020.976440, 13.082891, 177.765151, 6, 6, 1000);
	AddStaticVehicleEx(474, 1886.562500, -2020.194580, 13.094896, 177.765487, 6, 6, 1000);
	AddStaticVehicleEx(474, 1886.560302, -2039.570434, 13.205352, 178.780334, 6, 6, 1000);
	AddStaticVehicleEx(461, 1871.303344, -2032.127563, 13.148922, 273.678192, 6, 6, 1000);
	AddStaticVehicleEx(461, 1871.372802, -2034.372192, 13.152005, 271.296997, 6, 6, 1000);
	AddStaticVehicleEx(466, 1886.351684, -2057.172851, 13.258976, 269.379760, 6, 6, 1000);
	AddStaticVehicleEx(466, 1876.256835, -2057.578857, 13.243851, 273.254608, 6, 6, 1000);
	return 1;
}

public OnGameModeExit()
{
	return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
	
	SetPlayerPos(playerid, 2201.6306,1217.2319,10.8128);
	SetPlayerFacingAngle(playerid,178.6062);
	SetPlayerCameraPos(playerid, 2202.2537,1210.6444,10.8128);
	SetPlayerCameraLookAt(playerid, 2201.6306,1217.2319,10.8128);
	switch(classid)
	{
	    case 0 .. 5:
	    {
	        TextDrawDestroy(Classtext);
	        Classtext = TextDrawCreate(170.0, 350.0, "Grove St. Gangsters");
	        TextDrawLetterSize(Classtext, 1.5, 2.5);
	        TextDrawFont(Classtext, 0);
	        TextDrawColor(Classtext, COLOR_GROVES);
	        TextDrawShowForPlayer(playerid,Classtext);
	        SetPlayerPos(playerid, 2481.010253, -1654.001953, 13.317111);
	        SetPlayerCameraPos(playerid, 2486.577880, -1665.032836, 17.404399);
	        SetPlayerFacingAngle(playerid, 176.249954);
	        SetPlayerArmedWeapon(playerid, 3);
	        SetPlayerTeam(playerid, TEAM_GROVE);
	        gTeam[playerid] = TEAM_GROVE;
		}
		case 6 .. 8:
		{
		    TextDrawDestroy(Classtext);
		    Classtext = TextDrawCreate(170.0, 350.0, "Glen Park Ballas");
		    TextDrawLetterSize(Classtext, 1.5, 2.5);
	        TextDrawFont(Classtext, 0);
		    TextDrawColor(Classtext, COLOR_BALLAS);
		    TextDrawShowForPlayer(playerid, Classtext);
		    SetPlayerPos(playerid, 2002.447509, -1118.322631, 26.781250);
		    SetPlayerCameraPos(playerid, 2002.281616, -1123.249633, 26.577611);
		    SetPlayerFacingAngle(playerid,178.756668);
		    SetPlayerArmedWeapon(playerid, 3);
		    SetPlayerTeam(playerid, TEAM_BALLAS);
		    gTeam[playerid] = TEAM_BALLAS;
		}
		case 9 .. 11:
		{
		    TextDrawDestroy(Classtext);
		    Classtext = TextDrawCreate(170.0, 350.0, "Los Aztecas");
		    TextDrawLetterSize(Classtext, 1.5, 2.5);
	        TextDrawFont(Classtext, 0);
		    TextDrawColor(Classtext, COLOR_AZTECAS);
		    TextDrawShowForPlayer(playerid,Classtext);
		    SetPlayerPos(playerid, 2783.065673, -1989.021972, 13.554813);
		    SetPlayerCameraPos(playerid, 2785.370361, -1994.306518, 13.3828127);
		    SetPlayerFacingAngle(playerid, 200.376815);
		    SetPlayerArmedWeapon(playerid, 3);
		    SetPlayerTeam(playerid, TEAM_AZTECAS);
		    gTeam[playerid] = TEAM_AZTECAS;
		}
		case 12 .. 14:
		{
		    TextDrawDestroy(Classtext);
		    Classtext = TextDrawCreate(170.0, 350.0, "Los Santos Vagos");
		    TextDrawLetterSize(Classtext, 1.5, 2.5);
	        TextDrawFont(Classtext, 0);
		    TextDrawColor(Classtext, COLOR_VAGOS);
		    TextDrawShowForPlayer(playerid, Classtext);
		    SetPlayerPos(playerid, 1882.680419, -2036.278686, 13.390607);
		    SetPlayerCameraPos(playerid, 1882.914916, -2040.028686, 13.390607);
		    SetPlayerFacingAngle(playerid, 177.816802);
		    SetPlayerArmedWeapon(playerid, TEAM_VAGOS);
		    SetPlayerTeam(playerid,4);
		    gTeam[playerid] = TEAM_VAGOS;
		}
	}
	return 1;
}

public OnPlayerConnect(playerid)
SetPlayerMapIcon(playerid, 2, X,Y,Z, 19, MAPICON_GLOBAL);
    GangZoneShowForAll(Zone[CAPZONE], 0x00000043);
    IsPlayerCapturing[playerid][CAPZONE] = 0;
    CountVar[playerid][CAPZONE] = 25;
    if(tCP[CAPZONE] == NONE) GangZoneShowForAll(Zone[CAPZONE], -66);
    else if(tCP[CAPZONE] == TEAM1) GangZoneShowForAll(Zone[CAPZONE], TEAM1_COLOR);
    else if(tCP[CAPZONE] == TEAM2) GangZoneShowForAll(Zone[CAPZONE], TEAM2_COLOR);
{
	new connectmsg[128];
	format(connectmsg, sizeof(connectmsg), "%s(%d) has connected to the server!", PlayerName(playerid), playerid);
	SendClientMessageToAll(COLOR_WELCOME, connectmsg);
	new strText[104]; 
	format(strText, 35, "%s.ini", PlayerName(playerid));
	new registermsg[128];
	format(registermsg, sizeof(registermsg), "Welcome to Los Santos Gang Wars.\n\nAccount Name: %s\nThat account is not registered, type your password below to register!", PlayerName(playerid));
	new loginmsg[128];
	format(loginmsg, sizeof(loginmsg), "Welcome back to Los Santos Gang Wars!\n\nAccount Name: %s\nThat account is registered, type your password in to return to war.", PlayerName(playerid));
	if(!dfile_FileExists(strText))
    { 
        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Los Santos Gang Wars", registermsg, "Register", "Exit");
    }
    else 
    { 
   		new File[126];
    	format(File, sizeof(File), "%s.ini", PlayerName(playerid));
		dfile_Open(File);
		PlayerInfo[playerid][pAdmin] = dfile_ReadInt("Admin");
		PlayerInfo[playerid][pVIP] = dfile_ReadInt("VIP");
		PlayerInfo[playerid][pMoney] = dfile_ReadInt("Money");
		PlayerInfo[playerid][pScore] = dfile_ReadInt("Score");
		PlayerInfo[playerid][pKills] = dfile_ReadInt("Kills");
		PlayerInfo[playerid][pDeaths] = dfile_ReadInt("Deaths");
		PlayerInfo[playerid][pOnline] = dfile_ReadInt("Online");
		PlayerInfo[playerid][pBanned] = dfile_ReadInt("Banned");
		format(PlayerInfo[playerid][pBanReason],126,"%s",dfile_ReadString("BanReason"));
		dfile_SaveFile();
		dfile_CloseFile();
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "Los Santos Gang Wars", loginmsg, "Login", "Exit");
    } 
    SetPVarInt(playerid, "Joinned", 1);
	return 1;
}

public OnPlayerDisconnect(playerid, reason)
if(Captured[playerid][CAPZONE] == 0 && IsPlayerCapturing[playerid][CAPZONE] == 1)
    {
    LeavingCAPZONE(playerid);
    }
{
	new name[MAX_PLAYER_NAME], string[128];
    GetPlayerName(playerid, name, sizeof(name));
    switch(reason)
    {
        case 0: format(string, sizeof(string), "%s(%d) has left the server, reason: Time out!", name, playerid);
        case 1: format(string, sizeof(string), "%s(%d) has left the server, reason: Leaving!", name, playerid);
        case 2: format(string, sizeof(string), "%s(%d) has left the server, reason: Kicked or Banned!", name, playerid);
	}
    SendClientMessageToAll(COLOR_LIGHTRED, string);
    OnPlayerLogout(playerid);
	return 1;
}

public OnPlayerSpawn(playerid)
if(Captured[playerid][CAPZONE] == 0 && IsPlayerCapturing[playerid][CAPZONE] == 1)
    {
    LeavingCAPZONE(playerid);
    }
{
	TextDrawDestroy(Classtext);
	if(GetPVarInt(playerid, "Logged") == 0)
    {
        SendClientMessage(playerid, COLOR_LIGHTRED, "Login before you spawn! (Kicked)");
        Kick(playerid);
	}
    if(GetPVarInt(playerid, "Joinned") == 1)
    {
        GivePlayerMoney(playerid, PlayerInfo[playerid][pMoney]);
        SetPlayerScore(playerid, PlayerInfo[playerid][pScore]);
		SetPVarInt(playerid, "Joinned", 0); 
    }
    
    SetPlayerToTeamColor(playerid);
	return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
if(Captured[playerid][CAPZONE] == 0 && IsPlayerCapturing[playerid][CAPZONE] == 1)
        {
        LeavingCAPZONE(playerid);
        }
{
	new string[128];
	if(AntiTeamKill == 1)
	{
		if(gTeam[playerid] == gTeam[killerid])
		{
			SendClientMessage(killerid, COLOR_LIGHTRED, "Warning: do not Team Kill!");
			PlayerInfo[killerid][pMoney] -= 500;
			format(string, sizeof(string), ">> %s(%d) kicked due to Team Killing!", PlayerName(killerid), killerid);
			SendClientMessageToAll(COLOR_LIGHTRED, string);
			Kick(killerid);
		}
	}
	if(gTeam[playerid] != gTeam[killerid])
	{
 		PlayerInfo[killerid][pKills] ++;
		PlayerInfo[playerid][pDeaths] ++;
		PlayerInfo[killerid][pMoney] += 500;
		GivePlayerMoney(killerid, 500);
		format(string, sizeof(string), ">> %s(%d) has killed you!", PlayerName(killerid), killerid);
		SendClientMessage(playerid, COLOR_LIGHTRED, string);
		format(string, sizeof(string), ">> You killed %s(%d)! and earned $500 !", PlayerName(playerid), playerid);
		SendClientMessage(killerid, COLOR_LIGHTGREEN, string);
		SendClientMessage(playerid, COLOR_LIGHTBLUE, ">> Info: type /class to change team!");
	}

	return 1;
}

public OnVehicleSpawn(vehicleid)
{
	return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
	return 1;
}

public OnPlayerText(playerid, text[])
{
	new pname[MAX_PLAYER_NAME], str[128], string[128];
	if(text[0] == '!')
    {
  		if(GetPVarInt(playerid, "Logged") == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You are not logged in!");
        format(string,sizeof(string),"TEAM CHAT: %s says: %s",PlayerName(playerid),text[1]);
        foreach(Player, i)
        {
            if(gTeam[i] == gTeam[playerid])
            {
                SendClientMessage(i, COLOR_LIGHTBLUE, string);
			}
		}
		return 0;
    }
   
    GetPlayerName(playerid, pname, sizeof(pname));
    format(str, sizeof(str), "%s says: %s", pname, text);
    ProxDetector(30.0, playerid, str, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);

    return 0;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
	dcmd(givemoney, 9, cmdtext);
	dcmd(setmoney, 8, cmdtext);
	dcmd(givegun, 7, cmdtext);
	dcmd(makeadmin, 9, cmdtext);
	dcmd(unban, 5, cmdtext);
	dcmd(kick, 4, cmdtext);
	dcmd(a, 1, cmdtext);
	dcmd(veh, 3, cmdtext);
	dcmd(gethere, 7, cmdtext);
	new string[256];
	new sendername[MAX_PLAYER_NAME];
	new giveplayer[MAX_PLAYER_NAME];
	new giveplayerid, idx;
	new tmp[128];
	new cmd[128];
	cmd = strtok(cmdtext, idx);
	if(strcmp(cmd, "/shop", true) == 0)
	{
		if(GetPVarInt(playerid, "Logged") == 0)
		{
		    SendClientMessage(playerid, COLOR_LIGHTRED, "You are not logged in!");
		    return 1;
		}
		new x_item[128];
		x_item = strtok(cmdtext, idx);
		if(!strlen(x_item))
		{
		    SendClientMessage(playerid, COLOR_ORANGE, ">> Los Santos Shop");
		    SendClientMessage(playerid, COLOR_LIGHTBLUE, "[armour] Armour: $2,500");
		    SendClientMessage(playerid, COLOR_LIGHTBLUE, "[grenade] Grenade: $5,000");
		    SendClientMessage(playerid, COLOR_LIGHTBLUE, "[c4] C4 Explosive: $10,000");
		    SendClientMessage(playerid, COLOR_LIGHTBLUE, "/shop [name] to buy an item !");
		    return 1;
		}
		else if(strcmp(x_item,"armour",true) == 0)
		{
		    if(PlayerInfo[playerid][pMoney] <= 2499)
		    {
		        SendClientMessage(playerid, COLOR_LIGHTRED, ">> Shop: You need $2,500 !");
		        return 1;
			}
			else if(PlayerInfo[playerid][pMoney] >= 2500)
			{
			    GivePlayerMoney(playerid, -2500);
			    PlayerInfo[playerid][pMoney] = PlayerInfo[playerid][pMoney]-2500;
			    SetPlayerArmour(playerid, 100.0);
			    SendClientMessage(playerid, COLOR_LIGHTGREEN, ">> Shop: You bought Armour for $2,500!");
			    return 1;
			}
		}
		else if(strcmp(x_item,"grenade",true) == 0)
		{
		    if(PlayerInfo[playerid][pMoney] <= 4999)
		    {
		        SendClientMessage(playerid, COLOR_LIGHTRED, ">> Shop: You need $5,000 !");
		        return 1;
			}
			else if(PlayerInfo[playerid][pMoney] >= 5000)
			{
			    GivePlayerWeapon(playerid, 16, 1);
				GivePlayerMoney(playerid, -5000);
				PlayerInfo[playerid][pMoney] = PlayerInfo[playerid][pMoney]-5000;
				SendClientMessage(playerid, COLOR_LIGHTGREEN, ">> Shop: You bought 1 Grenade for $5,000 !");
				return 1;
			}
		}
		else if(strcmp(x_item,"c4",true) == 0)
		{
		    if(PlayerInfo[playerid][pMoney] <= 9999)
		    {
		        SendClientMessage(playerid, COLOR_LIGHTRED, ">> Shop: You need $10,000 !");
		        return 1;
			}
			if(PlayerInfo[playerid][pMoney] >= 10000)
			{
			    GivePlayerWeapon(playerid, 39, 1);
			    GivePlayerWeapon(playerid, 40, 1);
			    GivePlayerMoney(playerid, -10000);
			    PlayerInfo[playerid][pMoney] = PlayerInfo[playerid][pMoney]-10000;
			    SendClientMessage(playerid, COLOR_LIGHTGREEN, ">> Shop: You bought 1 C4 for $10,000 !");
			    return 1;
			}
		}
		else
		{
		    SendClientMessage(playerid, COLOR_LIGHTRED, ">> Shop: unknown buy name!");
		    return 1;
		}
		return 1;
	}
	if(strcmp(cmd, "/gotola", true) == 0)
	{
	    if(PlayerInfo[playerid][pAdmin] < 1) //Goto los aztecas
	    {
	        SendClientMessage(playerid, COLOR_LIGHTRED, "Go to LA yourself!");
	        return 1;
		}
		SetPlayerPos(playerid, 2785.370361, -1994.306518, 13.382812);
		SetPlayerVirtualWorld(playerid, 0);
		SetPlayerInterior(playerid, 0);
		return 1;
	}
	if(strcmp(cmd, "/gotogs", true) == 0) //Goto grove st
	{
	    if(PlayerInfo[playerid][pAdmin] < 1)
	    {
	        SendClientMessage(playerid, COLOR_LIGHTRED, "Go to GS yourself!");
	        return 1;
		}
		SetPlayerPos(playerid, 2478.777832, -1661.156738, 13.343750);
		SetPlayerVirtualWorld(playerid, 0);
		SetPlayerInterior(playerid, 0);
		return 1;
	}
	if(strcmp(cmd, "/saveveh", true) == 0)
	{
	    if(!IsPlayerAdmin(playerid))return SendClientMessage(playerid,0x80000000,"Must be RCON admin to use this command");
	    if(!IsPlayerInAnyVehicle(playerid))return SendClientMessage(playerid,0x80000000,"Must be inside a vehicle");
	    new File:file,strtmp[128],Float:x,Float:y,Float:z,Float:a,vehid;
	    file=fopen("AddStaticVehicle.txt",io_append);
	    vehid=GetPlayerVehicleID(playerid);
	    GetVehiclePos(vehid,x,y,z);
	    GetVehicleZAngle(vehid,a);
	    format(strtmp,128,"AddStaticVehicleEx(%d, %f, %f, %f, %f, -1, -1, 1000);\r\n",GetVehicleModel(GetPlayerVehicleID(playerid)),x,y,z,a);
	    fwrite(file,strtmp);
	    fclose(file);
	    return SendClientMessage(playerid,COLOR_GREY,"Vehicle saved to AddStaticVehicle.txt !");
	}
 	if(strcmp(cmd, "/gotogp", true) == 0) //Goto Ballas
	{
	    if(PlayerInfo[playerid][pAdmin] < 1)
	    {
	        SendClientMessage(playerid, COLOR_LIGHTRED, "Go to GP yourself!");
	        return 1;
		}
		SetPlayerPos(playerid, 2002.281616, -1123.249633, 26.577611);
		SetPlayerVirtualWorld(playerid, 0);
		SetPlayerInterior(playerid, 0);
		return 1;
	}
 	if(strcmp(cmd, "/gotovag", true) == 0) //Goto Vagos
	{
	    if(PlayerInfo[playerid][pAdmin] < 1)
	    {
	        SendClientMessage(playerid, COLOR_LIGHTRED, "Go to VAG yourself!");
	        return 1;
		}
		SetPlayerPos(playerid, 1882.914916, -2040.028686, 13.390607);
		SetPlayerVirtualWorld(playerid, 0);
		SetPlayerInterior(playerid, 0);
		return 1;
	}
	if(strcmp(cmd, "/help", true) == 0)
	{
	    if(GetPVarInt(playerid, "Logged") == 0)
		{
		    SendClientMessage(playerid, COLOR_LIGHTRED, "You are not logged in!");
		    return 1;
		}
		ShowPlayerDialog(playerid,11,DIALOG_STYLE_MSGBOX,"Help","/buylevel /stats /help /kill /class /blockpm /g /pm","Okay","");
		return 1;
	}
	if(strcmp(cmd, "/togtk", true) == 0)
	{
	    if(GetPVarInt(playerid, "Logged") == 0)
		{
		    SendClientMessage(playerid, COLOR_LIGHTRED, "You are not logged in!");
		    return 1;
		}
		if(PlayerInfo[playerid][pAdmin] == 0)
		{
		    SendClientMessage(playerid, COLOR_LIGHTRED, "You are not authorized to use this command!");
		    return 1;
		}
		if(AntiTeamKill == 1)
		{
		    AntiTeamKill = 0;
		    SendClientMessageToAll(COLOR_LIGHTRED, "Admin has turned off Anti-Team Kill!");
		    return 1;
		}
  		if(AntiTeamKill == 0)
		{
		    AntiTeamKill = 1;
		    SendClientMessageToAll(COLOR_LIGHTRED, "Admin has turned on Anti-Team Kill!");
		    return 1;
		}
		return 1;
	}
	if(strcmp(cmd, "/ahelp", true) == 0)
	{
	    if(GetPVarInt(playerid, "Logged") == 0)
		{
		    SendClientMessage(playerid, COLOR_LIGHTRED, "You are not logged in!");
		    return 1;
		}
		if(PlayerInfo[playerid][pAdmin] == 0)
		{
		    SendClientMessage(playerid, COLOR_LIGHTRED, "You are not authorized to use this command!");
		    return 1;
		}
		new admstring[358];
		format(admstring, sizeof(admstring), "Level 1:\n/gotola /gotogs /gotogp /gotovag /togtk /ban /unban /kick /a\n\nLevel 2:\n/gethere /givegun\n\nLevel 3:\n/veh /givemoney /setmoney\n\nLevel 4:\n--\n\nLevel 5:\n/makeadmin");
		ShowPlayerDialog(playerid,11,DIALOG_STYLE_MSGBOX,"Administration Help",admstring,"Okay","");
		return 1;
	}
	if(strcmp(cmd, "/stats", true) == 0)
	{
	    if(GetPVarInt(playerid, "Logged") == 0)
		{
		    SendClientMessage(playerid, COLOR_LIGHTRED, "You are not logged in!");
		    return 1;
		}
		new line2[128], line3[128], team[128], statsstring[258];
		format( line2, sizeof(line2), ">>      Los Santos Gang Wars Statitics    <<");
		format( line3, sizeof(line3), "__________________________________________");
		new level = PlayerInfo[playerid][pScore];
		new admlevel = PlayerInfo[playerid][pAdmin];
		new kills = PlayerInfo[playerid][pKills];
		new deaths = PlayerInfo[playerid][pDeaths];
		new cash = PlayerInfo[playerid][pMoney];
		new vip = PlayerInfo[playerid][pVIP];
		format(statsstring, sizeof(statsstring), "Level: %d || AdmLevel: %d\nKills: %d || Deaths: %d\nMoney: %d || VIP: %d", level, admlevel, kills, deaths, cash, vip);
	    if(gTeam[playerid] == TEAM_GROVE) { team = "Grove St. Gangstas (1)"; }
	    if(gTeam[playerid] == TEAM_BALLAS) { team = "Temple Drive Ballas (2)"; }
	    if(gTeam[playerid] == TEAM_AZTECAS) { team = "Los Aztecas (3)"; }
	    if(gTeam[playerid] == TEAM_VAGOS) { team = "Los Santos Vagos (4)"; }
	    new title[158];
	    format(title, sizeof(title), "%s - %s", PlayerName(playerid), team);
        ShowPlayerDialog(playerid,10,DIALOG_STYLE_MSGBOX,title,statsstring,"Okay","");
		return 1;
	}
	if(strcmp(cmd, "/g", true) == 0 || strcmp(cmd, "/global", true) == 0)
	{
    	if(GetPVarInt(playerid, "Logged") == 0)
    	{
        	SendClientMessage(playerid, COLOR_LIGHTRED, "You are not logged in!");
        	return 1;
    	}
    	new len = strlen(cmd);
    	if(!strlen(cmdtext[len+1]))
    	{
        	SendClientMessage(playerid, COLOR_ORANGE, "CMD: /g(lobal) [message]");
        	return 1;
    	}
    	GetPlayerName(playerid, sendername, sizeof(sendername));
    	format(string, sizeof(string), "[GLOBAL] %s(%d) says: %s", sendername, playerid, cmdtext[len+1]);
    	SendClientMessageToAll(COLOR_WHITE, string);
    	return 1;
	}

	if(strcmp(cmd, "/pm", true) == 0)
	{
    	if(GetPVarInt(playerid, "Logged") == 0)
    	{
        	SendClientMessage(playerid, COLOR_LIGHTRED, "You are not logged in!");
        	return 1;
    	}
    	tmp = strtok(cmdtext, idx);
    	if(!strlen(tmp))
    	{
        	SendClientMessage(playerid, COLOR_ORANGE, "CMD: /pm [playerid/name] [message]");
        	return 1;
    	}
    	giveplayerid = ReturnUser(tmp);
    	if(GetPVarInt(giveplayerid, "Logged") == 0)
    	{
    	    SendClientMessage(playerid, COLOR_LIGHTRED, "That player has not logged in!");
        	return 1;
   	 	}
    	if(BlockingPM[giveplayerid] == 1)
    	{
        	SendClientMessage(playerid, COLOR_LIGHTRED, "That player is blocking PMs!");
        	return 1;
    	}
    	if(!strlen(cmdtext[strlen(cmd)+strlen(tmp)+2]))
    	{
        	SendClientMessage(playerid, COLOR_ORANGE, "CMD: /pm [playerid/name] [message]");
        	return 1;
    	}
    	GetPlayerName(playerid, sendername, sizeof(sendername));
    	GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
    	format(string, sizeof(string), ">> PM: You have sent a PM to %s.", giveplayer);
    	SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
    	format(string, sizeof(string), ">> PM From %s(%d): %s", sendername, playerid, cmdtext[strlen(cmd)+strlen(tmp)+2]);
    	SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
    	return 1;
	}
	if(strcmp(cmd, "/ban", true) == 0)
	{
	    if(GetPVarInt(playerid, "Logged") == 0)
	    {
	        SendClientMessage(playerid, COLOR_LIGHTRED, "You are not logged in!");
	        return 1;
		}
		if(PlayerInfo[playerid][pAdmin] < 1)
		{
		    SendClientMessage(playerid, COLOR_LIGHTRED, "ADM: You're not authorized to use this command!");
		    return 1;
		}
		tmp = strtok(cmdtext, idx);
		if(!strlen(tmp))
		{
			SendClientMessage(playerid, COLOR_ORANGE, "ADM: /ban [playerid/name] [ban reason]");
			return 1;
		}
		giveplayerid = ReturnUser(tmp);
		if(giveplayerid == INVALID_PLAYER_ID)
		{
		    SendClientMessage(playerid, COLOR_LIGHTRED, "Invalid playerid/name!");
		    return 1;
		}
		if(GetPVarInt(giveplayerid, "Logged") == 0)
		{
		    SendClientMessage(playerid, COLOR_LIGHTRED, "That player has not logged in!");
		    return 1;
		}
		if(PlayerInfo[giveplayerid][pAdmin] > PlayerInfo[playerid][pAdmin])
		{
		    SendClientMessage(playerid, COLOR_LIGHTRED, "You can't ban higher level Admins!");
		    return 1;
		}
  		GetPlayerName(playerid, sendername, sizeof(sendername));
		GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
 		if(!strlen(cmdtext[strlen(cmd)+strlen(tmp)+2]))
    	{
        	SendClientMessage(playerid, COLOR_ORANGE, "CMD: /pm [playerid/name] [message]");
        	return 1;
    	}
		format(string, sizeof(string), "ADM: %s has been banned by an Admin, reason: %s", giveplayer, cmdtext[strlen(cmd)+strlen(tmp)+2]);
		SendClientMessageToAll(COLOR_LIGHTRED, string);
		foreach (Player, i)
		{
			if(PlayerInfo[i][pAdmin] >= 1)
			{
			    format(string, sizeof(string), "Admin %s has banned %s, reason: %s", sendername, giveplayer, cmdtext[strlen(cmd)+strlen(tmp)+2]);
			    SendClientMessage(i, COLOR_LIGHTRED, string);
			}
		}
		PlayerInfo[giveplayerid][pBanned] = 1;
		format(string, sizeof(string), "Ban Reason: %s", cmdtext[strlen(cmd)+strlen(tmp)+2]);
		strmid(PlayerInfo[giveplayerid][pBanReason], string, 0, strlen(string), 255);
		Kick(giveplayerid);
		return 1;
	}
	if(strcmp(cmd, "/blockpm", true) == 0)
	{
	    if(GetPVarInt(playerid, "Logged") == 0)
	    {
	        SendClientMessage(playerid, COLOR_LIGHTRED, "You are not logged in!");
	        return 1;
		}
		if(BlockingPM[playerid] == 0)
		{
		    BlockingPM[playerid] = 1;
		    SendClientMessage(playerid, COLOR_ORANGE, "CMD: You are now blocking PMs!");
		    return 1;
		}
 		if(BlockingPM[playerid] == 1)
		{
		    BlockingPM[playerid] = 0;
		    SendClientMessage(playerid, COLOR_ORANGE, "CMD: You have unblocked PMs!");
		    return 1;
		}
		return 1;
	}
	if(strcmp(cmd, "/buylevel", true) == 0)
	{
	    if(GetPVarInt(playerid, "Logged") == 0)
	    {
	        SendClientMessage(playerid, COLOR_LIGHTRED, "You are not logged in!");
	        return 1;
		}
		new levelcost = 10000;
		new nxtlevel = PlayerInfo[playerid][pScore]+1;
		new costlevel = nxtlevel*levelcost;
		if(PlayerInfo[playerid][pMoney] < costlevel)
		{
		    format(string, sizeof(string), "You can't afford that! (%d)", costlevel);
		    SendClientMessage(playerid, COLOR_LIGHTRED, string);
		    return 1;
		}
		else
		{
			GivePlayerMoney(playerid, -costlevel);
			PlayerInfo[playerid][pMoney] = PlayerInfo[playerid][pMoney] - costlevel;
			PlayerInfo[playerid][pScore]++;
			format(string, sizeof(string), "You've bought Level %d for %d!", nxtlevel, costlevel);
			SendClientMessage(playerid, COLOR_VAGOS, string);
			SetPlayerScore(playerid, nxtlevel);
			return 1;
		}
		return 1;
	}
	if (strcmp(cmd, "/savepos", true)==0)
	{
	    new Float:X, Float:Z, Float:Y, Float:A;
	    GetPlayerPos(playerid, X, Y, Z);
	    GetPlayerFacingAngle(playerid, A);
	    new File:pos=fopen("OnFootPos.txt", io_append);
	    format(string, sizeof(string), "(%f, %f, %f, %f);\r\n", X, Y, Z, A);
	    SendClientMessage(playerid,COLOR_GREY,"OnFootPosition saved to OnFootPos.txt !");
	    fwrite(pos, string);
	    fclose(pos);
	    return 1;
	}
	if (strcmp(cmd, "/savecampos", true)==0)
	{
	    new Float:X, Float:Z, Float:Y;
	    GetPlayerCameraPos(playerid, X, Y, Z);
	    new File:pos=fopen("CameraPos.txt", io_append);
	    format(string, sizeof(string), "(%f, %f, %f);\r\n", X, Y, Z);
	    SendClientMessage(playerid,COLOR_GREY,"CameraPos saved to CameraPos.txt !");
	    fwrite(pos, string);
	    fclose(pos);
	    return 1;
	}
	if(strcmp(cmd, "/savecamface", true) == 0)
	{
	    new Float:X,Float:Y,Float:Z;
	    GetPlayerCameraFrontVector(playerid, X, Y, Z);
	    new File:pos=fopen("CameraFace.txt", io_append);
	    format(string, sizeof(string), "SetPlayerCameraLookAt(playerid, %f, %f, %f);\r\n", X, Y, Z);
	    fwrite(pos, string);
	    SendClientMessage(playerid,COLOR_GREY,"CameraFace saved to CameraFace.txt !");
	    fclose(pos);
	    return 1;
	}
	if(strcmp(cmd, "/kill", true) == 0)
	{
		SetPlayerHealth(playerid, 0);
		format(string, sizeof(string), ">> %s(%d) has just committed suicide!", PlayerName(playerid), playerid);
		SendClientMessageToAll(COLOR_LIGHTRED, string);
		return 1;
	}
	if(strcmp(cmd, "/class", true) == 0)
	{
	    SetPlayerHealth(playerid, 0);
	    ForceClassSelection(playerid);
	    format(string, sizeof(string), ">> %s(%d) has killed himself.", PlayerName(playerid), playerid);
	    SendClientMessageToAll(COLOR_LIGHTRED, string);
	    ForceClassSelection(playerid);
	    return 1;
	}
	return SendClientMessage(playerid, COLOR_ORANGE, "ERROR: Unknown command (see /help)!");
}

forward OnPlayerEnterDynamicCP(playerid, checkpointid);
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
    if(checkpointid == CP[CAPZONE])
    {
        if(UnderAttack[CAPZONE] == 0)
        {
            if(tCP[CAPZONE] != gTeam[playerid])
            {
                CountVar[playerid][CAPZONE] = 25;
                ActiveCAPZONE(playerid);

            } else return SendClientMessage(playerid, COLOR_RED,"*This zone is already captured by your team!");
        } else return CaptureZoneMessage(playerid, 2);
    }
}
forward OnPlayerLeaveDynamicCP(playerid, checkpointid);
public OnPlayerLeaveDynamicCP(playerid, checkpointid)
{
    if(checkpointid == CP[CAPZONE] && Captured[playerid][CAPZONE] == 0 && IsPlayerCapturing[playerid][CAPZONE] == 1 && !IsPlayerInDynamicCP(playerid, CP[CAPZONE]))
    {
        LeavingCAPZONE(playerid);
    }
}
forward CAPZONETimer(playerid);
public CAPZONETimer(playerid)
{
    CAPZONECaptured(playerid);
    return 1;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
	return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
	return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
	return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
	return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
	return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
	return 1;
}

public OnPlayerLeaveRaceCheckpoint(playerid)
{
	return 1;
}

public OnRconCommand(cmd[])
{
	return 1;
}

public OnPlayerRequestSpawn(playerid)
{
	return 1;
}

public OnObjectMoved(objectid)
{
	return 1;
}

public OnPlayerObjectMoved(playerid, objectid)
{
	return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
	return 1;
}

public OnVehicleMod(playerid, vehicleid, componentid)
{
	return 1;
}

public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
	return 1;
}

public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
	return 1;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
	return 1;
}

public OnPlayerExitedMenu(playerid)
{
	return 1;
}

public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
	return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
	return 1;
}

public OnRconLoginAttempt(ip[], password[], success)
{
	return 1;
}

public OnPlayerUpdate(playerid)
{
    new currentspeed = GetPlayerSpeed(playerid,false);
	new string[128];
    if(currentspeed > 175 && PlayerInfo[playerid][pAdmin] < 1) //Anti Speed Hack
	{
		if(!(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER))
		{
  			new sendername[MAX_PLAYER_NAME];
			GetPlayerName(playerid, sendername, sizeof(sendername));
			format(string, sizeof(string), "Possible speedhack: [%d]%s %d mph.",playerid,sendername,currentspeed);
			foreach(Player, i)
			{
			    if(PlayerInfo[i][pAdmin] >= 1 || IsPlayerAdmin(i))
				{
				    SendClientMessage(i, COLOR_LIGHTRED, string);
				    return 1;
				}
			}
		}
	}
	return 1;
}

public OnPlayerStreamIn(playerid, forplayerid)
{
	return 1;
}

public OnPlayerStreamOut(playerid, forplayerid)
{
	return 1;
}

public OnVehicleStreamIn(vehicleid, forplayerid)
{
	return 1;
}

public OnVehicleStreamOut(vehicleid, forplayerid)
{
	return 1;
}


public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch(dialogid) 
    { 
        case DIALOG_REGISTER:
        { 
            if(response)
            {
                new
                    strText[179];

                if(strlen(inputtext) >= 4 && strlen(inputtext) <= 35)
                {
					SetPVarInt(playerid, "Registered", 1);
				    SetPVarInt(playerid, "Logged", 1);
                    new hashPassword[130];
                    WP_Hash(hashPassword, 130, inputtext);
					new File[126];
    				format(File, sizeof(File), "%s.ini", PlayerName(playerid));
					dfile_Create(File);
					dfile_Open(File);
					dfile_WriteString("Password", hashPassword);
				    dfile_WriteInt("Admin", 0);
				    dfile_WriteInt("VIP", 0);
				    dfile_WriteInt("Money", 500);
				    dfile_WriteInt("Score", 1);
				    dfile_WriteInt("Kills", 0);
				    dfile_WriteInt("Deaths", 0);
				    dfile_WriteInt("Online", 0);
				    dfile_WriteInt("Banned", 0);
				    dfile_WriteString("BanReason", "None");
				    dfile_SaveFile();
				    dfile_CloseFile();
				    OnPlayerLogin(playerid);
					format(strText, 125, "You have registered with name {FFFFFF}'%s' {FFFF00}and password {FFFFFF}'%s'{FFFF00}, you are now logged in!", GetName(playerid), inputtext);
                    SendClientMessage(playerid, COLOR_VAGOS, strText);
                } 
                else
                { 
                    new registermsg[128];
					format(registermsg, sizeof(registermsg), "Welcome to Los Santos Gang Wars.\n\nAccount Name: %s\nThat account is not registered, type your password below to register!", PlayerName(playerid));
                    ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Register for - Los Santos Gang Wars, string", registermsg, "Register", "Exit");
                }
            }
            else Kick(playerid); 
        } 

        case DIALOG_LOGIN:
        { 
            if(response)
            {
                new hashPassword[130];
                WP_Hash(hashPassword, 130, inputtext);
               	if(!strcmp(hashPassword,PlayerInfo[playerid][pPassword]))
                { 
                    OnPlayerLogin(playerid);
                } 
                else
                { 
					new loginmsg[128];
					format(loginmsg, sizeof(loginmsg), "Welcome back to Los Santos Gang Wars!\n\nAccount Name: %s\nThat account is registered, type your password in to return to war.", PlayerName(playerid));
                    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "Error: Wrong Password", loginmsg, "Login", "Exit");
                } 
            }
            else Kick(playerid); 
        } 
    }
	return 1;
}

public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
	return 1;
}

/*
	c - A character.
	d, i - An integer.
	h, x - A hex number (e.g. a colour).
	f - A float.
	s - A string.
	z - An optional string.
	pX - An additional delimiter where X is another character.
	'' - Encloses a litteral string to locate.
	u - User, takes a name, part of a name or an id and returns the id if they're connected.
	*/

// Admin Commands
dcmd_givegun(playerid, params[]) // Level 2
{
if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, COLOR_LIGHTRED, "You are not authorized to use this command!");
new target, weaponid, string[128];
if(sscanf(params, "ud", target, weaponid)) return SendClientMessage(playerid, COLOR_ORANGE, "CMD: /givegun [playerid/name] [weaponid]");
if(!IsPlayerConnected(target)) return SendClientMessage(playerid, COLOR_LIGHTRED, "Invalid player id!");
if(weaponid < 0 || weaponid > 46) return SendClientMessage(playerid, COLOR_LIGHTRED, "Invalid weapon ID! (0 - 46)");
GivePlayerWeapon(target, weaponid, 500);
format(string, sizeof(string), "Admin %s has given you a weapon!", PlayerName(playerid));
SendClientMessage(target, COLOR_LIGHTGREEN, string);
return 1;
}

dcmd_makeadmin(playerid, params[]) // Level 5
{
if(PlayerInfo[playerid][pAdmin] < 5 || !IsPlayerAdmin(playerid)) SendClientMessage(playerid, COLOR_LIGHTRED, "You are not authorized to use this command!");
new target, level, string[128];
if(sscanf(params, "ud", target, level)) return SendClientMessage(playerid, COLOR_ORANGE, "CMD: /makeadmin [playerid/name] [0-5]");
if(!IsPlayerConnected(target)) return SendClientMessage(playerid, COLOR_LIGHTRED, "Invalid player id!");
PlayerInfo[target][pAdmin] = level;
format(string, sizeof(string), "Admin %s has given you Level %d Admin!", PlayerName(playerid), level);
SendClientMessage(target, COLOR_LIGHTGREEN, string);
foreach(Player, i)
{
	if(PlayerInfo[i][pAdmin] >= 4)
	{
	    format(string, sizeof(string), "Admin %s has given %s level %d Admin!", PlayerName(playerid), PlayerName(target), level);
	    SendClientMessage(i, COLOR_LIGHTRED, string);
	}
}
return 1;
}
dcmd_setmoney(playerid, params[]) // Level 3
{
if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, COLOR_LIGHTRED, "You are not authorized to use this command!");
new target, amount;
new string[128];
if(sscanf(params, "ud", target, amount)) return SendClientMessage(playerid, COLOR_ORANGE, "CMD: /setmoney [playerid/name] [amount]");
if(!IsPlayerConnected(target)) return SendClientMessage(playerid, COLOR_LIGHTRED, "Invalid player id!");
PlayerInfo[target][pMoney] = amount;
ResetPlayerMoney(target);
new newmoney = PlayerInfo[target][pMoney];
GivePlayerMoney(target, newmoney);
format(string, sizeof(string), "Admin %s has set your money to %d !", PlayerName(playerid), newmoney);
SendClientMessage(target, COLOR_LIGHTGREEN, string);
foreach(Player, i)
{
	if (PlayerInfo[i][pAdmin] >= 1)
	{
	    format(string, sizeof(string), "Admin %s has set %s's money to %d !", PlayerName(playerid), PlayerName(target), amount);
	    SendClientMessage(i, COLOR_LIGHTRED, string);
	}
}
return 1;
}

dcmd_givemoney(playerid, params[]) // Level 3
{
if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, COLOR_LIGHTRED, "You are not authorized to use this command!");
new target, money;
new string[128];
if(sscanf(params, "ud", target, money)) return SendClientMessage(playerid, COLOR_ORANGE, "CMD: /givemoney [playerid/name] [amount]");
if(!IsPlayerConnected(target)) return SendClientMessage(playerid, COLOR_LIGHTRED, "Invalid player id!");
if(money < 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You can't givemoney below 0!");
GivePlayerMoney(target, money);
PlayerInfo[target][pMoney] += money;
format(string, sizeof(string), "Admin %s has given you %d !", PlayerName(playerid), money);
SendClientMessage(target, COLOR_LIGHTGREEN, string);
foreach(Player ,i)
{
	if(PlayerInfo[i][pAdmin] >=1)
	{
	    format(string, sizeof(string), "Admin %s has given %s %d !", PlayerName(playerid), PlayerName(target), money);
	    SendClientMessage(i, COLOR_LIGHTRED, string);
	}
}
return 1;
}
dcmd_kick(playerid, params[]) // Level 1
{
if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_LIGHTRED, "You are not authorized to use this command!");
new user, reason[128], string[128];
if(sscanf(params, "us[128]", user, reason)) return SendClientMessage(playerid, COLOR_ORANGE, "CMD: /kick [playerid/name] [reason]");
if(!IsPlayerConnected(user)) return SendClientMessage(playerid, COLOR_LIGHTRED, "Invalid player id!");
if(PlayerInfo[user][pAdmin] > PlayerInfo[playerid][pAdmin]) return SendClientMessage(playerid, COLOR_LIGHTRED, "You can't kick higher level Admins!");
format(reason, sizeof(reason), "%s", reason);
format(string, sizeof(string), "Admin %s has kicked %s, reason: %s", PlayerName(playerid), PlayerName(user), reason);
SendClientMessageToAll(COLOR_LIGHTRED, string);
Kick(user);
return 1;
}

dcmd_veh(playerid, params[]) // Level 3
{
if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, COLOR_LIGHTRED, "You are not authorized to use this command!");
if( !strlen( params ) ) return SendClientMessage(playerid, COLOR_LIGHTRED, "/veh [name] or [modelid]");
new car = ReturnVehicleModelID(params);
if(!car) return SendClientMessage(playerid, COLOR_LIGHTRED, "Invalid vehicle model id!");
new Float:x,Float:y,Float:z,Float:a;
GetPlayerPos(playerid, x,y,z);
GetPlayerFacingAngle(playerid, a);
CreateVehicle(car, x+1, y+1, z, a, -1, -1, 500);
SendClientMessage(playerid, COLOR_LIGHTGREEN, "You've spawned a vehicle!");
return 1;
}

dcmd_a(playerid, params[]) // All levels {admin chat}
{
if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_LIGHTRED, "You are not authorized to use this command!");
new message[128];
if(sscanf(params, "s[128]", message)) return SendClientMessage(playerid, COLOR_ORANGE, "CMD: /a [message]");
foreach(Player, i)
{
	if(PlayerInfo[i][pAdmin] >= 1)
	{
		new string[128];
		format(string, sizeof(string), "ADMIN %s says: %s", PlayerName(playerid), message);
		SendClientMessage(i, COLOR_LIGHTRED, string);
		return 1;
	}
}

return 1;
}
dcmd_unban(playerid, params[]) // Level 1
{
if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_LIGHTRED, "You are not authorized to use this command!");
new user[128], string[128],PlayerName2[24];
if(sscanf(params, "s[128]", PlayerName2)) return SendClientMessage(playerid, COLOR_ORANGE, "CMD: /unban [Full Player Name]");
format(user, sizeof(user), "%s.ini", PlayerName2);
if(dfile_FileExists(user))
    {
    	dfile_Delete(user);
		dfile_Create(user);
    	dfile_Open(user);
    	dfile_WriteInt("Admin", 0);
		dfile_WriteInt("VIP", 0);
    	dfile_WriteInt("Money", 0);
    	dfile_WriteInt("Score", 0);
    	dfile_WriteInt("Kills", 0);
    	dfile_WriteInt("Deaths", 0);
    	dfile_WriteInt("Online", 0);
	    dfile_WriteInt("Banned", 0);
	    dfile_WriteString("BanReason", "None");
		dfile_SaveFile();
		dfile_CloseFile();
        foreach(Player ,i)
        {
            if(PlayerInfo[i][pAdmin] >= 1)
            {
                format(string, sizeof(string), "Admin %s has unbanned the account '%s'", PlayerName(playerid), PlayerName2);
                SendClientMessage(i, COLOR_LIGHTRED, string);
            }
        }
        return 1;
    }
    else
    {
        SendClientMessage(playerid, COLOR_LIGHTRED, "User not found!");
        return 1;
    }
return 1;
}

dcmd_gethere(playerid, params[]) //level 2
{
if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, -1, "You're not an admin!");
new player;
if(sscanf(params, "u", player)) return SendClientMessage(playerid, -1, "USUAGE: /gethere [playerid]");
if(!IsPlayerConnected(player)) return SendClientMessage(playerid, -1, "Invalid player id!");
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid, x, y, z);
SetPlayerPos(player, x+2, y+2, z);
SendClientMessage(player, COLOR_LIGHTRED, "You've been teleported!");
return 1;
}
Reply
#2

EDIT: Got it all wrong, there might be any bracket missing.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)