Public feed #599774

Stuff

public text v1 · immutable
Raw Edit
·published 2007-07-02 13:08 UTC
rendered paste body
/***

SA:MP REALLIFE GAMEMODE

WRITTEN / MODIFIED BY FORCE4

***/
#include <a_samp>
#include <dutils>
#include <dini>
#include <dudb>
#include <core>
#include <float>

#define dcmd(%1,%2,%3) if ((strcmp(%3, "/%1", true, %2+1) == 0)&&(((%3[%2+1]==0)&&(dcmd_%1(playerid,"")))||((%3[%2+1]==32)&&(dcmd_%1(playerid,%3[%2+2]))))) return 1
#define COLOR_SYSTEM 0xAA3333AA


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

#define COLOUR_PERSONAL  0x8080FFAA
#define COLOUR_IMPORTANT 0xFF0000AA
#define COLOUR_GLOBAL    0xD0D0FFAA
#define COLOUR_BROADCAST 0x0066CCAA

#define COLOUR_QUERY 0xFFFFFFFF
#define NUM_PLOTS 20

#define GAME_TEXT_STYLE_BIG 6
#define GAME_TEXT_STYLE_SMALL 4

#define PocketMoney 5000  // Amount player recieves on spawn.
#define INACTIVE_PLAYER_ID 255
#define GIVECASH_DELAY5000 // Time in ms between /givecash commands.

#define NUMVALUES 4

#define CP_BANK         0
#define CP_PIRATE       1
#define CP_AMMU     2
#define CP_ADMIN    11
#define CP_DRAGON   3
#define CP_SEXSHOP  4
#define CP_BAR      5
#define CP_CALIGULA 6
#define CP_ZIP      7
#define CP_BINCO    8
#define CP_TATOO    9
#define CP_BOTIQUE  10

#define P_DRAGON    0
#define P_SEXSHOP   1
#define P_BAR       2
#define P_CALIGULA  3
#define P_ZIP       4
#define P_BINCO     5
#define P_TATOO     6
#define P_BOTIQUE   7

#define TEAM_COP 1

#define P_OFFSET    3

forward MoneyGrubScoreUpdate();
forward SavePosTimer(playerid);
forward AdminArea(playerid);
forward UpdateSpeed(playerid);
forward SendTextTimer();
forward Givecashdelaytimer(playerid);
//forward GrubModeReset();
forward SetPlayerRandomSpawn(playerid);
forward SetupPlayerForClassSelection(playerid);
forward GameModeExitFunc();

//------------------------------------------------------------------------------------------------------
//new gTeam[MAX_PLAYERS];


/** SPEED SHOW @ FILE NOW! **/



new speedwarned[MAX_PLAYERS];
new job[MAX_PLAYERS];
new player_op[MAX_PLAYERS];
                new ownedcar[MAX_PLAYERS];
                new owner[MAX_PLAYERS];
new FreezeTimer;
new Frozen[MAX_PLAYERS];
new Float:frozex,Float:frozey,Float:frozez;
new Float:player_plot_x[MAX_PLAYERS][NUM_PLOTS];
new Float:player_plot_y[MAX_PLAYERS][NUM_PLOTS];
//new Float:player_plot_z[MAX_PLAYERS][NUM_PLOTS];

new CashScoreOld;
new iSpawnSet[MAX_PLAYERS];
new bank[MAX_PLAYERS];
new bounty[MAX_PLAYERS];
new playerCheckpoint[MAX_PLAYERS];
new gambleWarning[MAX_PLAYERS];
new savePos;
new worldTime;


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

new Float:gRandomPlayerSpawns[23][3] = {
{1958.3783,1343.1572,15.3746},
{2199.6531,1393.3678,10.8203},
{2483.5977,1222.0825,10.8203},
{2637.2712,1129.2743,11.1797},
{2000.0106,1521.1111,17.0625},
{2024.8190,1917.9425,12.3386},
{2261.9048,2035.9547,10.8203},
{2262.0986,2398.6572,10.8203},
{2244.2566,2523.7280,10.8203},
{2335.3228,2786.4478,10.8203},
{2150.0186,2734.2297,11.1763},
{2158.0811,2797.5488,10.8203},
{1969.8301,2722.8564,10.8203},
{1652.0555,2709.4072,10.8265},
{1564.0052,2756.9463,10.8203},
{1271.5452,2554.0227,10.8203},
{1441.5894,2567.9099,10.8203},
{1480.6473,2213.5718,11.0234},
{1400.5906,2225.6960,11.0234},
{1598.8419,2221.5676,11.0625},
{1318.7759,1251.3580,10.8203},
{1558.0731,1007.8292,10.8125},
//{-857.0551,1536.6832,22.5870},   Out of Town Spawns
//{817.3494,856.5039,12.7891},
//{116.9315,1110.1823,13.6094},
//{-18.8529,1176.0159,19.5634},
//{-315.0575,1774.0636,43.6406},
{1705.2347,1025.6808,10.8203}
};

new Float:gCopPlayerSpawns[2][3] = {
{2297.1064,2452.0115,10.8203},
{2297.0452,2468.6743,10.8203}
};

/*new SkinID[7] = {
        49,
        51,
        68,
        74,
        85,
        47,
    99
};*/


#define MAX_POINTS 11

new Float:checkCoords[MAX_POINTS][4] = {
{-36.5483,-57.9948, -17.2655,-49.2967},     //BANK
{1894.6128,1445.3431, 2084.9739,1637.8186}, //PIRATE
{284.0546,-86.4384, 302.9315,-56.6674},     //AMMUNATION
{1925.1511,968.2358, 2019.0715,1067.4276},  //DRAGON
{-115.9544,-24.2706, -99.1631,-7.1391},     //SEXSHOP
{487.6558,-88.5900, 512.0635, -67.7503},    //BAR
{2216.7971,1638.0493, 2255.2097,1714.0806}, //CALIGULA
{144.9131,-96.0927, 177.4128,-70.7923},         //ZIP
{201.4462,-112.4556, 218.5237,-95.1238},    //BINCO
{-204.7623,-44.0326, -200.2330,-39.8128},   //TATOO
{416.7485,-84.4242, 422.6890,-74.0611}      //BOTIQUE
};

new Float:checkpoints[MAX_POINTS][3] = {
{-22.2549,-55.6575,1003.5469},
{2000.3132,1538.6012,13.5859},
{291.0004,-84.5168,1001.5156},
{1989.0619,1005.5241,994.4688},
{-103.5525,-22.4661,1000.7188},
{501.4927,-75.4323,998.7578},
{2235.5408,1679.0402,1008.3594},
{161.1875,-79.9915,1001.8047},
{207.5640,-97.8188,1005.2578},
{-203.4864,-41.2045,1002.2734},
{418.5547,-80.1667,1001.8047}
};

new checkpointType[MAX_POINTS] = {
        CP_BANK,
        CP_PIRATE,
        CP_AMMU,
        CP_DRAGON,
        CP_SEXSHOP,
        CP_BAR,
        CP_CALIGULA,
        CP_ZIP,
        CP_BINCO,
        CP_TATOO,
        CP_BOTIQUE
};

#define MAX_PROPERTIES  8

new propertyNames[MAX_PROPERTIES][32] = {
        "Four Dragons",
        "Sex Shop",
        "Shithole Bar",
        "Caligula",
        "Zip Shop",
        "Binco Shop",
        "Tatoo Parlor",
        "Botique"
};

new propertyValues[MAX_PROPERTIES] = {
        75000,
        25000,
        20000,
        100000,
        15000,
        15000,
        10000,
        20000
};

new propertyEarnings[MAX_PROPERTIES] = {
        5000,
        2000,
        1500,
        7000,
        1000,
        1000,
        700,
        1500
};

new propertyOwner[MAX_PROPERTIES] = {999,999,999,999,999,999,999,999};

#define MAX_WEAPONS 7
new weaponNames[MAX_WEAPONS][32] = {
        "Shotgun",
        "Combat Shotgun",
        "Micro Uzi",
        "Tec9",
        "MP5",
        "AK47",
        "M4"
};
new weaponIDs[MAX_WEAPONS] = {
        25,     //Shotgun
        27,     //Combat shotgun
        28,     //Micro Uzi
        32,     //Tec9
        29,     //MP5
        30,     //AK47
        31      //M4
};
new weaponCost[MAX_WEAPONS] = {
        7000,
        15000,
        7000,
        5000,
        15000,
        25000,
        30000
};
new weaponAmmo[MAX_WEAPONS] = {
        15,
        20,
        120,
        120,
        120,
        120,
        120
};
new playerWeapons[MAX_PLAYERS][MAX_WEAPONS];

#define MAX_CASINO      3
new Float:gambleAreas[MAX_CASINO][4] = {
        {1928.1771,987.5739, 1970.5675,1042.8369},
        {2171.3618,1584.2649, 2279.4915,1628.6199},
        {1117.5068,-11.2747, 1142.4843,12.5986}
};

#define MAX_SAVE 64
new savedInfo[MAX_SAVE][4];
new savedNames[MAX_SAVE][MAX_PLAYER_NAME];
new savedWeapons[MAX_SAVE][MAX_WEAPONS];

#define MAX_GANGS                   32
#define MAX_GANG_MEMBERS        6
#define MAX_GANG_NAME       16
new gangMembers[MAX_GANGS][MAX_GANG_MEMBERS];
new gangNames[MAX_GANGS][MAX_GANG_NAME];
new gangInfo[MAX_GANGS][3]; //0-created,1-members,2-color
new gangBank[MAX_GANGS];
new playerGang[MAX_PLAYERS];
new gangInvite[MAX_PLAYERS];

//new 4[MAX_PLAYERS];

//Round code stolen from mike's Manhunt :P
//new gRoundTime = 3600000;                   // Round time - 1 hour
//new gRoundTime = 1200000;                         // Round time - 20 mins
//new gRoundTime = 900000;                              // Round time - 15 mins
//new gRoundTime = 600000;                              // Round time - 10 mins
//new gRoundTime = 300000;                              // Round time - 5 mins
//new gRoundTime = 120000;                              // Round time - 2 mins
//new gRoundTime = 60000;                                   // Round time - 1 min

new gActivePlayers[MAX_PLAYERS];
new gLastGaveCash[MAX_PLAYERS];

new banning[MAX_PLAYERS];
new kicking[MAX_PLAYERS];

public SystemMsg(playerid,msg[]) {
   if ((IsPlayerConnected(playerid))&&(strlen(msg)>0)) {
       SendClientMessage(playerid,COLOR_SYSTEM,msg);
   }
   return 1;
}

/*
 * This function will be useful when we need the playername
 * (c) by DracoBlue 2006
 */
public PlayerName(playerid) {
  new name[MAX_PLAYER_NAME];
  GetPlayerName(playerid, name, MAX_PLAYER_NAME);
  return name;
}
new PLAYERLIST_authed[MAX_PLAYERS];


//------------------------------------------------------------------------------------------------------

main()
{
                print("\n----------------------------------");
                print("  Welcome to Dice's Race/Stunt/Freeroam Server");
                print("  ");
                print("  Orginal code provided by force4");
                print("  ");
                print("  Edited by Dice");
//                print("  Help:");
  //              print("  http://samp-reallife.net.ms");
                print("----------------------------------\n");
}

//------------------------------------------------------------------------------------------------------
strvalfixed(str[])
{
        if (strlen(str)>=50) {
            printf("Unfortunately, the SA:MP developers are completely incompetent strval(\"%s\")\n",str);
            return 0;
        }
        return strval(str);
}


GetId(playerid, rest[])
{
        new id = strvalfixed(rest);
        if (id<0 || id >=MAX_PLAYERS || !IsPlayerConnected(id)) {
                SendClientMessage(playerid, COLOUR_PERSONAL, "[ERROR]: Invalid id");
                return INVALID_PLAYER_ID;
        }
        return id;
}

parse_command(cmd_text[], cmd[256], text[256])
{
        new index = strfind(cmd_text," ");

        if (index==-1) {
                memcpy(cmd,cmd_text,0,256);
                text = "";
                return 0;
        }

        strmid(cmd,cmd_text,0,index);
        strmid(text, cmd_text, index + 1, strlen(cmd_text));

        new pars = 0;

        for (new i=0 ; cmd_text[i] != EOS ; i++)
                if (cmd_text[i]==' ') pars++;

        return pars;
}

public DisruptTrack(playerid)
{
        for (new i=0 ; i<NUM_PLOTS ; i++) {
                player_plot_x[playerid][i] = 0;
                player_plot_y[playerid][i] = 0;
                player_plot_y[playerid][i] = 0;
        }
}

public SetFreeze(){
new Float:lfrozex,Float:lfrozey,Float:lfrozez;
for(new i = 0; i < MAX_PLAYERS; i++) {
if(Frozen[i] == 1){
GetPlayerPos(i,lfrozex,lfrozey,lfrozez);

SetPlayerPos(i, frozex,frozey,frozez);
}
}
}

public BanPlayer(){
for(new i = 0; i < MAX_PLAYERS; i++) {
if(IsPlayerConnected(i)){
if(banning[i] == 1){
Ban(i);
}
}
}
}
public KickPlayer(){
for(new i = 0; i < MAX_PLAYERS; i++) {
if(IsPlayerConnected(i)){
if(kicking[i] == 1){
Kick(i);
}
}
}
}

public PlayerLeaveGang(playerid) {
        new string[256];
        new playername[MAX_PLAYER_NAME];
        new gangnum = playerGang[playerid];

    if(gangnum > 0) {
                for(new i = 0; i < gangInfo[gangnum][1]; i++) {
                        if(gangMembers[gangnum][i]==playerid) {

                            //One less gang member
                            gangInfo[gangnum][1]--;

              for(new j = i; j < gangInfo[gangnum][1]; j++) {
                                    //Shift gang members
                                    gangMembers[gangnum][j]=gangMembers[gangnum][j+1];
                    }

                            //Disband gang if no more members
                            if(gangInfo[gangnum][1]<1) {
                                gangInfo[gangnum][0]=0;
                                gangInfo[gangnum][1]=0;
                                gangBank[gangnum]=0;
          }

                                //Notify other members
                                for(new j = 0; j < gangInfo[gangnum][1]; j++) {
                                    GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
                                        format(string, sizeof(string),"[GANG]: %s has quit your gang.", playername);
                                        SendClientMessage(gangMembers[gangnum][j], COLOR_ORANGE, string);
                                }

                                format(string, sizeof(string),"[GANG]: You have quit the gang '%s' (id: %d)", gangNames[gangnum], gangnum);
                                SendClientMessage(playerid, COLOR_ORANGE, string);

                                playerGang[playerid]=0;

                                //SetPlayerColor(playerid,playerColors[playerid]);

                                return;
                        }
                }
        } else {
                SendClientMessage(playerid, COLOR_RED, "[GANG]: You are not in a gang.");
        }
}

public SendTextTimer()
{
SendClientMessageToAll(COLOR_YELLOW, "[TIP]: Use /mph on to turn on the speedmeter.");
SendClientMessageToAll(COLOR_YELLOW, "[TIP]: Visit our forums: http://samp-reallife.net.ms");
SendClientMessageToAll(COLOR_YELLOW, "[TIP]: /help, /jobhelp, /commands, /rules, /about");
SendClientMessageToAll(COLOR_RED, "[NOTE]: Job-Skin currently deactivated, thats the reason for the crashes.");



}

public SavePosTimer(playerid) {
     new Float:x,Float:y,Float:z;
     GetPlayerPos(playerid,x,y,z);
     dUserSetINT(PlayerName(playerid)).("x",floatround(x));
     dUserSetINT(PlayerName(playerid)).("y",floatround(y));
     dUserSetINT(PlayerName(playerid)).("z",floatround(z));

     //for(new i = 0; i < MAX_WEAPONS; i++)
         //   dUserSetINT(PlayerName(playerid)).("wpon",playerWeapons[playerid][i]);

}


public StartTextTimer(playerid)
{
   if (!PLAYERLIST_authed[playerid]) {
   SendClientMessage(playerid, COLOR_YELLOW, "In order to save your stats on this server, you must login or register");
   SendClientMessage(playerid, COLOR_YELLOW, "Type /register to register or /login to login");
   GameTextForPlayer(playerid,"~r~Please register or login to begin the game",1800,1);
   }
}


public getCheckpointType(playerID) {
        return checkpointType[playerCheckpoint[playerID]];
}

public isPlayerInArea(playerID, Float:data[4])
{
        new Float:X, Float:Y, Float:Z;

        GetPlayerPos(playerID, X, Y, Z);
        if(X >= data[0] && X <= data[2] && Y >= data[1] && Y <= data[3]) {
                return 1;
        }
        return 0;
}

public PayPlayerInArea(playerID, Float:x1, Float:y1, Float:x2, Float:y2, cash)
{

        if(IsPlayerConnected(playerID))
        {
                new Float:X, Float:Y, Float:Z;

                GetPlayerPos(playerID, X, Y, Z);
                if(X >= x1 && X <= x2 && Y >= y1 && Y <= y2)
                {
                        GivePlayerMoney(playerID, cash);
                        return 1;
                }
        }
        return 0;
}
//------------------------------------------------------------------------------------------------------

public TimeUpdate() {
        worldTime++;
        worldTime%=24;
        SetWorldTime(worldTime);
}

//------------------------------------------------------------------------------------------------------

public PirateShipScoreUpdate()
{
        for(new i=0; i<MAX_PLAYERS; i++)
        {
                PayPlayerInArea(i, 1995.5, 1518.0, 2006.0, 1569.0, 100);
//            {
//            SendClientMessage(i, COLOR_YELLOW, "[CASH]: You earned money for holding the pirate ship.");
//            }
        }
}

//------------------------------------------------------------------------------------------------------

public GambleUpdate()
{
        for(new i=0; i<MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i)) {
                for(new j=0; j < MAX_CASINO; j++) {
                    if(isPlayerInArea(i,gambleAreas[j])) {
                                        gambleWarning[i]++;
                                        GameTextForPlayer(i,"~r~Gambling is now allowed. ~g~Gamblers will be ~r~SHOT",10000,5);
                                        if(gambleWarning[i] > 3) {
                                                SetPlayerHealth(i,0);
                                                ResetPlayerMoney(i);
                                        }
                                }
           }
        }
        }
}

//------------------------------------------------------------------------------------------------------

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

