load data " not always working " ??
#1

hi all.

im a beginner and i can't understand why this happen...

the problem is :
i connect to my server , run away , disconnect , reconnect = back to last position i was
BUT if i restart the server it wont load my last pos anymore.
it still load money weapons and ammo

take a look at my code and tell me if you see where is the problem , please

Код:
#include <a_samp>
#include <YSI\y_ini>
#include <YSI\y_commands>
#include <fdialog>
#include <sscanf>
#include <inventory>


#define FDLG_NO_DISABLE_CALLBACK

#pragma tabsize 0
#define UserPath "Users/%s.ini"
native WP_Hash(buffer[],len,const str[]);

new dead[MAX_PLAYERS];
new deathskinID;


new NeedsMechanic[MAX_PLAYERS];
new Float:GetLocX, Float:GetLocY, Float:GetLocZ;
new WhoNeedsAMechanic;
new SomeOneNeedsAMechanic;



new Float:posx, Float:posy, Float:posz;
new Float:angle;



new setmissiontimer;
new boxtruck;
new playercheckpoint = 0;
new Float:loads[10][3] = {

    { 2155.1038, -2290.3298, 13.5707 },
    { 2389.9509, -2015.5701, 13.7227 },
    { 2484.8582, -2115.1455, 13.7204 },
    { 1641.7356, 1070.9087, 10.4453 },
    { 2736.1550, -1998.9930, 13.6260 },
    { 1985.9636, -1989.8496, 13.7203 },
    { 1617.3865, -1891.7042, 13.7210 },
    { 1391.9001, -1898.0645, 13.6743 },
    { 1007.8582, -1364.8033, 13.5093 },
    { 438.5351, -1294.6078, 15.3496 }
};
new Float:drops[11][3] = {

    { 2057.6660, -1636.6082, 13.7196 },
    { 2058.7354, -1694.6821, 13.7267 },
    { 2012.4716, -1737.4246, 13.7219 },
    { 1972.2361, -1727.4102, 16.1418 },
    { 1971.5975, -1658.7869, 16.1423 },
    { 1910.6210, -1117.4026, 25.9279 },
    { 2105.7471, -1242.6188, 25.1883 },
    { 2242.2573, -1237.5234, 25.1093 },
    { 2255.7549, -1280.7203, 25.4562 },
    { 2191.8838, -1465.7257, 25.7146 },
    { 2149.5251, -1454.4329, 25.4250 }
};




enum PlayerInfo
{
    Pass[129],
    Adminlevel,
    VIPlevel,
    Money,
    Scores,
    Kills,
    Deaths,
    Job,
	JobLVL
}
new pInfo[MAX_PLAYERS][PlayerInfo];


enum WeaponInfo
{
	Weapon1,
	Weapon1a,
	Weapon2,
	Weapon2a,
	Weapon3,
	Weapon3a,
	Weapon4,
	Weapon4a,
	Weapon5,
	Weapon5a,
	Weapon6,
	Weapon6a,
	Weapon7,
	Weapon7a,
	Weapon8,
	Weapon8a,
	Weapon9,
	Weapon9a,
	Weapon10,
	Weapon10a,
	Weapon11,
	Weapon11a,
	Weapon12,
	Weapon12a
}
new wInfo[MAX_PLAYERS][WeaponInfo];



#define jobless        0
#define mechanic       1
#define taxi           2
#define police         3
#define mineworker     4
#define farmer         5
#define fisher         6
#define fireman        7
#define trucker        8
#define deliveryman    9
#define drugdealer     10
#define fbi            11
#define pizzaboy       12
#define soldier        13
#define hooker         14
#define hitman         15



#define jobless_skin        230
#define mechanic_skin       50
#define taxi_skin           255
#define police_skin         280
#define mineworker_skin     27
#define farmer_skin         161
#define fisher_skin         122
#define fireman_skin        279
#define trucker_skin        202
#define deliveryman_skin    170
#define drugdealer_skin     29
#define fbi_skin            286
#define pizzaboy_skin       155
#define soldier_skin        287
#define hooker_skin         152
#define hitman_skin         127


#define jobless_color        0xAFAFAFAA
#define mechanic_color       0xFFFF00AA
#define taxi_color           0xFFFFFFAA
#define police_color         0x33CCFFAA
#define mineworker_color     0x63AFF00A
#define farmer_color         0x12900BBF
#define fisher_color         0x993300AA
#define fireman_color        0x99FFFFAA
#define trucker_color        0xCCFFDD56
#define deliveryman_color    0x9955DEEE
#define drugdealer_color     0x00EEADDF
#define fbi_color            0xFF0000AA
#define pizzaboy_color       0xDDDD2357
#define soldier_color        0x99FF00AA
#define hooker_color         0xFF66FFAA
#define hitman_color         0x800080AA


#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_RED 0xAA3333AA
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_PINK 0xFF66FFAA
#define COLOR_BLUE 0x0000BBAA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_DARKRED 0x660000AA
#define COLOR_ORANGE 0xFF9900AA
#define COLOR_BRIGHTRED 0xFF0000AA
#define COLOR_INDIGO 0x4B00B0AA
#define COLOR_VIOLET 0x9955DEEE
#define COLOR_LIGHTRED 0xFF99AADD
#define COLOR_SEAGREEN 0x00EEADDF
#define COLOR_GRAYWHITE 0xEEEEFFC4
#define COLOR_LIGHTNEUTRALBLUE 0xabcdef66
#define COLOR_GREENISHGOLD 0xCCFFDD56
#define COLOR_LIGHTBLUEGREEN 0x0FFDD349
#define COLOR_NEUTRALBLUE 0xABCDEF01
#define COLOR_LIGHTCYAN 0xAAFFCC33
#define COLOR_LEMON 0xDDDD2357
#define COLOR_MEDIUMBLUE 0x63AFF00A
#define COLOR_NEUTRAL 0xABCDEF97
#define COLOR_BLACK 0x00000000
#define COLOR_NEUTRALGREEN 0x81CFAB00
#define COLOR_DARKGREEN 0x12900BBF
#define COLOR_LIGHTGREEN 0x24FF0AB9
#define COLOR_DARKBLUE 0x300FFAAB
#define COLOR_BLUEGREEN 0x46BBAA00
#define COLOR_PINK 0xFF66FFAA
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_DARKRED 0x660000AA
#define COLOR_ORANGE 0xFF9900AA
#define COLOR_PURPLE 0x800080AA
#define COLOR_GRAD1 0xB4B5B7FF
#define COLOR_GRAD2 0xBFC0C2FF
#define COLOR_RED1 0xFF0000AA
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_RED 0xAA3333AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_BROWN 0x993300AA
#define COLOR_CYAN 0x99FFFFAA
#define COLOR_TAN 0xFFFFCCAA
#define COLOR_PINK 0xFF66FFAA
#define COLOR_KHAKI 0x999900AA
#define COLOR_LIME 0x99FF00AA
#define COLOR_SYSTEM 0xEFEFF7AA
#define COLOR_GRAD2 0xBFC0C2FF
#define COLOR_GRAD4 0xD8D8D8FF
#define COLOR_GRAD6 0xF0F0F0FF
#define COLOR_GRAD2 0xBFC0C2FF
#define COLOR_GRAD3 0xCBCCCEFF
#define COLOR_GRAD5 0xE3E3E3FF
#define COLOR_GRAD1 0xB4B5B7FF





main()
{
	print("\n----------------------------------");
	print(" My Virtual Life by Carnage");
	print("----------------------------------\n");
}