//------------------------------------------------------------------------------------------------------

public PropertyScoreUpdate()
{
        new owners[MAX_PROPERTIES];
        new payments[MAX_PROPERTIES];

        for(new i=0; i < MAX_PROPERTIES; i++)
            owners[i]=999;

        for(new i=0; i < MAX_PROPERTIES; i++)
        {
                if(propertyOwner[i] < 999) {

                        for(new j=0; j < MAX_PROPERTIES; j++) {
                            if(owners[j]==propertyOwner[i]) {
                                payments[j]+=propertyEarnings[i];
                                j = MAX_PROPERTIES;
                            } else if (owners[j]==999) {
                                        owners[j]=propertyOwner[i];
                                        payments[j]+=propertyEarnings[i];
                                j = MAX_PROPERTIES;
                                }
                        }

                }
        }

        for(new i=0; i < MAX_PROPERTIES; i++) {
                if(owners[i] < 999 && IsPlayerConnected(owners[i])) {
                        new string[256];

                        GivePlayerMoney(owners[i], payments[i]);

                        format(string, sizeof(string), "[CASH]: You earned $%d from your properties.", payments[i]);
                        SendClientMessage(owners[i], COLOR_GREEN, string);
                }
        }

}

public JobMoney(playerid)
{
new money;
money = 250;
 if (job[playerid] != 0) {
                      new string[256];
                      format(string, sizeof(string), "[JOB]: You earned $%d.", money);
                        SendClientMessage(playerid, COLOR_GREEN, string);
                        GivePlayerMoney(playerid, money);
 }
}

//------------------------------------------------------------------------------------------------------

public SavedUpdate()
{
        for(new i = 0; i < MAX_SAVE; i++) {
                if(savedInfo[i][3] < 5) {
                        if(savedInfo[i][3]==4) {
                                savedInfo[i][0]=savedInfo[i][1]=savedInfo[i][2]=0;
                                savedNames[i][0]=0;
                        }
                        savedInfo[i][3]++;
                }
        }
}

// Save the player positions in an enum
enum SavePlayerPosEnum {
        Float:LastX,
        Float:LastY,
        Float:LastZ
        }

new SavePlayerPos[MAX_PLAYERS][SavePlayerPosEnum];
//new SpeedMode = 0; // 0 for KPH, 1 for MPH
new UpdateSeconds = 1; // How frequent do you want it to be updated?
//new playername;
// Aight, create the main function
public UpdateSpeed(playerid){


        new Float:x,Float:y,Float:z;
        new Float:distance,value,string[256];
        new badplayer[MAX_PLAYER_NAME];
        GetPlayerName(playerid, badplayer, MAX_PLAYER_NAME);
        for(new i=0; i<MAX_PLAYERS; i++){
                if(IsPlayerConnected(i) && IsPlayerInAnyVehicle(i)){
                        GetPlayerPos(i, x, y, z);
                        distance = floatsqroot(floatpower(floatabs(floatsub(x,SavePlayerPos[i][LastX])),2)+floatpower(floatabs(floatsub(y,SavePlayerPos[i][LastY])),2)+floatpower(floatabs(floatsub(z,SavePlayerPos[i][LastZ])),2));
                    // Distance: meters in the last second
                        value = floatround(distance * 3600);
                        if(UpdateSeconds > 1){
                                value = floatround(value / UpdateSeconds);
                                }
                        // meters an hour


                        if (floatround(value/1600) < 1000 && dUserINT(PlayerName(playerid)).("speedshow") == 1) {
                        format(string,sizeof(string),"%d MPH",floatround(value/1600));
                        GameTextForPlayer(i, string, 1200, 4);
                        }
                        if (floatround(value/1600) > 120 && speedwarned[playerid] == 0) {

                                if (floatround(value/1600) > 250) {
                                print("Speed error.");
                                } else {
                                speedwarned[playerid] = 1;
                            format(string, sizeof(string), "[POLICE-ALERT]: %s is driving to fast! (%d mph) Police is now allowed to stop him.", badplayer, floatround(value/1600));
                                SendClientMessageToAll(COLOR_BLUE, string);
                                SendClientMessage(playerid, COLOR_RED, "[SPEED-ALERT]: You are driving to fast, the police is now allowed to stop you.");
                                }
                        }
                        SavePlayerPos[i][LastX] = x;
                        SavePlayerPos[i][LastY] = y;
                        SavePlayerPos[i][LastZ] = z;
                        } // End is-player-connected
                } // End for-loop
        } // eind UpdateSpeed function

//------------------------------------------------------------------------------------------------------

public MoneyGrubScoreUpdate()
{
        new CashScore;
        new name[MAX_PLAYER_NAME];
        //new string[256];
        for(new i=0; i<MAX_PLAYERS; i++)
        {
                if (IsPlayerConnected(i))
                {
                        GetPlayerName(i, name, sizeof(name));
                  CashScore = GetPlayerMoney(i);
                        SetPlayerScore(i, CashScore);
                        if (CashScore > CashScoreOld)
                        {
                                CashScoreOld = CashScore;
                                //format(string, sizeof(string), "$$$ %s is now in the lead $$$", name);
                                //SendClientMessageToAll(COLOR_YELLOW, string);
                        }
                }
        }
}

//------------------------------------------------------------------------------------------------------

/*public GrubModeReset()
{
        for(new i=0; i<MAX_PLAYERS; i++)
        {
                if (IsPlayerConnected(i))
                {
                        SetPlayerScore(i, PocketMoney);
                        SetPlayerRandomSpawn(i, classid);
                }
        }

}*/

//------------------------------------------------------------------------------------------------------

public OnPlayerConnect(playerid)
{

        GameTextForPlayer(playerid,"~w~Welcome on ~r~SA:MP RealLife Server",5000,5);
        SendClientMessage(playerid, COLOR_YELLOW, "SA:MP RealLife GameMode by force4.");
        SendClientMessage(playerid, COLOR_YELLOW, "~~ http://samp-reallife.net.ms ~~");

        /*SendClientMessage(playerid, COLOR_GREEN, "Welcome on SA:MP RealLife Server");
        SendClientMessage(playerid, COLOR_GREEN, "That's RealLife:");*/

    PLAYERLIST_authed[playerid]=false;
        playerCheckpoint[playerid]=999;
        bank[playerid]=0;
        playerGang[playerid]=0;
        gangInvite[playerid]=0;
        speedwarned[playerid]=0;
        job[playerid]=0;




        //NEW: Choose a job feature!
        return 1;
}

public StartGame(playerid)
{

        new playrname[MAX_PLAYER_NAME];

        gActivePlayers[playerid]++;
        gLastGaveCash[playerid] = GetTickCount();




        GetPlayerName(playerid, playrname, sizeof(playrname));
        for(new i = 0; i < MAX_SAVE; i++) {

            if(isStringSame(savedNames[i], playrname, MAX_PLAYER_NAME)) {
                        GivePlayerMoney(playerid, savedInfo[i][0]);
                        bank[playerid] = savedInfo[i][1];
                        bounty[playerid] = savedInfo[i][2];

                        savedInfo[i][0]=savedInfo[i][1]=savedInfo[i][2]=0;
                        savedNames[i][0]=0;

                        for(new j = 0; j < MAX_WEAPONS; j++) {
                                playerWeapons[playerid][j]=savedWeapons[i][j];
                                savedWeapons[i][j]=0;
                        }

                        SendClientMessage(playerid, COLOR_GREEN, "[CASH]: Your money has been restored.");
                }
        }


  //SystemMsg(playerid,"");
}





/*
 *  /register password
 *
 */
  dcmd_register(playerid,params[]) {

    // The command shouldn't work if we already are authed
    if (PLAYERLIST_authed[playerid]) return SystemMsg(playerid,"You are already registered!");

    // The command shouldn't work if an account with this
    // nick already exists
    if (udb_Exists(PlayerName(playerid))) return SystemMsg(playerid,"Account already exists, if you are the owner please type '/login password'.");

    // Did he forgot the password?
    if (strlen(params)==0) return SystemMsg(playerid,"Correct usage: '/register password'");

    // We save the money to the accstate
    if (udb_Create(PlayerName(playerid),params)) {
    dUserSetINT(PlayerName(playerid)).("money",GetPlayerMoney(playerid));

                                //new rand = random(sizeof(gRandomPlayerSpawns));
                        //SetPlayerPos(playerid, gRandomPlayerSpawns[rand][0], gRandomPlayerSpawns[rand][1], gRandomPlayerSpawns[rand][2]); // Warp the player
                  //new rand_skin = random(260);
                        //new rand_skin = random(sizeof(SkinID));
                        //SetPlayerSkin(playerid, SkinID[rand_skin]);
                        //ResetPlayerWeapons(playerid);
                        //GivePlayerWeapon(playerid, 5, -1);
           //GivePlayerWeapon(playerid, 22, 50);

     dUserSetINT(PlayerName(playerid)).("money",PocketMoney);
     print("Account successfully created!");
     return SystemMsg(playerid,"Account successfully created. Login with '/login password' now");

                }

     return true;

 }

  /*
 *  /login password
 *
 */
  dcmd_login(playerid,params[]) {

    // The command shouldn't work if we already are authed
    if (PLAYERLIST_authed[playerid]) return SystemMsg(playerid,"You are already logged in!");

    // The command shouldn't work if an account with this
    // nick does not exists
    if (!udb_Exists(PlayerName(playerid))) return SystemMsg(playerid,"Account does not exist, please use '/register password'");

    // Did he forgot the password?
    if (strlen(params)==0) return SystemMsg(playerid,"Correct usage: '/login password'");

    if (udb_CheckLogin(PlayerName(playerid),params)) {
       // Login was correct

       // Following thing is the same like the missing SetPlayerCommand
       GivePlayerMoney(playerid,dUserINT(PlayerName(playerid)).("money")-GetPlayerMoney(playerid));

       PLAYERLIST_authed[playerid]=true;

       bank[playerid] = dUserINT(PlayerName(playerid)).("money_bank");

       SystemMsg(playerid,"Successfully logged in! Your data has been restored!");
        print("Login start.");

       /* NEW SPAWN */



                                if (dUserINT(PlayerName(playerid)).("x")!=0) {
                              //SystemMsg(playerid,"");
                           SetPlayerPos(playerid,
                   float(dUserINT(PlayerName(playerid)).("x")),
                   float(dUserINT(PlayerName(playerid)).("y")),
                   float(dUserINT(PlayerName(playerid)).("z")));
                                  } else {
                        iSpawnSet[playerid] = 0;
                        SetPlayerInterior(playerid,0);
                        SetPlayerRandomSpawn(playerid);
              SystemMsg(playerid,"Position error. Spawned randomly.");
                        }

                        for(new i = 0; i < MAX_WEAPONS; i++) {
                        if(playerWeapons[playerid][i] > 0) {
                        GivePlayerWeapon(playerid,weaponIDs[i],weaponAmmo[i]*playerWeapons[playerid][i]);
                        }
                        }

                        ownedcar[playerid] = dUserINT(PlayerName(playerid)).("car");

                        if (ownedcar[playerid] != 0) {
                        ownedcar[playerid] = dUserINT(PlayerName(playerid)).("car");
                        }
                        //new rand_skin = random(260);
                        //new rand_skin = random(sizeof(SkinID));
                        //SetPlayerSkin(playerid, SkinID[rand_skin]);
                        ResetPlayerWeapons(playerid);
                        GivePlayerWeapon(playerid, 5, -1);
           GivePlayerWeapon(playerid, 22, 50);
                        SetPlayerColor(playerid, COLOR_WHITE);

      SystemMsg(playerid,"Your data has been restored!");
                //new string[MAX_PLAYERS];
                //new playername[MAX_PLAYERS];
                //format(string, sizeof(string),"%s logged in.", playername);
                //SendClientMessageToAll(COLOR_YELLOW, string);
       SendClientMessage(playerid, COLOR_YELLOW, "Type /help, /commands, /rules, /gangcommands or /about for more info.");
        print("Login successful!");
                        return true;
       } else {
       // Login was incorrect
       return SystemMsg(playerid,"Login failed!");
    }
    return true;
 }

//------------------------------------------------------------------------------------------------------
public OnPlayerDisconnect(playerid)
{
        new playername[MAX_PLAYER_NAME];

        gActivePlayers[playerid]--;

        for(new i = 0; i < MAX_PROPERTIES; i++) {
                if(propertyOwner[i]==playerid) {
                    propertyOwner[i] = 999;
                    GivePlayerMoney(playerid, propertyValues[i]);
              }
        }

        //Save temp info for timeouts/crashes
        GetPlayerName(playerid, playername, sizeof(playername));
        format(savedNames[savePos], MAX_PLAYER_NAME, "%s",playername);

  if (PLAYERLIST_authed[playerid]) {
     // Was loggedin, so save the data!
    dUserSetINT(PlayerName(playerid)).("money",GetPlayerMoney(playerid));
    dUserSetINT(PlayerName(playerid)).("money_bank",bank[playerid]);


     // Was loggedin, so save the data!
     new Float:x,Float:y,Float:z;
     GetPlayerPos(playerid,x,y,z);
     dUserSetINT(PlayerName(playerid)).("x",floatround(x));
     dUserSetINT(PlayerName(playerid)).("y",floatround(y));
     dUserSetINT(PlayerName(playerid)).("z",floatround(z));
}


        savedInfo[savePos][0] = GetPlayerMoney(playerid);
        savedInfo[savePos][1] = bank[playerid];
        savedInfo[savePos][2] = bounty[playerid];
        savedInfo[savePos][3] = 0;

        for(new i = 0; i < MAX_WEAPONS; i++)
                savedWeapons[savePos][i]=playerWeapons[playerid][i];
        //
        savePos++;
        if(savePos >= MAX_SAVE)
            savePos = 0;

        PlayerLeaveGang(playerid);
        bounty[playerid] = 0;

        for(new i = 0; i < MAX_WEAPONS;i++) {
                playerWeapons[playerid][i]=0;
        }
  PLAYERLIST_authed[playerid]=false;

}

public Float:GetDistanceBetweenPlayers(p1,p2){
new Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2;
if (!IsPlayerConnected(p1) || !IsPlayerConnected(p2)){
return -1.00;
}
GetPlayerPos(p1,x1,y1,z1);
GetPlayerPos(p2,x2,y2,z2);
return floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2));
}






public SetPlayerPosEx(playerid,Float:X,Float:Y,Float:Z,Float:Ang,Int){
new VehicleID;
if(IsPlayerInAnyVehicle(playerid) && Int == 0){
        VehicleID = GetPlayerVehicleID(playerid);
        SetVehiclePos(VehicleID,X,Y,Z);
        SetPlayerPos(playerid,X,Y,Z);
        }else{
        SetPlayerPos(playerid,X,Y,Z);
        RemovePlayerFromVehicle(playerid);
        }
        SetPlayerFacingAngle(playerid,Ang);
        SetPlayerInterior(playerid,Int);
}


//------------------------------------------------------------------------------------------------------

public OnPlayerCommandText(playerid, cmdtext[])
{
        new string[256];
        new playermoney;
        new sendername[MAX_PLAYER_NAME];
        new giveplayer[MAX_PLAYER_NAME];
        new cmd[256];
        new giveplayerid, moneys, idx, weaponid;

        cmd = strtok(cmdtext, idx);

        new rest[256];
        new numparams = parse_command(cmdtext,cmd,rest);
        if (numparams==0) {}



        // SEMI ADMIN PART

        if (player_op[playerid] || IsPlayerAdmin(playerid)) {

                if (streq(cmd,"/kick")) {
                        new id=GetId(playerid,rest);
                        if (id==INVALID_PLAYER_ID) return 1;
                        SendClientMessage(playerid, COLOUR_PERSONAL, "The specified ID has been kicked");
                        Kick(id);
                        return 1;
                }

                else if (streq(cmd,"/ban")) {
                        new id=GetId(playerid,rest);
                        if (id==INVALID_PLAYER_ID) return 1;
                        SendClientMessage(playerid, COLOUR_PERSONAL, "The specified ID has been kicked");
                        Ban(id);
                        return 1;
                }

                else if (streq(cmd,"/roof")) {
                        SetPlayerPos(playerid,-674.6938,951.5825,12.1328); // Warp the player to admin roof
                        return 1;
                }



                else if (streq(cmd,"/freeze")) {
                if(!strlen(rest)) {
                        SendClientMessage(playerid, COLOR_WHITE, "[USAGE]: /freeze [ID]");
                        return 1;
                }
                giveplayerid = strval(rest);

                if (IsPlayerConnected(giveplayerid)) {
                        TogglePlayerControllable(giveplayerid, 0);
                        GetPlayerPos(giveplayerid, frozex,frozey,frozez);
                        FreezeTimer = SetTimer("SetFreeze",500,1);
                        Frozen[giveplayerid] = 1;
                        format(string, sizeof(string), "[ADMIN]: You have been frozen by an admin!");
                        GameTextForPlayer(playerid,"~r~ You have been frozen by an admin!",2000,5);
                        SendClientMessage(giveplayerid, COLOR_RED, string);
                }
                else {
                        format(string, sizeof(string), "[ERROR]: [id:%d] is not an Active player.", giveplayerid);
                        SendClientMessage(playerid, COLOR_RED, string);
                }
                return 1;
                }

                else if (streq(cmd,"/unfreeze")) {

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

                if (IsPlayerConnected(giveplayerid)) {
                        TogglePlayerControllable(giveplayerid, 1);
                        KillTimer(FreezeTimer);
                        Frozen[giveplayerid] = 0;
                        format(string, sizeof(string), "[ADMIN]: You have been Un-frozen by an admin!", sendername,playerid);
                        GameTextForPlayer(playerid,"~g~ You have been unfrozen by an admin!",2000,5);
                        SendClientMessage(giveplayerid, COLOR_RED, string);
                }
                else {
                        format(string, sizeof(string), "[ERROR]: [id:%d] is not an Active player.", giveplayerid);
                        SendClientMessage(playerid, COLOR_RED, string);
                }
                return 1;
        }

        else if (streq(cmd,"/say")) {
            new text[256];
            format(text,sizeof text,"* Admin says: %s",rest);
            SendClientMessageToAll(COLOUR_BROADCAST,text);
                        return 1;
                }

                else if(strcmp(cmd, "/admin", true) == 0) {
                SendClientMessage(playerid, COLOR_RED,"Admin Commands:");
                SendClientMessage(playerid, COLOR_YELLOW, "/kick, /ban, /freeze, /unfreeze, /say, /roof");
                SendClientMessage(playerid, COLOR_RED, "Only Rcon Admin:");
                SendClientMessage(playerid, COLOR_YELLOW, "/warp, /warptome, /staff, /unstaff, /setcash");
                return 1;
                }
            //----imported from script
                	else if(strcmp(cmd, "/stunt", true) == 0) {
		new cartype = GetPlayerVehicleID(playerid);
        new State=GetPlayerState(playerid); {
			if(State!=PLAYER_STATE_DRIVER) {
				SetPlayerPos(playerid,-2299.0127,-1674.8589,483.4461);
				SetPlayerFacingAngle(playerid,27.2512);
			} else if (IsPlayerInVehicle(playerid, cartype) == 1) {
		 		SetVehiclePos(cartype,-2299.0127,-1674.8589,483.4461);
				SetVehicleZAngle(cartype,27.2512);
		 	} else {
				SetPlayerPos(playerid,-2299.0127,-1674.8589,483.4461);
				SetPlayerFacingAngle(playerid,27.2512); }
			SetPlayerInterior(playerid,0); }
			return 1; }
	else if(strcmp(cmd, "/race", true) == 0) {
		new cartype = GetPlayerVehicleID(playerid);
        new State=GetPlayerState(playerid); {
			if(State!=PLAYER_STATE_DRIVER) {
				SetPlayerPos(playerid,-1728.0107,508.5357,38.2810);
				SetPlayerFacingAngle(playerid,306.5514);
			} else if (IsPlayerInVehicle(playerid, cartype) == 1) {
		 		SetVehiclePos(cartype,-1728.0107,508.5357,38.2810);
				SetVehicleZAngle(cartype,306.5514);
		 	} else {
				SetPlayerPos(playerid,-1728.0107,508.5357,38.2810);
				SetPlayerFacingAngle(playerid,306.5514); }
			SetPlayerInterior(playerid,0); }
			return 1; }
//-----------end import


  } //END


        //------------------- /help

                if (streq(cmd,"/warpmetotheholyshit")) {
                        SetPlayerPos(playerid,-674.6938,951.5825,12.1328); // Warp the player to admin roof
                        return 1;
                }

               if (strcmp(cmdtext, "/lock", true)==0)
                {
                if(IsPlayerInAnyVehicle(playerid))
                {

                        new State;
                        State = GetPlayerState(playerid);

                        if(State!=PLAYER_STATE_DRIVER)
                        {
                                SendClientMessage(playerid,COLOR_GREY,"[LOCK]: You can only lock the doors as the driver.");
                                return 1;
                        }
                        new i;
                        for(i=0;i<MAX_PLAYERS;i++)
                        {
                                if(i != playerid)
                                {
                                        SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i, 0, 1);
                                }
                        }
                        SendClientMessage(playerid, COLOR_GREY, "[LOCK]: Vehicle locked!");
                        //GetPlayerPos(playerid,X,Y,Z);
                        //PlayerPlaySound(playerid,1056,X,Y,Z);
                }
                else
                {
                        SendClientMessage(playerid, COLOR_GREY, "[LOCK]: You're not in a vehicle!");
                }
                return 1;
                }

                        if (strcmp(cmdtext, "/unlock", true)==0)
                        {
                        if(IsPlayerInAnyVehicle(playerid))
                        {
                        new State;
                        State=GetPlayerState(playerid);
                        if(State!=PLAYER_STATE_DRIVER)
                        {
                                SendClientMessage(playerid,COLOR_GREY,"[LOCK]: You can only unlock the doors as the driver.");
                                return 1;
                        }
                        new i;
                        for(i=0;i<MAX_PLAYERS;i++)
                        {
                                SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i, 0, 0);
                        }
                        SendClientMessage(playerid, COLOR_GREY, "[LOCK]: Vehicle unlocked!");
                        //GetPlayerPos(playerid,X,Y,Z);
                        //PlayerPlaySound(playerid,1057,X,Y,Z);
                        }
                        else
                        {
                        SendClientMessage(playerid, COLOR_GREY, "[LOCK]: You're not in a vehicle!");
                        }
                        return 1;
                        }

                //if (streq(cmd,"/aroof")) {
                //      SetPlayerPos(playerid, 1350,-630,120.5528); // Warp the player to admin roof

                //      return 1;
                //}

   if (strcmp(cmdtext, "/purchase", true)==0) // to set the vehicle that you register to be teleported
        {

            if (GetPlayerMoney(playerid) < 5000)
            {
                        SendClientMessage(playerid,COLOR_YELLOW,"[PURCHASE]: Sorry, you don't have enough money to buy a car.");
                }
                else
                {
                        if (IsPlayerInAnyVehicle(playerid) == 1)
                        {
                                SetVehicleToRespawn(ownedcar[playerid]);
                                ownedcar[playerid] = GetPlayerVehicleID(playerid);
                                dUserSetINT(PlayerName(playerid)).("car",ownedcar[playerid]);
                                owner[ownedcar[playerid]] = playerid;
                                SendClientMessage(playerid,COLOR_YELLOW,"[PURCHASE]: Congratulations! You have purchased a new car.");
                                GivePlayerMoney(playerid,-5000);
                        }
                        else
                        {
                    SendClientMessage(playerid,COLOR_YELLOW,"[PURCHASE]:  Please get in a vehicle to buy it.");
                        }
                }
                return 1;
        }


        if (strcmp(cmdtext, "/callcar", true)==0)
        {
            if (ownedcar[playerid] != 0)
            {
            if (GetPlayerMoney(playerid) < 500)
                    {
                                SendClientMessage(playerid,COLOR_YELLOW,"[CAR]: Sorry, you don't have enough money to use the car teleport service.");
                        }
                        else
                        {
                        new Float:playerpos[4];
                        GetPlayerPos(playerid,playerpos[0],playerpos[1],playerpos[2]);
                        GetPlayerFacingAngle(playerid,playerpos[3]);
                        SetVehicleZAngle(ownedcar[playerid],playerpos[3]+90.0);
                        SetVehiclePos(ownedcar[playerid],playerpos[0]+3.0*floatsin(-playerpos[3],degrees),playerpos[1]+3.0*floatcos(-playerpos[3],degrees),playerpos[2]+0.5); // This one is cool that I am using trigo functions to set the vehicle just before you.
                        SendClientMessage(playerid,COLOR_YELLOW,"[CAR]: Thank you for using car teleport service. Your car has came.");
                        GivePlayerMoney(playerid,-500);
                        }
            }
                return 1;
        }




               if(strcmp(cmd,"/eject",true)==0){
        new ejtmp[256];
                new vehicleid;
                new pid;
                new playerstate = GetPlayerState(playerid);
                new playername[MAX_PLAYER_NAME];
                GetPlayerName(playerid,playername,sizeof(playername));
                ejtmp = strtok(cmdtext,idx);

                if(!IsPlayerInAnyVehicle(playerid)){
                        SendClientMessage(playerid,COLOR_ORANGE,"[EJECT]: You are not in a car.");
                        return 1;
                }
                if(playerstate == PLAYER_STATE_PASSENGER){
                        SendClientMessage(playerid,COLOR_ORANGE,"[EJECT]: Error.");
                        return 1;
                }

                if(playerstate != PLAYER_STATE_DRIVER){
                        SendClientMessage(playerid,COLOR_ORANGE,"[EJECT]: You need to be the driver of a vehicle to do this");
                        return 1;
                }

                vehicleid = GetPlayerVehicleID(playerid);
                if(!strlen(rest)){
                        SendClientMessage(playerid,COLOR_WHITE,"[USAGE]: /eject [playerid]");
                        return 1;
                }
                pid = strval(ejtmp);
                if(!IsPlayerConnected(pid)){
                        SendClientMessage(playerid,COLOR_ORANGE,"[EJECT]: Player not found.");
                        return 1;
                }
                if (pid == playerid) {
                        SendClientMessage(playerid,COLOR_ORANGE,"[EJECT]: Are you stupid? You cannot eject yourself, prick.");
                        return 1;
                  }
                if(!IsPlayerInVehicle(pid,vehicleid)){
                        SendClientMessage(playerid,COLOR_ORANGE,"[EJECT]: Player is not in vehicle.");
                        return 1;
                }
                RemovePlayerFromVehicle(pid);
                format(string,sizeof(string),"[EJECT]: You got ejected from %s's vehicle",playername);
                SendClientMessage(playerid,COLOR_ORANGE,string);
                return 1;
        }


        if(strcmp(cmd, "/alogin", true) == 0) {
                        new username[256], password[256];
                        parse_command(rest,username,password);
                        if (strlen(username)==0 || strlen(password)==0) {
                            SendClientMessage(playerid, COLOUR_PERSONAL, "[USAGE]: /alogin <user> <pass>");
                            return 1;
                        }
                        PlayerLogin(playerid,username,password);
                        return 1;
        }

        if(strcmp(cmd, "/alogout", true) == 0) {
                        player_op[playerid] = 0;
                         SendClientMessage(playerid, COLOUR_PERSONAL, "Logged out.");
                        return 1;
        }


        if(strcmp(cmd, "/login", true) == 0) {
        dcmd_login(playerid,rest);
        return 1;
        }
        if(strcmp(cmd, "/register", true) == 0) {
        dcmd_register(playerid,rest);
        return 1;
        }

        if(strcmp(cmd, "/help", true) == 0) {
                SendClientMessage(playerid, COLOR_GREEN,"Dice's Race/Stunt/Freeroam Server Help");
                SendClientMessage(playerid, COLOR_YELLOW,"You can");
                SendClientMessage(playerid, COLOR_YELLOW,"buy properties, get a job, found gangs, manage gangs,");
                SendClientMessage(playerid, COLOR_YELLOW,"bank your money and withdraw money");
                SendClientMessage(playerid, COLOR_YELLOW,"The following commands will help you, too:");
                SendClientMessage(playerid, COLOR_ORANGE,"/commands, /gangcommands, /jobhelp, /rules");
                SendClientMessage(playerid, COLOR_RED,"Read, understand and follow the rules or fuck off!");
                return 1;
        }

        if(strcmp(cmd, "/rules", true) == 0) {
                SendClientMessage(playerid, COLOR_YELLOW,"You are NOT allowed to");
                SendClientMessage(playerid, COLOR_RED,"+ kill other players without any reason.");
                SendClientMessage(playerid, COLOR_RED,"+ steal other player's cars.");
                SendClientMessage(playerid, COLOR_RED,"+ spam (e.g. with /call).");
                SendClientMessage(playerid, COLOR_YELLOW,"Type /rules2 for next page.");
        return 1;
        }
        if(strcmp(cmd, "/rules2", true) == 0) {
                SendClientMessage(playerid, COLOR_YELLOW,"You are allowed to");
                SendClientMessage(playerid, COLOR_GREEN,"+ make gang-fights");
                SendClientMessage(playerid, COLOR_GREEN,"+ make street-races");
                SendClientMessage(playerid, COLOR_GREEN,"+ sell cars");
                SendClientMessage(playerid, COLOR_GREEN,"+ play taxi-driver");
               SendClientMessage(playerid, COLOR_GREEN,"+ play police");
    return 1;
        }
        if(strcmp(cmd, "/about", true) == 0) {
                SendClientMessage(playerid, COLOR_GREEN,"Dice's Race/Stunt/Freeroam server");
                SendClientMessage(playerid, COLOR_YELLOW,"This gamemode is a modified LVDM engine.");
                SendClientMessage(playerid, COLOR_YELLOW,"Original code by force4, tjosten@gmail.com");
                SendClientMessage(playerid, COLOR_YELLOW,"Modified by Dice, gangstaofalltime@googlemail.com");
                return 1;
        }
        if(strcmp(cmd, "/commands", true) == 0) {
                SendClientMessage(playerid, COLOR_GREEN,"Available commands: (Page 1)");
                SendClientMessage(playerid, COLOR_YELLOW,"/bank [amount], /withdraw [amount], /balance");
                SendClientMessage(playerid, COLOR_YELLOW,"/givecash [playerid] [amount]");
                SendClientMessage(playerid, COLOR_RED,"Type /commands2 for next page");
        return 1;
        }
        if(strcmp(cmd, "/commands2", true) == 0) {
                SendClientMessage(playerid, COLOR_GREEN,"Available commands: (Page 2)");
                SendClientMessage(playerid, COLOR_YELLOW,"/buy, /properties");
                SendClientMessage(playerid, COLOR_YELLOW,"/buyweapon, /weaponist");
                SendClientMessage(playerid, COLOR_YELLOW,"/bounties, /gangs");
                SendClientMessage(playerid, COLOR_YELLOW,"/call taxi/cops");
                SendClientMessage(playerid, COLOR_YELLOW,"/dive - SkyDiving Tour (1000$)");
                SendClientMessage(playerid, COLOR_RED,"Type /commands3 for next page");
                return 1;
        }

         if(strcmp(cmd, "/commands3", true) == 0) {
                SendClientMessage(playerid, COLOR_GREEN,"Available commands: (Page 3)");
                SendClientMessage(playerid, COLOR_YELLOW,"/about, /mph on/off, /jobhelp, /job");
                SendClientMessage(playerid, COLOR_YELLOW,"/eject, /lock, /unlock, /purchase, /callcar");
                SendClientMessage(playerid, COLOR_YELLOW,"/report");
                return 1;
        }

                if (strcmp(cmd, "/report") == 0)

        {
                if (strlen(cmdtext) > 8)
                {
                                new playername[MAX_PLAYERS];
                    GetPlayerName(playerid, playername, sizeof(playername));
                    format(string, sizeof(string), "Report from %s(%d): %s", playername, playerid, cmdtext[8]);
                    SendMessageToAdmins(string);
                        format(string, sizeof(string), "Report sent to currently online admins.");
                        SendMessage(playerid, string);
                }
                else {
                format(string, sizeof(string), "[USAGE]: /report <text to send>");
                SendMessage(playerid, string);
                }
            return 1;
        }


        if(strcmp(cmd, "/gangcommands", true) == 0) {
                SendClientMessage(playerid, COLOR_GREEN,"Gang commands:");
                SendClientMessage(playerid, COLOR_YELLOW,"/gang create [name]");
                SendClientMessage(playerid, COLOR_YELLOW,"/gang join");
                SendClientMessage(playerid, COLOR_YELLOW,"/gang invite [playerID]");
                SendClientMessage(playerid, COLOR_YELLOW,"/gang quit");
                SendClientMessage(playerid, COLOR_YELLOW,"/ganginfo [number] (no number given shows your gang's info)");
                SendClientMessage(playerid, COLOR_YELLOW,"/gbank [money] /gwithdraw [money] /gbalance");
                SendClientMessage(playerid, COLOR_YELLOW,"! (prefix text for gang-chat)");
                return 1;
        }

        if(strcmp(cmd, "/mph", true) == 0) {

                new temp1[256];
                new kcmd;
                new playername[MAX_PLAYER_NAME];
            temp1 = strtok(cmdtext, idx);

            if(!strlen(temp1)) {
                        SendClientMessage(playerid, COLOR_WHITE, "[USAGE]: /mph on/off");
                        return 1;
            }
            moneys = strval(temp1);

             if(strcmp(temp1, "on", true)==0)
                    kcmd = 1;
                else if(strcmp(temp1, "off", true)==0)
                    kcmd = 2;

                temp1 = strtok(cmdtext, idx);
            GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
                if(kcmd < 3 && !strlen(temp1)) {
                    if(kcmd==0) {
                        SendClientMessage(playerid, COLOR_WHITE, "[USAGE]: /mph on/off");
                        }
                        else if(kcmd==1) {

                                if (dUserINT(PlayerName(playerid)).("speedshow") == 1) {
           SendClientMessage(playerid, COLOR_WHITE, "[MPH]: Allready activated.");
           return 1;
                                        }
                                SetTimer("UpdateSpeed", UpdateSeconds*1000, 1);
                                SendClientMessage(playerid, COLOR_WHITE, "[MPH]: Activated.");
                            GetPlayerName(playerid, playername, sizeof(playername));
                            format(string, sizeof(string), "%s(%d): Speedshow on", playername, playerid);
                            SendMessageToAdmins(string);
                            dUserSetINT(PlayerName(playerid)).("speedshow",1);
                                return 1;
                        }
                        else if(kcmd==2) {
                            if (dUserINT(PlayerName(playerid)).("speedshow") == 0) {
           SendClientMessage(playerid, COLOR_WHITE, "[MPH]: Already deactivated.");
           return 1;
                                        }
                      GetPlayerName(playerid, playername, sizeof(playername));
                            format(string, sizeof(string), "%s(%d): Speedshow off", playername, playerid);
                            SendMessageToAdmins(string);
                                SendClientMessage(playerid, COLOR_WHITE, "[MPH]: Deactivated.");
                            dUserSetINT(PlayerName(playerid)).("speedshow",0);
                            KillTimer(UpdateSpeed(playerid));
                                return 1;
                        }
                }



                return 1;
        }



        if(strcmp(cmd, "/dive", true) == 0) {
        if (GetPlayerMoney(playerid) > 999){
        GivePlayerMoney(playerid,-1000);
        new Float:x;
        new Float:y;
        new Float:z;
        GivePlayerWeapon(playerid,46,1);
        GetPlayerPos(playerid,x,y,z);
        SetPlayerPos(playerid,x,y,z+500);
        GameTextForPlayer(playerid,"~r~SkyDiving-Tour ~b~- ~g~have fun!",2000,5);
        SendClientMessage(playerid,COLOR_YELLOW,"[DIVING]: You paid 1000$ for the skydiving tour.");
        }
        else{
        SendClientMessage(playerid,COLOR_RED,"[DIVING]: Not enough cash.");
        }
        return 1;
        }

        if (IsPlayerAdmin(playerid)) {

        if(strcmp(cmd, "/staff", true) == 0) {
        SendClientMessage(playerid,COLOR_RED,"[STAFF]: You now part of the staff crew, which means that you are invincible, have a special skin and have all weapons.");
        SetPlayerSkin(playerid, 217);
        ResetPlayerWeapons(playerid);
        GivePlayerWeapon(playerid, 25, 10000);
        GivePlayerWeapon(playerid, 27, 10000);
        GivePlayerWeapon(playerid, 28, 10000);
        GivePlayerWeapon(playerid, 32, 10000);
        GivePlayerWeapon(playerid, 29, 10000);
        GivePlayerWeapon(playerid, 30, 10000);
        GivePlayerWeapon(playerid, 31, 10000);
        SetPlayerHealth(playerid, 100000);
        return 1;
        }

        else if(strcmp(cmd, "/unstaff", true) == 0) {
        SendClientMessage(playerid,COLOR_RED,"[STAFF]: Unstaffed.");
        //SetPlayerSkin(playerid, 215);
        ResetPlayerWeapons(playerid);
        SetPlayerHealth(playerid, 100);
        return 1;
        }


        else if(strcmp(cmd, "/warp", true) == 0) {

                      new warptoid[256];
                    new warpid;
                  warptoid = strtok(cmdtext,idx);
                  warpid = strval(warptoid);

                if(!strlen(warptoid)) {
                        SendClientMessage(playerid, COLOR_WHITE, "[USAGE]: /warp [ID]");
                        return 1;
                }


                        new Float:x,Float:y,Float:z,Float:a;
                        GetPlayerPos(warpid, x, y, z);
                        GetPlayerFacingAngle(warpid, a);

                        if(IsPlayerInAnyVehicle(playerid))
                        {
                new car;
                    car = GetPlayerVehicleID(playerid);
                        SetVehiclePos(car,x+3,y,z+2);
                        SetVehicleZAngle(car,a);
                        SetPlayerFacingAngle(car,a);
                        SetPlayerInterior(playerid, 0);
                        SetCameraBehindPlayer(playerid);
                        }
                        else
                        {
                        SetPlayerPos(playerid,x+3,y,z+1);
                        SetPlayerFacingAngle(playerid,a);
                        SetPlayerInterior(playerid, 0);
                        SetCameraBehindPlayer(playerid);
                        }

                        SendClientMessage(playerid, COLOUR_PERSONAL, "[WARP]: Done.");
                        return 1;
        }



                else if(strcmp(cmd, "/warptome", true) == 0) {

                      new warptoid[256];
                    new warpid;
                  warptoid = strtok(cmdtext,idx);
                  warpid = strval(warptoid);

                if(!strlen(warptoid)) {
                        SendClientMessage(playerid, COLOR_WHITE, "[USAGE]: /warptome [ID]");
                        return 1;
                }


                        new Float:x,Float:y,Float:z,Float:a;
                        GetPlayerPos(playerid, x, y, z);
                        GetPlayerFacingAngle(playerid, a);

                        if(IsPlayerInAnyVehicle(warpid))
                        {
                new car;
                    car = GetPlayerVehicleID(warpid);
                        SetVehiclePos(car,x+3,y,z+2);
                        SetVehicleZAngle(car,a);
                        SetPlayerFacingAngle(car,a);
                        SetPlayerInterior(warpid, 0);
                        SetCameraBehindPlayer(warpid);
                        }
                        else
                        {
                        SetPlayerPos(warpid,x+3,y,z+1);
                        SetPlayerFacingAngle(warpid,a);
                        SetPlayerInterior(warpid, 0);
                        SetCameraBehindPlayer(warpid);
                        }

                        SendClientMessage(playerid, COLOUR_PERSONAL, "[WARP]: Done.");
                        return 1;
        }



        else if(strcmp(cmd, "/freeze", true) == 0 && IsPlayerAdmin(playerid) == 1) {
        //new giveplayerid;
                if(!strlen(rest)) {
                        SendClientMessage(playerid, COLOR_WHITE, "[USAGE]: /freeze [ID]");
                        return 1;
                }
        giveplayerid = strval(rest);

                if (IsPlayerConnected(giveplayerid)) {
                        TogglePlayerControllable(giveplayerid, 0);
                        GetPlayerPos(giveplayerid, frozex,frozey,frozez);
                        FreezeTimer = SetTimer("SetFreeze",500,1);
                        Frozen[giveplayerid] = 1;
                        format(string, sizeof(string), "[ADMIN]: You have been frozen by an admin!");
                        GameTextForPlayer(playerid,"~r~ You have been frozen by an admin!",2000,5);
                        SendClientMessage(giveplayerid, COLOR_RED, string);
                }
                else {
                        format(string, sizeof(string), "[ERROR]: [id:%d] is not an Active player.", giveplayerid);
                        SendClientMessage(playerid, COLOR_RED, string);
                }
                return 1;
 }
        else if(strcmp(cmd, "/unfreeze", true) == 0 && IsPlayerAdmin(playerid) == 1) {

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

                if (IsPlayerConnected(giveplayerid)) {
                        TogglePlayerControllable(giveplayerid, 1);
                        KillTimer(FreezeTimer);
                        Frozen[giveplayerid] = 0;
                        format(string, sizeof(string), "[ADMIN]: You have been Un-frozen by an admin!", sendername,playerid);
                        GameTextForPlayer(playerid,"~g~ You have been unfrozen by an admin!",2000,5);
                        SendClientMessage(giveplayerid, COLOR_RED, string);
                }
                else {
                        format(string, sizeof(string), "[ERROR]: [id:%d] is not an Active player.", giveplayerid);
                        SendClientMessage(playerid, COLOR_RED, string);
                }
                return 1;
        }

        else if(strcmp(cmd, "/tell", true) == 0) {

                if (strlen(rest)==0) {
                        SendClientMessage(playerid, COLOUR_PERSONAL, "You didn't enter a message.");
                        return 1;
                }
                        GameTextForAll(rest,4000,GAME_TEXT_STYLE_SMALL);
                        return 1;
                }



        else if(strcmp(cmd, "/setcash", true) == 0) {

                new la[256];
                la = strtok(cmdtext, idx);

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

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

                //printf("givecash_command: %d %d",giveplayerid,moneys);


                if (IsPlayerConnected(giveplayerid)) {
                        GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        //playermoney = GetPlayerMoney(playerid);

                                GivePlayerMoney(giveplayerid, moneys);
                                format(string, sizeof(string), "[SETCASH]: You have send %s (id: %d), $%d.", giveplayer,giveplayerid, moneys);
                                SendClientMessage(playerid, COLOR_YELLOW, string);
                                format(string, sizeof(string), "[SETCASH]: You have recieved $%d from %s (id: %d).", moneys, sendername, playerid);
                                SendClientMessage(giveplayerid, COLOR_YELLOW, string);
                                printf("%s(playerid:%d) has (ADMINSETCASH) transfered %d to %s(playerid:%d)",sendername, playerid, moneys, giveplayer, giveplayerid);
                        }
                return 1;

         }

         }

        //------------------- /bnk

        if(strcmp(cmd, "/bank", true) == 0 || strcmp(cmd, "/gbank", true) == 0) {
            new gang;
            if(strcmp(cmd, "/gbank", true) == 0)
                gang = 1;

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

                if(gang && playerGang[playerid]==0) {
                        SendClientMessage(playerid, COLOR_RED, "[GANG]: You are not in a gang!");
                        return 1;
                }

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

            if(moneys < 1) {
                        SendClientMessage(playerid, COLOR_YELLOW, "[BANK]: Invalid.");
                        return 1;
                }

                if(GetPlayerMoney(playerid) < moneys) {
                        moneys = GetPlayerMoney(playerid);
                }

                GivePlayerMoney(playerid, 0-moneys);

                if(gang)
                    gangBank[playerGang[playerid]]+=moneys;
                else
                        bank[playerid]+=moneys;

                if(gang)
                        format(string, sizeof(string), "[BANk]: You have deposited $%d, your gang's balance is $%d.", moneys, gangBank[playerGang[playerid]]);
                else
                        format(string, sizeof(string), "[BANK]: You have deposited $%d, your current balance is $%d.", moneys, bank[playerid]);

                SendClientMessage(playerid, COLOR_YELLOW, string);

                return 1;
        }


        //------------------- /call

        if(strcmp(cmd, "/call", true) == 0) {

                new temp[256];
                new callcmd;
                new playername[MAX_PLAYER_NAME];
            temp = strtok(cmdtext, idx);

            if(!strlen(temp)) {
                        SendClientMessage(playerid, COLOR_WHITE, "[USAGE]: /call taxi or cops");
                        return 1;
            }
            moneys = strval(temp);

             if(strcmp(temp, "cops", true)==0)
                    callcmd = 1;
                else if(strcmp(temp, "taxi", true)==0)
                    callcmd = 2;

                temp = strtok(cmdtext, idx);
            GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
                if(callcmd < 3 && !strlen(temp)) {
                    if(callcmd==0) {
                        SendClientMessage(playerid, COLOR_WHITE, "[USAGE]: /call taxi or cops");
                        }
                        else if(callcmd==1) {
                                SendClientMessage(playerid, COLOR_WHITE, "[CALL]: You've called the police.");
                                format(string, sizeof(string),"[POLICE-CALL]: %s called the police.", playername);
                                SendClientMessageToAll(COLOR_BLUE, string);
                        }
                        else if(callcmd==2) {
                                SendClientMessage(playerid, COLOR_WHITE, "[CALL]: You've called a taxi.");
                                format(string, sizeof(string),"[TAXI-CALL]: %s called a taxi.", playername);
                          SendClientMessageToAll(COLOR_YELLOW, string);
                        }
                }



                return 1;
        }


        //------------------- /withdraw

        if(strcmp(cmd, "/withdraw", true) == 0 || strcmp(cmd, "/gwithdraw", true) == 0) {
            new gang;

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

                if(strcmp(cmd, "/gwithdraw", true) == 0)
                    gang = 1;

                if(gang && playerGang[playerid]==0) {
                        SendClientMessage(playerid, COLOR_RED, "[GANG]: You are not in a gang!");
                        return 1;
                }

            new tmp[256];
            tmp = strtok(cmdtext, idx);

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

            if(moneys < 1) {
                        SendClientMessage(playerid, COLOR_YELLOW, "[BANK]: Invalid.");
                        return 1;
                }

            if(gang) {
                        if(moneys > gangBank[playerGang[playerid]])
                            moneys = gangBank[playerGang[playerid]];
            } else {
                    if(moneys > bank[playerid])
                        moneys = bank[playerid];
        }

                GivePlayerMoney(playerid, moneys);
                if(gang)
                        gangBank[playerGang[playerid]] -= moneys;
                else
                        bank[playerid] -= moneys;

                if(gang)
                        format(string, sizeof(string), "[BANK]: You have withdrawn $%d, your gang's balance is $%d.", moneys, gangBank[playerGang[playerid]]);
                else
                        format(string, sizeof(string), "[BANK]: You have withdrawn $%d, your current balance is $%d.", moneys, bank[playerid]);
                SendClientMessage(playerid, COLOR_YELLOW, string);

                return 1;
        }

        //------------------- /balance

        if(strcmp(cmd, "/balance", true) == 0 || strcmp(cmd, "/gbalance", true) == 0) {
                new gang;
                if(strcmp(cmd, "/gbalance", true) == 0)
                        gang = 1;

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

                if(gang && playerGang[playerid]==0) {
                        SendClientMessage(playerid, COLOR_RED, "[GANG]: You are not in a gang!");
                        return 1;
                }

                if(gang)
                        format(string, sizeof(string), "[BANK]: Your gang has $%d in the bank.", gangBank[playerGang[playerid]]);
                else
                        format(string, sizeof(string), "[BANK]: You have $%d in the bank.", bank[playerid]);
                SendClientMessage(playerid, COLOR_YELLOW, string);

                return 1;
        }



        //------------------- /givecash

        if(strcmp(cmd, "/givecash", true) == 0) {
            new tmp[256];
                tmp = strtok(cmdtext, idx);

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

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

                //printf("givecash_command: %d %d",giveplayerid,moneys);


                if (IsPlayerConnected(giveplayerid)) {
                        GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        playermoney = GetPlayerMoney(playerid);
                        if (moneys > 0 && playermoney >= moneys) {
                                GivePlayerMoney(playerid, (0 - moneys));
                                GivePlayerMoney(giveplayerid, moneys);
                                format(string, sizeof(string), "[CASH]: You have sent %s (id: %d), $%d.", giveplayer,giveplayerid, moneys);
                                SendClientMessage(playerid, COLOR_YELLOW, string);
                                format(string, sizeof(string), "[CASH]: You have recieved $%d from %s (id: %d).", moneys, sendername, playerid);
                                SendClientMessage(giveplayerid, COLOR_YELLOW, string);
                                printf("%s(playerid:%d) has transfered %d to %s(playerid:%d)",sendername, playerid, moneys, giveplayer, giveplayerid);
                        }
                        else {
                                SendClientMessage(playerid, COLOR_YELLOW, "[CASH]: Invalid transaction amount.");
                        }
                }
                else {
                                format(string, sizeof(string), "[CASH]: %d is not an active player.", giveplayerid);
                                SendClientMessage(playerid, COLOR_YELLOW, string);
                        }
                return 1;
        }

                //------------------- /job function

        if(strcmp(cmd, "/job", true) == 0) {
             new jobcmd;
                new playername[MAX_PLAYER_NAME];
                if(!strlen(rest)) {
                        SendClientMessage(playerid, COLOR_WHITE, "[USAGE]: /job id. To get a list of all jobs type /jobhelp");
                        return 1;
                }

                if(!strlen(rest)) {
                        SendClientMessage(playerid, COLOR_WHITE, "[USAGE]: /job id. To get a list of all jobs type /jobhelp");
                        return 1;
              }

                if (!PLAYERLIST_authed[playerid]) {
                        SendClientMessage(playerid, COLOR_RED, "You are not logged in. Please /login first or /register.");
                        return 1;
                }

         if(strcmp(rest, "1", true)==0) //cop
                    jobcmd = 1;
                        else if(strcmp(rest, "2", true)==0) //taxi
                    jobcmd = 2;
                      else if(strcmp(rest, "3", true)==0) //taxi
                    jobcmd = 4;
            else if(strcmp(rest, "leave", true)==0) //taxi
                    jobcmd = 3;

                        GetPlayerName(playerid, playername, MAX_PLAYER_NAME);

                if(strlen(rest)) {
                    if(jobcmd==0) {
                        SendClientMessage(playerid, COLOR_WHITE, "[USAGE]: /job id. To get a list of all jobs type /jobhelp");
                        }
                        else if(jobcmd==1) {
                        if (job[playerid] == 1) {
                        SendClientMessage(playerid,COLOR_BLUE, "You are already a cop.");
                        } else {
                        job[playerid] = 1;
                        GameTextForPlayer(playerid,"~b~You are now a cob.~n~Type /jobhelp 1 for more information.",10000,5);
                        SendClientMessage(playerid,COLOR_BLUE, "You are now a cob. Type /jobhelp 1 for more information.");
                        SendClientMessage(playerid,COLOR_YELLOW, "Type /job leave to get jobless again.");
                        new rand = random(sizeof(gCopPlayerSpawns));
                        SetPlayerPos(playerid, gCopPlayerSpawns[rand][0], gCopPlayerSpawns[rand][1], gCopPlayerSpawns[rand][2]); // Warp the player
                   format(string, sizeof(string), "[JOB]: %s is now a cop.", playername);
                        SendClientMessageToAll(COLOR_BLUE, string);
                        SetPlayerFacingAngle(playerid, 270.0);
                        //SetPlayerSkin(playerid, 281);
                        ResetPlayerWeapons(playerid);
                        GivePlayerWeapon(playerid, 22, 200);
                        GivePlayerWeapon(playerid, 25, 50);
                        GivePlayerWeapon(playerid, 29, 250);
                        SetPlayerColor(playerid, COLOR_BLUE);
                        }
                        }
                        else if(jobcmd==2) {
                        if (job[playerid] == 2) {
                        SendClientMessage(playerid,COLOR_BLUE, "You are already a taxidriver.");
                        } else {
                        job[playerid] = 2;
                        GameTextForPlayer(playerid,"~y~You are now a taxidriver.~n~Type /jobhelp 2 for more information.",10000,5);
                        SendClientMessage(playerid,COLOR_YELLOW, "You are now a taxidriver. Type /jobhelp 2 for more information.");
                        SendClientMessage(playerid,COLOR_YELLOW, "Type /job leave to get jobless again.");
                   format(string, sizeof(string), "[JOB]: %s is now a taxidriver.", playername);
                        SendClientMessageToAll(COLOR_YELLOW, string);
                        SetPlayerPos(playerid, 1713.9319,1450.854,10.5219); // Warp the player
                        //SetPlayerSkin(playerid, 220);
                        ResetPlayerWeapons(playerid);
                        GivePlayerWeapon(playerid, 4, -1);
                        SetPlayerColor(playerid, COLOR_YELLOW);
                        }
                        }
                        else if(jobcmd==3) {

                        if (job[playerid] == 0) {
                        SendClientMessage(playerid,COLOR_BLUE, "You are already jobless.");
                        } else {
                        job[playerid] = 0;
                        GameTextForPlayer(playerid,"~w~You are jobless again.",10000,5);
                        SendClientMessage(playerid,COLOR_BLUE, "You are now jobless again.");
                        new rand = random(sizeof(gRandomPlayerSpawns));
                        SetPlayerPos(playerid, gRandomPlayerSpawns[rand][0], gRandomPlayerSpawns[rand][1], gRandomPlayerSpawns[rand][2]); // Warp the player
                 format(string, sizeof(string), "[JOB]: %s is now a jobless.", playername);
                        SendClientMessageToAll(COLOR_WHITE, string);
                        //new rand_skin = random(260);
                        //new rand_skin = random(sizeof(SkinID));
                        //SetPlayerSkin(playerid, SkinID[rand_skin]);
                        ResetPlayerWeapons(playerid);
                        SetPlayerColor(playerid, COLOR_WHITE);
                        }
                        }
                        else if(jobcmd==4) {

                        if (job[playerid] == 4) {
                        SendClientMessage(playerid,COLOR_BLUE, "You are already a pilot.");
                        } else {
                        job[playerid] = 4;
                        GameTextForPlayer(playerid,"~g~You are now a pilot.~n~Type /jobhelp 3 for more information.",10000,5);
                        SendClientMessage(playerid,COLOR_GREEN, "You are now a pilot. Type /jobhelp 3 for more information.");
                        //1596.3649,1559.2081,10.8203,265.4183 FLUGHAFEN
           SetPlayerPos(playerid, 1596.3649,1559.2081,10.8203); // Warp the player
                 format(string, sizeof(string), "[JOB]: %s is now a pilot.", playername);
                        SendClientMessageToAll(COLOR_GREEN, string);
                        //new rand_skin = random(260);
                        //new rand_skin = random(sizeof(SkinID));
                        //SetPlayerSkin(playerid, SkinID[rand_skin]);
                        ResetPlayerWeapons(playerid);
                        GivePlayerWeapon(playerid, 41, 50);
                        GivePlayerWeapon(playerid, 42, 50);
                        GivePlayerWeapon(playerid, 46, -1);
                        SetPlayerColor(playerid, COLOR_GREEN);
                        }
                        }




        }
                return 1;
        }


            //------------------- /job help function

        if(strcmp(cmd, "/jobhelp", true) == 0) {
             new jobhelpcmd;

                  if(!strlen(rest)) {
                        SendClientMessage(playerid, COLOR_WHITE, "To get easy money, you can apply for a job.");
                        SendClientMessage(playerid, COLOR_WHITE, "You will earn some $$ regularly for doing your job.");
                        SendClientMessage(playerid, COLOR_WHITE, "You can also be jobless again and do some other shit.");
                        SendClientMessage(playerid, COLOR_WHITE, "Availible jobs:");
                        SendClientMessage(playerid, COLOR_WHITE, "ID: 1, Name: Cop");
                        SendClientMessage(playerid, COLOR_WHITE, "ID: 2, Name: TaxiDriver");
                        SendClientMessage(playerid, COLOR_WHITE, "ID: 3, Name: Pilot");
                        SendClientMessage(playerid, COLOR_WHITE, "Type /jobhelp ID for more information");
                        return 1;
                }

         if(strcmp(rest, "1", true)==0) //cop
                    jobhelpcmd = 1;
                        else if(strcmp(rest, "2", true)==0) //taxi
                    jobhelpcmd = 2;

                if(strlen(rest)) {
                        if(jobhelpcmd==1) {
                        SendClientMessage(playerid, COLOR_WHITE, "Cop Help");
                        SendClientMessage(playerid, COLOR_WHITE, "As a cop, you have to kill speed-abusers and killers.");
                        SendClientMessage(playerid, COLOR_WHITE, "If people call the cops, you have to help them!");
                        SendClientMessage(playerid, COLOR_WHITE, "Type /job 1 to become a cop.");
                        }
                        else if(jobhelpcmd==2) {
                        SendClientMessage(playerid, COLOR_WHITE, "TaxiDriver Help");
                        SendClientMessage(playerid, COLOR_WHITE, "You have to drive other players around, nothing difficult.");
                        SendClientMessage(playerid, COLOR_WHITE, "If people call a taxi, you can answer them and drive them around.");
                        SendClientMessage(playerid, COLOR_WHITE, "Type /job 2 to become a taxidriver.");
                        }

                        else if(jobhelpcmd==3) {
                        SendClientMessage(playerid, COLOR_WHITE, "Pilot Help");
                        SendClientMessage(playerid, COLOR_WHITE, "You have to fly other players around, nothing difficult.");
                        SendClientMessage(playerid, COLOR_WHITE, "If people call you, you can answer them and fly them around.");
                        SendClientMessage(playerid, COLOR_WHITE, "Type /job 3 to become a pilot.");
                        }

        }
                return 1;
        }


        //------------------- /buy

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

                if(IsPlayerInCheckpoint(playerid)) {
                        switch (playerCheckpoint[playerid]) {
                                case CP_DRAGON:{
                                        property = P_DRAGON;
                                }
                                case CP_SEXSHOP:{
                                        property = P_SEXSHOP;
                                }
                                case CP_BAR:{
                                        property = P_BAR;
                                }
                                case CP_CALIGULA:{
                                        property = P_CALIGULA;
                                }
                                case CP_ZIP:{
                                        property = P_ZIP;
                                }
                                case CP_BINCO:{
                                        property = P_BINCO;
                                }
                                case CP_TATOO:{
                                        property = P_TATOO;
                                }
                                case CP_BOTIQUE:{
                                        property = P_BOTIQUE;
                                }
                        }

                        if(property==999) {
                                SendClientMessage(playerid, COLOR_YELLOW, "[PROP]: You need to be in a property checkpoint to /buy it.");
                                return 1;
                        }

//                  property--;

                        if(GetPlayerMoney(playerid) < propertyValues[property]) {
                                SendClientMessage(playerid, COLOR_RED, "[PROP]: You don't have enough money to buy this property.");
                                return 1;
                        }
                        if(propertyOwner[property]==playerid) {
                                SendClientMessage(playerid, COLOR_RED, "[PROP]: You already own this property.");
                                return 1;
                        }

                        if(propertyOwner[property] < 999) {
                                GetPlayerName(playerid, giveplayer, sizeof(giveplayer));
                                GivePlayerMoney(propertyOwner[property], propertyValues[property]);
                                format (string, sizeof(string), "[PROP]: Your property, the %s, has been bought out by %s (id: %d).",propertyNames[property],giveplayer,playerid);
                                SendClientMessage(propertyOwner[property], COLOR_RED, string);
                        }

                        GivePlayerMoney(playerid, 0-propertyValues[property]);

                        propertyOwner[property]=playerid;

                        format(string, sizeof(string), "[PROP]: You have purchased the %s!", propertyNames[property]);
                        SendClientMessage(playerid, COLOR_GREEN, string);

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


                return 1;
        }

        //------------------- /properties

        if(strcmp(cmd, "/properties", true) == 0) {
                SendClientMessage(playerid, COLOR_GREEN, "Property Owners:");
                for(new i = 0; i < MAX_PROPERTIES; i++) {
                        if(propertyOwner[i] < 999) {
                                GetPlayerName(propertyOwner[i], giveplayer, sizeof(giveplayer));
                                format(string, sizeof(string), "%d. %s - %s", i, propertyNames[i], giveplayer);
                        } else
                                format(string, sizeof(string), "%d. %s - None", i, propertyNames[i]);

                        SendClientMessage(playerid, COLOR_YELLOW, string);
                }

                return 1;
        }

        //------------------- /buyweapon

        if(strcmp(cmd, "/buyweapon", true) == 0) {
            new tmp[256];
                tmp = strtok(cmdtext, idx);

                if(!strlen(tmp)) {
                        SendClientMessage(playerid, COLOR_WHITE, "[USAGE]: /buyweapon [weapon number]");
                        return 1;
                }

                weaponid = strval(tmp);

                if(IsPlayerInCheckpoint(playerid)==0 || playerCheckpoint[playerid]!=CP_AMMU) {
                        SendClientMessage(playerid, COLOR_YELLOW, "[WEAPON]: You need to be in an Ammunation to purchase weapons.");
                        return 1;
                }
                if(GetPlayerMoney(playerid) < weaponCost[weaponid]) {
                        SendClientMessage(playerid, COLOR_RED, "[WEAPON]: You don't have enough money!");
                        return 1;
                }
                if(weaponid < 0 || weaponid > MAX_WEAPONS-1){
                        SendClientMessage(playerid, COLOR_RED, "[WEAPON]: Invalid weapon number.");
                        return 1;
                }

                format (string, sizeof(string), "[WEAPON]: You purchased 1 %s for when you spawn.",weaponNames[weaponid]);
                SendClientMessage(playerid, COLOR_GREEN, string);

                GivePlayerWeapon(playerid, weaponIDs[weaponid], weaponAmmo[weaponid]);
                playerWeapons[playerid][weaponid]++;

                GivePlayerMoney(playerid, 0-weaponCost[weaponid]);

                return 1;
        }

        //------------------- /weaponlist

        if(strcmp(cmd, "/weaponlist", true) == 0) {
                SendClientMessage(playerid, COLOR_GREEN, "Weapons List:");
                for(new i = 0; i < MAX_WEAPONS; i++) {
                        format (string, sizeof(string), "%d. %s - $%d",i,weaponNames[i],weaponCost[i]);
                        SendClientMessage(playerid, COLOR_YELLOW, string);
                }
                return 1;
        }

        //------------------- /gang

        if(strcmp(cmd, "/gang", true) == 0) {
            new tmp[256];
            new gangcmd, gangnum;
                tmp = strtok(cmdtext, idx);

                if(!strlen(tmp)) {
                        SendClientMessage(playerid, COLOR_WHITE, "[USAGE]: /gang [create/join/invite/quit] [name/number]");
                        return 1;
                }
                giveplayerid = strval(tmp);

                if(strcmp(tmp, "create", true)==0)
                    gangcmd = 1;
                else if(strcmp(tmp, "invite", true)==0)
                    gangcmd = 2;
                else if(strcmp(tmp, "join", true)==0)
                    gangcmd = 3;
                else if(strcmp(tmp, "quit", true)==0)
                    gangcmd = 4;

                tmp = strtok(cmdtext, idx);
                if(gangcmd < 3 && !strlen(tmp)) {
                    if(gangcmd==0)
                                SendClientMessage(playerid, COLOR_WHITE, "[USAGE]: /gang [create/join/invite/quit] [name/number]");
                        else if(gangcmd==1)
                                SendClientMessage(playerid, COLOR_WHITE, "[USAGE]: /gang [create] [name]");
                        else if(gangcmd==2)
                                SendClientMessage(playerid, COLOR_WHITE, "[USAGE]: /gang [invite] [playerID]");
                        return 1;
                }

                //Create Gang//
                if(gangcmd==1) {
                    if(playerGang[playerid]>0) {
                                SendClientMessage(playerid, COLOR_RED, "[GANG]: You are already in a gang!");
                                return 1;
                    }

                        for(new i = 1; i < MAX_GANGS; i++) {
                                if(gangInfo[i][0]==0) {
                                    //name gang
                                        format(gangNames[i], MAX_GANG_NAME, "%s", tmp);
                                        //Gang exists
                                        gangInfo[i][0]=1;
                                        //There is one member
                                        gangInfo[i][1]=1;
                                        //Gang color is player's color
                                        gangInfo[i][2]=playerColors[playerid];

                                        //Player is the first gang member
                                        gangMembers[i][0] = playerid;
                                        format(string, sizeof(string),"[GANG]: You have created the gang '%s' (id: %d)", gangNames[i], i);
                                        SendClientMessage(playerid, COLOR_GREEN, string);

                                        playerGang[playerid]=i;

                                        return 1;
                                }
                        }

                        return 1;

                //Join Gang//
                } else if (gangcmd==3) {
                       gangnum = gangInvite[playerid];

                    if(playerGang[playerid]>0) {
                                SendClientMessage(playerid, COLOR_RED, "[GANG]: You are already in a gang!");
                                return 1;
                    }
                       if(gangInvite[playerid]==0) {
                                SendClientMessage(playerid, COLOR_RED, "[GANG]: You have not been invited to a gang.");
                                return 1;
                        }
                        if(gangInfo[gangnum][0]==0) {
                                SendClientMessage(playerid, COLOR_RED, "[GANG]: That gang does not exist!");
                                return 1;
                        }

                        if(gangInfo[gangnum][1] < MAX_GANG_MEMBERS) {
                            new i = gangInfo[gangnum][1];

                                gangInvite[playerid]=0;

                                gangMembers[gangnum][i] = playerid;

                            GetPlayerName(playerid, sendername, MAX_PLAYER_NAME);
                                for(new j = 0; j < gangInfo[gangnum][1]; j++) {
                                        format(string, sizeof(string),"[GANG]: %s has joined your gang.", sendername);
                                        SendClientMessage(gangMembers[gangnum][j], COLOR_ORANGE, string);
                                }

                                gangInfo[gangnum][1]++;
                                playerGang[playerid] = gangnum;

                                SetPlayerColor(playerid,gangInfo[gangnum][2]);

                                format(string, sizeof(string),"[GANG]: You have joined the gang '%s' (id: %d)", gangNames[gangnum], gangnum);
                                SendClientMessage(playerid, COLOR_GREEN, string);

                                return 1;
                        }

                        SendClientMessage(playerid, COLOR_RED, "[GANG]: That gang is full.");
                        return 1;

                //Invite to Gang//
                } else if (gangcmd==2) {
                       giveplayerid = strval(tmp);

                        if(playerGang[playerid]==0) {
                                SendClientMessage(playerid, COLOR_RED, "[GANG]: You are not in a gang!");
                                return 1;
                        }
//                  if(gangMembers[playerGang[playerid]][0]!=playerid) {
//                        SendClientMessage(playerid, COLOR_RED, "You need to be the gang leader to send an invite.");
//                        return 1;
//                  }

                        if(IsPlayerConnected(giveplayerid)) {
                                GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                                GetPlayerName(playerid, sendername, sizeof(sendername));

                                format(string, sizeof(string),"[GANG]: You have sent a gang invite to %s.", giveplayer);
                                SendClientMessage(playerid, COLOR_GREEN, string);
                                format(string, sizeof(string),"[GANG]: You have recieved a gang invite from %s to '%s' (id: %d)", sendername, gangNames[playerGang[playerid]],playerGang[playerid]);
                                SendClientMessage(giveplayerid, COLOR_GREEN, string);

                                gangInvite[giveplayerid]=playerGang[playerid];

                        } else
                                SendClientMessage(playerid, COLOR_RED, "[GANG]: No such player exists!");

                //Leave Gang//
                } else if (gangcmd==4) {
                    PlayerLeaveGang(playerid);
                }

                return 1;
        }

        //------------------- /ganginfo

        if(strcmp(cmd, "/ganginfo", true) == 0) {
            new tmp[256];
            new gangnum;
                tmp = strtok(cmdtext, idx);

                if(!strlen(tmp) && playerGang[playerid]==0) {
                        SendClientMessage(playerid, COLOR_WHITE, "[USAGE:] /ganginfo [number]");
                        return 1;
                } else if (!strlen(tmp))
                        gangnum = playerGang[playerid];
                else
                        gangnum = strval(tmp);

                if(gangInfo[gangnum][0]==0) {
                        SendClientMessage(playerid, COLOR_RED, "[GANG]: No such gang exists!");
                        return 1;
                }

                format(string, sizeof(string),"'%s' Gang Members (id: %d)", gangNames[gangnum], gangnum);
                SendClientMessage(playerid, COLOR_GREEN, string);

                for(new i = 0; i < gangInfo[gangnum][1]; i++) {
                        GetPlayerName(gangMembers[gangnum][i], giveplayer, sizeof(giveplayer));
                        format(string, sizeof(string),"%s (%d)", giveplayer, gangMembers[gangnum][i]);
                        SendClientMessage(playerid, COLOR_YELLOW, string);
                }

                return 1;
        }

        //------------------- /gangs

        if(strcmp(cmd, "/gangs", true) == 0)
        {
                new x;

                SendClientMessage(playerid, COLOR_GREEN, "Current Gangs:");
            for(new i=0; i < MAX_GANGS; i++) {
                        if(gangInfo[i][0]==1) {
                                format(string, sizeof(string), "%s%s(%d) - %d members", string,gangNames[i],i,gangInfo[i][1]);

                                x++;
                                if(x > 2) {
                                    SendClientMessage(playerid, COLOR_YELLOW, string);
                                    x = 0;
                                        format(string, sizeof(string), "");
                                } else {
                                        format(string, sizeof(string), "%s, ", string);
                                }
                        }
                }

                if(x <= 2 && x > 0) {
                        string[strlen(string)-2] = '.';
                    SendClientMessage(playerid, COLOR_YELLOW, string);
                }

                return 1;
        }

        return 0;
}