public OnGameModeInit()
{
	SetGameModeText(" My Virtual Life");
	AddPlayerClass(135,1648.2819,-2287.9338,-1.2065,271.2087,0,0,0,0,0,0);
	setmissiontimer = SetTimer("setplayerdeliverymission", 1800000, 1);
	
	//ManualVehicleEngineAndLights();
    UsePlayerPedAnims();
    DisableInteriorEnterExits();
    ShowPlayerMarkers(0);
	
	
	
	//bank
	CreateObject(13007, 601.20837, -1273.01379, 1036.47498,   0.00000, 0.00000, 22.06300);
	CreateObject(9, 602.82184, -1273.88965, 1035.77576,   98.00000, 0.00000, 0.00000);
	CreateObject(18981, 595.52753, -1265.97095, 1035.95886,   0.00000, 0.00000, 291.99405);
	CreateObject(18981, 610.34747, -1268.10828, 1035.95886,   0.00000, 0.00000, 201.99240);
	CreateObject(2873, 590.09583, -1268.66382, 1035.85645,   0.00000, 0.00000, 22.24190);
	CreateObject(2873, 591.62732, -1268.07861, 1035.85645,   0.00000, 0.00000, 22.24190);

    // mairie
    CreateObject(14602, 1477.11108, -1776.49084, 1000.32800,   360.06241, 0.00000, 94.15910);
	CreateObject(1522, 391.20313, 173.03125, 1007.36719,   3.14159, 0.00000, 1.57080);
	CreateObject(2904, 1491.35669, -1779.52100, 996.12988,   0.00000, 0.00000, 273.35049);
	CreateObject(2904, 1491.41199, -1780.39819, 996.12988,   0.00000, 0.00000, 273.35049);
	CreateObject(2904, 1492.63013, -1779.41162, 996.12988,   0.00000, 0.00000, 273.35049);
	CreateObject(2904, 1491.39551, -1779.66064, 998.09827,   0.00000, 0.00000, 273.35049);
	CreateObject(2904, 1491.42957, -1780.36401, 998.21094,   0.00000, 0.00000, 273.35049);
	CreateObject(1506, 1461.96240, -1786.82166, 994.97424,   0.00000, 0.00000, 273.73764);
	CreateObject(1212, 1481.03540, -1794.27563, 995.68640,   0.00000, 0.00000, 193.10721);
	CreateObject(1212, 1481.02344, -1794.13635, 995.68640,   0.00000, 0.00000, 193.10721);
	CreateObject(955, 1484.21216, -1783.02417, 995.35809,   0.00000, 0.00000, 273.65170);
	CreateObject(2186, 1483.63647, -1798.59741, 994.95331,   0.00000, 0.00000, 183.51447);
	CreateObject(2190, 1480.03772, -1792.40747, 995.67291,   0.00000, 0.00000, 329.51569);


    //jobhouse
    CreateObject(14530, 913.73425, -1000.79987, 1000.15430,   360.00000, 0.00000, 360.00000);
    CreateObject(1493, 914.84802, -988.82257, 998.46051,   0.00000, 0.00000, 0.00000);
	CreateObject(1493, 915.73590, -988.80908, 999.51367,   0.00000, 0.00000, 0.00000);
	CreateObject(1493, 912.05981, -1005.74896, 998.36517,   0.00000, 0.00000, 0.00000);
	CreateObject(11334, 908.55438, -1001.99268, 999.15363,   0.00000, 0.00000, 270.13718);
	CreateObject(1998, 920.79358, -1004.84924, 998.38202,   0.00000, 0.00000, 90.05277);
	
	
	AddStaticVehicle(420,1672.8082,-2312.2703,-2.6718,270.7440,6,1); // public service
	AddStaticVehicle(420,1655.4961,-2311.9312,-2.6764,268.8695,6,1); // public service
	AddStaticVehicle(420,1646.4023,-2311.7380,-2.6896,268.9787,6,1); // public service
	AddStaticVehicle(420,1673.1578,-2261.2151,-2.7480,89.3488,6,1); // public service
	AddStaticVehicle(420,1656.8508,-2260.8376,-2.7219,89.7332,6,1); // public service
	AddStaticVehicle(420,1648.3184,-2261.0842,-2.7156,89.3340,6,1); // public service
	AddStaticVehicle(438,1098.2144,-1772.3580,13.3337,90.0917,6,1); // public service
	AddStaticVehicle(438,1098.3529,-1766.4839,13.3500,89.1344,6,1); // public service
	AddStaticVehicle(438,1098.2788,-1760.8821,13.3370,88.4151,6,1); // public service
	AddStaticVehicle(438,1098.5709,-1754.8893,13.3402,91.0300,6,1); // public service
	AddStaticVehicle(409,1081.3315,-1769.7308,13.2213,90.7347,1,1); // public service
	AddStaticVehicle(409,1081.2714,-1775.5494,13.2094,89.3735,1,1); // public service
	AddStaticVehicle(409,1081.1205,-1763.8744,13.2349,89.6532,1,1); // public service
	AddStaticVehicle(409,1081.2311,-1757.8512,13.2478,91.1208,1,1); // public service
	AddStaticVehicle(420,1062.2610,-1772.5785,13.3606,270.5717,6,76); // public service
	AddStaticVehicle(420,1062.3411,-1766.7850,13.3838,269.5175,6,76); // public service
	AddStaticVehicle(420,1062.3833,-1760.7294,13.4078,270.3735,6,76); // public service
	AddStaticVehicle(420,1062.2695,-1754.9147,13.4367,270.7573,6,76); // public service
	AddStaticVehicle(420,1062.5275,-1748.9949,13.4534,268.9571,6,76); // public service
	AddStaticVehicle(420,1062.0284,-1743.1365,13.4675,269.0803,6,76); // public service
	AddStaticVehicle(596,1526.4349,-1644.5522,5.6123,359.6361,0,1); // LSPD
	AddStaticVehicle(596,1530.4495,-1644.2931,5.6103,0.1722,0,1); // LSPD
	AddStaticVehicle(596,1534.6753,-1644.6266,5.6120,0.2711,0,1); // LSPD
	AddStaticVehicle(596,1538.7284,-1644.6705,5.6110,359.4716,0,1); // LSPD
	AddStaticVehicle(596,1545.2334,-1651.0472,5.6108,90.1454,0,1); // LSPD
	AddStaticVehicle(596,1544.9452,-1655.1099,5.6112,89.0140,0,1); // LSPD
	AddStaticVehicle(596,1544.8601,-1659.0345,5.6108,89.7770,0,1); // LSPD
	AddStaticVehicle(416,1177.7241,-1338.9841,14.5632,271.0410,1,3); //
	AddStaticVehicle(416,1177.5291,-1308.3597,14.5215,269.4391,1,3); //
	AddStaticVehicle(416,1183.1855,-1315.3824,14.2254,180.5791,1,3); //
	AddStaticVehicle(416,1182.9148,-1332.3381,14.2339,359.8133,1,3); //
	AddStaticVehicle(416,1147.0635,-1311.2725,14.3262,22.3073,1,3); //
	AddStaticVehicle(416,1147.3556,-1302.8877,14.3232,20.9430,1,3); //
	AddStaticVehicle(416,1147.5508,-1294.8168,14.3114,24.8223,1,3); //
	AddStaticVehicle(596,1535.8169,-1678.6388,13.2474,359.5273,0,1); //
	AddStaticVehicle(596,1535.7959,-1672.3774,13.2477,0.2931,0,1); //
	AddStaticVehicle(523,1535.9844,-1668.0298,12.9342,92.3142,0,0); //
	AddStaticVehicle(523,1535.9778,-1666.4882,12.9361,95.7091,0,0); //
	AddStaticVehicle(523,1536.1499,-1664.9197,12.9333,92.0067,0,0); //
	AddStaticVehicle(599,1546.2585,-1605.1112,13.4782,268.4388,0,1); //
	AddStaticVehicle(599,1545.6078,-1609.8575,13.4863,270.1936,0,1); //
	AddStaticVehicle(599,1545.8613,-1614.4500,13.4942,268.8693,0,1); //
	AddStaticVehicle(596,1585.3055,-1671.4384,5.7546,271.4629,0,1); //
	AddStaticVehicle(596,1585.1298,-1667.6371,5.7665,270.9059,0,1); //
	AddStaticVehicle(523,1598.7526,-1680.0782,5.4463,11.6692,0,0); //
	AddStaticVehicle(523,1600.8385,-1680.0481,5.4448,4.4698,0,0); //
	AddStaticVehicle(523,1604.6118,-1680.1263,5.4441,357.6356,0,0); //
	AddStaticVehicle(523,1602.7939,-1680.1570,5.4475,9.2586,0,0); //
	AddStaticVehicle(596,1544.9762,-1663.2732,5.7536,91.3043,0,1); //
	AddStaticVehicle(596,1544.9821,-1668.0310,5.7559,88.6101,0,1); //
	AddStaticVehicle(596,1545.2639,-1671.9628,5.7559,91.8751,0,1); //
	AddStaticVehicle(596,1545.1987,-1676.2474,5.7530,90.0537,0,1); //
	AddStaticVehicle(596,1544.9999,-1680.3530,5.7530,91.0737,0,1); //
	AddStaticVehicle(596,1545.0275,-1684.3818,5.7567,90.0841,0,1); //
	AddStaticVehicle(427,1587.3291,-1710.4536,6.0226,359.0903,0,1); //
	AddStaticVehicle(427,1591.8236,-1710.4869,6.0225,359.7759,0,1); //
	AddStaticVehicle(427,1595.4144,-1710.3766,6.0226,359.6438,0,1); //
	AddStaticVehicle(427,1583.2977,-1710.5935,6.0225,0.5235,0,1); //
	AddStaticVehicle(528,1578.6029,-1711.3419,5.9352,0.8549,0,0); //
	AddStaticVehicle(528,1574.4458,-1711.1163,5.9355,0.3954,0,0); //
	AddStaticVehicle(528,1570.5953,-1711.7333,5.9341,2.0271,0,0); //
	AddStaticVehicle(601,1558.9027,-1710.9323,5.6494,358.5751,1,1); //
    AddStaticVehicle(490,-2426.1167,518.5465,30.0996,221.7304,0,0); //
	AddStaticVehicle(490,-2430.0183,515.2512,30.0851,219.0582,0,0); //
	AddStaticVehicle(490,-2422.5618,521.9503,30.1192,224.6859,0,0); //
	AddStaticVehicle(490,-2419.5437,525.4987,30.0941,231.2543,0,0); //
	AddStaticVehicle(490,-2417.3589,528.9186,30.1049,239.8169,0,0); //
	AddStaticVehicle(490,-2415.8279,532.4188,30.1049,245.1193,0,0); //
	AddStaticVehicle(490,-2414.5645,536.0826,30.1071,258.8416,0,0); //
	AddStaticVehicle(490,-2414.3057,539.7922,30.0944,268.4468,0,0); //
	AddStaticVehicle(599,1601.9857,-1688.0863,5.9860,90.2888,0,1); //
	AddStaticVehicle(599,1601.9268,-1683.8192,5.9887,90.3286,0,1); //
	AddStaticVehicle(599,1601.9500,-1691.6957,5.9860,89.2399,0,1); //
	AddStaticVehicle(599,1602.0854,-1695.9666,5.9860,90.6373,0,1); //
	AddStaticVehicle(599,1601.9203,-1700.3416,5.9861,90.3301,0,1); //
	AddStaticVehicle(599,1602.0798,-1704.1113,5.9861,88.6788,0,1); //
	AddStaticVehicle(428,1528.7690,-1688.1602,6.0167,271.5935,4,75); //
	AddStaticVehicle(428,610.2052,-1265.6277,17.3541,168.6867,4,75); //
	AddStaticVehicle(428,610.2831,-1277.1282,16.5926,191.6963,4,75); //
	AddStaticVehicle(428,1528.6978,-1684.1115,6.0146,271.8097,4,75); //
	AddStaticVehicle(525,-2052.5952,145.1329,28.5728,179.9640,44,51); //
	AddStaticVehicle(525,-2033.1168,178.7365,28.5760,271.2627,44,51); //
	AddStaticVehicle(525,-2033.4717,170.3611,28.5728,269.5365,44,51); //
	AddStaticVehicle(525,-2037.2981,132.2831,28.5728,271.9069,44,51); //
	AddStaticVehicle(525,-2047.6234,123.7584,28.6093,187.6608,44,51); //
	AddStaticVehicle(525,-2029.1941,125.5350,28.8040,358.4366,44,51); //
	AddStaticVehicle(525,-2024.8368,125.2274,28.8235,4.3969,44,51); //
	AddStaticVehicle(481,1672.6382,-2299.1372,-1.6864,4.0871,12,9); //
	AddStaticVehicle(481,1674.9366,-2298.9041,-1.6796,7.3044,65,9); //
	AddStaticVehicle(481,1677.4769,-2298.8433,-1.6774,7.2431,6,6); //
	AddStaticVehicle(481,1669.9528,-2299.0474,-1.6921,2.0742,6,6); //
	AddStaticVehicle(509,1669.0955,-2274.1182,-1.7403,187.9336,16,1); //
	AddStaticVehicle(509,1672.2711,-2274.0771,-1.7370,182.5770,16,1); //
	AddStaticVehicle(509,1675.2837,-2274.0730,-1.7345,183.3168,16,1); //
	AddStaticVehicle(509,1677.2905,-2274.2354,-1.7290,183.9580,16,1); //
	AddStaticVehicle(415,599.5848,-1297.0853,14.3326,190.7426,62,1); //
	AddStaticVehicle(496,595.4615,-1297.7607,14.5225,192.1966,9,14); //
	AddStaticVehicle(533,591.8151,-1298.9362,14.6516,192.7188,79,1); //
	AddStaticVehicle(555,567.2856,-1259.2977,16.7454,199.2867,2,1); //
	AddStaticVehicle(541,579.8582,-1255.9110,17.5229,193.1050,60,1); //
	AddStaticVehicle(562,576.3359,-1256.7198,17.1982,191.2856,113,1); //
	AddStaticVehicle(481,601.0984,-1207.1006,17.9005,238.9070,12,9); //
	AddStaticVehicle(509,598.8768,-1208.3922,17.8352,233.9419,53,1); //
	AddStaticVehicle(468,610.5441,-1254.1765,17.5811,227.2963,6,6); //
	AddStaticVehicle(462,610.4725,-1250.3304,17.8388,229.9439,1,2); //
	AddStaticVehicle(498,611.4026,-1240.1334,18.7177,190.6536,27,107); //
	AddStaticVehicle(544,1763.5426,2074.1624,11.0560,180.5619,3,1); //
    AddStaticVehicle(453,-2259.0251,2418.9116,-0.4114,227.2627,56,56); //
	AddStaticVehicle(453,-2252.3474,2428.4434,-0.1761,225.3332,56,56); //
	AddStaticVehicle(453,-2224.4941,2400.4839,-0.3262,43.7045,56,56); //
	AddStaticVehicle(453,-2232.3586,2393.0305,-0.2142,44.8031,56,56); //
	AddStaticVehicle(453,-2233.0339,2449.1641,-0.4721,226.8392,56,56); //
	AddStaticVehicle(453,-2204.5959,2420.4124,-0.2386,44.3582,56,56); //
	AddStaticVehicle(484,-2324.3311,2317.7146,0.1119,178.6092,50,32); //
	AddStaticVehicle(500,-2271.5195,2336.2009,4.8054,91.1452,4,119); //
	AddStaticVehicle(424,-2271.1914,2321.4243,5.0978,268.4299,1,0); //
	AddStaticVehicle(458,-2252.3354,2329.8149,4.6926,90.5275,113,1); //
	AddStaticVehicle(415,-2251.8567,2306.0952,4.3592,90.3521,0,1); //
	AddStaticVehicle(439,-2271.4246,2300.2852,4.7179,89.2820,25,78); //
	AddStaticVehicle(402,-2271.9141,2285.5745,4.6054,269.9929,90,90); //
	AddStaticVehicle(522,-2251.9753,2287.9001,4.4108,87.4224,39,106); //
	AddStaticVehicle(522,-2558.8059,2261.7969,4.6372,331.7849,39,106); //
	AddStaticVehicle(416,1588.3193,1728.3514,11.4755,178.9695,1,3); //
	AddStaticVehicle(416,1582.3787,1745.7590,11.4774,90.4406,1,3); //
	AddStaticVehicle(416,1574.2888,1774.2252,11.3566,1.2123,1,3); //
	AddStaticVehicle(416,1574.4956,1765.9437,11.4264,1.8282,1,3); //
	AddStaticVehicle(416,1574.7256,1755.2476,11.4228,1.3983,1,3); //
	AddStaticVehicle(416,1608.0603,1822.9490,11.4734,272.0786,1,3); //
	AddStaticVehicle(598,2298.5308,2464.1934,3.0217,269.0381,0,1); //
	AddStaticVehicle(598,2298.4927,2460.3726,3.0191,271.0012,0,1); //
	AddStaticVehicle(598,2298.4880,2455.9810,3.0190,270.5458,0,1); //
	AddStaticVehicle(598,2298.6482,2451.6934,3.0190,271.8889,0,1); //
	AddStaticVehicle(598,2314.4739,2460.7122,3.0197,89.9595,0,1); //
	AddStaticVehicle(598,2314.4539,2465.2666,3.0183,88.5278,0,1); //
	AddStaticVehicle(598,2314.7798,2470.6428,3.0200,89.6307,0,1); //
	AddStaticVehicle(598,2314.0654,2475.0664,3.0186,89.5640,0,1); //
	AddStaticVehicle(598,2314.8130,2480.0654,3.0208,87.8901,0,1); //
	AddStaticVehicle(598,2313.9231,2485.3972,3.0186,89.7121,0,1); //
	AddStaticVehicle(598,2314.3198,2490.4451,3.0209,91.3779,0,1); //
	AddStaticVehicle(598,2314.4292,2495.3833,3.0194,90.1429,0,1); //
	AddStaticVehicle(598,2313.6028,2500.4492,3.0173,91.0990,0,1); //
	AddStaticVehicle(599,2285.4968,2474.6523,3.3689,179.5903,0,1); //
	AddStaticVehicle(599,2281.0986,2474.9023,3.3689,179.5616,0,1); //
	AddStaticVehicle(599,2276.9160,2474.1199,3.3689,180.1882,0,1); //
	AddStaticVehicle(599,2272.6172,2474.5564,3.3688,180.2697,0,1); //
	AddStaticVehicle(599,2268.3550,2475.0193,3.3689,180.8428,0,1); //
	AddStaticVehicle(599,2263.5366,2474.8140,3.3689,178.8857,0,1); //
	AddStaticVehicle(599,2276.8733,2431.5015,3.3689,1.6458,0,1); //
	AddStaticVehicle(599,2272.6809,2431.3059,3.3688,1.3495,0,1); //
	AddStaticVehicle(599,2268.3992,2431.2217,3.3689,0.1979,0,1); //
	AddStaticVehicle(599,2264.0759,2431.0347,3.3689,359.5327,0,1); //
	AddStaticVehicle(599,2259.9880,2431.5996,3.3689,359.7192,0,1); //
	AddStaticVehicle(599,2255.2231,2430.9172,3.3689,358.1080,0,1); //
	AddStaticVehicle(599,2250.8916,2431.8101,3.3687,354.9199,0,1); //
	AddStaticVehicle(599,2246.5508,2431.2551,3.3685,359.7805,0,1); //
	AddStaticVehicle(598,2285.9429,2431.8945,3.0190,359.3139,0,1); //
	AddStaticVehicle(598,2290.1826,2432.1414,3.0221,358.2462,0,1); //
	AddStaticVehicle(598,2294.7410,2431.7671,3.0209,0.5541,0,1); //
	AddStaticVehicle(598,2299.3198,2431.2100,3.0204,0.4703,0,1); //
	AddStaticVehicle(598,2303.7988,2431.2419,3.0207,0.8991,0,1); //
	AddStaticVehicle(598,2307.6880,2431.2646,3.0208,358.0395,0,1); //
	AddStaticVehicle(598,2312.1375,2431.6460,3.0206,2.0598,0,1); //
	AddStaticVehicle(598,2316.9751,2431.6794,3.0169,359.7454,0,1); //
	AddStaticVehicle(598,2314.0830,2455.5806,3.0192,91.2546,0,1); //
	AddStaticVehicle(528,2239.8308,2475.6743,3.3149,270.7931,0,0); //
	AddStaticVehicle(528,2240.7656,2471.1287,3.3170,269.9293,0,0); //
	AddStaticVehicle(528,2240.3938,2466.2258,3.3170,272.3971,0,0); //
	AddStaticVehicle(528,2240.5310,2461.6697,3.3171,269.7192,0,0); //
	AddStaticVehicle(427,2239.8721,2456.6333,3.4063,269.7820,0,1); //
	AddStaticVehicle(427,2240.3267,2452.2615,3.4054,268.4214,0,1); //
	AddStaticVehicle(427,2239.9243,2447.4590,3.4060,270.7573,0,1); //
	AddStaticVehicle(427,2240.0229,2442.3623,3.4052,271.7242,0,1); //
	AddStaticVehicle(427,2239.9895,2437.3987,3.4052,270.6766,0,1); //
	AddStaticVehicle(427,2281.9705,2477.5073,10.9525,180.9474,0,1); //
	AddStaticVehicle(427,2273.6052,2477.3193,10.9517,178.9903,0,1); //
	AddStaticVehicle(427,2260.6956,2477.5042,10.9533,179.3845,0,1); //
	AddStaticVehicle(427,2251.9163,2477.5374,10.9529,182.4645,0,1); //
	AddStaticVehicle(598,2282.3262,2443.9800,10.5681,178.7565,0,1); //
	AddStaticVehicle(598,2273.6392,2442.9993,10.5650,2.0225,0,1); //
	AddStaticVehicle(598,2260.4531,2443.0156,10.5678,180.7990,0,1); //
	AddStaticVehicle(598,2251.8972,2442.7192,10.5654,179.3014,0,1); //
	AddStaticVehicle(598,2255.7834,2460.3694,10.5658,358.8562,0,1); //
	AddStaticVehicle(598,2268.8347,2459.7290,10.5665,179.9528,0,1); //
	AddStaticVehicle(599,2282.2542,2460.7405,10.9158,359.8072,0,1); //
	AddStaticVehicle(599,2291.1206,2476.2092,10.9152,180.5255,0,1); //
	AddStaticVehicle(599,2290.7673,2442.5842,10.9157,359.9638,0,1); //
	AddStaticVehicle(523,2313.7390,2500.2717,-7.8917,267.6190,0,0); //
	AddStaticVehicle(523,2314.6809,2494.9006,-7.8901,269.5539,0,0); //
	AddStaticVehicle(523,2313.4163,2490.1499,-7.8950,270.1061,0,0); //
	AddStaticVehicle(523,2313.6216,2485.3127,-7.8952,86.5972,0,0); //
	AddStaticVehicle(523,2314.5786,2480.0190,-7.8907,90.4751,0,0); //
	AddStaticVehicle(523,2314.3757,2474.7922,-7.8905,98.3634,0,0); //
	AddStaticVehicle(523,2313.6875,2470.4255,-7.8903,89.1098,0,0); //
	AddStaticVehicle(523,2314.4863,2465.1055,-7.8895,88.9713,0,0); //
	AddStaticVehicle(523,2314.3262,2460.5896,-7.8836,264.1569,0,0); //
	AddStaticVehicle(523,2314.3030,2455.2629,-7.8895,275.3852,0,0); //
	AddStaticVehicle(601,2298.1030,2460.3982,-7.6943,269.7861,1,1); //
	AddStaticVehicle(601,2298.7815,2451.4221,-7.6943,272.1534,1,1); //
	AddStaticVehicle(403,-1703.1677,-78.8419,4.1723,44.8624,25,1); //
	AddStaticVehicle(407,-1257.8569,66.9267,14.3835,46.0348,3,1); //
	AddStaticVehicle(407,-1261.0293,62.7058,14.3836,44.9379,3,1); //
	AddStaticVehicle(407,-2051.7395,92.2747,28.6188,89.7086,3,1); //
	AddStaticVehicle(407,-2051.8137,75.1745,28.6244,90.4019,3,1); //
	AddStaticVehicle(407,-2052.2732,84.4464,28.6316,91.4450,3,1); //
	AddStaticVehicle(407,1769.6926,2076.4104,11.0581,180.8321,3,1); //
	AddStaticVehicle(544,1763.5426,2074.1624,11.0560,180.5619,3,1); //
	AddStaticVehicle(407,1751.2198,2076.5979,11.0546,182.0471,3,1); //
	AddStaticVehicle(407,-2021.9722,75.1417,28.3434,270.7473,3,1); //
	AddStaticVehicle(407,-2021.3990,93.1270,28.2654,270.8457,3,1); //
	AddStaticVehicle(544,-2019.1958,83.8320,28.0921,270.3031,3,1); //

	
	
	
	return 1;
}