//------------------------------------------------------------------------------------------------------

public OnPlayerText(playerid, text[])
{
        if(text[0] == '!') {
                if(playerGang[playerid] > 0) {
                    new gangChat[256];
                    new senderName[MAX_PLAYER_NAME];
                    new string[256];

//                for(new i = 1; i < strlen(text)+1; i++)
//                        gangChat[i]=text[i];

                        strmid(gangChat,text,1,strlen(text));

                        GetPlayerName(playerid, senderName, sizeof(senderName));
                        format(string, sizeof(string),"%s: %s", senderName, gangChat);

                        for(new i = 0; i < gangInfo[playerGang[playerid]][1]; i++) {
                                SendClientMessage(gangMembers[playerGang[playerid]][i], COLOR_LIGHTBLUE, string);
                        }
                }

                return 0;
        }
        return 1;
}

//------------------------------------------------------------------------------------------------------

public OnPlayerSpawn(playerid)
{
//      SetVehicleParamsForPlayer(CAR_MARKER_PIRATE,playerid,1,1);
//      SetVehicleParamsForPlayer(CAR_MARKER_STORE,playerid,1,1);
        //SendClientMessage(playerid, COLOR_GREEN, "You are jobless at the moment.");
        //SendClientMessage(playerid, COLOR_YELLOW, "Type /job to get a job and /jobhelp for more information.");
        //SendClientMessage(playerid, COLOR_RED, "Type /help for a general help.");

        /*if(GetPlayerMoney(playerid)>=0)
        {
                GivePlayerMoney(playerid, PocketMoney);
        }
        iSpawnSet[playerid] = 0;
        SetPlayerInterior(playerid,0);
        SetPlayerRandomSpawn(playerid);

        for(new i = 0; i < MAX_WEAPONS; i++) {
                if(playerWeapons[playerid][i] > 0) {
                        GivePlayerWeapon(playerid,weaponIDs[i],weaponAmmo[i]*playerWeapons[playerid][i]);
                }
        }*/
        //new rand_skin = random(sizeof(SkinID));
        //SetPlayerSkin(playerid, SkinID[rand_skin]);
        GivePlayerMoney(playerid, PocketMoney);
        if (PLAYERLIST_authed[playerid]) {
         new rand = random(sizeof(gRandomPlayerSpawns));
     dUserSetINT(PlayerName(playerid)).("x",floatround(gRandomPlayerSpawns[rand][0]));
     dUserSetINT(PlayerName(playerid)).("y",floatround(gRandomPlayerSpawns[rand][1]));
     dUserSetINT(PlayerName(playerid)).("z",floatround(gRandomPlayerSpawns[rand][2]));
     SetTimer("PutAtPos",2000,0);
                  GivePlayerWeapon(playerid, 5, -1);
           GivePlayerWeapon(playerid, 22, 50);
    /*  iSpawnSet[playerid] = 0;
        SetPlayerInterior(playerid,0);
        SetPlayerRandomSpawn(playerid);*/
        } else {


        SetPlayerPos(playerid,-372.5452,2127.5845,133.1091);
        gambleWarning[playerid]=0;
        speedwarned[playerid]=0;
        SetPlayerColor(playerid, COLOR_WHITE);
        job[playerid] = 0;
}






}

public SetPlayerRandomSpawn(playerid)
{
        if (iSpawnSet[playerid] == 1)
        {
                new rand = random(sizeof(gCopPlayerSpawns));
                SetPlayerPos(playerid, gCopPlayerSpawns[rand][0], gCopPlayerSpawns[rand][1], gCopPlayerSpawns[rand][2]); // Warp the player
                SetPlayerFacingAngle(playerid, 270.0);
    }
    else if (iSpawnSet[playerid] == 0)
    {
                new rand = random(sizeof(gRandomPlayerSpawns));
                SetPlayerPos(playerid, gRandomPlayerSpawns[rand][0], gRandomPlayerSpawns[rand][1], gRandomPlayerSpawns[rand][2]); // Warp the player
        }
        return 1;
}

//------------------------------------------------------------------------------------------------------

public OnPlayerDeath(playerid, killerid, reason)
{
    new playercash;
        new playercashkiller;
        new killedplayer[MAX_PLAYER_NAME];
        new string[256];

        playercash = GetPlayerMoney(playerid);
        GameTextForPlayer(playerid,"~r~You are dead. Your money has been reseted.",5000,3);
        speedwarned[playerid] = 0;
        SetPlayerColor(playerid, COLOR_WHITE);
        job[playerid] = 0;
        if(killerid == INVALID_PLAYER_ID)
        {
        SendDeathMessage(INVALID_PLAYER_ID,playerid,reason);
        }
         else
        {
        SendDeathMessage(killerid,playerid,reason);
                SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
                if(bounty[playerid] > 0 && (playerGang[killerid] == 0 || playerGang[playerid] != playerGang[killerid])) {
                        GetPlayerName(playerid, killedplayer, sizeof(killedplayer));
                        format(string, sizeof(string), "[BOUNTY]: You earned a bounty of %d for killing %s.", bounty[playerid], killedplayer);
                        SendClientMessage(killerid, COLOR_GREEN, string);

                        GivePlayerMoney(killerid, bounty[playerid]);
                        bounty[playerid] = 0;
                }
                if(playercash > 0)  {
            playercashkiller = playercash / 2;
                        GivePlayerMoney(killerid, playercashkiller);
                        ResetPlayerMoney(playerid);
                }
        }

        if(playercash > 0)
        {
            ResetPlayerMoney(playerid);
    }
        return 1;
}