public OnGameModeExit()
{
	KillTimer(setmissiontimer);
	return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
	SetPlayerPos(playerid, 1648.0865,-2287.7813,-1.2066);
	SetPlayerCameraPos(playerid, 1659.9435,-2286.9714,-1.2138);
	SetPlayerCameraLookAt(playerid, 1648.0865,-2287.7813,-1.2066);
	return 1;
}

public OnPlayerConnect(playerid)
{
    dead[playerid] = 0;
    new name[MAX_PLAYER_NAME]; //Making a new variable called 'name'. name[MAX_PLAYER_NAME] is created so we can use it to get player's name.
    GetPlayerName(playerid,name,sizeof(name)); //Get player's name
    if(fexist(Path(playerid))) /* Check if the connected user is registered or not. fexist stands for file exist. So if file exist in the files(Path(playerid)),*/
    {// then
        INI_ParseFile(Path(playerid),"loadaccount_%s", .bExtra = true, .extra = playerid); //Will load user's data using INI_Parsefile.
        ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Login","Welcome back. This account is registered. \nInsert your password to login to your account","Login","Quit");/*A dialog with input style will appear so you can insert your password to login.*/
	}
    else //If the connected user is not registered,
    {//then we will 'force' him to register :)
        ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"Register","Welcome! This account is not registered.\nEnter your own password to create a new account.","Register","Quit");
        return 1;
    }
    

    
    return 1;
}


public OnPlayerDisconnect(playerid, reason)
{

    GetPlayerPos(playerid, posx, posy, posz);
    GetPlayerFacingAngle(playerid, angle);

    GetPlayerWeaponData(playerid, 1, wInfo[playerid][Weapon1], wInfo[playerid][Weapon1a]);
    GetPlayerWeaponData(playerid, 2, wInfo[playerid][Weapon2], wInfo[playerid][Weapon2a]);
    GetPlayerWeaponData(playerid, 3, wInfo[playerid][Weapon3], wInfo[playerid][Weapon3a]);
    GetPlayerWeaponData(playerid, 4, wInfo[playerid][Weapon4], wInfo[playerid][Weapon4a]);
    GetPlayerWeaponData(playerid, 5, wInfo[playerid][Weapon5], wInfo[playerid][Weapon5a]);
    GetPlayerWeaponData(playerid, 6, wInfo[playerid][Weapon6], wInfo[playerid][Weapon6a]);
    GetPlayerWeaponData(playerid, 7, wInfo[playerid][Weapon7], wInfo[playerid][Weapon7a]);
    GetPlayerWeaponData(playerid, 8, wInfo[playerid][Weapon8], wInfo[playerid][Weapon8a]);
    GetPlayerWeaponData(playerid, 9, wInfo[playerid][Weapon9], wInfo[playerid][Weapon9a]);
    GetPlayerWeaponData(playerid, 10, wInfo[playerid][Weapon10], wInfo[playerid][Weapon10a]);
    GetPlayerWeaponData(playerid, 11, wInfo[playerid][Weapon11], wInfo[playerid][Weapon11a]);
    GetPlayerWeaponData(playerid, 12, wInfo[playerid][Weapon12], wInfo[playerid][Weapon12a]);
    
    //Same as OnDialogResponse, we will save their stats inside of their user's account
	new INI:file = INI_Open(Path(playerid)); //will open their file
	INI_SetTag(file,"Player's Data");//We will set a tag inside of user's account called "Player's Data"
	INI_WriteInt(file,"AdminLevel",pInfo[playerid][Adminlevel]); //If you've set his/her admin level, then his/her admin level will be saved inside of his/her account
	INI_WriteInt(file,"VIPLevel",pInfo[playerid][VIPlevel]);//As explained above
	INI_WriteInt(file,"Money",GetPlayerMoney(playerid));//We will save his money inside of his account
	INI_WriteInt(file,"Scores",GetPlayerScore(playerid));//We will save his score inside of his account
	INI_WriteInt(file,"Kills",pInfo[playerid][Kills]);//As explained above
	INI_WriteInt(file,"Deaths",pInfo[playerid][Deaths]);//As explained above
	INI_WriteInt(file, "JobID", pInfo[playerid][Job]);
	INI_WriteInt(file, "JobLVL", pInfo[playerid][JobLVL]);
    INI_WriteInt(file,"Weapon1",wInfo[playerid][Weapon1]);
    INI_WriteInt(file,"Weapon1a",wInfo[playerid][Weapon1a]);
    INI_WriteInt(file,"Weapon2",wInfo[playerid][Weapon2]);
    INI_WriteInt(file,"Weapon2a",wInfo[playerid][Weapon2a]);
    INI_WriteInt(file,"Weapon3",wInfo[playerid][Weapon3]);
    INI_WriteInt(file,"Weapon3a",wInfo[playerid][Weapon3a]);
    INI_WriteInt(file,"Weapon4",wInfo[playerid][Weapon4]);
    INI_WriteInt(file,"Weapon4a",wInfo[playerid][Weapon4a]);
    INI_WriteInt(file,"Weapon5",wInfo[playerid][Weapon5]);
    INI_WriteInt(file,"Weapon5a",wInfo[playerid][Weapon5a]);
    INI_WriteInt(file,"Weapon6",wInfo[playerid][Weapon6]);
    INI_WriteInt(file,"Weapon6a",wInfo[playerid][Weapon6a]);
    INI_WriteInt(file,"Weapon7",wInfo[playerid][Weapon7]);
    INI_WriteInt(file,"Weapon7a",wInfo[playerid][Weapon7a]);
    INI_WriteInt(file,"Weapon8",wInfo[playerid][Weapon8]);
    INI_WriteInt(file,"Weapon8a",wInfo[playerid][Weapon8a]);
    INI_WriteInt(file,"Weapon9",wInfo[playerid][Weapon9]);
    INI_WriteInt(file,"Weapon9a",wInfo[playerid][Weapon9a]);
    INI_WriteInt(file,"Weapon10",wInfo[playerid][Weapon10]);
    INI_WriteInt(file,"Weapon10a",wInfo[playerid][Weapon10a]);
    INI_WriteInt(file,"Weapon11",wInfo[playerid][Weapon11]);
    INI_WriteInt(file,"Weapon11a",wInfo[playerid][Weapon11a]);
    INI_WriteInt(file,"Weapon12",wInfo[playerid][Weapon12]);
    INI_WriteInt(file,"Weapon12a",wInfo[playerid][Weapon12a]);
	INI_WriteFloat(file, "posX", posx);
	INI_WriteFloat(file, "posY", posy);
	INI_WriteFloat(file, "posZ", posz);
	INI_WriteFloat(file, "angle", angle);

	INI_Close(file);//Now after we've done saving their data, we now need to close the file
	return 1;
}