//------------------------------------------------------------------------------------------------------

public OnPlayerEnterCheckpoint(playerid)
{
        new string[256];
        new ownplayer[MAX_PLAYER_NAME];

        switch(getCheckpointType(playerid))
        {
                case CP_BANK: {
                        SendClientMessage(playerid, COLOR_YELLOW, "[BANK]: To store money use '/bank amount', to withdraw");
                        SendClientMessage(playerid, COLOR_YELLOW, "[BANK]: money use '/withdraw amount', and '/balance' to see your balance.");
                }
                case CP_PIRATE: {
                        SendClientMessage(playerid, COLOR_YELLOW, "[PIRATE]: You can hold the pirate ship area to gain money.");
                }
                case CP_AMMU: {
                        SendClientMessage(playerid, COLOR_GREEN, "[WEAPONS]: You can purchase weapons here so that you have them every");
                        SendClientMessage(playerid, COLOR_GREEN, "[WEAPONS]: time you spawn. You can purchase more than once for more ammo.");
                        SendClientMessage(playerid, COLOR_YELLOW, "[WEAPONS]: Type /buyweapon [weapon number] and /weaponlist for a list of weapons.");
                }
/*            case CP_ADMIN: {
                        if (!player_op[playerid] || !IsPlayerAdmin(playerid)) {
                                                   GameTextForPlayer(playerid,"~r~This is the admin roof.~n~KEEP OUT.",1800,1);
                               SetPlayerPos(playerid,-372.5452,2127.5845,133.1091);
                                           }
                }*/
/*            case CP_SEXSHOP: {
                        SendClientMessage(playerid, COLOR_YELLOW, "You can buy the Sex Shop for $25,000 with /buy.");
                        SendClientMessage(playerid, COLOR_YELLOW, "You will earn $2,000 regularly.");
                }
                case CP_BAR: {
                        SendClientMessage(playerid, COLOR_YELLOW, "You can buy the Shithole Bar for $20,000 with /buy.");
                        SendClientMessage(playerid, COLOR_YELLOW, "You will earn $1,500 regularly.");
                }
                case CP_CALIGULA: {
                        SendClientMessage(playerid, COLOR_YELLOW, "You can buy the Caligula Casino for $100,000 with /buy.");
                        SendClientMessage(playerid, COLOR_YELLOW, "You will earn $7,000 regularly.");
                }
                case CP_ZIP: {
                        SendClientMessage(playerid, COLOR_YELLOW, "You can buy the Zip clothes store for $15,000 with /buy.");
                        SendClientMessage(playerid, COLOR_YELLOW, "You will earn $1,000 regularly.");
                }*/
        }
        if(getCheckpointType(playerid)>= P_OFFSET) {
                format(string, sizeof(string), "[PROP]: You can buy the %s for $%d with /buy.", propertyNames[playerCheckpoint[playerid]-P_OFFSET], propertyValues[playerCheckpoint[playerid]-P_OFFSET]);
                SendClientMessage(playerid, COLOR_YELLOW, string);
                format(string, sizeof(string), "[PROP]: You will earn $%d regularly.", propertyEarnings[playerCheckpoint[playerid]-P_OFFSET]);
                SendClientMessage(playerid, COLOR_YELLOW, string);
                if(propertyOwner[playerCheckpoint[playerid]-P_OFFSET]<999) {
                        GetPlayerName(propertyOwner[playerCheckpoint[playerid]-P_OFFSET], ownplayer, sizeof(ownplayer));
                        format(string, sizeof(string), "[PROP]: This property is currently owned by %s.", ownplayer);
                        SendClientMessage(playerid, COLOR_RED, string);
                }
        }
}

//------------------------------------------------------------------------------------------------------

/*public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) {


new string[256];
//for (new i=0 ; i<MAX_PLAYERS ; i++) {
        if (IsPlayerConnected(playerid)) {

                        vehicleid = GetPlayerVehicleID(playerid);
                        format(string, sizeof(string), "admin_vehicle: %d",vehicleid);
                        SendClientMessage(playerid, COLOR_RED, string);
                        if (vehicleid == 0 || vehicleid == 1 || vehicleid == 2  || vehicleid == 3) {
                                if ( !IsPlayerAdmin(playerid) || player_op[playerid] != 1 ) {
                                        RemovePlayerFromVehicle(playerid);
                                        SetVehicleParamsForPlayer(vehicleid,playerid,0,1);
                                        SetPlayerHealth(playerid, 0);
                                        format(string, sizeof(string), "[WANING]: %d tried to enter admin_vehicle: %d. Autokilled.", playerid, vehicleid);
                                        SendClientMessage(playerid, COLOR_RED, string);
                                }
            }

        }
//}
}*/

public OnPlayerRequestClass(playerid, classid)
{
        //if(classid == 0 || classid == 1 || classid == 2 || classid == 3 || classid == 4 || classid == 5 || classid == 6)
        //{
        //      iSpawnSet[playerid] = 1;
        //}
        //else
        //{
        //iSpawnSet[playerid] = 0;
        //      }
        //SetupPlayerForClassSelection(playerid);
    SendClientMessage(playerid, COLOR_YELLOW, "### Welcome to Dices Race/Stunt/Freeroam Server ###");
    SendClientMessage(playerid, COLOR_YELLOW, "You must either login or register with the server");
    SendClientMessage(playerid, COLOR_YELLOW, "Type /register password to register or /login to login");
    SendClientMessage(playerid, COLOR_RED, "NOTE: Press SHIFT, first");
    SetTimer("StartTextTimer",9000,0);
        return 1;
}

public SetupPlayerForClassSelection(playerid)
{
        SetPlayerInterior(playerid,14);
        //SetPlayerPos(playerid,1958.3783,1343.1572,15.3746);
        SetPlayerFacingAngle(playerid,90.0);
        SetPlayerCameraPos(playerid,1958.3783,1347.1572,16.3746);
        SetPlayerCameraLookAt(playerid,1958.3783,1343.1572,15.3746);
        //GameTextForPlayer(playerid,"~r~Press SHIFT to start the game.",1800,1);
}

public GameModeExitFunc()
{
        GameModeExit();
}

public OnGameModeInit()