public OnPlayerSpawn( playerid )
{
        
        GivePlayerMoney(playerid, pInfo[playerid][Money]);
        
        GivePlayerWeapon(playerid, wInfo[playerid][Weapon1], wInfo[playerid][Weapon1a]);
        GivePlayerWeapon(playerid, wInfo[playerid][Weapon2], wInfo[playerid][Weapon2a]);
        GivePlayerWeapon(playerid, wInfo[playerid][Weapon3], wInfo[playerid][Weapon3a]);
        GivePlayerWeapon(playerid, wInfo[playerid][Weapon4], wInfo[playerid][Weapon4a]);
        GivePlayerWeapon(playerid, wInfo[playerid][Weapon5], wInfo[playerid][Weapon5a]);
        GivePlayerWeapon(playerid, wInfo[playerid][Weapon6], wInfo[playerid][Weapon6a]);
        GivePlayerWeapon(playerid, wInfo[playerid][Weapon7], wInfo[playerid][Weapon7a]);
        GivePlayerWeapon(playerid, wInfo[playerid][Weapon8], wInfo[playerid][Weapon8a]);
        GivePlayerWeapon(playerid, wInfo[playerid][Weapon9], wInfo[playerid][Weapon9a]);
        GivePlayerWeapon(playerid, wInfo[playerid][Weapon10], wInfo[playerid][Weapon10a]);
        GivePlayerWeapon(playerid, wInfo[playerid][Weapon11], wInfo[playerid][Weapon11a]);
        GivePlayerWeapon(playerid, wInfo[playerid][Weapon12], wInfo[playerid][Weapon12a]);

        

        
    if (pInfo[playerid][Job] == 0) //jobless
	{
        SetPlayerPos(playerid, 1648.2819, -2287.9338, -1.2065);
        SetPlayerFacingAngle(playerid, 271.2087);
        SetPlayerSkin(playerid, 230);
        SetPlayerColor(playerid, COLOR_GREY);
	}
	else if (pInfo[playerid][Job] == 1)//mechanic
	{
        SetPlayerPos(playerid, 1648.2819, -2287.9338, -1.2065);
        SetPlayerFacingAngle(playerid, 271.2087);
        SetPlayerSkin(playerid, 50);
        SetPlayerColor(playerid, COLOR_YELLOW);
	}
	else if (pInfo[playerid][Job] == 2)//taxi
	{
        SetPlayerPos(playerid, 1648.2819, -2287.9338, -1.2065);
        SetPlayerFacingAngle(playerid, 271.2087);
        SetPlayerSkin(playerid, 255);
        SetPlayerColor(playerid, COLOR_WHITE);
	}
	else if (pInfo[playerid][Job] == 3)//police
	{
        SetPlayerPos(playerid, 1648.2819, -2287.9338, -1.2065);
        SetPlayerFacingAngle(playerid, 271.2087);
        SetPlayerSkin(playerid, 280);
        SetPlayerColor(playerid, COLOR_LIGHTBLUE);
	}
	else if (pInfo[playerid][Job] == 4)//mineworker
	{
        SetPlayerPos(playerid, 1648.2819, -2287.9338, -1.2065);
        SetPlayerFacingAngle(playerid, 271.2087);
        SetPlayerSkin(playerid, 27);
	}
	else if (pInfo[playerid][Job] == 5)//farmer
	{
        SetPlayerPos(playerid, 1648.2819, -2287.9338, -1.2065);
        SetPlayerFacingAngle(playerid, 271.2087);
        SetPlayerSkin(playerid, 161);
        SetPlayerColor(playerid, COLOR_DARKGREEN);
	}
	else if (pInfo[playerid][Job] == 6)//fisher
	{
        SetPlayerPos(playerid, 1648.2819, -2287.9338, -1.2065);
        SetPlayerFacingAngle(playerid, 271.2087);
        SetPlayerSkin(playerid, 122);
        SetPlayerColor(playerid, COLOR_BROWN);
	}
	else if (pInfo[playerid][Job] == 7)//fireman
	{
        SetPlayerPos(playerid, 1648.2819, -2287.9338, -1.2065);
        SetPlayerFacingAngle(playerid, 271.2087);
        SetPlayerSkin(playerid, 279);
        SetPlayerColor(playerid, COLOR_CYAN);
	}
	else if (pInfo[playerid][Job] == 8)//trucker
	{
        SetPlayerPos(playerid, 1648.2819, -2287.9338, -1.2065);
        SetPlayerFacingAngle(playerid, 271.2087);
        SetPlayerSkin(playerid, 202);
        SetPlayerColor(playerid, COLOR_GREENISHGOLD);
	}
	else if (pInfo[playerid][Job] == 9)//delivery man
	{
        SetPlayerPos(playerid, 1648.2819, -2287.9338, -1.2065);
        SetPlayerFacingAngle(playerid, 271.2087);
        SetPlayerSkin(playerid, 170);
        SetPlayerColor(playerid, COLOR_VIOLET);
	}
	else if (pInfo[playerid][Job] == 10)//drug dealer
	{
        SetPlayerPos(playerid, 1648.2819, -2287.9338, -1.2065);
        SetPlayerFacingAngle(playerid, 271.2087);
        SetPlayerSkin(playerid, 29);
        SetPlayerColor(playerid, COLOR_SEAGREEN);
	}
	else if (pInfo[playerid][Job] == 11)// fbi
	{
        SetPlayerPos(playerid, 1648.2819, -2287.9338, -1.2065);
        SetPlayerFacingAngle(playerid, 271.2087);
        SetPlayerSkin(playerid, 286);
        SetPlayerColor(playerid, COLOR_BRIGHTRED);
	}
	else if (pInfo[playerid][Job] == 12)//pizza boy
	{
        SetPlayerPos(playerid, 1648.2819, -2287.9338, -1.2065);
        SetPlayerFacingAngle(playerid, 271.2087);
        SetPlayerSkin(playerid, 155);
        SetPlayerColor(playerid, COLOR_LEMON);
	}
	else if (pInfo[playerid][Job] == 13)//soldier
	{
        SetPlayerPos(playerid, 1648.2819, -2287.9338, -1.2065);
        SetPlayerFacingAngle(playerid, 271.2087);
        SetPlayerSkin(playerid, 287);
        SetPlayerColor(playerid, COLOR_LIME);
	}
	else if (pInfo[playerid][Job] == 14)//hooker
	{
        SetPlayerPos(playerid, 1648.2819, -2287.9338, -1.2065);
        SetPlayerFacingAngle(playerid, 271.2087);
        SetPlayerSkin(playerid, 152);
        SetPlayerColor(playerid, COLOR_PINK);
	}
	else if (pInfo[playerid][Job] == 15)//hitman
	{
        SetPlayerPos(playerid, 1648.2819, -2287.9338, -1.2065);
        SetPlayerFacingAngle(playerid, 271.2087);
        SetPlayerSkin(playerid, 127);
        SetPlayerColor(playerid, COLOR_PURPLE);
	}

        
    if(dead[playerid] == 1)
    {
        respawned(playerid);
        SetPlayerSkin(playerid, deathskinID);
    }


    if ( posx != 0 && posy != 0 && posz != 0 )
    {
        SetPlayerPos(playerid , posx, posy, posz);
        SetPlayerFacingAngle(playerid, angle);
    }
        

    return ( 1 );
}

public OnPlayerDeath(playerid, killerid, reason)
{
    deathskinID = GetPlayerSkin(playerid);
	if(killerid != INVALID_PLAYER_ID)
	{
	deathskinID = GetPlayerSkin(playerid);
	pInfo[killerid][Kills]++;
    pInfo[playerid][Deaths]++;
    }
    else
    {
    deathskinID = GetPlayerSkin(playerid);
    GivePlayerMoney(playerid, -100);
    SendClientMessage(playerid, -1, "You have been hospitalized and hospital fee cost $100");
    dead[playerid] = 1;
    pInfo[killerid][Kills]++;
    pInfo[playerid][Deaths]++;
    }
    return 1;
}

public OnVehicleSpawn(vehicleid)
{
	return 1;
}

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

public OnPlayerText(playerid, text[])
{
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/mycommand", cmdtext, true, 10) == 0)
	{
		// Do something here
		return 1;
	}
	
	
	if (strcmp("/weapon", cmdtext, true, 10) == 0)
	{
		GivePlayerWeapon(playerid, 24, 5);
		GivePlayerWeapon(playerid, 31, 5);
		GivePlayerWeapon(playerid, 33, 5);
		return 1;
	}
	
	
	if (strcmp("/money", cmdtext, true, 10) == 0)
	{
		GivePlayerMoney(playerid, 1000);
		return 1;
	}
	
	
	
	
	return 0;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{

	return 1;
}

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

public OnPlayerStateChange(playerid, newstate, oldstate)
{
	new vehicleid;
	vehicleid = GetPlayerVehicleID(playerid);
	if(newstate == PLAYER_STATE_DRIVER)
	{
	    if(GetVehicleModel(vehicleid) != 403 || GetVehicleModel(vehicleid) != 514 || GetVehicleModel(vehicleid) != 515) // 411 is the infernus model
    	{
			if (pInfo[playerid][Job] != 8)
			{
	        	RemovePlayerFromVehicle(playerid);
	        	SendClientMessage(playerid, COLOR_RED, "Vous ne pouvez pas conduire ce vehicule !");
	    	}
	    }
	
	}


	return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
	new thevehicleid;
	thevehicleid = GetPlayerVehicleID(playerid);

	if(playercheckpoint == 1)
	{
	    PutPlayerInVehicle(playerid, boxtruck, 0);
	    DisablePlayerCheckpoint(playerid);
    	new rand = random(sizeof(loads));
    	SetPlayerCheckpoint(playerid, loads[rand][0], loads[rand][1], loads[rand][2], 2.0);
    	playercheckpoint = 2;
		SendClientMessage(playerid, COLOR_WHITE, "Go load the goods");
	}
	else if(playercheckpoint == 2)
	{
		if(GetVehicleModel(thevehicleid) == 414)
    	{
        	PutPlayerInVehicle(playerid, boxtruck, 0);
	    	DisablePlayerCheckpoint(playerid);
    		new rand = random(sizeof(drops));
    		SetPlayerCheckpoint(playerid, drops[rand][0], drops[rand][1], drops[rand][2], 2.0);
    		playercheckpoint = 3;
			SendClientMessage(playerid, COLOR_WHITE, "Go load the goods");

    	}
	}
	else if(playercheckpoint == 3)
	{
		if(GetVehicleModel(thevehicleid) == 414)
    	{
    	    DisablePlayerCheckpoint(playerid);
    	    RemovePlayerFromVehicle(playerid);
            DestroyVehicle(boxtruck);
   			GivePlayerMoney(playerid, 250);
			SendClientMessage(playerid, COLOR_WHITE, "Mission succesfull");
			playercheckpoint = 0;
    	}
    	else
    	{
    	    SendClientMessage(playerid, COLOR_WHITE, "Mission failed");
    	    playercheckpoint = 0;
    	    DisablePlayerCheckpoint(playerid);
    	    RemovePlayerFromVehicle(playerid);
            DestroyVehicle(boxtruck);
    	}
	}





	return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
	return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
	return 1;
}

public OnPlayerLeaveRaceCheckpoint(playerid)
{
	return 1;
}

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

public OnPlayerRequestSpawn(playerid)
{
	return 1;
}

public OnObjectMoved(objectid)
{
	return 1;
}

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

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

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

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

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

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

public OnPlayerExitedMenu(playerid)
{
	return 1;
}

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

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

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

public OnPlayerUpdate(playerid)
{
	return 1;
}

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

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

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

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

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    InventoryOnDialogResponse(playerid, dialogid, response, inputtext);
	return 1;
}