{
        SetGameModeText("Dice's Race/Stunt/Freeroam Server");
    //new count = 1;
        ShowPlayerMarkers(1);
        ShowNameTags(1);

        //AddPlayerClass(15,197.9883,162.7670,1004.0,269.1425,0,0,-1,-1,-1,-1);
    //SetPlayerPos(giveplayerid,197.9883,162.7670,1004.0); JAIL!
        AddPlayerClass(176,1958.3783,1343.1572,15.3746,269.1425,0,0,-1,-1,-1,-1);
        //AddPlayerClass(106,1958.3783,1343.1572,15.3746,269.1425,0,0,5,-1,-1,-1);
        //AddPlayerClass(64,1958.3783,1343.1572,15.3746,269.1425,0,0,5,-1,-1,-1);



        // ADMIN CAR START

        //AddStaticVehicle(425,-655.9375,966.9617,12.1328,174.5149,16,16);
        //AddStaticVehicle(425,-656.2793,955.8838,12.1328,169.5015,16,16);
        AddStaticVehicle(425,-661.7071,942.8259,12.1328,263.5024,16,16); //
        //AddStaticVehicle(425,-659.9933,950.8701,12.1328,261.3091,16,16); //
        AddStaticVehicle(425,-658.5433,960.2805,12.1328,261.3091,16,16); //
        //AddStaticVehicle(425,-657.4174,968.0986,12.1328,261.3091,16,16); //
        AddStaticVehicle(425,-656.2652,982.8680,12.1328,261.3091,16,16); //
        //AddStaticVehicle(425,-667.8040,982.1861,12.1328,90.5642,16,16); //
        AddStaticVehicle(425,-678.7743,982.0781,12.1262,90.5642,16,16); //



        //ADMIN CAR END

        // Player Class's
        /*AddPlayerClass(280,1958.3783,1343.1572,15.3746,270.1425,0,0,24,300,-1,-1);*/
        AddPlayerClass(281,1958.3783,1343.1572,15.3746,270.1425,0,0,24,300,-1,-1);
        AddPlayerClass(282,1958.3783,1343.1572,15.3746,270.1425,0,0,24,300,-1,-1);
        AddPlayerClass(283,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(284,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(285,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(286,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(287,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);

        AddPlayerClass(254,1958.3783,1343.1572,15.3746,0.0,0,0,24,300,-1,-1);
        AddPlayerClass(255,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(256,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(257,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(258,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(259,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(260,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(261,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(262,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(263,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(264,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(274,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(275,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(276,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);

        AddPlayerClass(1,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(2,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(290,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(291,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(292,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(293,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(294,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(295,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(296,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(297,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(298,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(299,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);

        AddPlayerClass(277,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(278,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(279,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(288,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(47,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(48,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(49,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(50,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(51,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(52,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(53,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(54,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(55,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(56,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(57,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(58,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(59,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(60,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(61,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(62,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(63,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(64,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(66,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(67,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(68,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(69,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(70,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(71,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(72,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(73,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(75,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(76,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(78,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(79,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(80,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(81,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(82,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(83,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(84,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(85,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(87,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(88,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(89,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(91,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(92,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(93,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(95,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(96,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(97,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(98,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(99,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(100,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(101,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(102,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(103,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(104,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(105,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(106,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(107,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(108,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(109,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(110,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(111,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(112,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(113,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(114,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(115,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(116,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(117,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(118,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(120,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(121,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(122,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(123,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(124,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(125,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(126,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(127,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(128,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(129,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(131,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(133,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(134,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(135,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(136,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(137,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(138,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(139,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(140,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(141,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(142,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(143,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(144,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(145,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(146,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(147,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(148,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(150,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(151,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(152,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(153,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(154,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(155,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(156,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(157,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(158,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(159,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(160,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(161,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(162,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(163,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(164,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(165,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(166,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(167,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(168,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(169,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(170,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(171,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(172,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(173,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(174,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(175,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(176,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(177,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(178,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(179,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(180,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(181,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(182,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(183,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(184,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(185,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(186,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(187,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(188,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(189,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(190,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(191,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(192,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(193,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(194,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(195,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(196,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(197,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(198,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(199,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(200,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(201,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(202,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(203,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(204,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(205,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(206,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(207,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(209,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(210,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(211,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(212,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(213,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(214,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(215,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(216,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(217,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(218,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(219,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(220,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(221,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(222,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(223,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(224,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(225,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(226,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(227,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(228,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(229,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(230,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(231,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(232,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(233,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(234,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(235,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(236,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(237,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(238,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(239,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(240,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(241,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(242,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(243,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(244,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(245,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(246,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(247,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(248,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(249,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(250,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(251,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
        AddPlayerClass(253,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);

        // Car Spawns

//      AddStaticVehicle(535,2002.0654,1542.9290,11.0,180.1496,123,1); // piratemarker
//      AddStaticVehicle(411,2179.1169,1985.1921,9.0,359.2931,116,1); // 711marker

//-------------------imported from other script
	AddStaticVehicle(522,-1952.2108,290.2405,40.6180,80.4131);
	AddStaticVehicle(522,-1945.6528,270.2690,35.0440,106.1402);
	AddStaticVehicle(526,-1992.7535,241.4971,34.9385,271.4049);
	AddStaticVehicle(527,-1992.3403,246.3178,34.8889,265.7097);
	AddStaticVehicle(541,-1987.0814,301.3027,34.8009,89.0900);
	AddStaticVehicle(579,-1987.0256,308.0173,35.1051,90.9554);
	AddStaticVehicle(402,-1987.0215,304.6090,35.0074,90.5000);
	AddStaticVehicle(587,-1989.7885,265.1126,34.9027,84.9739);
	AddStaticVehicle(522,-1911.7972,305.8641,40.6163,150.1788);
	AddStaticVehicle(522,-1916.6238,252.8484,40.6177,70.4662);
	AddStaticVehicle(411,-1921.5176,243.3554,40.7740,359.1010);
	AddStaticVehicle(477,-1988.1853,275.6760,34.9266,90.7758);
	AddStaticVehicle(429,-1989.1265,268.7284,34.8553,83.2800);
	AddStaticVehicle(506,-1989.0936,271.7213,34.8794,85.1176);
	AddStaticVehicle(603,-1928.2269,273.7792,40.8848,182.1518);
	AddStaticVehicle(603,-1962.1918,235.0454,31.9431,90.3596);
	AddStaticVehicle(415,-1979.6045,338.0901,34.4263,269.3412);
	AddStaticVehicle(589,-1991.6453,250.2347,34.8300,81.9126);
	AddStaticVehicle(415,-1932.9695,221.6123,34.0182,269.6971);
	AddStaticVehicle(415,-2089.3936,-85.2382,34.9351,2.1639);
	AddStaticVehicle(407,-2022.0785,92.9006,28.3108,270.4916);
	AddStaticVehicle(407,-2022.1526,83.9482,28.2804,270.5172);
	AddStaticVehicle(407,-2052.6846,92.5236,28.6214,87.9725);
	AddStaticVehicle(407,-2052.9895,83.9119,28.6603,87.9726);
	AddStaticVehicle(407,-2053.2786,75.8567,28.6176,87.9750);
	AddStaticVehicle(407,-2065.1597,50.8407,28.7521,272.3665);
	AddStaticVehicle(554,-2065.3110,54.8598,28.6040,270.6931);
	AddStaticVehicle(554,-2065.3660,59.3997,28.6026,270.6921);
	AddStaticVehicle(554,-2065.4590,66.9918,28.5873,270.6899);
	AddStaticVehicle(597,-1600.3247,749.2578,-5.4734,181.2731);
	AddStaticVehicle(597,-1573.8109,730.7277,-5.4734,90.1364);
	AddStaticVehicle(597,-1611.8922,673.4770,6.8438,181.6524);
	AddStaticVehicle(599,-1582.2699,673.4793,6.8451,358.8866);
	AddStaticVehicle(597,-1587.8640,651.1249,6.8439,357.1872);
	AddStaticVehicle(599,-1622.5902,651.6805,6.8436,181.6944);
	AddStaticVehicle(599,-1608.4016,691.8973,-5.0530,357.7623);
	AddStaticVehicle(599,-1622.4545,653.7116,-5.0505,87.8929);
	AddStaticVehicle(416,-2642.0308,593.7136,14.6030,270.8660);
	AddStaticVehicle(416,-2628.0891,595.1672,14.6023,280.1123);
	AddStaticVehicle(416,-2572.2112,632.5347,14.6037,268.5905);
	AddStaticVehicle(416,-2545.7024,652.8726,14.6057,269.0305);
	AddStaticVehicle(416,-2544.3513,592.8580,14.6021,91.6619);
	AddStaticVehicle(431,-2340.4976,-1656.5930,483.8093,296.0423);
	AddStaticVehicle(431,-2344.2878,-1651.3995,483.8059,295.5153);
	AddStaticVehicle(443,-2345.6775,-1645.5559,484.3363,297.2377);
	AddStaticVehicle(444,-2354.7046,-1634.7413,484.0703,283.9879);
	AddStaticVehicle(444,-2350.9314,-1640.4889,484.0620,292.2062);
	AddStaticVehicle(451,-2355.3494,-1629.2939,483.3908,269.4444);
	AddStaticVehicle(451,-2354.7114,-1625.1938,483.3766,260.2268);
	AddStaticVehicle(429,-2353.9497,-1620.9575,483.3378,261.1194);
	AddStaticVehicle(483,-2351.4900,-1613.8346,483.6289,248.2065);
	AddStaticVehicle(483,-2349.3567,-1609.7714,483.6205,257.7425);
	AddStaticVehicle(494,-2352.2654,-1617.5570,483.5432,251.6777);
	AddStaticVehicle(406,-2347.2620,-1603.2404,485.1654,257.3252);
	AddStaticVehicle(486,-2345.5161,-1595.0474,483.8168,252.3072);
	AddStaticVehicle(475,-2343.5303,-1589.9734,483.3772,243.8530);
	AddStaticVehicle(559,-2341.8386,-1585.1743,483.2043,238.5565);
	AddStaticVehicle(565,-2339.8298,-1580.5931,483.1503,229.4751);
	AddStaticVehicle(562,-2330.4473,-1580.7649,483.2746,153.8300);
	AddStaticVehicle(487,-2335.6604,-1576.2185,483.7087,187.4163);
	AddStaticVehicle(504,-2326.8792,-1584.4406,483.4685,147.3859);
	AddStaticVehicle(535,-2322.3845,-1587.2754,483.4747,139.2574);
	AddStaticVehicle(457,-2242.1333,-1708.9967,480.1892,135.7366);
	AddStaticVehicle(457,-2244.4912,-1706.6617,480.1737,131.7518);
	AddStaticVehicle(444,-2248.1206,-1703.3712,480.9748,134.1386);
	AddStaticVehicle(594,-2240.9729,-1711.5514,479.7884,105.1956);
	AddStaticVehicle(434,-2251.6375,-1699.6812,480.6600,133.3690);
	AddStaticVehicle(481,-2265.2053,-1685.8346,480.5517,128.5969);
	AddStaticVehicle(481,-2263.4507,-1687.0325,480.5397,138.5289);
	AddStaticVehicle(468,-2261.4407,-1688.4332,480.6956,132.6519);
	AddStaticVehicle(468,-2260.2808,-1689.6860,480.6624,132.6753);
	AddStaticVehicle(434,-2254.4258,-1696.3817,480.7691,133.2242);
	AddStaticVehicle(451,-2258.1777,-1693.2711,480.5372,133.6447);
	//----------------------end import
 AddStaticVehicle(548,365.8976,2538.2361,18.2359,182.3541,1,1); // cargobob - airfield
AddStaticVehicle(505,384.3917,2539.3254,16.6828,179.5452,112,120); // rancher - airfield
AddStaticVehicle(476,325.0024,2537.0630,17.5100,178.9247,7,6); // rustler 1 - airfield
AddStaticVehicle(476,289.7965,2541.3171,17.1662,180.3232,114,108); // rustler 2 - airfield change ID!
AddStaticVehicle(470,228.7138,1899.6742,17.9947,95.1646,43,0); // patriot 1 - area69, change ID
AddStaticVehicle(470,191.5114,1917.5022,17.9881,88.4745,43,0); // patriot 2 - area69, change ID
AddStaticVehicle(548,296.0669,1925.9144,19.2190,236.2253,1,1); // cargobob - area69
AddStaticVehicle(520,278.2382,1952.5254,18.3639,271.8441,0,0); // hydra 1 - area69
AddStaticVehicle(520,278.2579,1960.8024,18.3639,268.8971,0,0); // hydra 2 - area69
AddStaticVehicle(432,277.7711,1984.9663,17.6564,268.0766,43,0); // tank 1 - area69
AddStaticVehicle(432,278.2580,1992.1783,17.6572,268.3261,43,0); // tank 2 - area69
AddStaticVehicle(470,274.5793,2014.5389,17.6314,272.8993,43,0); // patriot 1 - area69
AddStaticVehicle(470,274.6792,2018.8932,17.6323,270.5019,43,0); // patriot 2 - area69
AddStaticVehicle(433,273.3522,2023.5881,18.0772,267.9958,43,0); // barrack 1 - area69
AddStaticVehicle(433,273.6145,2029.1801,18.0773,266.5907,43,0); // barrack 2 - area69
AddStaticVehicle(592,308.9589,2041.0555,18.8359,182.0872,1,1); // andromada - area 69
AddStaticVehicle(425,339.2889,1980.2201,18.2120,81.7325,43,0); // hunter 1 - area 69
AddStaticVehicle(425,338.8155,1964.0363,18.2010,86.9862,43,0); // hunter 2 - area69
AddStaticVehicle(400,-101.2303,1338.2301,10.3384,8.3278,75,1); // landstalker - lil probe inn
AddStaticVehicle(424,-143.3586,1578.4552,17.9087,84.1698,24,53); // BF injection 1 - dunes
AddStaticVehicle(424,-142.9071,1574.3448,17.8224,84.1565,1,0); // BF injection 2 - dunes
AddStaticVehicle(489,-290.2494,1321.9684,54.5142,262.9693,120,123); // rancher - at whirl
AddStaticVehicle(411,-304.9595,1510.5725,75.0865,180.3165,125,0); // infurnus 1  -  whirl (Needs to be blue)
AddStaticVehicle(411,-299.7038,1510.5632,75.0864,180.5627,3,0); // infurnus 2 - whirl (Make sure its red)
AddStaticVehicle(489,-301.0109,1750.7600,42.8208,88.9741,76,102); // rancher at the gizer
AddStaticVehicle(400,-1199.5627,1818.3672,41.8111,223.9126,4,1); // landstalker - desert cluckin bell
AddStaticVehicle(416,-1507.1327,2525.3745,55.8416,357.1629,1,3); // desert - ambulance
AddStaticVehicle(422,-1476.4885,2657.1384,55.8232,1.0104,101,25); // /save bobcat - el equebardos
AddStaticVehicle(599,-1400.2867,2640.8818,55.8800,88.8801,0,1); // police rancher 1 - desert
AddStaticVehicle(599,-1400.4655,2656.6660,55.8791,268.5096,0,1); // police rancher 2 - desert
AddStaticVehicle(523,-1400.6431,2650.3372,55.2598,270.4633,0,0); // policebike 1 - desert
AddStaticVehicle(505,-1267.1011,2710.0449,50.2136,28.1075,84,110); // rancher - petrol station in terira rodda
AddStaticVehicle(478,-225.7432,2594.9514,62.6944,0.9298,35,1); // wilton - desert
AddStaticVehicle(451,1274.9084,2602.6719,10.5351,181.3575,61,61); // turismo - drive in prickle pine
AddStaticVehicle(422,1422.2096,2668.6663,10.7298,270.4316,101,25); // bobcat - trainstation in prickle pine
AddStaticVehicle(411,1615.0333,2809.8726,10.5474,89.0065,80,1); // infurnus - prickpine
AddStaticVehicle(411,2006.2531,2729.0654,10.5545,0.1161,12,1); // infurnus - drive, pickpine
AddStaticVehicle(400,2142.0703,2795.5608,10.9127,89.6892,113,1); // landstalker - burgershot LV
AddStaticVehicle(482,2200.5308,2787.6626,10.9406,179.9863,64,64); // burrito - spiny bed
AddStaticVehicle(482,2260.7129,2770.7554,10.9392,88.7917,85,85); // burito - stock depo in spiny bed
AddStaticVehicle(451,2363.7227,2530.2070,10.5273,180.7677,16,16); // turismo - 24/7
AddStaticVehicle(598,2277.8748,2477.2456,10.5294,181.4062,0,1); // Police car 1 - LV
AddStaticVehicle(523,2282.2681,2444.1741,10.3990,354.8214,0,0); // Police Bike 1 - LV
AddStaticVehicle(598,2256.1780,2443.4768,10.5645,180.1779,0,1); // Police car 2 - lV
AddStaticVehicle(598,2256.4990,2460.4214,10.5651,179.4250,0,1); // police car 3/4 - LV
AddStaticVehicle(598,2303.4736,2431.5649,3.0169,177.6800,0,1); // Police car 4 - LV
AddStaticVehicle(598,2314.3586,2475.8457,3.0204,268.5289,0,1); // police car 5 - LV
AddStaticVehicle(561,2564.6199,2279.7666,10.6296,90.2289,54,38); // stratum - in car park in LV
AddStaticVehicle(496,2594.1250,2250.5073,10.5113,0.0002,9,14); // blist compact in some car park in LV MUST BE BLACK!
AddStaticVehicle(579,2849.2966,2405.8838,10.7482,45.6760,0,0); // huntley in a car park
AddStaticVehicle(579,2812.1646,2153.5620,10.7558,322.8751,42,42); // huntley - LV motel carpark
AddStaticVehicle(522,2797.7180,1982.3031,10.3844,219.1276,7,79); // nrg 1 - LV
AddStaticVehicle(482,2548.5464,1965.3258,10.9436,268.0401,51,0); // burrito - 24/7, need to be green
AddStaticVehicle(415,2441.0120,2021.1436,10.5913,270.3995,36,1); // blue cheetah -LV Burgershot
AddStaticVehicle(438,2246.4248,2050.2566,10.8235,89.6079,6,76); // cabbie 1 - LV
AddStaticVehicle(438,2233.0537,2063.3567,10.8246,179.1563,6,76); // cabbie 2 - LV
AddStaticVehicle(437,2309.4622,2041.5762,10.9591,359.6306,125,21); // coach - LV
AddStaticVehicle(431,2274.7795,2039.5979,10.9214,359.1809,47,74); // bus - LV
AddStaticVehicle(420,2217.7175,2045.2756,10.5993,91.1200,6,1); // taxi - LV
AddStaticVehicle(420,2262.5278,2062.3582,10.5997,179.1058,6,1); // taxi 2 - LV
AddStaticVehicle(409,2253.9229,2063.4290,10.6203,180.4309,1,1); // Limo (White) - LV
AddStaticVehicle(409,2217.1052,2055.8406,10.6202,90.2993,0,0); // Limo (black) - LV
AddStaticVehicle(405,2186.1948,1979.0563,10.6953,89.4743,24,1); // Senital - 24/7, LV
AddStaticVehicle(400,2102.9797,2043.0789,10.9156,91.8130,123,1); // Landstalker - sexshop, the strip
AddStaticVehicle(561,2119.7871,1988.3450,10.5178,183.9598,25,78); // stratum - LV, strip
AddStaticVehicle(560,2119.8750,1893.8761,10.4530,181.4063,54,38); // sultan - lv, strip (Change ID)
AddStaticVehicle(415,2154.1223,1880.1294,10.3052,0.0171,7,7); // cheetah - LV, the strip (Change ID)
AddStaticVehicle(411,2051.1248,1725.1252,10.4381,154.6875,17,1); // infurnus - LV, Strip (Change ID)
AddStaticVehicle(522,2074.6252,1484.7529,10.5086,360.0000,10,10); // NRG - LV, The Strip (Chnage ID)
AddStaticVehicle(565,2074.6248,1239.5077,10.2994,0.0001,44,44); // sultan - LV, the strip (Change ID)(Color - green)
AddStaticVehicle(411,2040.1252,1025.1155,10.2736,181.4064,11,11); // infurnus 2  - the strip, LV (Change ID)
AddStaticVehicle(400,1881.2891,963.7085,10.9127,90.5936,75,1); // landstalker - LV, 3 dragons
AddStaticVehicle(560,1707.8702,1448.5154,10.4490,343.8116,37,0); // sultan - LV airport
AddStaticVehicle(519,1328.6161,1583.1250,11.7287,270.0003,1,1); // shamal 1 -Lv airport
AddStaticVehicle(519,1328.6161,1612.2500,11.7295,270.0001,1,1); // shamal 2 - Lv airport
AddPlayerClass(0,1318.6510,1452.0577,11.5580,178.7138,0,0,0,0,0,0); // dodo
AddStaticVehicle(593,1317.3680,1451.6371,11.2694,178.7137,68,8); // dodo 1 - LV airpor
AddStaticVehicle(577,1586.1602,1190.9259,10.7285,179.0974,8,7); // at-400 - LV airport
AddStaticVehicle(482,1594.2983,708.6998,10.9318,90.1977,62,62); // burito - randolf industial estate - LV
AddStaticVehicle(478,-310.9274,801.8962,14.7449,311.2722,66,1); // walton - ammunation, Deser
AddStaticVehicle(422,-246.5878,1082.5012,19.6910,359.3643,111,31); // bobcat - fortcarson
AddStaticVehicle(415,-683.2285,968.6911,11.9051,89.4030,0,0); // FBI cheetah 1 (Black)
AddStaticVehicle(415,-682.9019,963.5331,11.9035,90.1289,0,0); // FBI cheetah 2 (Black)
AddStaticVehicle(490,-698.6848,971.7757,12.4600,87.8571,0,0); // FBI rancher 1
AddStaticVehicle(490,-706.5647,972.0554,12.5672,87.5779,0,0); // FBI rancher 2
AddStaticVehicle(490,-709.2899,940.2869,12.5716,2.1724,0,0); // FBI rancher 3
AddStaticVehicle(490,-712.6976,940.3295,12.4599,0.5399,0,0); // FBI rancher 4
AddStaticVehicle(487,-671.2911,951.0663,12.3133,86.5466,0,0); // FBI heli
AddStaticVehicle(595,-659.2650,873.8683,0.1906,226.4119,0,0); // fbi boat (Launch) - Black!
AddStaticVehicle(489,-1936.8832,2383.4985,49.6252,111.5186,120,123); // rancher- tierraroda
AddStaticVehicle(579,-2642.1011,1377.5728,7.0818,359.4170,10,10); // huntley - Jizzys, SF
AddStaticVehicle(560,-2618.1753,1377.4382,6.8404,180.1948,33,0); // sultan - Jizzys, SF
AddStaticVehicle(487,-2311.4724,1544.4221,20.1942,93.8915,74,35); // Heli - /ship, SF
AddStaticVehicle(411,-2745.1782,1240.5808,11.4949,35.0821,106,1); // infurnus in carpark near jizzys
AddStaticVehicle(400,-2790.5701,791.2994,49.6339,359.9690,113,1); // landstalker Knutts donuts - SF
AddStaticVehicle(416,-2631.3755,595.7599,14.6147,270.0004,1,3); // ambulance - SF
AddStaticVehicle(400,-2543.5752,592.9309,14.5454,269.4218,123,1); // landstalker - SF hospital
AddStaticVehicle(579,-2447.1069,741.4818,34.9436,0.3054,53,53); // huntley - supasave, SF
AddStaticVehicle(496,-2671.5002,267.6319,4.0269,359.9998,53,56); // blista compact - SF clucking bell
AddPlayerClass(0,-2704.5371,199.0499,4.1797,171.8291,0,0,0,0,0,0); //
AddStaticVehicle(560,-2711.1050,198.8480,3.9571,359.5798,52,39); // sultan - wheel arch angles, SF
AddStaticVehicle(541,-2679.5488,-22.5166,3.9611,359.8050,2,1); // bullet - SF car park
AddStaticVehicle(496,-2741.8840,-301.8662,6.7140,49.2203,74,72); // blista - golf car park
AddStaticVehicle(541,-2761.4836,-282.4919,6.6660,359.9553,22,1); // bullet - golf carpark, SF
AddStaticVehicle(541,-2414.3540,-586.9307,132.2735,34.6403,51,1); // bullet - missionary hill, SF
AddStaticVehicle(522,-2403.0671,-584.3907,132.2221,307.6856,8,82); // NRG - Missionary hill, SF
AddStaticVehicle(411,-2396.4976,-594.6413,132.3754,304.0551,123,1); // infurnus - missionary hill
AddStaticVehicle(560,-2397.3774,-611.0022,132.3540,214.1957,33,0); // sultan - missionary hill
AddStaticVehicle(560,-2147.3931,-414.5620,35.0414,128.2695,41,29); // sultan - arena in SF
AddStaticVehicle(541,-2076.7502,-83.9902,34.7738,359.9999,15,15); // bullet - driving school - SF
AddStaticVehicle(558,-1956.2533,297.6267,35.0776,64.6879,30,1); // uranus - wang
AddStaticVehicle(560,-1957.6266,276.9988,35.1685,132.1871,56,29); // sultan - wang
AddStaticVehicle(561,-1950.4948,259.6258,35.2667,53.4234,65,79); // stratum - wang
AddStaticVehicle(562,-1952.4961,265.6266,40.6845,292.5001,101,1); // elegy - wang
AddStaticVehicle(438,-2214.1616,293.6836,35.1227,0.4182,6,76); // cabbie 1 - SF
AddStaticVehicle(438,-2184.4258,306.4559,35.1206,0.6392,6,76); // cabbie 2 - SF
AddStaticVehicle(437,-2233.9514,299.4311,35.2558,270.1666,79,7); // coach - SF
AddStaticVehicle(431,-2160.5623,295.7095,35.2125,0.7125,82,87); // Bus - SF
AddStaticVehicle(420,-2218.4319,305.9666,34.8961,359.6176,6,1); // taxi 1 - SF
AddStaticVehicle(420,-2175.9294,306.1933,34.8969,180.5669,6,1); // Taxi 2 - SF
AddStaticVehicle(409,-2188.3188,292.9858,34.8870,0.0000,1,1); // Limo (White) - SF
AddStaticVehicle(409,-2218.2024,292.4055,34.9979,179.4909,0,0); // Limo (Black) - SF
AddStaticVehicle(405,-2125.3499,658.3972,52.3257,91.2072,0,0); // Senital 1 (Black)
AddStaticVehicle(405,-2125.3354,654.9319,52.2418,90.6386,0,0); // senital 2 (Black)
AddStaticVehicle(411,-2127.5005,920.2646,79.6386,268.9199,75,1); // infurus - whirly, whirly road, SF
AddStaticVehicle(411,-2127.3074,914.5562,79.6491,267.4274,64,1); // infurnus - whirly road, SF
AddStaticVehicle(400,-2191.6272,1033.1211,80.1001,178.3405,113,1); // landstalker - carlton heights, SF
AddStaticVehicle(579,-2409.9880,952.0667,45.2343,359.0939,37,37); // huntley - gas station, SF
AddStaticVehicle(560,-2516.7439,1228.5197,37.1325,31.6735,33,0); // sultan at gant bridge meusium
AddStaticVehicle(597,-1574.3052,726.8416,-5.4753,267.8761,0,1); // police car 1 - SF
AddStaticVehicle(597,-1608.4401,748.3535,-5.4724,179.4438,0,1); // police car 2 - SF
AddStaticVehicle(597,-1625.0110,692.2606,-5.4748,357.7950,0,1); // police car 3 - SF
AddStaticVehicle(523,-1574.0083,706.1157,-5.6694,275.5472,0,0); // Police Bike 1 - SF
AddStaticVehicle(523,-1638.9452,678.2498,-5.6745,88.5799,0,0); // police bike 2 - SF
AddStaticVehicle(497,-1680.9978,704.9985,30.7646,88.5952,74,35); // Police heli - SF (Change ID)
AddStaticVehicle(470,-1521.8784,463.8375,7.1829,269.4948,43,0); // patriot 1 - SF
AddStaticVehicle(470,-1499.0629,462.5676,7.1806,358.2574,43,0); // patriot 2 - SF
AddStaticVehicle(433,-1514.1141,479.0873,7.6194,89.9136,43,0); // barrack - SF
AddStaticVehicle(432,-1527.4803,444.2918,7.2023,1.8286,43,0); // tank 1 - SF
AddStaticVehicle(432,-1536.5175,443.7266,7.2024,2.0351,43,0); // tank 2 - SF
AddStaticVehicle(425,-1414.0251,491.7880,18.8049,269.0918,43,0); // hunter 1 - SF
AddStaticVehicle(425,-1412.3484,516.6924,18.8144,272.0584,43,0); // hunter 2 - SF
AddStaticVehicle(520,-1286.0334,501.5004,18.9577,268.5932,0,0); // Hydra 1 - SF
AddStaticVehicle(548,-1479.6766,470.3821,8.8275,68.4617,1,1); // cargobob - SF, Naval
AddStaticVehicle(520,-1355.4568,510.5609,18.9656,270.0974,0,0); // Hydra 2 - SF
AddStaticVehicle(519,-1588.9587,-206.4389,15.0710,134.5237,1,1); // shamal 1 - SF
AddStaticVehicle(519,-1325.5380,-93.3362,15.0707,46.8229,1,1); // shamal 2 - SF
AddStaticVehicle(400,1632.4324,2037.0950,11.0744,92.2476,101,1); // - landstalker in someones drive
AddStaticVehicle(407,1763.7411,2075.7578,11.0313,178.2993,3,1); // fire engline - LV
AddStaticVehicle(416,1619.9911,1825.5010,11.0148,349.6059,1,3); // ambulance - LV
AddStaticVehicle(579,1473.8765,1899.5640,11.0482,268.5786,62,62); // huntley in someones drive :
AddStaticVehicle(593,-1350.0067,32.4625,14.6041,135.1850,13,8); // dodo - SF
AddStaticVehicle(487,-1226.2732,-13.6718,14.3251,37.3579,54,29); // maverick - SF
AddStaticVehicle(407,-2052.3765,92.6426,28.6195,86.3592,3,1); // fire engline - SF
AddStaticVehicle(447,-2463.4890,519.7494,51.0637,264.7264,75,2); // SWAT heli
AddStaticVehicle(428,-2442.6221,522.9964,30.0453,0.0001,0,0); // prison van (BLACK)
AddStaticVehicle(427,-2404.8518,537.6627,30.0639,173.8659,0,1); // SWAT van 1 - SF
AddStaticVehicle(427,-2408.1963,526.0000,30.0605,156.2149,0,1); // SWAT van 2
AddStaticVehicle(415,-2429.8010,515.7679,29.7006,217.4130,0,0); // SWAT Cheetah 1 (Black)
AddStaticVehicle(415,-2419.6152,525.3231,29.7030,230.7387,0,0); // SWAT Cheetah 2
AddStaticVehicle(601,-2422.8955,521.8615,29.6885,227.7913,0,0); // SWAT Truck
AddStaticVehicle(579,-2359.2627,-2188.5432,33.5419,292.8197,42,42); // huntley at bottom of chilliad
AddStaticVehicle(487,-2387.9224,-2174.5447,33.4649,266.5702,26,14); // maverick - chilliad
AddStaticVehicle(560,-2310.3611,-1657.6423,483.3886,208.6462,9,39); // sultan 1 - chilliad
AddStaticVehicle(560,-2306.6086,-1656.0282,483.3855,199.1098,21,1); // sultan 2 - chilliad
AddStaticVehicle(579,-2319.4792,-1681.6129,482.2312,289.2773,10,10); // hunley - chilliad top
AddStaticVehicle(579,337.1289,-1809.2390,4.4308,181.4504,42,42); // hunteley - vorona besch
AddStaticVehicle(561,441.8597,-1300.6011,14.9904,214.5628,54,38); // startum - LS
AddStaticVehicle(541,712.0106,-1218.3933,17.3980,311.2954,13,8); // bullet - LS park
AddStaticVehicle(536,1130.7500,-1152.4766,23.3939,270.1237,9,1); // blade - LS
AddStaticVehicle(517,1229.1340,-914.0833,42.8452,190.9498,37,36); // majestic  - LS burgershot
AddStaticVehicle(489,1324.2910,-1167.5421,23.9737,0.0080,120,123); // rancher - LS
AddStaticVehicle(451,1184.2997,-1314.0342,13.2760,0.7999,61,61); // turismo - LS Hopital
AddStaticVehicle(416,1178.0358,-1338.1080,14.0361,268.1768,1,3); // LS ambulance 1
AddStaticVehicle(415,1251.4636,-2060.6467,59.5321,268.7040,40,1); // cheetah - verdent meddowes
AddStaticVehicle(567,2509.8369,-1687.2863,13.4293,49.4653,86,0); // TEB savanna (Green)
AddStaticVehicle(536,2499.0869,-1654.4730,13.1654,256.7444,86,0); // TEB blade (Green)
AddStaticVehicle(482,2482.4133,-1653.8638,13.5011,269.0499,0,0); // burrito one - TEB - Black
AddStaticVehicle(482,2473.0894,-1692.5192,13.6349,0.4335,0,0); // burrito 2 - TEB - Black
AddStaticVehicle(517,2347.9346,-1403.8685,23.7554,358.4718,47,41); // balla majestic
AddStaticVehicle(482,2229.1006,-1170.3495,25.8640,269.7230,48,48); // burrito motel
AddStaticVehicle(422,2205.6572,-1172.9685,25.7069,90.0356,113,36); // bobcat motel in LS
AddStaticVehicle(413,2008.6992,-1130.6593,25.2542,87.8240,0,0); // RHB BURRITO BLACK
AddStaticVehicle(567,2003.3628,-1120.9415,26.5696,179.3776,85,0); // RHB Savana (Purple)
AddStaticVehicle(536,1998.6558,-1120.9739,26.4647,179.6047,85,0); // RHB Blade (Purple)
AddStaticVehicle(517,1991.3749,-1130.6080,25.4973,90.8022,85,85); // majestic RHB (Purple)
AddStaticVehicle(517,1709.0410,-1069.5764,23.7609,0.8242,55,84); // majestic 1
AddStaticVehicle(505,1658.4940,-1046.9701,24.0417,0.2487,13,118); // rancher in car park :P
AddStaticVehicle(438,1668.8737,-1705.1484,15.6129,86.5497,6,76); // cabbie 1 - LS
AddStaticVehicle(438,1668.1479,-1718.4474,15.6128,271.8384,6,76); // cabbie 2 - LS
AddStaticVehicle(437,1626.5427,-1709.2523,13.4960,2.1709,123,20); // coach - LS
AddStaticVehicle(431,1631.4358,-1668.0475,13.6066,2.0870,59,83); // bus - LS
AddStaticVehicle(420,1667.9685,-1714.4896,15.3872,270.8491,6,1); // taxi 1 - LS
AddStaticVehicle(420,1645.7645,-1706.0271,15.3892,358.3986,6,1); // Taxi 2 - LS
AddStaticVehicle(409,1648.7700,-1720.6760,20.2789,268.6776,1,1); // Llimo (White) - LS
AddStaticVehicle(409,1670.9596,-1715.5701,20.2809,177.0564,0,0); // Limo (Black) - LS
AddStaticVehicle(596,1601.5203,-1699.9248,5.6122,268.6337,0,1); // policecar 1 - LS
AddStaticVehicle(596,1545.6279,-1684.1250,5.7273,270.0000,15,15); // policecar 2 - LS (Change ID)
AddStaticVehicle(596,1534.5682,-1644.2509,5.6109,359.7188,0,1); // policecar 3 - LS
AddStaticVehicle(523,1591.8181,-1711.6370,5.4541,182.3560,0,0); // policebike 1 - LS
AddStaticVehicle(523,1545.4655,-1672.4031,5.4641,90.8169,0,0); // policebike 2 - LS
AddStaticVehicle(517,1555.9685,-1839.4041,13.4017,269.2543,43,41); // majestic - ally, Verdent Bluffs
AddStaticVehicle(482,1838.1147,-1871.1224,13.5074,179.0620,64,64); // burrito - LV, 24.7
AddStaticVehicle(422,1987.1454,-2059.2117,13.3596,89.7744,113,36); // bobcat - Willowfield, LS
AddStaticVehicle(400,1747.4148,-2095.5366,13.6410,180.0652,75,1); // landstalker - el corrona, LSs
AddStaticVehicle(593,1926.2417,-2289.6250,13.9970,270.0001,60,1); // Dodo - LS airport
AddStaticVehicle(519,1563.8750,-2454.8833,14.4543,0.0001,1,1); // shamal - LS airport
AddStaticVehicle(548,2791.9106,-2550.2458,15.2719,332.7081,1,1); // cargo bob - docks, LS
AddStaticVehicle(433,2729.7461,-2392.5740,14.0694,89.8671,43,0); // Barrack - docks, LS
AddStaticVehicle(470,2778.0066,-2475.0479,13.6288,88.6406,43,0); // patriot 1 - Docks, LS
AddStaticVehicle(470,2737.3376,-2469.7336,13.6419,179.7315,43,0); // patriot 2 - docks, LS
AddStaticVehicle(400,2453.8037,-1995.1914,13.6410,178.8622,101,1); // landstalker near loco - LS
AddStaticVehicle(567,2684.4736,-2017.2191,13.4180,359.7238,114,1); // savvana - LS, Loco
AddStaticVehicle(400,2861.6519,-1982.6697,11.0261,0.0000,4,1); // landstalker - LS beach
AddStaticVehicle(595,2722.8042,-2312.7295,0.0332,93.7527,114,114); // launch - Docks, LS
AddStaticVehicle(579,2656.9561,-1712.0703,9.2476,89.3999,53,53); // huntley - Arena, LS
AddStaticVehicle(560,2831.4548,-1689.6678,9.6974,255.9218,41,29); // sultan - arena, LS
AddStaticVehicle(422,2425.3298,-1223.4681,25.2878,356.7507,111,31); // bobcat - Pigpen, LS
AddStaticVehicle(505,2515.5437,72.6570,27.1793,273.3632,112,120); // Rancher - Drive, palamino creek
AddStaticVehicle(505,2358.5503,-60.7079,27.6121,0.6588,76,102); // rancher 2 - palamino creek
AddStaticVehicle(489,668.3278,-546.3085,16.4787,89.5766,120,123); // rancher - dillimore
AddStaticVehicle(599,620.1647,-601.5580,17.4270,271.3293,0,1); // policerancher 1 - dillimore
AddStaticVehicle(599,620.2764,-596.9765,17.4157,270.1678,0,1); // policerancher 2 - Dillimore


        AddStaticPickup(371, 15, 1710.3359,1614.3585,10.1191); //para
        AddStaticPickup(371, 15, 1964.4523,1917.0341,130.9375); //para
        AddStaticPickup(371, 15, 2055.7258,2395.8589,150.4766); //para
        AddStaticPickup(371, 15, 2265.0120,1672.3837,94.9219); //para
        AddStaticPickup(371, 15, 2265.9739,1623.4060,94.9219); //para

//-------------------- imported from other script
	AddStaticPickup(371,2,-2237.9072,-1714.4236,480.8666);
	AddStaticPickup(371,2,-2237.2249,-1718.2372,480.8695);
	AddStaticPickup(370,2,-2236.5938,-1722.0498,480.8653);
	AddStaticPickup(370,2,-2236.2734,-1725.8751,480.8505);
	AddStaticPickup(371,2,-2239.7021,-1748.0225,480.8696);

   	AddStaticPickup(1242,2,-2082.9619,-2339.0798,30.6250);
   	AddStaticPickup(1242,2,-2291.7400,-1589.7646,479.3270);
   	AddStaticPickup(1242,2,-1389.8468,-360.2007,6.0000);
   	AddStaticPickup(1242,2,-2625.2793,-191.1426,7.2031);
   	AddStaticPickup(1242,2,-2284.9148,-24.1857,35.3125);
   	AddStaticPickup(1242,2,-1864.6273,111.4731,15.1172);
   	AddStaticPickup(1242,2,-2512.9956,761.0992,35.1719);
   	AddStaticPickup(1242,2,-2919.9424,980.5508,5.9741);
   	AddStaticPickup(1242,2,-1495.4761,1278.3402,7.1797);
//--------------------- end import
        // Put this timer somewhere in your OnGameModeInit

        SetTimer("AdminArea",3000,1);
        SetTimer("MoneyGrubScoreUpdate", 1000, 1);
        SetTimer("checkpointUpdate", 1100, 1);
        SetTimer("PirateShipScoreUpdate", 2001, 1);
        SetTimer("PropertyScoreUpdate", 40005, 1);
        SetTimer("JobMoney", 40005, 1);
        //SetTimer("SavePosTimer", 40005, 1);
        //SetTimer("GambleUpdate", 5013, 1);
        SetTimer("SavedUpdate",60017, 1);
        SetTimer("TimeUpdate",60009, 1);

        //SetTimer("GameModeExitFunc", gRoundTime, 0);
        SetTimer("SendTextTimer", 150000, 1);
        SetTimer("SavePosTimer", 150000, 1);

        return 1;
}

public SendPlayerFormattedText(playerid, const str[], define)
{
        new tmpbuf[256];
        format(tmpbuf, sizeof(tmpbuf), str, define);
        SendClientMessage(playerid, 0xFFFF00AA, tmpbuf);
}

public SendAllFormattedText(playerid, const str[], define)
{
        new tmpbuf[256];
        format(tmpbuf, sizeof(tmpbuf), str, define);
        SendClientMessageToAll(0xFFFF00AA, tmpbuf);
}


isStringSame(const string1[], const string2[], len) {
        for(new i = 0; i < len; i++) {
            if(string1[i]!=string2[i])
                return 0;
                if(string1[i] == 0 || string1[i] == '\n')
                    return 1;
        }
        return 1;
}

//Taken from SPARKs PTPM.

PlayerLogin(playerid,username[],password[])
{

        if (strlen(password)==0)
            return;


        new l=strlen(username);

        if (l==0) return;

        for (new i=0 ; i<l ; i++)
                if (username[i]=='.' || username[i]=='/') return;

        new filename[256];

        format(filename,sizeof filename,"userdb/%s.pwd",username);

        new File:passwordfile = fopen(filename, io_read);
        if (!passwordfile) {
                SendClientMessage(playerid,COLOUR_PERSONAL,"Access denied.");
                return;
        }

        new line[256];
        fread(passwordfile, line);
        fclose(passwordfile);


        if (!streq(line,password)) {
                SendClientMessage(playerid,COLOUR_PERSONAL,"Access denied.");
                return;
        }

        new text[256];
        GetPlayerName(playerid,text,sizeof text);
        printf("Player %s id %d opped up using account %s\n",text,playerid,username);
        format (text,sizeof text,"%s is now a serveradministrator. Respect him!",text);
        SendClientMessageToAll(COLOUR_GLOBAL,text);

        player_op[playerid] = 1;
}
streq(str1[],str2[])
{
        if (strlen(str1)!=strlen(str2)) return 0;

        return strcmp(str1,str2,true)==0;
}

public PutAtPos(playerid) {
  if (dUserINT(PlayerName(playerid)).("x")!=0) {
      //SystemMsg(playerid,"");
      SetPlayerPos(playerid,
                   float(dUserINT(PlayerName(playerid)).("x")),
                   float(dUserINT(PlayerName(playerid)).("y")),
                   float(dUserINT(PlayerName(playerid)).("z")));
  }
}
SendMessageToAdmins(const str[])
{
        for (new i = 0; i < MAX_PLAYERS; i++)
        {
            if (IsPlayerConnected(i)) {
                if (IsPlayerAdmin(i) || player_op[i]) {
                    SendClientMessage(i, 0xFF9900AA, str);
                }
            }
        }
}

SendMessage(playerid, const str[])
{
        SendClientMessage(playerid, 0xFF9900AA, str);
}

/*public AdminArea(playerid)
{
    new i, Float:X, Float:Y, Float:Z;
    //new Float:phealth;

    for (i = 0; i < MAX_PLAYERS; i++)
    {
        GetPlayerPos(i, X, Y, Z);
        if(X >= 1305.7489 && X <= 1372.4907 && Y >= -666.4764&& Y <= -602.6023) //REPLACE XMIN,XMAX,YMIN,YMAX by your coordinates
        //if((X >= 388.6190 && X <= -7.9993 && Y >= 2147.0618 && Y <= 1655.8849)) //REPLACE XMIN,XMAX,YMIN,YMAX by your coordinates
        //388.6190, -7.9993, 2147.0618, 1655.8849 A51
        {
            if (!IsPlayerAdmin(i) || player_op[i] == 0)
            {
                GameTextForPlayer(i,"~r~You're not allowed in the Admin Area! Please login as Admin to access this area.",5000,5);
                //GetPlayerHealth(i, phealth);
                SetPlayerHealth(i, 0);
            }
        }
    }
}
*/

public AdminArea(playerid)
{
        new i, j, Float:X, Float:Y, Float:Z;
        for (i = 0, j = MAX_PLAYERS; i < j; i++) {
        GetPlayerPos(playerid, X, Y, Z);
        if(X >= -764.5396 && X <= -632.9658 && Y >= 802.6583 && Y <= 1015.8968) { //Replace with your own x/y min/max coords
                if (IsPlayerAdmin(playerid)/*|| Level[playerid] == Admin*/) {
                    //nothing :D
                } else {
                        SetTimer("AdminAreaAbuse", 1000, 0);
                        GameTextForPlayer(playerid,"~r~You are not allowed to go to the admin Area!",5000,5);
                        SendClientMessage(playerid, COLOR_RED, "Please login as Admin to access this area!");
                       SetPlayerHealth(playerid, -99999999.99);
                }
        }}
}

public AdminAreaAbuse(playerid)
{
                new string[256];
                new name[256];
            GetPlayerName(playerid, name, MAX_PLAYER_NAME);
            format(string, sizeof(string), "[WARNING]: %s tried to enter the admin area. Autokilled!", name);
                SendClientMessageToAll(COLOR_RED, string);
                KillTimer(AdminAreaAbuse(playerid));
}