fDialog(1)
{
	if(!response) return Kick(playerid); //If they clicked the second button "Quit", we will kick them.
    if(response) //if they clicked the first button "Register"
    {//then
	if(!strlen(inputtext)) //If they didn't enter any password
	{// then we will tell to them to enter the password to register
		ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"Register","Welcome! This account is not registered.\nEnter your own password to create a new account.\nPlease enter the password!","Register","Quit");
		return 1;
        }
        //If they have entered a correct password for his/her account...
		new hashpass[129]; //Now we will create a new variable to hash his/her password
        WP_Hash(hashpass,sizeof(hashpass),inputtext);//We will use whirlpool to hash their inputted text
        new INI:file = INI_Open(Path(playerid)); // we will open a new file for them to save their account inside of Scriptfiles/Users folder
        INI_SetTag(file,"Player's Data");//We will set a tag inside of user's account called "Player's Data"
        INI_WriteString(file,"Password",hashpass);//This will write a hashed password into user's account
        INI_WriteInt(file,"AdminLevel",0); //Write an integer inside of user's account called "AdminLevel". We will set his level to 0 after he registered.
        INI_WriteInt(file,"VIPLevel",0);//As explained above
        INI_WriteInt(file,"Money",0);//Write an integer inside of user's account called "Money". We will set their money to 0 after he registered
        INI_WriteInt(file,"Scores",0);//Write an integer inside of user's account called "Scores". We will set their score to 0 after he registered
        INI_WriteInt(file,"Kills",0);//As explained above
        INI_WriteInt(file,"Deaths",0);//As explained above
        INI_WriteInt(file,"JobID",0);
        INI_WriteInt(file,"JobLVL",0);
        INI_WriteInt(file,"Weapon1",0);//As explained above
        INI_WriteInt(file,"Weapon1a",0);//As explained above
        INI_WriteInt(file,"Weapon2",0);//As explained above
        INI_WriteInt(file,"Weapon2a",0);//As explained above
        INI_WriteInt(file,"Weapon3",0);//As explained above
        INI_WriteInt(file,"Weapon3a",0);//As explained above
        INI_WriteInt(file,"Weapon4",0);//As explained above
        INI_WriteInt(file,"Weapon4a",0);//As explained above
        INI_WriteInt(file,"Weapon5",0);//As explained above
        INI_WriteInt(file,"Weapon5a",0);//As explained above
        INI_WriteInt(file,"Weapon6",0);//As explained above
        INI_WriteInt(file,"Weapon6a",0);//As explained above
        INI_WriteInt(file,"Weapon7",0);//As explained above
        INI_WriteInt(file,"Weapon7a",0);//As explained above
        INI_WriteInt(file,"Weapon8",0);//As explained above
        INI_WriteInt(file,"Weapon8a",0);//As explained above
        INI_WriteInt(file,"Weapon9",0);//As explained above
        INI_WriteInt(file,"Weapon9a",0);//As explained above
        INI_WriteInt(file,"Weapon10",0);//As explained above
        INI_WriteInt(file,"Weapon10a",0);//As explained above
        INI_WriteInt(file,"Weapon11",0);//As explained above
        INI_WriteInt(file,"Weapon11a",0);//As explained above
        INI_WriteInt(file,"Weapon12",0);//As explained above
        INI_WriteInt(file,"Weapon12a",0);//As explained above
        
        INI_Close(file);//Now after we've done saving their data, we now need to close the file
        SendClientMessage(playerid,-1,"You have been successfully registered");//Tell to them that they have successfully registered a new account
        return 1;
        }
    return 1;
}


fDialog(2)
{
	if(!response) return Kick(playerid); //If they clicked the second button "Quit", we will kick them.
    if(response) //if they clicked the first button "Register"
        {//then
            new hashpass[129]; //Will create a new variable to hash his/her password
            WP_Hash(hashpass,sizeof(hashpass),inputtext); //Will hash inputted password
            if(!strcmp(hashpass,pInfo[playerid][Pass])) //If they have insert their correct password
            {//then
                INI_ParseFile(Path(playerid),"loadaccount_%s",.bExtra = true, .extra = playerid);//We will load his account's data from user's path
                SetPlayerScore(playerid,pInfo[playerid][Scores]);//We will get their score inside of his user's account and we will set it here
                GivePlayerMoney(playerid,pInfo[playerid][Money]);//As explained above
                SendClientMessage(playerid,-1,"Welcome back! You have successfully logged in");//Tell them that they've successfully logged in
		    }
            else //If they've entered an incorrect password
            {//then
                ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Login","Welcome back. This account is registered. \nInsert your password to login to your account.\nIncorrect password!","Login","Quit");//We will tell to them that they've entered an incorrect password
                return 1;
            }
        }
    return 1;
}



fDialog(3)
{
    if(response)
        {
           	switch(listitem)// Checking which listitem was selected
        	{
        	    case 0://mecanicien
        	    {
                	SetPlayerSkin(playerid, 50);
        			SetPlayerColor(playerid, COLOR_YELLOW);
        	    }
        	    case 1://taxi
        	    {
        			SetPlayerSkin(playerid, 255);
        			SetPlayerColor(playerid, COLOR_WHITE);
        	    }
        	    case 2://policier
        	    {
        			SetPlayerSkin(playerid, 280);
        			SetPlayerColor(playerid, COLOR_LIGHTBLUE);
        	    }
        	    case 3://policier
        	    {
        			SetPlayerSkin(playerid, 280);
        			SetPlayerColor(playerid, COLOR_LIGHTBLUE);
        	    }
        	    case 4://policier
        	    {
        			SetPlayerSkin(playerid, 280);
        			SetPlayerColor(playerid, COLOR_LIGHTBLUE);
        	    }
        	    case 5://policier
        	    {
        			SetPlayerSkin(playerid, 280);
        			SetPlayerColor(playerid, COLOR_LIGHTBLUE);
        	    }
        	    case 6://policier
        	    {
        			SetPlayerSkin(playerid, 280);
        			SetPlayerColor(playerid, COLOR_LIGHTBLUE);
        	    }
        	    case 7://policier
        	    {
        			SetPlayerSkin(playerid, 280);
        			SetPlayerColor(playerid, COLOR_LIGHTBLUE);
        	    }
        	    case 8://policier
        	    {
        			SetPlayerSkin(playerid, 280);
        			SetPlayerColor(playerid, COLOR_LIGHTBLUE);
        	    }
        	    case 9://policier
        	    {
        			SetPlayerSkin(playerid, 280);
        			SetPlayerColor(playerid, COLOR_LIGHTBLUE);
        	    }
        	    case 10://policier
        	    {
        			SetPlayerSkin(playerid, 280);
        			SetPlayerColor(playerid, COLOR_LIGHTBLUE);
        	    }
        	    case 11://policier
        	    {
        			SetPlayerSkin(playerid, 280);
        			SetPlayerColor(playerid, COLOR_LIGHTBLUE);
        	    }
        	    case 12://policier
        	    {
        			SetPlayerSkin(playerid, 280);
        			SetPlayerColor(playerid, COLOR_LIGHTBLUE);
        	    }
        	    case 13://policier
        	    {
        			SetPlayerSkin(playerid, 280);
        			SetPlayerColor(playerid, COLOR_LIGHTBLUE);
        	    }
        	    
        	    
        	    
        	    
        	    
        	}
        }
    return 1;
}



fDialog(4)
{
	if(response)
		{
		if(listitem == 0)
		{
			new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0; // This means the distance that the player would be able to hear music
       		GetPlayerPos(playerid, X, Y, Z);
       		PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=133521"); // Here, you can add any stream URL you'd like,
       		SendClientMessage(playerid, COLOR_WHITE, "Music started!");
       		return 1;
		}
		if(listitem == 1)
		{
		    new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0; // This means the distance that the player would be able to hear music
       		GetPlayerPos(playerid, X, Y, Z);
       		PlayAudioStreamForPlayer(playerid, "http://www.streamingthe.net/fr/CKOI-96.9-FM-Montreal/p/18843&player=1#.UZ2Lp5y2R1c"); // Here, you can add any stream URL you'd like,
       		SendClientMessage(playerid, COLOR_WHITE, "Music started!");
            StopAudioStreamForPlayer(playerid);
       		return 1;
		}
		if(listitem == 2)
		{
		    new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0; // This means the distance that the player would be able to hear music
       		GetPlayerPos(playerid, X, Y, Z);
       		PlayAudioStreamForPlayer(playerid, "http://chik.player.amri.ca/"); // Here, you can add any stream URL you'd like,
       		SendClientMessage(playerid, COLOR_WHITE, "Music started!");
            StopAudioStreamForPlayer(playerid);
       		return 1;
		}

		if(listitem == 3)
		{
            StopAudioStreamForPlayer(playerid);
       		return 1;
		}
	}
    return 1;
}





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



stock Path(playerid) //Will create a new stock so we can easily use it later to load/save user's data in user's path
{
    new str[128],name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    format(str,sizeof(str),UserPath,name);
    return str;
}

forward loadaccount_user(playerid, name[], value[]);
public loadaccount_user(playerid, name[], value[])
{
    INI_String("Password", pInfo[playerid][Pass],129); /*we will use INI_String to load user's password.
    ("Password",.. will load user's password inside of user's path. 'pInfo[playerid][Pass]',...We have defined our user's variable above called, pInfo. Now it's time to use it here to load user's password. '129',... 129 is a length of a hashed user's password. Whirlpool will hash 128 characters + NULL*/
    INI_Int("AdminLevel",pInfo[playerid][Adminlevel]);/*We will use INI_Int to load user's admin level. INI_Int stands for INI_Integer. This load an admin level. */
    INI_Int("VIPLevel",pInfo[playerid][VIPlevel]);//As explained above
    INI_Int("Money",pInfo[playerid][Money]); //As explained above
    INI_Int("Scores",pInfo[playerid][Scores]);//As explained above
    INI_Int("Kills",pInfo[playerid][Kills]);//As explained above
    INI_Int("Deaths",pInfo[playerid][Deaths]);//As explained above
    INI_Int("JobID",pInfo[playerid][Job]);
    INI_Int("JobLVL",pInfo[playerid][JobLVL]);
    INI_Int("Weapon1",wInfo[playerid][Weapon1]);
    INI_Int("Weapon1a",wInfo[playerid][Weapon1a]);
    INI_Int("Weapon2",wInfo[playerid][Weapon2]);
    INI_Int("Weapon2a",wInfo[playerid][Weapon2a]);
    INI_Int("Weapon3",wInfo[playerid][Weapon3]);
    INI_Int("Weapon3a",wInfo[playerid][Weapon3a]);
    INI_Int("Weapon4",wInfo[playerid][Weapon4]);
    INI_Int("Weapon4a",wInfo[playerid][Weapon4a]);
    INI_Int("Weapon5",wInfo[playerid][Weapon5]);
    INI_Int("Weapon5a",wInfo[playerid][Weapon5a]);
    INI_Int("Weapon6",wInfo[playerid][Weapon6]);
    INI_Int("Weapon6a",wInfo[playerid][Weapon6a]);
    INI_Int("Weapon7",wInfo[playerid][Weapon7]);
    INI_Int("Weapon7a",wInfo[playerid][Weapon7a]);
    INI_Int("Weapon8",wInfo[playerid][Weapon8]);
    INI_Int("Weapon8a",wInfo[playerid][Weapon8a]);
    INI_Int("Weapon9",wInfo[playerid][Weapon9]);
    INI_Int("Weapon9a",wInfo[playerid][Weapon9a]);
    INI_Int("Weapon10",wInfo[playerid][Weapon10]);
    INI_Int("Weapon10a",wInfo[playerid][Weapon10a]);
    INI_Int("Weapon11",wInfo[playerid][Weapon11]);
    INI_Int("Weapon11a",wInfo[playerid][Weapon11a]);
    INI_Int("Weapon12",wInfo[playerid][Weapon12]);
    INI_Int("Weapon12a",wInfo[playerid][Weapon12a]);

    
    return 1;
}



forward respawned(playerid); //anywhere
public respawned(playerid) //anywhere
{
    SetPlayerPos(playerid, 1173.0612, -1323.1986, 15.3969);
    SetPlayerFacingAngle(playerid, 268.7180);
    SetPlayerSkin(playerid, deathskinID);
    SetPlayerSkin(playerid, deathskinID);
    dead[playerid] = 0;
    return 1;
}




CMD:enter(playerid,params[])
{
	// SA bank
    if(IsPlayerInRangeOfPoint(playerid, 5.0, 594.4772,-1249.1016,18.2201))
    {
       SetPlayerPos(playerid, 591.7039,-1269.4248,1035.6932);
       SetPlayerInterior(playerid, 0);
    }
    // mairie
    if(IsPlayerInRangeOfPoint(playerid, 5.0, 1481.1119,-1771.1141,18.7958))
    {
       SetPlayerPos(playerid, 1476.1237, -1765.6045, 995.9890);
       SetPlayerInterior(playerid, 3);
    }

    // jobhouse
    if(IsPlayerInRangeOfPoint(playerid, 5.0, 914.0151,-1003.2240,38.0076))
    {
       SetPlayerPos(playerid, 914.87433, -990.59930, 999.58380);
       SetPlayerInterior(playerid, 0);
    }
	return 1;
}

CMD:exit(playerid,params[])
{
	// SA BANK
    if(IsPlayerInRangeOfPoint(playerid, 5.0, 591.7039,-1269.4248,1035.6932))
    {
       SetPlayerPos(playerid, 594.4772,-1249.1016,18.2201);
       SetPlayerFacingAngle(playerid, 89.0684);
       SetPlayerInterior(playerid, 0);
    }
	// mairie
    if(IsPlayerInRangeOfPoint(playerid, 5.0, 1476.2694,-1762.8276,995.9606))
    {
       SetPlayerPos(playerid, 1480.8271,-1770.5574,18.7958);
       SetPlayerFacingAngle(playerid, 2.0389);
       SetPlayerInterior(playerid, 0);
    }
    //jobhouse
    if(IsPlayerInRangeOfPoint(playerid, 5.0, 915.8417,-989.5709,999.3730))
    {
       SetPlayerPos(playerid, 913.5525,-1003.4492,38.0031);
       SetPlayerFacingAngle(playerid, 17.7092);
       SetPlayerInterior(playerid, 0);
    }
	return 1;
}


CMD:resignmyjob(playerid,params[])
{
    pInfo[playerid][Job] = 0;
    pInfo[playerid][JobLVL] = 0;
	SetPlayerSkin(playerid, jobless_skin);
	SetPlayerColor(playerid, jobless_color);
return 1;
}

CMD:getjob(playerid,params[])
{
    if(IsPlayerInRangeOfPoint(playerid, 5.0, 918.9927,-1002.3051,999.3730))
    {
        ShowPlayerDialog(playerid,3,DIALOG_STYLE_LIST, "Selectionnez votre travail", " Mecanicien\n Taxi\n Policier\n Mineur\n Fermier\n Pecheur\n Pompier\n Camionneur\n Livreur\n Vendeur de drogue\n FBI\n Livreur de pizza\n Soldat\n Pute\n Chasseur de prime", "Prendre", "Annuler");
    }
    else
    {
       SendClientMessage(playerid, 0xAFAFAFAA, "Tu n'est pas a la maison des travail.");
    }
return 1;
}

CMD:mecanicien(playerid,params[])
{
	WhoNeedsAMechanic = playerid;
	SomeOneNeedsAMechanic = 1;
	NeedsMechanic[playerid] = 1; //the player needs the mechanic
	GetPlayerPos(playerid,GetLocX,GetLocY,GetLocZ);
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
		if (pInfo[i][Job] == 1)
		{
		new string[128];
		new pname[24];
		GetPlayerName(playerid, pname, sizeof(pname));
		format(string, 128,"[MECANICIEN]: %s a besoin d'un mecanicien. Faite /accepter pour accepter l'appel",pname);
		SendClientMessage(i,COLOR_GREEN,string);
		}
	}
return 1;
}

CMD:accepter(playerid,params[])
{
	if (pInfo[playerid][Job] == 1)
	{
		if(SomeOneNeedsAMechanic == 1)
		{
			WhoNeedsAMechanic = 255;
            SomeOneNeedsAMechanic = 0;
	        new string[128];
	        new pname[24];
	        GetPlayerName(playerid, pname, sizeof(pname));
	        format(string, 128,"[MECANICIEN]: %s a accepter votre appel et est en route!",pname);
	        SendClientMessage(WhoNeedsAMechanic,COLOR_GREEN,string);
	        SetPlayerCheckpoint(playerid,GetLocX,GetLocY,GetLocZ,2);
            GetLocX = 0; GetLocY = 0; GetLocZ = 0;
            }
            else
            {
            	SendClientMessage(playerid, COLOR_GREEN, "Personne n'a besoin d'un mecanicien.");
            }
	    }
	    else
	    {
        	SendClientMessage(playerid,COLOR_GREEN, "[!] Vous n'ete pas un mecanicien!");
	    }
return 1;
}


CMD:inventaire(playerid,params[])
{
    ShowInventory(playerid);
return 1;
}


CMD:radio(playerid,params[])
{
    ShowPlayerDialog(playerid, 4, DIALOG_STYLE_LIST, "Radio Station", "Techno \nCKOI 96,9 \nNRJ 98,9 \nTurn radio off", "Select", "Cancel");
return 1;
}


forward setplayerdeliverymission(playerid);
public setplayerdeliverymission(playerid)
{
    boxtruck = CreateVehicle(414, 2268.0627, -2017.7373, 13.6388, 179.8147, 40, 111, 0);
    SetPlayerCheckpoint(playerid, 2268.3843,-2025.7472,13.5469, 3.0);
	SendClientMessage(playerid, COLOR_WHITE, "Take the delivery truck");
	playercheckpoint = 1;
	// KillTimer(setmissiontimer);
	return 1;
}




my INI file
Код:
[Player's Data]
AdminLevel = 0
VIPLevel = 0
Money = 1051
Scores = 0
Kills = 0
Deaths = 0
JobID = 8
JobLVL = 0
Weapon1 = 0
Weapon1a = 0
Weapon2 = 24
Weapon2a = 62
Weapon3 = 0
Weapon3a = 0
Weapon4 = 0
Weapon4a = 0
Weapon5 = 31
Weapon5a = 57
Weapon6 = 33
Weapon6a = 62
Weapon7 = 0
Weapon7a = 0
Weapon8 = 0
Weapon8a = 0
Weapon9 = 0
Weapon9a = 0
Weapon10 = 0
Weapon10a = 0
Weapon11 = 0
Weapon11a = 0
Weapon12 = 0
Weapon12a = 0
posX = 785.938232
posY = -1873.022338
posZ = 3.622005
Password = ************************************************************
angle = 47.221542
Reply
#2

help please
Reply
#3

problem fixed.
i feel so dumb....
i just forgot to load position on the loadaccount stock
FML
Reply
#4

where is the edit ?
do it work on firefox ? i dont see it

anyway...
sorry to bump , but it still dont work.
damn samp... i start to understand why mta is way more popular...
plus my thread as been seen over 25 time still no help...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)