Advertisement
Five_NT

[GM] RRT

Feb 25th, 2014
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 135.42 KB | None | 0 0
  1. /*              Credits                     */
  2. //                                          //
  3. //      Codding by Punct.                   //
  4. //      Mapping by Punct. and Compact       //
  5. //                                          //
  6. /*              Like a boss                 */
  7.  
  8. #include <a_samp>
  9. #include <core>
  10. #include <float>
  11. #include <streamer>
  12. #include <Dini>
  13. #include <curse>
  14. #include <sscanf2>
  15. #include <a_mysql>
  16.  
  17. #define PRESSED(%0) \
  18.     (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
  19. #define strcpy(%0,%1,%2) strcat((%0[0] = '\0', %0), %1, %2)
  20.  
  21. #define     SQL_HOST    "localhost"
  22. #define     SQL_USER    "root"
  23. #define     SQL_DB      "truck"
  24. #define     SQL_PASS    ""
  25.  
  26. #define     D_Login             0
  27. #define     D_Register          1
  28. #define     STATS               2
  29. #define     MIS                 3
  30. #define     CURSA               4
  31. #define     JOB                 5
  32. #define     DIALOG_ANUNT        6
  33. #define     DIALOG_START        7
  34. #define     DIALOG_BENZINA      8
  35. #define     MAX_MESSAGES        20
  36. #define     SCM                 SendClientMessage
  37. #define     KEY_HORN            2
  38. #define     MAX_ZONE_NAME       28 // Numarul de zone
  39. #define     MAX_HOUSES          200
  40. #define     c_alb               0xFFFFFFFF
  41. #define     c_albb              "{FFFFFF}"
  42. #define     c_rosu              "{F81414}"
  43. #define     c_verde             "{00FF22}"
  44. #define     c_gri               "{B1BBBE}"
  45. #define     c_p                 "{F48651}" // culoare - portocaliu
  46. #define     c_a                 "{67BDFC}" // culoare - albastru
  47. #define     RWTime              60000*10
  48.  
  49.  
  50. #pragma tabsize 0
  51.  
  52. forward OnAccountCheck(playerid);
  53. forward OnAccountLoad(playerid);
  54. forward SAM(color, string[]);
  55. forward KickPublic(playerid);
  56. forward SendMSG();
  57. forward Inchide_vama_LSLV(playerid);
  58. forward Inchide_vama_LVLS(playerid);
  59. forward SpeedoMeter();
  60. forward CruiseControl(playerid);
  61. forward SeteazaTimp(playerid);
  62. forward Zones_Update();
  63. forward LoadHouse(houseid);
  64. forward SaveHouse(houseid);
  65. forward LoadSeif(seifid);
  66. forward SaveSeif(seifid);
  67. forward OnPropUpdate(update, num);
  68. forward LoadProperty();
  69. forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
  70. forward RWeather();
  71. forward AscundeTD();
  72. native WP_Hash(buffer[], len, const str[]);
  73.  
  74. static
  75.     mysql, //This variable will be used to manage our database
  76.     Name[MAX_PLAYERS][24], //We will use this variable to store player's name.
  77.     IP[MAX_PLAYERS][16] //We will use this variable to store player's ip.
  78.     ;
  79.    
  80. enum _PINFO
  81. {
  82.     pID,
  83.     pPassword[129],
  84.     pLevel,
  85.     pCash,
  86.     pAdmin,
  87.     pKills,
  88.     pDeaths,
  89.     pHouseKey,
  90.     pSpawn
  91. }
  92. new PlayerInfo[MAX_PLAYERS][_PINFO];
  93.  
  94. enum _HINFO
  95. {
  96.     hID,
  97.     hLevel,
  98.     hPrice,
  99.     bool:hOwned, //NO = False, YES = True
  100.     hOwner[MAX_PLAYER_NAME],
  101.     Float:hEnterX,
  102.     Float:hEnterY,
  103.     Float:hEnterZ,
  104.     Float:hExitX,
  105.     Float:hExitY,
  106.     Float:hExitZ,
  107.     hInt,
  108.     hVir,
  109.     hDescriere[MAX_PLAYER_NAME]
  110.     //hVecModel,
  111.     //Float:hVecX,
  112.     //Float:hVecY,
  113.     //Float:hVecZ,
  114.     //Float:hVecA
  115. };
  116. new HouseInfo[MAX_HOUSES][_HINFO];
  117. //new HouseCar[MAX_HOUSES];
  118. new Text3D:HouseLabel[sizeof(HouseInfo)];
  119. new HousePickup[sizeof(HouseInfo)];
  120.  
  121. enum _SINFO
  122. {
  123.     sID,
  124.     sMoney,
  125.     sPass[50],
  126.     Float:sEnterX,
  127.     Float:sEnterY,
  128.     Float:sEnterZ
  129. };
  130. new SeifInfo[MAX_PLAYERS][_SINFO];
  131. new Text3D:SeifLabel[sizeof(SeifInfo)];
  132. new SeifPickup[sizeof(SeifInfo)];
  133. new TrySeifLog[sizeof(SeifInfo)][MAX_PLAYERS];
  134.  
  135. enum _MISIUNE
  136. {
  137.     mMarfa[30],
  138.     mLoadp[40],
  139.     mUnloadp[40],
  140.     Float:mLoadp_x,
  141.     Float:mLoadp_y,
  142.     Float:mLoadp_z,
  143.     Float:mUnLoadp_x,
  144.     Float:mUnLoadp_y,
  145.     Float:mUnLoadp_z,
  146.     mDistanta,
  147.     mCastig
  148. }
  149. new MisiuneInfo[MAX_PLAYERS][_MISIUNE];
  150.  
  151. new RandomMsg[][] =
  152. {
  153.     "{FFFFFF}[{67BDFC}Sfat{FFFFFF}] Textdraw-urile pot fi ascunse folosind {67BDFC}'{F48651}/textdraw{F48651}'{FFFFFF}.",
  154.     "{FFFFFF}[{67BDFC}Sfat{FFFFFF}] Daca ai ramas pe drumuri poti folosi {67BDFC}'{67BDFC}/job{67BDFC}'{FFFFFF}.",
  155.     "{FFFFFF}[{67BDFC}Sfat{FFFFFF}] Te-ai saturat de misiunile random? Cumpara o {F48651}licenta {FFFFFF}[{67BDFC}'{F48651}/licenta{67BDFC}'{FFFFFF}].",
  156.     "{FFFFFF}[{67BDFC}Sfat{FFFFFF}] Serverul este in versiunea beta, deci orice bug va rugam sa il raportati {F48651}administratorilor{FFFFFF}.",
  157.     "{FFFFFF}[{67BDFC}Sfat{FFFFFF}] Momentan spawn-urile s-au facut in orasele {F48651}LosSantos{FFFFFF} si {F48651}LasVenturas{FFFFFF}.",
  158.     "{FFFFFF}[{67BDFC}Sfat{FFFFFF}] Pentru a activa {F48651}CruiseControl{FFFFFF} apasa tasta {F48651}2{FFFFFF}.",
  159.     "{FFFFFF}[{67BDFC}Sfat{FFFFFF}] Daca ai uitat informatiile despre cursa si ai ascuns TextDraw-ul foloseste {67BDFC}'{F48651}/cursa{67BDFC}'{FFFFFF}."
  160. };
  161. new RandomW[][] =
  162. {
  163.     "{67BDFC}Anunt Meteo {F48651}Cer senin {FFFFFF}| {F48651}Vizibilitate: Ridicata {FFFFFF}| {F48651}Vand: Nu {FFFFFF}| {F48651}Nori: Aproape 0",
  164.     "{67BDFC}Anunt Meteo {F48651}Cer moderat {FFFFFF}| {F48651}Vizibilitate: Ridicata {FFFFFF}| {F48651}Vand: Slab {FFFFFF}| {F48651}Nori: Putini",
  165.     "{67BDFC}Anunt Meteo {F48651}Cer senin, ceata{FFFFFF}| {F48651}Vizibilitate: Ridicata {FFFFFF}| {F48651}Vand: Nu {FFFFFF}| {F48651}Nori: Moderat",
  166.     "{67BDFC}Anunt Meteo {F48651}Cer moderat, ceata {FFFFFF}| {F48651}Vizibilitate: Ridicata {FFFFFF}| {F48651}Vand: Nu {FFFFFF}| {F48651}Nori: Moderat",
  167.     "{67BDFC}Anunt Meteo {F48651}Innorat {FFFFFF}| {F48651}Vizibilitate: Medie {FFFFFF}| {F48651}Vand: Slab {FFFFFF}| {F48651}Nori: Da",
  168.     "{67BDFC}Anunt Meteo {F48651}Ploi {FFFFFF}| {F48651}Vizibilitate: Medie {FFFFFF}| {F48651}Vand: Moderat{FFFFFF}| {F48651}Nori: Innorat",
  169.     "{67BDFC}Anunt Meteo {F48651}Furtuna {FFFFFF}| {F48651}Vizibilitate: Scazuta {FFFFFF}| {F48651}Vand: Puternic {FFFFFF}| {F48651}Nori: Innorat",
  170.     "{67BDFC}Anunt Meteo {F48651}Cer moderat {FFFFFF}| {F48651}Vizibilitate: Ridicata {FFFFFF}| {F48651}Vand: Slab {FFFFFF}| {F48651}Nori: Putini",
  171.     "{67BDFC}Anunt Meteo {F48651}Cer senin {FFFFFF}| {F48651}Vizibilitate: Ridicata {FFFFFF}| {F48651}Vand: Nu {FFFFFF}| {F48651}Nori: Aproape 0",
  172.     "{67BDFC}Anunt Meteo {F48651}Cer moderat {FFFFFF}| {F48651}Vizibilitate: Ridicata {FFFFFF}| {F48651}Vand: Slab {FFFFFF}| {F48651}Nori: Putini",
  173.     "{67BDFC}Anunt Meteo {F48651}Cer senin {FFFFFF}| {F48651}Vizibilitate: Ridicata {FFFFFF}| {F48651}Vand: Nu {FFFFFF}| {F48651}Nori: Aproape 0",
  174.     "{67BDFC}Anunt Meteo {F48651}Innorat {FFFFFF}| {F48651}Vizibilitate: Medie {FFFFFF}| {F48651}Vand: Slab {FFFFFF}| {F48651}Nori: Da",
  175.     "{67BDFC}Anunt Meteo {F48651}Cer senin {FFFFFF}| {F48651}Vizibilitate: Ridicata {FFFFFF}| {F48651}Vand: Nu {FFFFFF}| {F48651}Nori: Aproape 0",
  176.     "{67BDFC}Anunt Meteo {F48651}Cer moderat {FFFFFF}| {F48651}Vizibilitate: Ridicata {FFFFFF}| {F48651}Vand: Slab {FFFFFF}| {F48651}Nori: Putini",
  177.     "{67BDFC}Anunt Meteo {F48651}Innorat {FFFFFF}| {F48651}Vizibilitate: Medie {FFFFFF}| {F48651}Vand: Slab {FFFFFF}| {F48651}Nori: Da",
  178.     "{67BDFC}Anunt Meteo {F48651}Ploi {FFFFFF}| {F48651}Vizibilitate: Medie {FFFFFF}| {F48651}Vand: Moderat{FFFFFF}| {F48651}Nori: Innorat",
  179.     "{67BDFC}Anunt Meteo {F48651}Cer senin {FFFFFF}| {F48651}Vizibilitate: Ridicata {FFFFFF}| {F48651}Vand: Nu {FFFFFF}| {F48651}Nori: Aproape 0",
  180.     "{67BDFC}Anunt Meteo {F48651}Cer moderat {FFFFFF}| {F48651}Vizibilitate: Ridicata {FFFFFF}| {F48651}Vand: Slab {FFFFFF}| {F48651}Nori: Putini",
  181.     "{67BDFC}Anunt Meteo {F48651}Furtuna de nisip{FFFFFF}| {F48651}Vizibilitate: Minima {FFFFFF}| {F48651}Vand: Puternic {FFFFFF}| {F48651}Nori: Innorat"
  182. };
  183.  
  184. enum SAZONE_MAIN { //Betamaster
  185.         SAZONE_NAME[25],
  186.         Float:SAZONE_AREA[6]
  187. };
  188.  
  189. static const gSAZones[][SAZONE_MAIN] = {  // Majority of names and area coordinates adopted from Mabako's 'Zones Script' v0.2
  190.     //  NAME                            AREA (Xmin,Ymin,Zmin,Xmax,Ymax,Zmax)
  191.     // Main Zones
  192.     {"Los Santos",                  {44.60,-2892.90,-242.90,2997.00,-768.00,900.00}},
  193.     {"Las Venturas",                {869.40,596.30,-242.90,2997.00,2993.80,900.00}},
  194.     {"Bone County",                 {-480.50,596.30,-242.90,869.40,2993.80,900.00}},
  195.     {"Tierra Robada",               {-2997.40,1659.60,-242.90,-480.50,2993.80,900.00}},
  196.     {"Tierra Robada",               {-1213.90,596.30,-242.90,-480.50,1659.60,900.00}},
  197.     {"San Fierro",                  {-2997.40,-1115.50,-242.90,-1213.90,1659.60,900.00}},
  198.     {"Red County",                  {-1213.90,-768.00,-242.90,2997.00,596.30,900.00}},
  199.     {"Flint County",                {-1213.90,-2892.90,-242.90,44.60,-768.00,900.00}},
  200.     {"Whetstone",                   {-2997.40,-2892.90,-242.90,-1213.90,-1115.50,900.00}}
  201. };
  202.  
  203. new Menu:orase;
  204. new Menu:oras_ls;
  205. new Menu:oras_lv;
  206.  
  207. new Text:Data[2];
  208. new Text:Anunt[2];
  209. new Text:Name_V[MAX_PLAYERS];
  210. new Text:Speed[MAX_PLAYERS];
  211. new Text:HP[MAX_PLAYERS];
  212. new Text:HG[MAX_PLAYERS];
  213. new Text:Zones[MAX_PLAYERS];
  214. new Text:Logo[4];
  215. new PlayerText:Info[5][MAX_PLAYERS];
  216.  
  217. //new Weather;
  218. new SeifLogin[MAX_PLAYERS];
  219. new vama_LSLV, vama_LVLS;
  220. new Float:PlayerCruiseSpeed[MAX_PLAYERS];
  221. new Float:PlayerHeadingAngle[MAX_PLAYERS];
  222. new Speedo[MAX_PLAYERS];
  223. new vtimer;
  224. new addveh;
  225. new CP[MAX_PLAYERS];
  226. new cargo_marfa[250];
  227. new cursa[MAX_PLAYERS];
  228.  
  229. new VehicleNames[212][] =
  230. {
  231.     {"Landstalker"},{"Bravura"},{"Buffalo"},{"Linerunner"},{"Perrenial"},{"Sentinel"},{"Dumper"},
  232.     {"Firetruck"},{"Trashmaster"},{"Stretch"},{"Manana"},{"Infernus"},{"Voodoo"},{"Pony"},{"Mule"},
  233.     {"Cheetah"},{"Ambulance"},{"Leviathan"},{"Moonbeam"},{"Esperanto"},{"Taxi"},{"Washington"},
  234.     {"Bobcat"},{"Mr Whoopee"},{"BF Injection"},{"Hunter"},{"Premier"},{"Enforcer"},{"Securicar"},
  235.     {"Banshee"},{"Predator"},{"Bus"},{"Rhino"},{"Barracks"},{"Hotknife"},{"Cargo Trailer"},{"Previon"},
  236.     {"Coach"},{"Cabbie"},{"Stallion"},{"Rumpo"},{"RC Bandit"},{"Romero"},{"Packer"},{"Monster"},
  237.     {"Admiral"},{"Squalo"},{"Seasparrow"},{"Pizzaboy"},{"Tram"},{"Ore Trailer"},{"Turismo"},
  238.     {"Speeder"},{"Reefer"},{"Tropic"},{"Flatbed"},{"Yankee"},{"Caddy"},{"Solair"},{"Berkley's Van"},
  239.     {"Skimmer"},{"PCJ-600"},{"Faggio"},{"Freeway"},{"RC Baron"},{"RC Raider"},{"Glendale"},{"Oceanic"},
  240.     {"Sanchez"},{"Sparrow"},{"Patriot"},{"Quad"},{"Coastguard"},{"Dinghy"},{"Hermes"},{"Sabre"},
  241.     {"Rustler"},{"ZR-350"},{"Walton"},{"Regina"},{"Comet"},{"BMX"},{"Burrito"},{"Camper"},{"Marquis"},
  242.     {"Baggage"},{"Dozer"},{"Maverick"},{"News Chopper"},{"Rancher"},{"FBI Rancher"},{"Virgo"},{"Greenwood"},
  243.     {"Jetmax"},{"Hotring"},{"Sandking"},{"Blista Compact"},{"Police Maverick"},{"Boxville"},{"Benson"},
  244.     {"Mesa"},{"RCGoblin"},{"HotRacer A"},{"HotRacer B"},{"Bloodring Banger"},{"Rancher"},
  245.     {"Super GT"},{"Elegant"},{"Journey"},{"Bike"},{"Mountain Bike"},{"Beagle"},{"Cropdust"},{"Stunt"},
  246.     {"Tanker"}, {"Roadtrain"},{"Nebula"},{"Majestic"},{"Buccaneer"},{"Shamal"},{"Hydra"},{"FCR-900"},
  247.     {"NRG-500"},{"HPV1000"},{"Cement Truck"},{"Tow Truck"},{"Fortune"},{"Cadrona"},{"FBI Truck"},
  248.     {"Willard"},{"Forklift"},{"Tractor"},{"Combine"},{"Feltzer"},{"Remington"},{"Slamvan"},
  249.     {"Blade"},{"Freight"},{"Streak"},{"Vortex"},{"Vincent"},{"Bullet"},{"Clover"},{"Sadler"},
  250.     {"Firetruck LA"},{"Hustler"},{"Intruder"},{"Primo"},{"Cargobob"},{"Tampa"},{"Sunrise"},{"Merit"},
  251.     {"Utility"},{"Nevada"},{"Yosemite"},{"Windsor"},{"Monster A"},{"Monster B"},{"Uranus"},{"Jester"},
  252.     {"Sultan"},{"Stratum"},{"Elegy"},{"Raindance"},{"RC Tiger"},{"Flash"},{"Tahoma"},{"Savanna"},
  253.     {"Bandito"},{"Freight Flat"},{"Streak Carriage"},{"Kart"},{"Mower"},{"Duneride"},{"Sweeper"},
  254.     {"Broadway"},{"Tornado"},{"AT-400"},{"DFT-30"},{"Huntley"},{"Stafford"},{"BF-400"},{"Newsvan"},
  255.     {"Tug"},{"Petrol Trailer"},{"Emperor"},{"Wayfarer"},{"Euros"},{"Hotdog"},{"Club"},{"Freight Carriage"},
  256.     {"Arctic Trailer"},{"Andromada"},{"Dodo"},{"RC Cam"},{"Launch"},{"Police Car"},{"SFPD"},
  257.     {"LVPD"},{"Police Ranger"},{"Picador"},{"S.W.A.T. Van"},{"Alpha"},{"Phoenix"},{"Glendale"},
  258.     {"Sadler"},{"LuTrailer A"},{"LuTrailer B"},{"Stair Trailer"},{"Boxville"},{"Farm Plow"},
  259.     {"Utility Trailer"}
  260. };
  261.  
  262.  
  263. main()
  264. {
  265.     for(new j=1; j<=50; j++)
  266.         print(" ");
  267.     print("\t|------------------------------------|");
  268.     print("\t|             SA:MP Server           |\n");
  269.     print("\t|  Romania Regional Trucking | 0.3x  |\n");
  270.     print("\t|           Made by Punct.           |\n");
  271.     print("\t|------------------------------------|\n");
  272.     for(new j=1; j<=5; j++)
  273.         print(" ");
  274. }
  275. /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
  276. /*                          * OnPlayerCommandText *                           */
  277. /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
  278. public OnPlayerCommandText(playerid, cmdtext[])
  279. {
  280.     new idx;
  281.     new cmd[200], tmp[256];
  282.     new string[256];
  283.     new sendername[MAX_PLAYER_NAME], giveplayer[MAX_PLAYER_NAME];
  284.     GetPlayerName(playerid, sendername, sizeof(sendername));
  285.     cmd = strtok(cmdtext, idx);
  286.     printf("[CMD] %s: %s", sendername, cmd);
  287.     if(strcmp(cmd, "/help", true) == 0)                                         //help
  288.     {
  289.         if(IsPlayerConnected(playerid))
  290.         {
  291.             SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] {F48651}** {67BDFC}R{F48651}omania {67BDFC}R{F48651}egional {F48651} {67BDFC}T{F48651}rucking{67BDFC} **");
  292.             SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] /help /stats /textdraw /start /cursa /job /repair /flip");
  293.             if(PlayerInfo[playerid][pHouseKey] != 255) SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] /buyhouse /sellhouse /changespawn");
  294.             format(string, sizeof(string), "{FFFFFF}[{DD0000}CMD{FFFFFF}] {F48651}%s {B1BBBE}a folosit {FFFFFF}'{67BDFC}/help{FFFFFF}'.", sendername);
  295.             SAM(c_alb, string);
  296.         }
  297.         return 1;
  298.     }
  299.  
  300.     if(strcmp(cmd, "/job", true) == 0 || strcmp(cmd, "/respawn", true) == 0 || strcmp(cmd, "/rescue", true) == 0)    //job //respawn //rescue
  301.     {
  302.         if(IsPlayerConnected(playerid))
  303.         {
  304.             ShowMenuForPlayer(orase,playerid);
  305.             format(string, sizeof(string), "{FFFFFF}[{DD0000}CMD{FFFFFF}] {F48651}%s {B1BBBE}a folosit {FFFFFF}'{67BDFC}/job{FFFFFF}'.", sendername);
  306.             SAM(c_alb, string);
  307.         }
  308.         return 1;
  309.     }
  310. /*  if(strcmp(cmd, "/textdraw", true) == 0)                                     //textdraw
  311.     {
  312.         if(IsPlayerConnected(playerid))
  313.         {
  314.             SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] {F48651}Apasa pe {67BDFC}x{F48651}-ul de pe TexDraw-ul care vrei sa il inchizi{FFFFFF}.");
  315.             if(td5_10[playerid] == 1 || td11_15[playerid] == 1 || td27_37[playerid] == 1)
  316.             {
  317.                 SelectTextDraw(playerid, 0x84C128DD);
  318.                 if(td5_10[playerid] == 1)
  319.                     TextDrawShowForPlayer(playerid, Textdraw7[playerid]);
  320.                 else {}
  321.                 if(td11_15[playerid] == 1)
  322.                     TextDrawShowForPlayer(playerid, Textdraw15[playerid]);
  323.                 else {}
  324.                 if(td27_37[playerid] == 1)
  325.                     TextDrawShowForPlayer(playerid, Textdraw36[playerid]);
  326.                 else {}
  327.             }
  328.             else if(td5_10[playerid] == 0 && td11_15[playerid] == 0 && td27_37[playerid] == 0)
  329.                 SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] {F48651}Ai ascuns toate TextDraw-urile{FFFFFF}.");
  330.             format(string, sizeof(string), "{FFFFFF}[{DD0000}CMD{FFFFFF}] {F48651}%s {B1BBBE}a folosit {FFFFFF}'{67BDFC}/textdraw{FFFFFF}'.", sendername);
  331.             SAM(c_alb, string);
  332.         }
  333.         return 1;
  334.     }
  335.  
  336.     if(strcmp(cmd, "/stoptextdraw", true) == 0)                                 //stoptextdraw
  337.     {
  338.         if(IsPlayerConnected(playerid))
  339.         {
  340.             CancelSelectTextDraw(playerid);
  341.             TextDrawHideForPlayer(playerid, Textdraw7[playerid]);
  342.             TextDrawHideForPlayer(playerid, Textdraw15[playerid]);
  343.             TextDrawHideForPlayer(playerid, Textdraw37[playerid]);
  344.             format(string, sizeof(string), "{FFFFFF}[{DD0000}CMD{FFFFFF}] {F48651}%s {B1BBBE}a folosit {FFFFFF}'{67BDFC}/stoptextdraw{FFFFFF}'.", sendername);
  345.             SAM(c_alb, string);
  346.         }
  347.         return 1;
  348.     }
  349. */
  350.     if(strcmp(cmd, "/stop", true) == 0)                                         //stop
  351.     {
  352.         if(IsPlayerConnected(playerid))
  353.         {
  354.             if(cursa[playerid] == 1)
  355.             {
  356.                 cursa[playerid] = 0;
  357.                 SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] {F48651}Ai oprit cursa{FFFFFF}. {67BDFC}Ai platit 500$ ca daune {F48651}pentru amanarea cursei{FFFFFF}.");
  358.                 GivePlayerMoney(playerid, -500);
  359.                 format(string, sizeof(string), "{FFFFFF}[{DD0000}CMD{FFFFFF}] {F48651}%s {B1BBBE}a folosit {FFFFFF}'{67BDFC}/stop{FFFFFF}'.", sendername);
  360.                 SAM(c_alb, string);
  361.                 CP[playerid] = 0;
  362.                 DisablePlayerCheckpoint(playerid);
  363.                 for(new t; t != sizeof(Info); ++t)
  364.                 {
  365.                     PlayerTextDrawHide(playerid, Info[t][playerid]);
  366.                 }
  367.             }
  368.         }
  369.         return 1;
  370.     }
  371.  
  372.     if(strcmp(cmd, "/start2", true) == 0)                                        //start
  373.     {
  374.         if(IsPlayerConnected(playerid))
  375.         {
  376.             if(cursa[playerid] == 0)
  377.             {
  378.                 new vehicleid = GetPlayerVehicleID(playerid);
  379.                 if(IsPlayerInVehicle(playerid, vehicleid))
  380.                 {
  381.                     if(vehicleid >= 1 && vehicleid <= 50)
  382.                     {
  383.                         if(GetVehicleModel(GetVehicleTrailer(GetPlayerVehicleID(playerid))) == 584)
  384.                         {
  385.                             ShowPlayerDialog(playerid, DIALOG_START, DIALOG_STYLE_LIST, "{FFFFFF}Marfa", "1. Benzina\n2. Motorina\n3. Disel\n4. Gaz lichefiat\n5. Ulei", "Next", "Cancel");
  386.                         }   else return SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Iti trebuie un trailer pentru a incepe o cursa.");
  387.                     }
  388.                     else return SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Trebuie sa fii intr-un tir.");
  389.                 }
  390.                 else return SCM(playerid, c_alb,"{FFFFFF}[{67BDFC}System{FFFFFF}] Ai inceput deja o cursa. Termina cursa actuala si poti incepe alta.");
  391.             }
  392.             else return SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Trebuie sa fii intr-un vehicul.");
  393.         }
  394.         return 1;
  395.     }
  396.  
  397.  
  398.     if(strcmp(cmd, "/start", true) == 0)                                        //start
  399.     {
  400.         if(IsPlayerConnected(playerid))
  401.         {
  402.             if(cursa[playerid] == 0)
  403.             {
  404.                 new vehicleid = GetPlayerVehicleID(playerid);
  405.                 if(IsPlayerInVehicle(playerid, vehicleid))
  406.                 {
  407.                     if(vehicleid >= 1 && vehicleid <= 50)
  408.                     {
  409.  
  410.                         if(GetVehicleModel(GetVehicleTrailer(GetPlayerVehicleID(playerid))) == 435)
  411.                         {
  412.                             new idt = random(sizeof(Curse_Cargo));
  413.  
  414.                             format(cargo_marfa, sizeof(cargo_marfa), "{FFFFFF}** {F48651}Transporti: {67BDFC}%s \n{FFFFFF}** {F48651}Incarci la: {67BDFC}%s\n{FFFFFF}** {F48651}Descarci la: {67BDFC}%s", Curse_Cargo[idt][idx0], Curse_Cargo[idt][idx1], Curse_Cargo[idt][idx2]);
  415.                             ShowPlayerDialog(playerid, MIS, DIALOG_STYLE_MSGBOX, "Informatii cursa", cargo_marfa, "Ok", "");
  416.  
  417.                             MisiuneInfo[playerid][mLoadp_x] = Curse_Cargo[idt][idx3];
  418.                             MisiuneInfo[playerid][mLoadp_y] = Curse_Cargo[idt][idx4];
  419.                             MisiuneInfo[playerid][mLoadp_z] = Curse_Cargo[idt][idx5];
  420.                             MisiuneInfo[playerid][mUnLoadp_x] = Curse_Cargo[idt][idx6];
  421.                             MisiuneInfo[playerid][mUnLoadp_y] = Curse_Cargo[idt][idx7];
  422.                             MisiuneInfo[playerid][mUnLoadp_z] = Curse_Cargo[idt][idx8];
  423.                             strcpy(MisiuneInfo[playerid][mMarfa], Curse_Cargo[idt][idx0], 40);
  424.                             strcpy(MisiuneInfo[playerid][mLoadp], Curse_Cargo[idt][idx1], 40);
  425.                             strcpy(MisiuneInfo[playerid][mUnloadp], Curse_Cargo[idt][idx2], 40);
  426.                             SetPlayerCheckpoint(playerid, MisiuneInfo[playerid][mLoadp_x], MisiuneInfo[playerid][mLoadp_y], MisiuneInfo[playerid][mLoadp_z], 5.0);
  427.                             CP[playerid] = 1;
  428.                             cursa[playerid] = 1;
  429.                             MisiuneInfo[playerid][mCastig] = Curse_Cargo[idt][idx9];
  430.                             MisiuneInfo[playerid][mDistanta] = GetDistance(MisiuneInfo[playerid][mLoadp_x], MisiuneInfo[playerid][mLoadp_y], MisiuneInfo[playerid][mLoadp_z], MisiuneInfo[playerid][mUnLoadp_x], MisiuneInfo[playerid][mUnLoadp_y], MisiuneInfo[playerid][mUnLoadp_z])/100;
  431.                             new nr = MisiuneInfo[playerid][mDistanta];
  432.                             new m[30], dl[30], l[30], d[40];
  433.                             format(m, sizeof(m), "Marfa: %s", Curse_Cargo[idt][idx0]);
  434.                             PlayerTextDrawSetString(playerid, Info[1][playerid], m);
  435.                             format(dl, sizeof(dl), "De la: %s", Curse_Cargo[idt][idx1]);
  436.                             PlayerTextDrawSetString(playerid, Info[2][playerid], dl);
  437.                             format(l, sizeof(m), "La: %s", Curse_Cargo[idt][idx2]);
  438.                             PlayerTextDrawSetString(playerid, Info[3][playerid], l);
  439.                             format(d, sizeof(d), "Distanta: %i km", nr);
  440.                             PlayerTextDrawSetString(playerid, Info[4][playerid], d);
  441.                             for(new t; t != sizeof(Info); ++t)
  442.                             {
  443.                                 PlayerTextDrawShow(playerid, Info[t][playerid]);
  444.                             }
  445.                             format(string, sizeof(string), "{FFFFFF}[{DD0000}CMD{FFFFFF}] {F48651}%s {B1BBBE}a folosit {FFFFFF}'{67BDFC}/start{FFFFFF}'.", sendername);
  446.                             SAM(c_alb, string);
  447.                         }
  448.                         else if (GetVehicleModel(GetVehicleTrailer(GetPlayerVehicleID(playerid))) == 584)
  449.                         {
  450.                             new idt = random(sizeof(Curse_Fluid));
  451.  
  452.                             format(cargo_marfa, sizeof(cargo_marfa), "{FFFFFF}** {F48651}Transporti: {67BDFC}%s \n{FFFFFF}** {F48651}Incarci la: {67BDFC}%s\n{FFFFFF}** {F48651}Descarci la: {67BDFC}%s", Curse_Fluid[idt][idx0], Curse_Fluid[idt][idx1], Curse_Fluid[idt][idx2]);
  453.                             ShowPlayerDialog(playerid, MIS, DIALOG_STYLE_MSGBOX, "Informatii cursa", cargo_marfa, "Ok", "");
  454.  
  455.                             MisiuneInfo[playerid][mLoadp_x] = Curse_Fluid[idt][idx3];
  456.                             MisiuneInfo[playerid][mLoadp_y] = Curse_Fluid[idt][idx4];
  457.                             MisiuneInfo[playerid][mLoadp_z] = Curse_Fluid[idt][idx5];
  458.                             MisiuneInfo[playerid][mUnLoadp_x] = Curse_Fluid[idt][idx6];
  459.                             MisiuneInfo[playerid][mUnLoadp_y] = Curse_Fluid[idt][idx7];
  460.                             MisiuneInfo[playerid][mUnLoadp_z] = Curse_Fluid[idt][idx8];
  461.                             strcpy(MisiuneInfo[playerid][mMarfa], Curse_Fluid[idt][idx0], 40);
  462.                             strcpy(MisiuneInfo[playerid][mLoadp], Curse_Fluid[idt][idx1], 40);
  463.                             strcpy(MisiuneInfo[playerid][mUnloadp], Curse_Fluid[idt][idx2], 40);
  464.                             SetPlayerCheckpoint(playerid, MisiuneInfo[playerid][mLoadp_x], MisiuneInfo[playerid][mLoadp_y], MisiuneInfo[playerid][mLoadp_z], 5.0);
  465.                             CP[playerid] = 1;
  466.                             cursa[playerid] = 1;
  467.                             MisiuneInfo[playerid][mCastig] = Curse_Fluid[idt][idx9];
  468.                             MisiuneInfo[playerid][mDistanta] = GetDistance(MisiuneInfo[playerid][mLoadp_x], MisiuneInfo[playerid][mLoadp_y], MisiuneInfo[playerid][mLoadp_z], MisiuneInfo[playerid][mUnLoadp_x], MisiuneInfo[playerid][mUnLoadp_y], MisiuneInfo[playerid][mUnLoadp_z])/100;
  469.                             new nr = floatround(MisiuneInfo[playerid][mDistanta]);
  470.                             new m[30], dl[30], l[30], d[40];
  471.                             format(m, sizeof(m), "Marfa: %s", Curse_Fluid[idt][idx0]);
  472.                             PlayerTextDrawSetString(playerid, Info[1][playerid], m);
  473.                             format(dl, sizeof(dl), "De la: %s", Curse_Fluid[idt][idx1]);
  474.                             PlayerTextDrawSetString(playerid, Info[2][playerid], dl);
  475.                             format(l, sizeof(m), "La: %s", Curse_Fluid[idt][idx2]);
  476.                             PlayerTextDrawSetString(playerid, Info[3][playerid], l);
  477.                             format(d, sizeof(d), "Distanta: %i km", nr);
  478.                             PlayerTextDrawSetString(playerid, Info[4][playerid], d);
  479.                             for(new t; t != sizeof(Info); ++t)
  480.                             {
  481.                                 PlayerTextDrawShow(playerid, Info[t][playerid]);
  482.                             }
  483.                             format(string, sizeof(string), "{FFFFFF}[{DD0000}CMD{FFFFFF}] {F48651}%s {B1BBBE}a folosit {FFFFFF}'{67BDFC}/start{FFFFFF}'.", sendername);
  484.                             SAM(c_alb, string);
  485.                         }   else return SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Iti trebuie un trailer pentru a incepe o cursa.");
  486.                     }
  487.                     else return SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Trebuie sa fii intr-un tir.");
  488.                 }
  489.                 else return SCM(playerid, c_alb,"{FFFFFF}[{67BDFC}System{FFFFFF}] Ai inceput deja o cursa. Termina cursa actuala si poti incepe alta.");
  490.             }
  491.             else return SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Trebuie sa fii intr-un vehicul.");
  492.         }
  493.         return 1;
  494.     }
  495.  
  496.     if(strcmp(cmd, "/stats", true) == 0)                                        //stats
  497.     {
  498.         if(IsPlayerConnected(playerid))
  499.         {
  500.             new spawn[7];
  501.             if(PlayerInfo[playerid][pSpawn] == 1) strcpy(spawn, "Firma", 7);
  502.             else if(PlayerInfo[playerid][pSpawn] == 2) strcpy(spawn, "Acasa", 7);
  503.             new Str[1000];
  504.             format(Str, sizeof(Str), "{F48651}Nume: {67BDFC}%s\t\t{F48651}ID: {67BDFC}%d\n** {F48651}Score: {FFFFFF}\t ..... \t{67BDFC}%d\n** {F48651}Cash: {FFFFFF}\t ..... \t{67BDFC}%d{F48651}$\n{67BDFC}** {F48651}Admin: {FFFFFF}\t ..... \t{67BDFC}%d\n** {F48651}Casa: {FFFFFF}\t ..... \t{67BDFC}%d\n** {F48651}Kills: {FFFFFF}\t ..... \t{67BDFC}%d\n** {F48651}Deaths: {FFFFFF}\t ..... \t{67BDFC}%d\n** {F48651}Spawn: {FFFFFF}\t ..... \t{67BDFC}%s",
  505.             sendername, playerid,
  506.             GetPlayerScore(playerid),
  507.             GetPlayerMoney(playerid),
  508.             PlayerInfo[playerid][pAdmin],
  509.             PlayerInfo[playerid][pHouseKey],
  510.             PlayerInfo[playerid][pKills],
  511.             PlayerInfo[playerid][pDeaths],
  512.             spawn);
  513.             ShowPlayerDialog(playerid, STATS, DIALOG_STYLE_MSGBOX, ""c_a"Statisticile contului tau", Str, "Ok", "");
  514.             format(string, sizeof(string), "{FFFFFF}[{DD0000}CMD{FFFFFF}] {F48651}%s {B1BBBE}a folosit {FFFFFF}'{67BDFC}/stats{FFFFFF}'.", sendername);
  515.             SAM(c_alb, string);
  516.         }
  517.         return 1;
  518.     }
  519.  
  520.     if(strcmp(cmd, "/cursa", true) == 0)                                        //cursa
  521.     {
  522.         if(IsPlayerConnected(playerid))
  523.         {
  524.             if(cursa[playerid] == 1)
  525.             {
  526.                 new Str[500];
  527.                 format(Str, sizeof(Str), "\n{FFFFFF}** {F48651}Transporti: {67BDFC}%s\n\n{FFFFFF}** {F48651}Incarci marfa la {67BDFC}%s\n\n{FFFFFF}** {F48651}Descarci marfa la {67BDFC}%s\n\n",
  528.                 MisiuneInfo[playerid][mMarfa], MisiuneInfo[playerid][mLoadp], MisiuneInfo[playerid][mUnloadp]);
  529.                 ShowPlayerDialog(playerid, CURSA, DIALOG_STYLE_MSGBOX, "{FFFFFF}Informatii cursa", Str, "Ok", "");
  530.                 format(string, sizeof(string), "{FFFFFF}[{DD0000}CMD{FFFFFF}] {F48651}%s {B1BBBE}a folosit {FFFFFF}'{67BDFC}/cursa{FFFFFF}'.", sendername);
  531.                 SAM(c_alb, string);
  532.             }
  533.             else SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] {FFFFFF}Nu ai inceput vreo cursa{FFFFFF}.");
  534.         }
  535.         return 1;
  536.     }
  537.  
  538.  
  539.     if(strcmp(cmd, "/repair", true) == 0 || strcmp(cmd, "/fix", true) == 0)     //repair //fix
  540.     {
  541.         if(IsPlayerConnected(playerid))
  542.         {
  543.             if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
  544.             {
  545.                 RepairVehicle(GetPlayerVehicleID(playerid));
  546.                 SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] {F48651}Vehiculul tau a fost {67BDFC}reparat{FFFFFF}.");
  547.                 format(string, sizeof(string), "{FFFFFF}[{DD0000}CMD{FFFFFF}] {F48651}%s {B1BBBE}a folosit {FFFFFF}'{67BDFC}/repair{FFFFFF}' {B1BBBE}sau {FFFFFF}'{67BDFC}/fix{FFFFFF}'.", sendername);
  548.                 SAM(c_alb, string);
  549.             }
  550.             else SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Nu esti intr-un vehicul.");
  551.         }
  552.         return 1;
  553.     }
  554.  
  555.     if(strcmp(cmd, "/changespawn", true) == 0 || strcmp(cmd, "/cspawn", true) == 0)     //repair //fix
  556.     {
  557.         if(IsPlayerConnected(playerid))
  558.         {
  559.             if(PlayerInfo[playerid][pSpawn] == 1)
  560.             {
  561.                 PlayerInfo[playerid][pSpawn] = 2;
  562.                 SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Acum vei fi spawnat {F48651}acasa{FFFFFF}.");
  563.             }
  564.             else if(PlayerInfo[playerid][pSpawn] == 2)
  565.             {
  566.                 PlayerInfo[playerid][pSpawn] = 1;
  567.                 SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Acum vei fi spawnat {F48651}la firma{FFFFFF}.");
  568.             }
  569.             format(string, sizeof(string), "{FFFFFF}[{DD0000}CMD{FFFFFF}] {F48651}%s {B1BBBE}a folosit {FFFFFF}'{67BDFC}/changespan{FFFFFF}'.", sendername);
  570.             SAM(c_alb, string);
  571.  
  572.         }
  573.         return 1;
  574.     }
  575.  
  576.     if(strcmp(cmdtext, "/flip", true) == 0)                                     //flip
  577.     {
  578.         if(IsPlayerConnected(playerid))
  579.         {
  580.             if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
  581.             {
  582.                 new vehicul;
  583.                 new Float:rotatie;
  584.                 vehicul = GetPlayerVehicleID(playerid);
  585.                 GetVehicleZAngle(vehicul, rotatie);
  586.                 SetVehicleZAngle(vehicul, rotatie);
  587.                 SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Vehiculul tau a fost {F48651}indreptat{FFFFFF}.");
  588.                 format(string, sizeof(string), "{FFFFFF}[{DD0000}CMD{FFFFFF}] {F48651}%s {B1BBBE}a folosit {FFFFFF}'{67BDFC}/flip{FFFFFF}'.", sendername);
  589.                 SAM(c_alb, string);
  590.             }
  591.             else SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Nu esti intr-un vehicul.");
  592.         }
  593.         return 1;
  594.     }
  595.    
  596.     if(strcmp(cmd, "/seif", true) == 0)
  597.     {
  598.         new houseid = PlayerInfo[playerid][pHouseKey]+5;
  599.         new x_nr[182], moneys;
  600.         x_nr = strtok(cmdtext, idx);
  601.         if(!strlen(x_nr))
  602.         {
  603.             SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Foloseste {F48651}/seif [name]");
  604.             SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Nume Valabile: login, status, logout, wmoney, dmoney");
  605.             return 1;
  606.         }
  607.         //GetPlayerName(playerid, sendername, sizeof(sendername));
  608.         else if(strcmp(x_nr,"setpin",true) == 0)
  609.         {
  610.             if(SeifLogin[playerid] == 0)
  611.             {
  612.                 SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Nu esti logat la nici un seif!");
  613.                 return 1;
  614.             }
  615.             new dr = SeifLogin[playerid];
  616.             if(!PlayerToPoint(5.0, playerid, SeifInfo[dr][sEnterX],SeifInfo[dr][sEnterY],SeifInfo[dr][sEnterZ]))
  617.             {
  618.                 SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Nu esti langa seif!");
  619.                 return 1;
  620.             }
  621.             if(PlayerInfo[playerid][pAdmin] < 12 || PlayerInfo[playerid][pHouseKey] == 255)
  622.             {
  623.                 SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Doar adminii & proprietarii caselor cu seif pot schimba parolele seifurilor.");
  624.                 return 1;
  625.             }
  626.             tmp = strtok(cmdtext, idx);
  627.             if(!strlen(tmp))
  628.             {
  629.                 SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] /seif setpin [noua parola]");
  630.                 return 1;
  631.             }
  632.             if(strfind(tmp, "|", true) != -1)
  633.             {
  634.                     SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Parola introdusa nu este valabila.");
  635.                     return 1;
  636.             }
  637.             else
  638.             {
  639.                 if(SeifInfo[dr][sID] == houseid)
  640.                 {
  641.                     format(string, sizeof(string), "%s", tmp);
  642.                     strmid(SeifInfo[dr][sPass], string, 0, strlen(string), 255);
  643.                     format(string, sizeof(string), "{FFFFFF}[{67BDFC}System{FFFFFF}]Noua parola a seifului(%d) casei(%d) tale este: %s", dr, dr-5, tmp);
  644.                     SCM(playerid, c_alb, string);
  645.                 }
  646.                 else
  647.                 {
  648.                     format(string, sizeof(string), "%s", tmp);
  649.                     strmid(SeifInfo[dr][sPass], string, 0, strlen(string), 255);
  650.                     format(string, sizeof(string), "{FFFFFF}[{67BDFC}System{FFFFFF}]Noua parola a seifului %d tale este: %s", dr, tmp);
  651.                     SCM(playerid, c_alb, string);
  652.  
  653.                 }
  654.                 return 1;
  655.             }
  656.         }
  657.         if(strcmp(x_nr,"login",true) == 0)
  658.         {
  659.             if(SeifLogin[playerid] == 1)
  660.             {
  661.                 SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Esti logat la un seif, delogheaza-te mai intai!");
  662.                 return 1;
  663.             }
  664.             new x_nrr[182];
  665.             x_nrr = strtok(cmdtext, idx);
  666.             if(!strlen(x_nrr))
  667.             {
  668.                 SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Foloseste {F48651}/seif login");
  669.                 SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Nume Valabile: Admin, Helper, Event, Truck, Public, House");
  670.                 return 1;
  671.             }
  672.             if(strcmp(x_nrr,"admin",true) == 0)
  673.             {
  674.                 if(TrySeifLog[1][playerid] >= 3)
  675.                 {
  676.                     SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Nu mai ai voie sa folosesti aceasta comanda");
  677.                     return 1;
  678.                 }
  679.                 new x_nrd[182];
  680.                 x_nrd = strtok(cmdtext, idx);
  681.                 if(!strlen(x_nrd))
  682.                 {
  683.                     SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Foloseste {F48651}/seif login admin [password]");
  684.                     return 1;
  685.                 }
  686.                 if(strcmp(x_nrd,SeifInfo[1][sPass],true) == 0)
  687.                 {
  688.                     SeifLogin[playerid] = 1;
  689.                     SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Te-ai logat la un seif.");
  690.                     return 1;
  691.                 }
  692.                 else
  693.                 {
  694.                     SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Parola introdusa este incorecta");
  695.                     TrySeifLog[1][playerid]++;
  696.                     if(TrySeifLog[1][playerid] == 3)
  697.                     {
  698.                         format(string, sizeof(string), "{FFFFFF}[{67BDFC}System{FFFFFF}] {F48651}%s {FFFFFF}a incercat sa sparga parola {F48651}seifului 1{FFFFFF}.",sendername);
  699.                         SAM(c_alb, string);
  700.                     }
  701.                     return 1;
  702.                 }
  703.             }
  704.             else if(strcmp(x_nrr,"helper",true) == 0)
  705.             {
  706.                 if(TrySeifLog[2][playerid] >= 3)
  707.                 {
  708.                     SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Nu mai ai voie sa folosesti aceasta comanda");
  709.                     return 1;
  710.                 }
  711.                 new x_nrd[182];
  712.                 x_nrd = strtok(cmdtext, idx);
  713.                 if(!strlen(x_nrd))
  714.                 {
  715.                     SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Foloseste /seif login helper [password]");
  716.                     return 1;
  717.                 }
  718.                 if(strcmp(x_nrd,SeifInfo[2][sPass],true) == 0)
  719.                 {
  720.                     SeifLogin[playerid] = 2;
  721.                     SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Te-ai logat la un seif.");
  722.                     return 1;
  723.                 }
  724.                 else
  725.                 {
  726.                     SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Parola introdusa este incorecta");
  727.                     TrySeifLog[2][playerid]++;
  728.                     if(TrySeifLog[2][playerid] == 3)
  729.                     {
  730.                         format(string, sizeof(string), "{FFFFFF}[{67BDFC}System{FFFFFF}] {F48651}%s {FFFFFF}a incercat sa sparga parola {F48651}seifului 2{FFFFFF}.",sendername);
  731.                         SAM(c_alb, string);
  732.                     }
  733.                     return 1;
  734.                 }
  735.             }
  736.             else if(strcmp(x_nrr,"event",true) == 0)
  737.             {
  738.                 if(TrySeifLog[3][playerid] >= 3)
  739.                 {
  740.                     SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Nu mai ai voie sa folosesti aceasta comanda");
  741.                     return 1;
  742.                 }
  743.                 new x_nrd[182];
  744.                 x_nrd = strtok(cmdtext, idx);
  745.                 if(!strlen(x_nrd))
  746.                 {
  747.                     SCM(playerid, c_alb, "/seif login event [password]");
  748.                     return 1;
  749.                 }
  750.                 if(strcmp(x_nrd,SeifInfo[3][sPass],true) == 0)
  751.                 {
  752.                     SeifLogin[playerid] = 3;
  753.                     SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Te-ai logat la un seif.");
  754.                     return 1;
  755.                 }
  756.                 else
  757.                 {
  758.                     SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Parola introdusa este incorecta");
  759.                     TrySeifLog[3][playerid]++;
  760.                     if(TrySeifLog[3][playerid] == 3)
  761.                     {
  762.                         format(string, sizeof(string), "{FFFFFF}[{67BDFC}System{FFFFFF}] {F48651}%s {FFFFFF}a incercat sa sparga parola {F48651}seifului 31{FFFFFF}.",sendername);
  763.                         SAM(c_alb, string);
  764.                     }
  765.                     return 1;
  766.                 }
  767.             }
  768.             else if(strcmp(x_nrr,"Truck",true) == 0)
  769.             {
  770.                 if(TrySeifLog[4][playerid] >= 3)
  771.                 {
  772.                     SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Nu mai ai voie sa folosesti aceasta comanda");
  773.                     return 1;
  774.                 }
  775.                 new x_nrd[182];
  776.                 x_nrd = strtok(cmdtext, idx);
  777.                 if(!strlen(x_nrd))
  778.                 {
  779.                     SCM(playerid, c_alb, "/seif login Truck [password]");
  780.                     return 1;
  781.                 }
  782.                 if(strcmp(x_nrd,SeifInfo[4][sPass],true) == 0)
  783.                 {
  784.                     SeifLogin[playerid] = 4;
  785.                     SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Te-ai logat la un seif.");
  786.                     return 1;
  787.                 }
  788.                 else
  789.                 {
  790.                     SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Parola introdusa este incorecta");
  791.                     TrySeifLog[4][playerid]++;
  792.                     if(TrySeifLog[4][playerid] == 3)
  793.                     {
  794.                         format(string, sizeof(string), "{FFFFFF}[{67BDFC}System{FFFFFF}] {F48651}%s {FFFFFF}a incercat sa sparga parola {F48651}seifului 4{FFFFFF}.",sendername);
  795.                         SAM(c_alb, string);
  796.                     }
  797.                     return 1;
  798.                 }
  799.             }
  800.             else if(strcmp(x_nrr,"public",true) == 0)
  801.             {
  802.                 if(TrySeifLog[5][playerid] >= 3)
  803.                 {
  804.                     SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Nu mai ai voie sa folosesti aceasta comanda");
  805.                     return 1;
  806.                 }
  807.                 new x_nrd[182];
  808.                 x_nrd = strtok(cmdtext, idx);
  809.                 if(!strlen(x_nrd))
  810.                 {
  811.                     SCM(playerid, c_alb, "/seif login public [password]");
  812.                     return 1;
  813.                 }
  814.                 if(strcmp(x_nrd,SeifInfo[5][sPass],true) == 0)
  815.                 {
  816.                     SeifLogin[playerid] = 5;
  817.                     SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Te-ai logat la un seif.");
  818.                     return 1;
  819.                 }
  820.                 else
  821.                 {
  822.                     SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Parola introdusa este incorecta");
  823.                     TrySeifLog[5][playerid]++;
  824.                     if(TrySeifLog[5][playerid] == 3)
  825.                     {
  826.                         format(string, sizeof(string), "{FFFFFF}[{67BDFC}System{FFFFFF}] {F48651}%s {FFFFFF}a incercat sa sparga parola {F48651}seifului 5{FFFFFF}.",sendername);
  827.                         SAM(c_alb, string);
  828.                     }
  829.                     return 1;
  830.                 }
  831.             }
  832.             else if(strcmp(x_nrr,"house",true) == 0)
  833.             {
  834.                 if(TrySeifLog[houseid][playerid] >= 3)
  835.                 {
  836.                     SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Nu mai ai voie sa folosesti aceasta comanda.");
  837.                     return 1;
  838.                 }
  839.                 new x_nrd[182];
  840.                 x_nrd = strtok(cmdtext, idx);
  841.                 if(!strlen(x_nrd))
  842.                 {
  843.                     SCM(playerid, c_alb, "/seif login house [password]");
  844.                     return 1;
  845.                 }
  846.                 if(strcmp(x_nrd, SeifInfo[houseid][sPass], true) == 0)
  847.                 {
  848.                     SeifLogin[playerid] = houseid;
  849.                     SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Te-ai logat la un seif.");
  850.                     return 1;
  851.                 }
  852.                 else
  853.                 {
  854.                     SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Parola introdusa este incorecta");
  855.                     TrySeifLog[houseid][playerid]++;
  856.                     if(TrySeifLog[houseid][playerid] == 3)
  857.                     {
  858.                         format(string, sizeof(string), "{FFFFFF}[{67BDFC}System{FFFFFF}] {F48651}%s {FFFFFF}a incercat sa sparga parola {F48651}seifului casei %d{FFFFFF}.",sendername, houseid);
  859.                         SAM(c_alb, string);
  860.                     }
  861.                     return 1;
  862.                 }
  863.             }
  864.             else
  865.             {
  866.                 SCM(playerid, c_alb, "|_______________________ Seif _______________________|");
  867.                 SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}]/seif login [name] [password]");
  868.                 SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}]Nume Valabile: Admin, Helper, Event, Truck, Public, House");
  869.                 SCM(playerid, c_alb, "|____________________________________________________|");
  870.                 return 1;
  871.             }
  872.         }
  873.         else if(strcmp(x_nr,"dmoney",true) == 0)
  874.         {
  875.             if(SeifLogin[playerid] == 0)
  876.             {
  877.                 SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Nu esti logat la nici un seif!");
  878.                 return 1;
  879.             }
  880.             new dr = SeifLogin[playerid];
  881.             if(!PlayerToPoint(5.0, playerid, SeifInfo[dr][sEnterX], SeifInfo[dr][sEnterY], SeifInfo[dr][sEnterZ]))
  882.             {
  883.                 SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Nu esti langa seif!");
  884.                 return 1;
  885.             }
  886.             tmp = strtok(cmdtext, idx);
  887.             if(!strlen(tmp))
  888.             {
  889.                 SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] /seif dmoney [suma]");
  890.                 return 1;
  891.             }
  892.             moneys = strval(tmp);
  893.             if(moneys <= 0)
  894.             {
  895.                 SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] /seif dmoney [suma]");
  896.                 return 1;
  897.             }
  898.             if(moneys > GetPlayerMoney(playerid))
  899.             {
  900.                 SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Nu detii aceasta suma.");
  901.                 return 1;
  902.             }
  903.             else
  904.             {
  905.                 GivePlayerMoney(playerid, -moneys);
  906.                 SeifInfo[dr][sMoney] += moneys;
  907.                 format(string, sizeof(string), "{FFFFFF}[{67BDFC}System{FFFFFF}] Ai depus $%d in seiful factiuni",moneys);
  908.                 SCM(playerid, c_alb, string);
  909.             }
  910.         }
  911.         else if(strcmp(x_nr,"wmoney",true) == 0)
  912.         {
  913.             if(SeifLogin[playerid] == 0)
  914.             {
  915.                 SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Nu esti logat la nici un seif!");
  916.                 return 1;
  917.             }
  918.             new PlayerName[MAX_PLAYER_NAME];
  919.             GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
  920.             //if(PlayerInfo[playerid][pLeader] == 0)
  921.             //{
  922.             //    SCM(playerid, c_alb, "Server: Doar lideri pot scoate bani din seif!");
  923.             //    return 1;
  924.             //}
  925.             new dr = SeifLogin[playerid];
  926.             if(!PlayerToPoint(5.0, playerid, SeifInfo[dr][sEnterX],SeifInfo[dr][sEnterY],SeifInfo[dr][sEnterZ]))
  927.             {
  928.                 SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Nu esti langa seif!");
  929.                 return 1;
  930.             }
  931.             tmp = strtok(cmdtext, idx);
  932.             if(!strlen(tmp))
  933.             {
  934.                 SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] /seif wmoney [suma]");
  935.                 return 1;
  936.             }
  937.             moneys = strval(tmp);
  938.             //if(PlayerInfo[playerid][pMember] + PlayerInfo[playerid][pLeader] != dr)
  939.             //{
  940.             //    return 1;
  941.             //}
  942.             if(moneys <= 0)
  943.             {
  944.                 SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] /seif wmoney [suma]");
  945.                 return 1;
  946.             }
  947.             if(moneys > SeifInfo[dr][sMoney])
  948.             {
  949.                 SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] In seif nu se gasesc atatia bani.");
  950.                 return 1;
  951.             }
  952.             else
  953.             {
  954.                 GivePlayerMoney(playerid, moneys);
  955.                 SeifInfo[dr][sMoney] -= moneys;
  956.                 format(string, sizeof(string), "Ai scos $%s din seiful factiuni.", moneys);
  957.                 SCM(playerid, c_alb, string);
  958.                 return 1;
  959.             }
  960.         }
  961.         else if(strcmp(x_nr,"status",true) == 0)
  962.         {
  963.             if(SeifLogin[playerid] == 0)
  964.             {
  965.                 SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Nu esti logat la nici un seif!");
  966.                 return 1;
  967.             }
  968.             new dr = SeifLogin[playerid];
  969.             if(!PlayerToPoint(1.0, playerid, SeifInfo[dr][sEnterX], SeifInfo[dr][sEnterY], SeifInfo[dr][sEnterZ]))
  970.             {
  971.                 SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Nu esti langa seif!");
  972.                 return 1;
  973.             }
  974.             else
  975.             {
  976.                 new ttext[40];
  977.                 if(SeifLogin[playerid] == 1) { ttext = "admin"; }
  978.                 else if(SeifLogin[playerid] == 2) { ttext = "helper"; }
  979.                 else if(SeifLogin[playerid] == 3) { ttext = "event"; }
  980.                 else if(SeifLogin[playerid] == 4) { ttext = "truck"; }
  981.                 else if(SeifLogin[playerid] == 5) { ttext = "public"; }
  982.                 else if(SeifLogin[playerid] == houseid) { ttext = "casei"; }
  983.                 else { ttext = "empty"; }
  984.                 format(string, sizeof(string), "{FFFFFF}In {0099FF}seiful %s {FFFFFF}se gasesc {228B22}%d${FFFFFF}.", ttext, SeifInfo[dr][sMoney]);
  985.                 SCM(playerid, c_alb, string);
  986.             }
  987.         }
  988.         else if(strcmp(x_nr,"logout",true) == 0)
  989.         {
  990.             if(SeifLogin[playerid] == 0)
  991.             {
  992.                 SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Nu esti logat la nici un seif!");
  993.                 return 1;
  994.             }
  995.             //new dr = SeifLogin[playerid];
  996.             //if(!PlayerToPoint(5.0, playerid, SeifInfo[dr][sEnterX],SeifInfo[dr][sEnterY],SeifInfo[dr][sEnterZ]))
  997.             //{
  998.             //    SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Nu esti langa seif!");
  999.             //    return 1;
  1000.             //}
  1001.             //else
  1002.             //{
  1003.                 SeifLogin[playerid] = 0;
  1004.                 SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Te-ai deconectat cu succes de la seif!");
  1005.             //    return 1;
  1006.             //}
  1007.         }
  1008.         else
  1009.         {
  1010.             SCM(playerid, c_alb, "|_______________________ Seif _______________________|");
  1011.             SCM(playerid, c_alb, "/seif [name]");
  1012.             SCM(playerid, c_alb, "Nume Valabile: login, status, logout, wmoney, dmoney");
  1013.             SCM(playerid, c_alb, "|____________________________________________________|");
  1014.             return 1;
  1015.         }
  1016.     }
  1017. //////////////////////////////// Comenzi Casa //////////////////////////////////
  1018.     if(strcmp(cmd, "/enterh", true) == 0)
  1019.     {
  1020.         if(IsPlayerConnected(playerid))
  1021.         {
  1022.             for(new i=0; i<MAX_HOUSES; i++)
  1023.             {
  1024.                 if(PlayerToPoint(1.0, playerid, HouseInfo[i][hEnterX], HouseInfo[i][hEnterY], HouseInfo[i][hEnterZ]))// && GetPlayerInterior(playerid) == HouseInfo[i][hOutsideInt] && GetPlayerVirtualWorld(playerid) == HouseInfo[i][hOutsideVir])
  1025.                 {
  1026.                     SetPlayerPos(playerid, HouseInfo[i][hExitX], HouseInfo[i][hExitY], HouseInfo[i][hExitZ]);
  1027.                     SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] {F48651}Bun venit acasa{FFFFFF}!");
  1028.                     SetPlayerInterior(playerid, HouseInfo[i][hInt]);
  1029.                     SetPlayerVirtualWorld(playerid, HouseInfo[i][hVir]);
  1030.                 }
  1031.             }
  1032.         }
  1033.         return 1;
  1034.     }
  1035.  
  1036.     if(strcmp(cmd, "/exith", true) == 0)
  1037.     {
  1038.         if(IsPlayerConnected(playerid))
  1039.         {
  1040.             for(new i=0; i<MAX_HOUSES; i++)
  1041.             {
  1042.                 if(PlayerToPoint(1.5, playerid, HouseInfo[i][hExitX], HouseInfo[i][hExitY], HouseInfo[i][hExitZ]))// && GetPlayerInterior(playerid) == HouseInfo[i][hOutsideInt] && GetPlayerVirtualWorld(playerid) == HouseInfo[i][hOutsideVir])
  1043.                 {
  1044.                     SetPlayerPos(playerid, HouseInfo[i][hEnterX], HouseInfo[i][hEnterY], HouseInfo[i][hEnterZ]+0.5);
  1045.                     SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] {F48651}Drum bun{FFFFFF}!");
  1046.                     SetPlayerInterior(playerid, 0);
  1047.                     SetPlayerVirtualWorld(playerid, 0);
  1048.                 }
  1049.             }
  1050.         }
  1051.         return 1;
  1052.     }
  1053.  
  1054.     if(strcmp(cmdtext, "/buyhouse", true) == 0)
  1055.     {
  1056.         new pName[MAX_PLAYER_NAME];
  1057.         GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
  1058.         for(new i = 0; i < MAX_HOUSES; i++)
  1059.         {
  1060.             if(PlayerToPoint(0.7, playerid, HouseInfo[i][hEnterX], HouseInfo[i][hEnterY], HouseInfo[i][hEnterZ]))// && GetPlayerInterior(playerid) == HouseInfo[i][hOutsideInt] && GetPlayerVirtualWorld(playerid) == HouseInfo[i][hOutsideVir])
  1061.             {
  1062.                 if(GetPlayerScore(playerid) < HouseInfo[i][hLevel]) return SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Nu ai level-ul necesar.");
  1063.                 if(PlayerInfo[playerid][pHouseKey] != 255) return SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Nu poti detine mai mult de o casa.");
  1064.                 if(HouseInfo[i][hOwned] == true) { SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Aceasta casa are deja un proprietar."); return 1; }
  1065.                 if(GetPlayerMoney(playerid) < HouseInfo[i][hPrice]) return SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Nu ai suficienti bani.");
  1066.                 HouseInfo[i][hOwned] = true;
  1067.                 PlayerInfo[playerid][pHouseKey] = HouseInfo[i][hID];
  1068.                 strcpy(HouseInfo[i][hOwner], pName, MAX_PLAYER_NAME);
  1069.                 GivePlayerMoney(playerid, -HouseInfo[i][hPrice]);
  1070.                 format(string, sizeof(string), "{FFFFFF}[{67BDFC}System{FFFFFF}] Ti-ai cumparat o casa noua. [ID:%d].", HouseInfo[i][hPrice]);
  1071.                 SCM(playerid, c_alb, string);
  1072.                 SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Acum iti poti schimba spawn-ul folosind '{F48651}/changespawn{FFFFFF}'.");
  1073.                 OnPropUpdate(1, i);
  1074.                 SaveHouse(i);
  1075.             }
  1076.         }
  1077.         return 1;
  1078.     }
  1079.  
  1080.     if(strcmp(cmdtext, "/sellhouse", true) == 0)
  1081.     {
  1082.         new pName[MAX_PLAYER_NAME];
  1083.         GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
  1084.         for(new i = 0; i < MAX_HOUSES; i++)
  1085.         {
  1086.             if(PlayerToPoint(2.0, playerid, HouseInfo[i][hEnterX], HouseInfo[i][hEnterY], HouseInfo[i][hEnterZ]))// && GetPlayerInterior(playerid) == HouseInfo[i][hOutsideInt] && GetPlayerVirtualWorld(playerid) == HouseInfo[i][hOutsideVir])
  1087.             {
  1088.                 if(strcmp(HouseInfo[i][hOwner], pName, true, strlen(HouseInfo[i][hOwner]))) return SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Nu esti proprietarul acestei case.");
  1089.                 if(PlayerInfo[playerid][pHouseKey] == 255) return SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Nu ai o casa.");
  1090.                 strcpy(HouseInfo[i][hOwner], "For sale", 9);
  1091.                 HouseInfo[i][hOwned] = false;
  1092.                 PlayerInfo[playerid][pHouseKey] = 255;
  1093.                 new money = HouseInfo[i][hPrice]/2 + HouseInfo[i][hPrice]/4;
  1094.                 GivePlayerMoney(playerid, money);
  1095.                 format(string, sizeof(string), "{FFFFFF}[{67BDFC}System{FFFFFF}] Ti-ai vandut casa cu {F48651}%d ${FFFFFF}.", money);
  1096.                 SCM(playerid, c_alb, string);
  1097.                 if(PlayerInfo[playerid][pSpawn] == 2) PlayerInfo[playerid][pSpawn] = 1;
  1098.                 SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Pentru ca ti-ai vandut casa, spawn-ul ti s-a schimba la firma.");
  1099.                 OnPropUpdate(1, i);
  1100.                 SaveHouse(i);
  1101.              }
  1102.         }
  1103.         return 1;
  1104.     }
  1105.  
  1106.     /*if(!strcmp(cmdtext, "/getcar", true))
  1107.     {
  1108.         new pName[MAX_PLAYER_NAME], Float:X, Float:Y, Float:Z, Float:A;
  1109.         new houseid = cmdtext[8]; //The param. /tphousecar is 0-8. With a space, 9. Then, the param is at 10.
  1110.         GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
  1111.         if(!strcmp(HouseInfo[houseid][hOwner], pName, false)) return SCM(playerid, c_alb, "Nu esti proprietarul acestei case.");
  1112.         if(!IsPlayerInAnyVehicle(playerid)) return SCM(playerid, c_alb, "Trebuie sa fii intr-un vehicul!"); //if is player not in an vehicle, send an message and stop (RETURN [message])
  1113.         GetVehiclePos(GetPlayerVehicleID(playerid), X, Y, Z);
  1114.         GetVehicleZAngle(GetPlayerVehicleID(playerid), A);
  1115.         HouseInfo[houseid][hVecX] = X;
  1116.         HouseInfo[houseid][hVecY] = Y;
  1117.         HouseInfo[houseid][hVecZ] = Z;
  1118.         HouseInfo[houseid][hVecA] = A;
  1119.         return 1;
  1120.     }*/
  1121. //////////////////////////////// Comenzi Admin /////////////////////////////////
  1122.     if(strcmp(cmd, "/ahelp", true) == 0 || strcmp(cmd, "/ah", true) == 0)       //ahelp
  1123.     {
  1124.         if(IsPlayerConnected(playerid))
  1125.         {
  1126.             if(PlayerInfo[playerid][pAdmin] >= 10)
  1127.             {
  1128.                 SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] {F48651}Comenzile adminilor serverului {67BDFC}R{F48651}omania{67BDFC} T{F48651}rucking{67BDFC} R{F48651}egional {FFFFFF}.");
  1129.                 if(PlayerInfo[playerid][pAdmin] >= 11)
  1130.                 {
  1131.                     SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}Admin 1{FFFFFF}] /nitro /hidra /tod /kick");
  1132.                 }
  1133.                 if(PlayerInfo[playerid][pAdmin] >= 12)
  1134.                 {
  1135.                     SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}Admin 2{FFFFFF}] /goto /gethere /anunt");
  1136.                 }
  1137.                 if(PlayerInfo[playerid][pAdmin] >= 13)
  1138.                 {
  1139.                     SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}Admin 3{FFFFFF}] /addhev /delveh");
  1140.                 }
  1141.                 if(PlayerInfo[playerid][pAdmin] >= 14)
  1142.                 {
  1143.                     SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}Admin 4{FFFFFF}] /chouse /cseif");
  1144.                 }
  1145.                 if(PlayerInfo[playerid][pAdmin] >= 15)
  1146.                 {
  1147.                     SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}Admin 5{FFFFFF}] /givemoneyall");
  1148.                 }
  1149.                 if(PlayerInfo[playerid][pAdmin] >= 16)
  1150.                 {
  1151.                     SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}Admin 6{FFFFFF}] /setadmin");
  1152.                 }
  1153.                 format(string, sizeof(string), "{FFFFFF}[{DD0000}CMD{FFFFFF}] {F48651}%s {B1BBBE}a folosit {FFFFFF}'{67BDFC}/ahelp{FFFFFF}'.", sendername);
  1154.                 SAM(c_alb, string);
  1155.             }
  1156.         }
  1157.         return 1;
  1158.     }
  1159.  
  1160.     if(strcmp(cmd, "/cseif", true) == 0 || strcmp(cmd, "/createseif", true) == 0)     //cseif
  1161.     {
  1162.         if(IsPlayerConnected(playerid))
  1163.         {
  1164.             if(PlayerInfo[playerid][pAdmin] >= 14)
  1165.             {
  1166.                 tmp = strtok(cmdtext, idx);
  1167.                 if(!strlen(tmp))
  1168.                 {
  1169.                     SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Foloseste {67BDFC}/{F48651}cseif [id]");
  1170.                     return 1;
  1171.                 }
  1172.                 new seifid;
  1173.                 seifid = strval(tmp);
  1174.                 new File[100];
  1175.                 format(File, sizeof(File), "Seifuri/%d.ini", seifid);
  1176.                 new Float:X, Float:Y, Float:Z;
  1177.                 GetPlayerPos(playerid, X,Y,Z);
  1178.                 dini_Create(File);
  1179.                 dini_IntSet(File, "ID", seifid);
  1180.                 dini_IntSet(File, "Money", 0);
  1181.                 strmid(SeifInfo[seifid][sPass], "parola", 0, strlen(string), 255);
  1182.                 dini_FloatSet(File, "EnterX", X);
  1183.                 dini_FloatSet(File, "EnterY", Y);
  1184.                 dini_FloatSet(File, "EnterZ", Z);
  1185.                 format(string, sizeof(string), "{FFFFFF}[{67BDFC}System{FFFFFF}] Ai creat seiful cu id-ul {F48651}%d{FFFFFF}.", seifid);
  1186.                 SCM(playerid, c_alb, string);
  1187.                 LoadSeif(seifid);
  1188.                 OnPropUpdate(2, seifid);
  1189.                 format(string, sizeof(string), "{FFFFFF}[{DD0000}CMD{FFFFFF}] {F48651}%s {B1BBBE}a folosit {FFFFFF}'{67BDFC}/createseif{FFFFFF}'.", sendername);
  1190.                 SAM(c_alb, string);
  1191.             } else SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] {F48651}Doar adminii au acces la aceasta comanda{FFFFFF}.");
  1192.         }
  1193.         return 1;
  1194.     }
  1195.  
  1196.     if(strcmp(cmd, "/chouse", true) == 0 || strcmp(cmd, "/createhouse", true) == 0)       //chouse
  1197.     {
  1198.         if(IsPlayerConnected(playerid))
  1199.         {
  1200.             if(PlayerInfo[playerid][pAdmin] >= 14)
  1201.             {
  1202.                 tmp = strtok(cmdtext, idx);
  1203.                 if(!strlen(tmp))
  1204.                 {
  1205.                     SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Foloseste {67BDFC}/{F48651}chouse [level] [pret] [interior] [id casa]'");
  1206.                     return 1;
  1207.                 }
  1208.                 new level;
  1209.                 level = strval(tmp);
  1210.                 tmp = strtok(cmdtext, idx);
  1211.                 if(!strlen(tmp))
  1212.                 {
  1213.                     SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Foloseste {67BDFC}/{F48651}chouse [Level] [pret] [interior] [id casa]");
  1214.                     return 1;
  1215.                 }
  1216.                 new pret;
  1217.                 pret = strval(tmp);
  1218.                 tmp = strtok(cmdtext, idx);
  1219.                 if(!strlen(tmp))
  1220.                 {
  1221.                     SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Foloseste {67BDFC}/{F48651}chouse [level] [Pret] [interior] [id casa]");
  1222.                     return 1;
  1223.                 }
  1224.                 new interior;
  1225.                 interior = strval(tmp);
  1226.                 tmp = strtok(cmdtext, idx);
  1227.                 if(!strlen(tmp))
  1228.                 {
  1229.                     SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Foloseste {67BDFC}/{F48651}chouse [level] [pret] [Interior] [id casa]");
  1230.                     return 1;
  1231.                 }
  1232.                 new houseid;
  1233.                 houseid = strval(tmp);
  1234.                 new File[100];
  1235.                 format(File, sizeof(File), "Case/%d.ini", houseid);
  1236.                 new Float:X, Float:Y, Float:Z;
  1237.                 GetPlayerPos(playerid, X,Y,Z);
  1238.                 dini_Create(File);
  1239.                 dini_IntSet(File, "ID", houseid);
  1240.                 dini_IntSet(File, "Level", level);
  1241.                 dini_IntSet(File, "Price", pret);
  1242.                 dini_IntSet(File, "Owned", false);
  1243.                 strcpy(HouseInfo[houseid][hOwner], "For Sale", 9);
  1244.                 dini_FloatSet(File, "EnterX", X);
  1245.                 dini_FloatSet(File, "EnterY", Y);
  1246.                 dini_FloatSet(File, "EnterZ", Z);
  1247.                 dini_IntSet(File, "Vir", houseid);
  1248.                 if(interior == 3)
  1249.                 {
  1250.                     dini_FloatSet(File, "ExitX", 235.508);
  1251.                     dini_FloatSet(File, "ExitY", 1189.169);
  1252.                     dini_FloatSet(File, "ExitZ", 1080.340);
  1253.                     dini_IntSet(File, "Int", 3);
  1254.                     strcpy(HouseInfo[houseid][hDescriere], "Casa mare", 10);
  1255.                 }
  1256.                 if(interior == 5)
  1257.                 {
  1258.                     dini_FloatSet(File, "ExitX", 1299.14);
  1259.                     dini_FloatSet(File, "ExitY", -794.77);
  1260.                     dini_FloatSet(File, "ExitZ", 1084.00);
  1261.                     dini_IntSet(File, "Int", 5);
  1262.                     strcpy(HouseInfo[houseid][hDescriere], "Madd Doggs Mansion", 19);
  1263.                 }
  1264.                 else if(interior == 7)
  1265.                 {
  1266.                     dini_FloatSet(File, "ExitX", 225.631);
  1267.                     dini_FloatSet(File, "ExitY", 1022.480);
  1268.                     dini_FloatSet(File, "ExitZ", 1084.070);
  1269.                     dini_IntSet(File, "Int", 7);
  1270.                     strcpy(HouseInfo[houseid][hDescriere], "Casa foarte mare", 17);
  1271.                 }
  1272.                 else if(interior == 12)
  1273.                 {
  1274.                     dini_FloatSet(File, "ExitX", 2324.419);
  1275.                     dini_FloatSet(File, "ExitY", -1145.568);
  1276.                     dini_FloatSet(File, "ExitZ", 1050.719);
  1277.                     dini_IntSet(File, "Int", 12);
  1278.                     strcpy(HouseInfo[houseid][hDescriere], "Unused safe house", 20);
  1279.                 }
  1280.                 format(string, sizeof(string), "{FFFFFF}[{67BDFC}System{FFFFFF}] Ai creat casa cu id-ul {F48651}%d{FFFFFF}.", houseid);
  1281.                 SCM(playerid, c_alb, string);
  1282.                 LoadHouse(houseid);
  1283.                 OnPropUpdate(1, houseid);
  1284.                 format(string, sizeof(string), "{FFFFFF}[{DD0000}CMD{FFFFFF}] {F48651}%s {B1BBBE}a folosit {FFFFFF}'{67BDFC}/createhouse{FFFFFF}'.", sendername);
  1285.                 SAM(c_alb, string);
  1286.  
  1287.             } else SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] {F48651}Doar adminii au acces la aceasta comanda{FFFFFF}.");
  1288.         }
  1289.         return 1;
  1290.     }
  1291.  
  1292.     if(strcmp(cmdtext, "/anunt", true) == 0)
  1293.     {
  1294.         if(IsPlayerConnected(playerid))
  1295.         {
  1296.             if(PlayerInfo[playerid][pAdmin] >= 12)
  1297.             {
  1298.                 new pName[MAX_PLAYER_NAME];
  1299.                 GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
  1300.                 ShowPlayerDialog(playerid, DIALOG_ANUNT, DIALOG_STYLE_INPUT, "{FFFFFF}Anunt", "{FFFFFF}Introduceti anuntul care doriti sa-l faceti public:", "OK", "Cancel");
  1301.                 format(string, sizeof(string), "{FFFFFF}[{DD0000}CMD{FFFFFF}] {F48651}%s {B1BBBE}a folosit {FFFFFF}'{67BDFC}/anunt{FFFFFF}'.", sendername);
  1302.                 SAM(c_alb, string);
  1303.             }
  1304.         }
  1305.         return 1;
  1306.     }
  1307.  
  1308.     if(strcmp(cmd, "/givemoneyall", true) == 0)
  1309.     {
  1310.         if(IsPlayerConnected(playerid))
  1311.         {
  1312.             new PlayerName[MAX_PLAYER_NAME], bani;
  1313.             GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
  1314.             if(PlayerInfo[playerid][pAdmin] >= 14)
  1315.             {
  1316.                 tmp = strtok(cmdtext, idx);
  1317.                 if(!strlen(tmp))
  1318.                 {
  1319.                     SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Foloseste {67BDFC}/{F48651}givemoneyall [suma]");
  1320.                     return 1;
  1321.                 }
  1322.                 bani = strval(tmp);
  1323.                 if(bani < 1)
  1324.                 {
  1325.                     SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Nu poti da mai putin de {F48651}1$");
  1326.                     return 1;
  1327.                 }
  1328.                 for(new i=0; i<MAX_PLAYERS; i++)
  1329.                 {
  1330.                     GivePlayerMoney(i, bani);
  1331.                     format(string, sizeof(string), "{FFFFFF}[{67BDFC}System{FFFFFF}] {67BDFC}Administratorul {F48651}%s {67BDFC}a dat la toata lumea cate {F48651}%d${FFFFFF}.", sendername, bani);
  1332.                     SCM(i, c_alb, string);
  1333.                 }
  1334.                 format(string, sizeof(string), "{FFFFFF}[{DD0000}CMD{FFFFFF}] {F48651}%s {B1BBBE}a folosit {FFFFFF}'{67BDFC}/givemoneyall %d{FFFFFF}'.", sendername, bani);
  1335.                 SAM(c_alb, string);
  1336.             }
  1337.             else SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] {F48651}Doar adminii au acces la aceasta comanda{FFFFFF}.");
  1338.         }
  1339.         return 1;
  1340.     }
  1341.  
  1342.     if(strcmp(cmd, "/setadmin", true) == 0)                                     //setadmin
  1343.     {
  1344.         if(IsPlayerConnected(playerid))
  1345.         {
  1346.             tmp = strtok(cmdtext, idx);
  1347.             if(!strlen(tmp))
  1348.             {
  1349.                 SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Foloseste {67BDFC}/{F48651}setadmin [playerid/PartOfName] [AdminLevel]");
  1350.                 return 1;
  1351.             }
  1352.             new para1;
  1353.             new level;
  1354.             para1 = ReturnUser(tmp);
  1355.             tmp = strtok(cmdtext, idx);
  1356.             level = strval(tmp);
  1357.             new PlayerName[MAX_PLAYER_NAME];
  1358.             GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
  1359.             if(PlayerInfo[playerid][pAdmin] >= 15)
  1360.             {
  1361.                 if(IsPlayerConnected(para1))
  1362.                 {
  1363.                     if(para1 != INVALID_PLAYER_ID)
  1364.                     {
  1365.                         GetPlayerName(para1, giveplayer, sizeof(giveplayer));
  1366.                         GetPlayerName(playerid, sendername, sizeof(sendername));
  1367.                         format(string, sizeof(string), "{FFFFFF}[{67BDFC}System{FFFFFF}] {FFFFFF}Ai fost promovat {F48651}admin level %d {FFFFFF}de catre {F48651}%s{FFFFFF}.", level-10, sendername);
  1368.                         SCM(para1, c_alb, string);
  1369.                         format(string, sizeof(string), "{FFFFFF}[{67BDFC}System{FFFFFF}] {FFFFFF}L-ai promovat pe {F48651}%s {FFFFFF}la gradul de {F48651}admin level %d{FFFFFF}.", giveplayer, level-10);
  1370.                         SCM(playerid, c_alb, string);
  1371.                         format(string, sizeof(string), "{FFFFFF}[{67BDFC}System{FFFFFF}] {F48651}%s {67BDFC}l-a promovat pe {F48651}%s {67BDFC}la gradul de {F48651}admin nivel %d{FFFFFF}.",sendername, giveplayer, level-10);
  1372.                         PlayerInfo[para1][pAdmin] = level+10;
  1373.                         format(string, sizeof(string), "{FFFFFF}[{DD0000}CMD{FFFFFF}] {F48651}%s {B1BBBE}a folosit {FFFFFF}'{67BDFC}/setadmin %s %d{FFFFFF}'.", sendername, giveplayer, level-10);
  1374.                         SAM(c_alb, string);
  1375.                     }
  1376.                 }
  1377.                 else SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Acest jucator nu este {F48651}online{FFFFFF}.");
  1378.             }
  1379.             else SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] {F48651}Doar adminii au acces la aceasta comanda{FFFFFF}.");
  1380.         }
  1381.         return 1;
  1382.     }
  1383.  
  1384.     if(strcmp(cmd, "/tod", true) == 0)
  1385.     {
  1386.         if(IsPlayerConnected(playerid))
  1387.         {
  1388.             tmp = strtok(cmdtext, idx);
  1389.             if(!strlen(tmp))
  1390.             {
  1391.                 SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Foloseste {67BDFC}/{F48651}tod [ora]");
  1392.                 return 1;
  1393.             }
  1394.             new hour;
  1395.             hour = strval(tmp);
  1396.             if (PlayerInfo[playerid][pAdmin] >= 10)
  1397.             {
  1398.                 SetWorldTime(hour);
  1399.                 format(string, sizeof(string), "{FFFFFF}[{67BDFC}System{FFFFFF}] Ceasul a fost schimbat la ora {F48651}%d", hour);
  1400.                 SendClientMessageToAll(c_alb, string);
  1401.                 format(string, sizeof(string), "{FFFFFF}[{DD0000}CMD{FFFFFF}] {F48651}%s {B1BBBE}a folosit {FFFFFF}'{67BDFC}/tod %d{FFFFFF}'.", sendername, hour);
  1402.                 SAM(c_alb, string);
  1403.             }
  1404.             else SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] {F48651}Doar adminii au acces la aceasta comanda{FFFFFF}.");
  1405.         }
  1406.         return 1;
  1407.     }
  1408.  
  1409.     if(strcmp(cmd, "/addveh", true) == 0)                                       //addveh
  1410.     {
  1411.         if(IsPlayerConnected(playerid))
  1412.         {
  1413.             if(PlayerInfo[playerid][pAdmin] >= 13)
  1414.             {
  1415.                 tmp = strtok(cmdtext, idx);
  1416.                 if(!strlen(tmp))
  1417.                 {
  1418.                     SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Foloseste {67BDFC}/{F48651}addveh [model]");
  1419.                     return 1;
  1420.                 }
  1421.                 new car;
  1422.                 car = strval(tmp);
  1423.                 if(car < 400 || car > 611)
  1424.                 {
  1425.                     SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] {FFFFFF}Modelul masinilor trebuie sa fie cuprins intre {F48651}400 {FFFFFF}si {F48651}611{FFFFFF}.");
  1426.                     return 1;
  1427.                 }
  1428.                 new Float:X, Float:Y, Float:Z, Float:A;
  1429.                 GetPlayerPos(playerid, X,Y,Z);
  1430.                 GetPlayerFacingAngle(playerid, A);
  1431.                 new carid = CreateVehicle(car, X, Y, Z+1.0, A, -1, -1, 6000);
  1432.                 format(string, sizeof(string), "{FFFFFF}[{67BDFC}System{FFFFFF}] {FFFFFF}Masina cu id-ul {F48651}%d {FFFFFF}a fost creata.", carid);
  1433.                 SCM(playerid, c_alb, string);
  1434.                 addveh++;
  1435.                 format(string, sizeof(string), "{FFFFFF}[{DD0000}CMD{FFFFFF}] {F48651}%s {B1BBBE}a folosit {FFFFFF}'{67BDFC}/addveh %d{FFFFFF}'.", sendername, car);
  1436.                 SAM(c_alb, string);
  1437.             }
  1438.             else SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] {F48651}Doar adminii au acces la aceasta comanda{FFFFFF}.");
  1439.         }
  1440.         return 1;
  1441.     }
  1442.  
  1443.     if(strcmp(cmd, "/delveh", true) == 0)                                       //delveh
  1444.     {
  1445.         if(IsPlayerConnected(playerid))
  1446.         {
  1447.             if(PlayerInfo[playerid][pAdmin] >= 13)
  1448.             {
  1449.                 if(addveh == 0) SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Nu a fost creata vreo masina.");
  1450.                 tmp = strtok(cmdtext, idx);
  1451.                 if(!strlen(tmp))
  1452.                 {
  1453.                     SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Foloseste {67BDFC}/{F48651}delveh [id]");
  1454.                     return 1;
  1455.                 }
  1456.                 new idv;
  1457.                 idv = strval(tmp);
  1458.                 if(idv < addveh+90)
  1459.                 {
  1460.                     format(string, sizeof(string), "{FFFFFF}[{67BDFC}System{FFFFFF}] {FFFFFF}Masina cu id-ul {67BDFC}%d {F48651}nu a fost creeata{FFFFFF}.", idv);
  1461.                     SCM(playerid, c_alb, string);
  1462.                     return 1;
  1463.                 }
  1464.                 DestroyVehicle(idv);
  1465.                 format(string, sizeof(string), "{FFFFFF}[{67BDFC}System{FFFFFF}] {FFFFFF}Masina cu id-ul {F48651}%d {FFFFFF}a fost stearsa{FFFFFF}.", idv);
  1466.                 SCM(playerid, c_alb, string);
  1467.                 addveh--;
  1468.                 format(string, sizeof(string), "{FFFFFF}[{DD0000}CMD{FFFFFF}] {F48651}%s {B1BBBE}a folosit {FFFFFF}'{67BDFC}/delveh %d{FFFFFF}'.", sendername, idv);
  1469.                 SAM(c_alb, string);
  1470.             }
  1471.             else SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] {F48651}Doar adminii au acces la aceasta comanda{FFFFFF}.");
  1472.         }
  1473.         return 1;
  1474.     }
  1475.  
  1476.     if(strcmp(cmd, "/nitro", true) == 0)
  1477.     {
  1478.         if(IsPlayerConnected(playerid))
  1479.         {
  1480.             if(PlayerInfo[playerid][pAdmin] >= 10)
  1481.             {
  1482.                 if(IsPlayerInAnyVehicle(playerid))
  1483.                 {
  1484.                     AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
  1485.                     SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Ai adugat {F48651}NITRO {FFFFFF}la vehiculul tau.");
  1486.                     format(string, sizeof(string), "{FFFFFF}[{DD0000}CMD{FFFFFF}] {F48651}%s {B1BBBE}a folosit {FFFFFF}'{67BDFC}/nitro{FFFFFF}'.", sendername);
  1487.                     SAM(c_alb, string);
  1488.                 }
  1489.             }
  1490.             else SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] {F48651}Doar adminii au acces la aceasta comanda{FFFFFF}.");
  1491.         }
  1492.         return 1;
  1493.     }
  1494.  
  1495.     if(strcmp(cmd, "/hidra", true) == 0)
  1496.     {
  1497.         if(IsPlayerConnected(playerid))
  1498.         {
  1499.             if(PlayerInfo[playerid][pAdmin] >= 10)
  1500.             {
  1501.                 if(IsPlayerInAnyVehicle(playerid))
  1502.                 {
  1503.                     AddVehicleComponent(GetPlayerVehicleID(playerid), 1087);
  1504.                     SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Ai adaugat {F48651}HIDRAULICE {FFFFFF}la vehiculul tau.");
  1505.                     format(string, sizeof(string), "{FFFFFF}[{DD0000}CMD{FFFFFF}] {F48651}%s {B1BBBE}a folosit {FFFFFF}'{67BDFC}/hidra{FFFFFF}'.", sendername);
  1506.                     SAM(c_alb, string);
  1507.                 }
  1508.             }
  1509.             else SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] {F48651}Doar adminii au acces la aceasta comanda{FFFFFF}.");
  1510.         }
  1511.         return 1;
  1512.     }
  1513.  
  1514.     if(strcmp(cmd, "/kick", true) == 0)                                         //goto
  1515.     {
  1516.         if(IsPlayerConnected(playerid))
  1517.         {
  1518.             tmp = strtok(cmdtext, idx);
  1519.             if(!strlen(tmp))
  1520.             {
  1521.                 SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Foloseste {67BDFC}/{F48651}kick [playerid/PartOfName] [motiv]");
  1522.                 return 1;
  1523.             }
  1524. //          new Float:plocx,Float:plocy,Float:plocz;
  1525.             new playerid2;
  1526.             playerid2 = ReturnUser(tmp);
  1527.             if (IsPlayerConnected(playerid2))
  1528.             {
  1529.                 if(playerid2 != INVALID_PLAYER_ID)
  1530.                 {
  1531.                     //new motiv[100];
  1532.                     tmp = strtok(cmdtext, idx);
  1533.                     if(!strlen(tmp))
  1534.                     {
  1535.                         SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Foloseste {67BDFC}/{F48651}kick [playerid/PartOfName] [motiv]");
  1536.                         return 1;
  1537.                     }
  1538.                     if (PlayerInfo[playerid][pAdmin] >= 10)
  1539.                     {
  1540.                         format(string, sizeof(string), "{FFFFFF}[{F48651}AdmCmd{FFFFFF}] Ai primit kick de la %s. ( %s ).", sendername, tmp);
  1541.                         KickWithMessage(playerid2, 0xFF0000FF, string);
  1542.                         format(string, sizeof(string), "{FFFFFF}[{DD0000}CMD{FFFFFF}] {F48651}%s {B1BBBE}a folosit {FFFFFF}'{67BDFC}/kick %s %s{FFFFFF}'.", sendername, playerid2, tmp);
  1543.                         SAM(c_alb, string);
  1544.                     }
  1545.                     else SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] {F48651}Doar adminii au acces la aceasta comanda{FFFFFF}.");
  1546.                 }
  1547.             }
  1548.             else SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] {F48651}Acest jucator nu este {67BDFC}online{FFFFFF}.");
  1549.         }
  1550.         return 1;
  1551.     }
  1552.                    
  1553.     if(strcmp(cmd, "/goto", true) == 0)                                         //goto
  1554.     {
  1555.         if(IsPlayerConnected(playerid))
  1556.         {
  1557.             tmp = strtok(cmdtext, idx);
  1558.             if(!strlen(tmp))
  1559.             {
  1560.                 SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Foloseste {67BDFC}/{F48651}goto [playerid/PartOfName]");
  1561.                 return 1;
  1562.             }
  1563.             new Float:plocx,Float:plocy,Float:plocz;
  1564.             new playerid2;
  1565.             playerid2 = ReturnUser(tmp);
  1566.             if (IsPlayerConnected(playerid2))
  1567.             {
  1568.                 if(playerid2 != INVALID_PLAYER_ID)
  1569.                 {
  1570.                     if (PlayerInfo[playerid][pAdmin] >= 12)
  1571.                     {
  1572.                         GetPlayerName(playerid, sendername, sizeof(sendername));
  1573.                         GetPlayerName(playerid2, giveplayer, sizeof(giveplayer));
  1574.                         GetPlayerPos(playerid2, plocx, plocy, plocz);
  1575.                         if (GetPlayerState(playerid) == 2)
  1576.                         {
  1577.                             new tmpcar = GetPlayerVehicleID(playerid);
  1578.                             SetVehiclePos(tmpcar, plocx, plocy+2, plocz);
  1579.                         }
  1580.                         else
  1581.                         {
  1582.                             SetPlayerPos(playerid, plocx, plocy, plocz+1);
  1583.                         }
  1584.                         SetPlayerInterior(playerid, GetPlayerInterior(playerid2));
  1585.                         format(string,sizeof(string),"{FFFFFF}[{67BDFC}System{FFFFFF}] Ai fost teleportat cu succes la {F48651}%s{FFFFFF}.", giveplayer);
  1586.                         SCM(playerid, c_alb, string);
  1587.                         format(string, sizeof(string), "{FFFFFF}[{DD0000}CMD{FFFFFF}] {F48651}%s {B1BBBE}a folosit {FFFFFF}'{67BDFC}/goto %s{FFFFFF}'.", sendername, giveplayer);
  1588.                         SAM(c_alb, string);
  1589.                     }
  1590.                     else SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] {F48651}Doar adminii au acces la aceasta comanda{FFFFFF}.");
  1591.                 }
  1592.             }
  1593.             else SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] {F48651}Acest jucator nu este {67BDFC}online{FFFFFF}.");
  1594.         }
  1595.         return 1;
  1596.     }
  1597.  
  1598.     if(strcmp(cmd, "/gethere", true) == 0)                                      //gethere
  1599.     {
  1600.         if(IsPlayerConnected(playerid))
  1601.         {
  1602.             tmp = strtok(cmdtext, idx);
  1603.             if(!strlen(tmp))
  1604.             {
  1605.                 SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Foloseste {67BDFC}/{F48651}gethere [playerid/PartOfName]");
  1606.                 return 1;
  1607.             }
  1608.             new Float:plocx,Float:plocy,Float:plocz;
  1609.             new playerid2;
  1610.             playerid2 = ReturnUser(tmp);
  1611.             if (IsPlayerConnected(playerid2))
  1612.             {
  1613.                 if(playerid2 != INVALID_PLAYER_ID)
  1614.                 {
  1615.                     if (PlayerInfo[playerid][pAdmin] >= 12)
  1616.                     {
  1617.                         GetPlayerPos(playerid, plocx, plocy, plocz);
  1618.                         SetPlayerInterior(playerid2, GetPlayerInterior(playerid));
  1619.                         SetPlayerPos(playerid2, plocx, plocy, plocz+0.5);
  1620.                         GetPlayerName(playerid, sendername, sizeof(sendername));
  1621.                         GetPlayerName(playerid2, giveplayer, sizeof(giveplayer));
  1622.                         new string2[200];
  1623.                         format(string2, sizeof(string2), "{FFFFFF}[{67BDFC}System{FFFFFF}] {FFFFFF}Ai fost teleportat la {F48651}%s {FFFFFF}de catre {F48651}%s{FFFFFF}.", sendername, giveplayer);
  1624.                         SCM(playerid2, c_alb, string2);
  1625.                         format(string, sizeof(string), "{FFFFFF}[{DD0000}CMD{FFFFFF}] {F48651}%s {B1BBBE}a folosit {FFFFFF}'{67BDFC}/gethere %s{FFFFFF}'.", sendername, giveplayer);
  1626.                         SAM(c_alb, string);
  1627.                 }
  1628.                     else SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] {F48651}Doar adminii au acces la aceasta comanda{FFFFFF}.");
  1629.                 }
  1630.             }
  1631.             else SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Acest jucator nu este {F48651}online{FFFFFF}.");
  1632.         }
  1633.         return 1;
  1634.     }
  1635.     return 0;
  1636. }
  1637.  
  1638. /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
  1639. /*                          * OnPlayerEnterCheckpoint *                       */
  1640. /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
  1641. public OnPlayerEnterCheckpoint(playerid)
  1642. {
  1643.     new vehicleid = GetPlayerVehicleID(playerid);
  1644.     if(CP[playerid] == 1)
  1645.     {
  1646.         if(GetVehicleModel(vehicleid) == 515 || GetVehicleModel(vehicleid) == 514)
  1647.         {
  1648.             DisablePlayerCheckpoint(playerid);
  1649.             SCM(playerid, c_alb, "Loaded!");
  1650.             SetPlayerCheckpoint(playerid, MisiuneInfo[playerid][mUnLoadp_x], MisiuneInfo[playerid][mUnLoadp_y], MisiuneInfo[playerid][mUnLoadp_z], 4.0);
  1651.             CP[playerid] = 2;
  1652.         }
  1653.         else SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] {FFFFFF}Trebuie sa fii intr-un tir{FFFFFF}.");
  1654.     }
  1655.     else if(CP[playerid] == 2)
  1656.     {
  1657.         if(GetVehicleModel(vehicleid) == 515 || GetVehicleModel(vehicleid) == 514)
  1658.         {
  1659.             new nume[MAX_PLAYER_NAME];
  1660.             GetPlayerName(playerid, nume, sizeof(nume));
  1661.             cursa[playerid] = 0;
  1662.             new money = (floatround(MisiuneInfo[playerid][mDistanta]) * 1000 + MisiuneInfo[playerid][mCastig]);
  1663.             new scor = GetPlayerScore(playerid);
  1664.             new teext[150], teeext[200], mesaj[250];
  1665.             CP[playerid] = 0; cursa[playerid] = 0;
  1666.             DisablePlayerCheckpoint(playerid);
  1667.             SetPlayerScore(playerid, scor+3);
  1668.             GivePlayerMoney(playerid, money);
  1669. //          printf("%d KM | %d/50 | %d$ mCastig | %d$ Total", floatround(MisiuneInfo[playerid][mDistanta]), floatround(MisiuneInfo[playerid][mDistanta])/50, MisiuneInfo[playerid][mCastig], money);
  1670.             format(teext, sizeof(teext), "{FFFFFF}[{67BDFC}System{FFFFFF}] Ai terminat de transportat {F48651}%s {FFFFFF}de la {F48651}%s {FFFFFF}la {F48651}%s{FFFFFF}.", MisiuneInfo[playerid][mMarfa], MisiuneInfo[playerid][mLoadp], MisiuneInfo[playerid][mUnloadp]);
  1671.             SCM(playerid, c_alb, teext);
  1672.             format(teeext, sizeof(teeext), "{FFFFFF}[{67BDFC}System{FFFFFF}] Ai primit {F48651}%d${FFFFFF} si {F48651}3 score{FFFFFF} pentru {F48651}%i km{FFFFFF}.", money, floatround(MisiuneInfo[playerid][mDistanta])/100);
  1673.             SCM(playerid, c_alb, teeext);
  1674.             format(mesaj, sizeof(mesaj), "{FFFFFF}* {F48651}%s {FFFFFF}a transportat {F48651}%s {FFFFFF}de la {F48651}%s {FFFFFF}la {F48651}%s{FFFFFF}.", nume, MisiuneInfo[playerid][mMarfa], MisiuneInfo[playerid][mLoadp], MisiuneInfo[playerid][mUnloadp]);
  1675.             SendClientMessageToAll(c_alb, mesaj);
  1676.             for(new t; t != sizeof(Info); ++t)
  1677.             {
  1678.                 PlayerTextDrawHide(playerid, Info[t][playerid]);
  1679.             }
  1680.         }
  1681.         else SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Trebuie sa fii intr-un vehicul{FFFFFF}.");
  1682.     }
  1683.     return 1;
  1684. }
  1685.  
  1686. /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
  1687. /*                              * OnPlayerText *                              */
  1688. /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
  1689. public OnPlayerText(playerid, text[])
  1690. {
  1691.     new textv2[300], name[MAX_PLAYER_NAME];
  1692.     GetPlayerName(playerid, name, sizeof (name));
  1693.     format(textv2, sizeof (textv2), "{FFFFFF}%s.", text);
  1694.     SendPlayerMessageToAll(playerid, textv2);
  1695.     printf("[Chat] %s: %s", name, text);
  1696.     return 0;
  1697. }
  1698. /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
  1699. /*                              * OnPlayerConnect *                           */
  1700. /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
  1701. public OnPlayerConnect(playerid)
  1702. {
  1703.     new query[700]; //We use this variable to format our query
  1704.     GetPlayerName(playerid, Name[playerid], 24); //Getting player's name
  1705.     GetPlayerIp(playerid, IP[playerid], 16); //Getting layer's IP
  1706.     mysql_format(mysql, query, sizeof(query),"SELECT * FROM `players` WHERE `Username` = '%e' LIMIT 1", Name[playerid]);
  1707.     // - We use mysql_format instead of format because we can use an %e specifier. %e specifier escapes a string so we can avoid sql injection which means we don't have to use mysql_real_escape_string
  1708.     // - Formatting our query; SELECT * FROM `players` WHERE `Username`='%e' means we are selecting all rows in the table called `players` that has your name in Username column
  1709.     // - LIMIT 1; we only need 1 result to be shown
  1710.     mysql_tquery(mysql, query, "OnAccountCheck", "i", playerid);
  1711.     //lets execute the formatted query and when the execution is done, a callback OnAccountCheck will be called
  1712.     //You can name the callback however you like
  1713.    
  1714.     for(new i=1; i<sizeof(SeifInfo); i++)
  1715.     {
  1716.         TrySeifLog[i][playerid] = 0;
  1717.     }
  1718.     cursa[playerid] = 0;
  1719.     Speedo[playerid] = 1;
  1720.     SeifLogin[playerid] = 0;
  1721.     new CString[200];
  1722.     format(CString, sizeof(CString), "{FFFFFF}[{67BDFC}System{FFFFFF}] {F48651}Jucatorul {67BDFC}%s {F48651}s-a conectat la server cu id-ul {67BDFC}%d{FFFFFF}.", pNamee(playerid), playerid);
  1723.     SendClientMessageToAll(c_alb, CString);
  1724.  
  1725. /*  new File[200];
  1726.     format(File, sizeof(File), "Conturi/%s.ini", pNamee(playerid));
  1727.  
  1728.     if(fexist(File))
  1729.     {
  1730.         new iStr[128];
  1731.         format(iStr, sizeof(iStr), "{FFFFFF}Bine ai revenit {67BDFC}%s{FFFFFF}({67BDFC}%d{FFFFFF}).\nIntrodu parola pentru a continua.",pNamee(playerid), playerid);
  1732.         ShowPlayerDialog(playerid, LOGIN, DIALOG_STYLE_INPUT, "Login", iStr, "Login", "Kick");
  1733.     }
  1734.     else
  1735.     {
  1736.         new iStr[128];
  1737.         format(iStr, sizeof(iStr), "{FFFFFF}Bine ai venit %s{FFFFFF}({67BDFC}%d{FFFFFF})!\nAcest nume nu este inregistrat.\nAlege o parola cu care te vei conecta la server.", pNamee(playerid), playerid);
  1738.         ShowPlayerDialog(playerid, REGISTER, DIALOG_STYLE_INPUT, "Register", iStr, "Register", "Kick");
  1739.     }
  1740. */
  1741.     Info[0][playerid] = CreatePlayerTextDraw(playerid, 569.000000, 104.000000, "Info");
  1742.     PlayerTextDrawAlignment(playerid, Info[0][playerid], 2);
  1743.     PlayerTextDrawBackgroundColor(playerid, Info[0][playerid], 204);
  1744.     PlayerTextDrawFont(playerid, Info[0][playerid], 1);
  1745.     PlayerTextDrawLetterSize(playerid, Info[0][playerid], 0.589999, 1.500000);
  1746.     PlayerTextDrawColor(playerid, Info[0][playerid], -52);
  1747.     PlayerTextDrawSetOutline(playerid, Info[0][playerid], 1);
  1748.     PlayerTextDrawSetProportional(playerid, Info[0][playerid], 1);
  1749.     PlayerTextDrawUseBox(playerid, Info[0][playerid], 1);
  1750.     PlayerTextDrawBoxColor(playerid, Info[0][playerid], 1740504149);
  1751.     PlayerTextDrawTextSize(playerid, Info[0][playerid], 731.000000, -146.000000);
  1752.  
  1753.     Info[1][playerid] = CreatePlayerTextDraw(playerid, 501.000000, 122.000000, "Marfa: ");
  1754.     PlayerTextDrawBackgroundColor(playerid, Info[1][playerid], 204);
  1755.     PlayerTextDrawFont(playerid, Info[1][playerid], 2);
  1756.     PlayerTextDrawLetterSize(playerid, Info[1][playerid], 0.240000, 1.100000);
  1757.     PlayerTextDrawColor(playerid, Info[1][playerid], -192523777);
  1758.     PlayerTextDrawSetOutline(playerid, Info[1][playerid], 1);
  1759.     PlayerTextDrawSetProportional(playerid, Info[1][playerid], 1);
  1760.     PlayerTextDrawUseBox(playerid, Info[1][playerid], 1);
  1761.     PlayerTextDrawBoxColor(playerid, Info[1][playerid], 1740504132);
  1762.     PlayerTextDrawTextSize(playerid, Info[1][playerid], 731.000000, -146.000000);
  1763.  
  1764.     Info[2][playerid] = CreatePlayerTextDraw(playerid, 501.000000, 136.000000, "De la: ");
  1765.     PlayerTextDrawBackgroundColor(playerid, Info[2][playerid], 204);
  1766.     PlayerTextDrawFont(playerid, Info[2][playerid], 2);
  1767.     PlayerTextDrawLetterSize(playerid, Info[2][playerid], 0.240000, 1.100000);
  1768.     PlayerTextDrawColor(playerid, Info[2][playerid], -192523777);
  1769.     PlayerTextDrawSetOutline(playerid, Info[2][playerid], 1);
  1770.     PlayerTextDrawSetProportional(playerid, Info[2][playerid], 1);
  1771.     PlayerTextDrawUseBox(playerid, Info[2][playerid], 1);
  1772.     PlayerTextDrawBoxColor(playerid, Info[2][playerid], 1740504132);
  1773.     PlayerTextDrawTextSize(playerid, Info[2][playerid], 731.000000, -146.000000);
  1774.  
  1775.     Info[3][playerid] = CreatePlayerTextDraw(playerid, 501.000000, 150.000000, "La: ");
  1776.     PlayerTextDrawBackgroundColor(playerid, Info[3][playerid], 204);
  1777.     PlayerTextDrawFont(playerid, Info[3][playerid], 2);
  1778.     PlayerTextDrawLetterSize(playerid, Info[3][playerid], 0.240000, 1.100000);
  1779.     PlayerTextDrawColor(playerid, Info[3][playerid], -192523777);
  1780.     PlayerTextDrawSetOutline(playerid, Info[3][playerid], 1);
  1781.     PlayerTextDrawSetProportional(playerid, Info[3][playerid], 1);
  1782.     PlayerTextDrawUseBox(playerid, Info[3][playerid], 1);
  1783.     PlayerTextDrawBoxColor(playerid, Info[3][playerid], 1740504132);
  1784.     PlayerTextDrawTextSize(playerid, Info[3][playerid], 731.000000, -146.000000);
  1785.  
  1786.     Info[4][playerid] = CreatePlayerTextDraw(playerid, 501.000000, 164.000000, "Distanta:  km");
  1787.     PlayerTextDrawBackgroundColor(playerid, Info[4][playerid], 204);
  1788.     PlayerTextDrawFont(playerid, Info[4][playerid], 2);
  1789.     PlayerTextDrawLetterSize(playerid, Info[4][playerid], 0.240000, 1.100000);
  1790.     PlayerTextDrawColor(playerid, Info[4][playerid], -192523777);
  1791.     PlayerTextDrawSetOutline(playerid, Info[4][playerid], 1);
  1792.     PlayerTextDrawSetProportional(playerid, Info[4][playerid], 1);
  1793.     PlayerTextDrawUseBox(playerid, Info[4][playerid], 1);
  1794.     PlayerTextDrawBoxColor(playerid, Info[4][playerid], 1740504132);
  1795.     PlayerTextDrawTextSize(playerid, Info[4][playerid], 731.000000, -146.000000);
  1796.  
  1797. }
  1798.  
  1799. /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
  1800. /*                              * OnAccountCheck *                            */
  1801. /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
  1802. public OnAccountCheck(playerid)
  1803. {
  1804.     new rows, fields; //a variable that will be used to retrieve rows and fields in the database.
  1805.     cache_get_data(rows, fields, mysql);//let's get the rows and fields from the database.
  1806.     if(rows) //if there is row
  1807.     {//then
  1808.         cache_get_row(0, 2, PlayerInfo[playerid][pPassword], mysql, 129);
  1809.         //we will load their password into PlayerInfo[playerid][Password] to be used in logging in
  1810.         //0 is row, 2 is field. If you're wondering why row is 0; remember we used LIMIT 1 while checking player's account. LIMIT is a limitation of results to be shown. Since we used LIMIT 1, it'd be like;
  1811.         // ---> row>  ID | Username | Password | IP | Level | .... and so on
  1812.         //             ^       ^           ^     ^      ^
  1813.         //      fields 0       1           2     3      4
  1814.         //So we're getting row 0, field 2 which is password
  1815.         PlayerInfo[playerid][pID] = cache_get_row_int(0, 0); //now let's load player's ID into PlayerInfo[playerid][ID] so we can use it later
  1816.         ShowPlayerDialog(playerid, D_Login, DIALOG_STYLE_INPUT, "Login", "Inainte de a putea juca pe server trebuie sa te loghezi.\n Introdu parola contului tau.", "Login", "Kick"); //And since we found a result from the database, which means, there is an account; we will show a login dialog
  1817.        
  1818.     }
  1819.     else //if we didn't find any rows from the database, that means, no accounts were found
  1820.     {
  1821.         //So we show the a dialog register
  1822.         ShowPlayerDialog(playerid, D_Register, DIALOG_STYLE_INPUT, "Register", "Alege o parola si introdu-o in casuta de mai jos.", "Register", "Kick");
  1823.     }
  1824.     return 1;
  1825. }
  1826.  
  1827. /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
  1828. /*                                  * OnAccountLoad *                         */
  1829. /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
  1830. public OnAccountLoad(playerid)
  1831. {
  1832.     // ---> row>  ID | Username | Password | Level | Money | Admin | Kills | Deaths | HouseKey | Spawn
  1833.     //             ^       ^           ^       ^       ^       ^       ^       ^         ^         ^
  1834.     //      fields 0       1           2       3       4       5       6       7         8         9
  1835.     PlayerInfo[playerid][pLevel] = cache_get_row_int(0, 3);
  1836.     PlayerInfo[playerid][pCash] = cache_get_row_int(0, 4);
  1837.     PlayerInfo[playerid][pAdmin] = cache_get_row_int(0, 5);
  1838.     PlayerInfo[playerid][pKills] = cache_get_row_int(0, 6);
  1839.     PlayerInfo[playerid][pDeaths] = cache_get_row_int(0, 7);
  1840.     PlayerInfo[playerid][pHouseKey] = cache_get_row_int(0, 8);
  1841.     PlayerInfo[playerid][pSpawn] = cache_get_row_int(0, 9);
  1842.   //we're getting a field 4 from row 0. And since it's an integer, we use cache_get_row_int
  1843.  /*   PlayerInfo[playerid][VIP] = cache_get_row_int(0, 5); //Above
  1844.     PlayerInfo[playerid][Money] = cache_get_row_int(0, 6);//Above
  1845.     PlayerInfo[playerid][posX] = cache_get_row_float(0, 7);//Above. Since player's position is a float, we use cache_get_row_float
  1846.     PlayerInfo[playerid][posY] = cache_get_row_float(0, 8);//Above
  1847.     PlayerInfo[playerid][posZ] = cache_get_row_float(0, 9);//Above
  1848. */
  1849.     GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);//Let's set their money
  1850.     //For player's position, set it once they spawn(OnPlayerSpawn)
  1851.     SCM(playerid, -1, "Successful logged in."); //tell them that they have succesfully logged in
  1852.     return 1;
  1853. }
  1854.  
  1855. /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
  1856. /*                              * OnDialogResponse *                          */
  1857. /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
  1858. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  1859. {
  1860.     //new File[50];
  1861.     //format(File, sizeof(File), "Conturi/%s.ini", pNamee(playerid));
  1862.     new query[700];
  1863.     switch(dialogid)
  1864.     {
  1865. /*      case LOGIN:
  1866.         {
  1867.             if(response)
  1868.             {
  1869.                 if(strlen(inputtext) == 0)
  1870.                 {
  1871.                     new iStr[200];
  1872.                     format(iStr, sizeof(iStr), "{FFFFFF}Bine ai revenit {67BDFC}%s{FFFFFF}({67BDFC}%d{FFFFFF}).\nIntrodu parola pentru a continua.", pNamee(playerid), playerid);
  1873.                     return ShowPlayerDialog(playerid, LOGIN, DIALOG_STYLE_INPUT, "Login", iStr, "Login", "Kick");
  1874.                 }
  1875.                 new pw[40];
  1876.                 format(pw, sizeof(pw), "%s", dini_Get(File, "Password"));
  1877.                 if(strcmp(inputtext, pw) == 0)
  1878.                 {
  1879.  
  1880.                     SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] {F48651}Te-ai logat cu succes. Apasa {FFFFFF}'{67BDFC}SHIFT{FFFFFF}' {F48651}pentru a continua{FFFFFF}.");
  1881.                     SetPlayerScore(playerid, dini_Int(File, "Level"));
  1882.                     GivePlayerMoney(playerid, dini_Int(File, "Cash"));
  1883.                     PlayerInfo[playerid][pAdmin] = dini_Int(File, "Admin");
  1884.                     PlayerInfo[playerid][pKills] = dini_Int(File, "Kills");
  1885.                     PlayerInfo[playerid][pDeaths] = dini_Int(File, "Deaths");
  1886.                     PlayerInfo[playerid][pHouseKey] = dini_Int(File, "HouseKey");
  1887.                     PlayerInfo[playerid][pSpawn] = dini_Int(File, "Spawn");
  1888.                     for (new t; t != sizeof (Logo); ++t)
  1889.                     {
  1890.                         TextDrawShowForPlayer(playerid, Logo[t]);
  1891.                     }
  1892.                 }
  1893.                 else
  1894.                 {
  1895.                     new iStr[200];
  1896.                     format(iStr, sizeof(iStr), "{FFFFFF}Bine ai revenit {67BDFC}%s{FFFFFF}({67BDFC}%d{FFFFFF}).\nIntrodu parola pentru a continua.", pNamee(playerid), playerid);
  1897.                     return ShowPlayerDialog(playerid, LOGIN, DIALOG_STYLE_INPUT, "Login", iStr, "Login", "Kick");
  1898.                 }
  1899.             }
  1900.             else Kick(playerid);
  1901.         }
  1902.         case REGISTER:
  1903.         {
  1904.             if(response)
  1905.             {
  1906.                 if(strlen(inputtext) == 0)
  1907.                 {
  1908.                     new iStr[200];
  1909.                     format(iStr, sizeof(iStr), "{FFFFFF}Bine ai venit {67BDFC}%s{FFFFFF}({67BDFC}%d{FFFFFF})!\nAcest nume nu este inregistrat.\nAlege o parola cu care te vei conecta la server.", pNamee(playerid), playerid);
  1910.                     return ShowPlayerDialog(playerid, REGISTER, DIALOG_STYLE_INPUT, "Register", iStr, "Register", "Leave");
  1911.                 }
  1912.                 dini_Create(File);
  1913.                 dini_Set(File, "Password",  inputtext);
  1914.                 dini_IntSet(File, "Level", 5);
  1915.                 dini_IntSet(File, "Cash", 100000);
  1916.                 dini_IntSet(File, "Admin", 0);
  1917.                 dini_IntSet(File, "Kills",  10);
  1918.                 dini_IntSet(File, "Deaths", 0);
  1919.                 dini_IntSet(File, "HouseKey", 255);
  1920.                 dini_IntSet(File, "Spawn", 1);
  1921.                 new iStr[128];
  1922.                 format(iStr, sizeof(iStr), "{FFFFFF}Bine ai revenit {67BDFC}%s{FFFFFF}({67BDFC}%d{FFFFFF}).\nIntrodu parola pentru a continua.",pNamee(playerid), playerid);
  1923.                 ShowPlayerDialog(playerid, LOGIN, DIALOG_STYLE_INPUT, "Login", iStr, "Login", "Kick");
  1924.                 SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] {F48651}Contul tau a fost {67BDFC}inregistrat{FFFFFF}!{F48651} Te rog logheaza-te!");
  1925.             }
  1926.             else Kick(playerid);
  1927.         }*/
  1928.         case D_Login:
  1929.         {
  1930.             if(!response) Kick(playerid); //if they clicked Quit, we will kick them
  1931.             new hpass[129]; //for password hashing
  1932.             WP_Hash(hpass, 129, inputtext); //hashing inputtext
  1933.             if(!strcmp(hpass, PlayerInfo[playerid][pPassword])) //remember we have loaded player's password into this variable, PlayerInfo[playerid][pPassword] earlier. Now let's use it to compare the hashed password with password that we load
  1934.             { //if the hashed password matches with the loaded password from database
  1935.                 mysql_format(mysql, query, sizeof(query), "SELECT * FROM `players` WHERE `Username` = '%e' LIMIT 1", Name[playerid]);
  1936.                 //let's format our query
  1937.                 //once again, we select all rows in the table that has your name and limit the result
  1938.                 mysql_tquery(mysql, query, "OnAccountLoad", "i", playerid);
  1939.                 //lets execute the formatted query and when the execution is done, a callback OnAccountLoad will be called
  1940.                 //You can name the callback however you like
  1941.             }
  1942.             else //if the hashed password didn't match with the loaded password(PlayerInfo[playerid][pPassword])
  1943.             {
  1944.                 //we tell them that they have inserted a wrong password
  1945.                 ShowPlayerDialog(playerid, D_Login, DIALOG_STYLE_INPUT, "Login", "Parola introdusa este incorecta.", "Login", "Kick");
  1946.             }
  1947.         }
  1948.         case D_Register:
  1949.         {
  1950.             if(!response) return Kick(playerid); //if they clicked Quit, we will kick them
  1951.             if(strlen(inputtext) < 6) return ShowPlayerDialog(playerid, D_Register, DIALOG_STYLE_INPUT, "Register", "Parola trebuie sa contina cel putin 6 caractere.", "Register", "Kick");
  1952.             //strlen checks a lenght of a string. so if player types their password that is lower than 6, we tell them; Your password must be at least 6 characters long!
  1953.             WP_Hash(PlayerInfo[playerid][pPassword], 129, inputtext); //hashing inputtext
  1954.             mysql_format(mysql, query, sizeof(query), "INSERT INTO `players`(`Username`, `Password`, `IP`, `pLevel`, `Money`, `AdminLevel`, `Kills`, `Deaths`, `HouseKey`, `Spawn`) VALUES (%e, %s, %s, 10, 100000, 0, 0, 0, 255, 1)", Name[playerid], PlayerInfo[playerid][pPassword], IP[playerid]);
  1955.             //Now let's create a new row and insert player's information in it
  1956.            
  1957.             mysql_tquery(mysql, query, "", "");
  1958.             //let's execute the query
  1959.             ShowPlayerDialog(playerid, D_Login, DIALOG_STYLE_INPUT, "Login", "Introduceti parola", "Login", "Kick");
  1960.      }
  1961.     case DIALOG_ANUNT:
  1962.     {
  1963.         if(response)
  1964.         {
  1965.             if(strlen(inputtext) < 10 || strlen(inputtext) > 60)
  1966.             return SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Anuntul trebuie sa contina intre 10 si 60 caractere.");
  1967.             new sendername[MAX_PLAYER_NAME];
  1968.             GetPlayerName(playerid, sendername, sizeof(sendername));
  1969.             new anuntt[71], dela[15+MAX_PLAYER_NAME];
  1970.             format(dela, sizeof(dela), "    * Anunt de la: %s.", sendername);
  1971.             format(anuntt, sizeof(anuntt), "%s", inputtext);
  1972.             TextDrawSetString(Anunt[0], anuntt);
  1973.             TextDrawSetString(Anunt[1], dela);
  1974.             TextDrawShowForAll(Anunt[0]);TextDrawShowForAll(Anunt[1]);
  1975.             SetTimer("AscundeTD", 15000, true);
  1976.         }
  1977.         else SCM(playerid, c_alb, "Ai renuntat");
  1978.     }
  1979.     case DIALOG_START:
  1980.     {
  1981.         if(response)
  1982.         {
  1983.                 switch(listitem)
  1984.                 {
  1985.                     case 0:
  1986.                     {
  1987.                         new load[2000], sss[50], ss[52];
  1988.                         for(new p=0; p<11; p++)
  1989.                         {
  1990.                             format(sss, sizeof(sss), "%d. %s  -  %s", p+1, Curse_Fluid[p][idx1], Curse_Fluid[p][idx2]);
  1991.                             format(ss, sizeof(ss), "%s \n", sss);
  1992.                             strcat(load, ss);
  1993.                         }
  1994.                         ShowPlayerDialog(playerid, DIALOG_BENZINA, DIALOG_STYLE_LIST, "{FFFFFF}Cursa", load, "Next", "Cancel");
  1995.                     }
  1996.                 }
  1997.             }
  1998.             else SCM(playerid, c_alb, "Canceled");
  1999.         }
  2000.         case DIALOG_BENZINA:
  2001.         {
  2002.             if(response)
  2003.             {
  2004.                 new idt;
  2005.                 if(listitem == 0)
  2006.                     idt = 0;// new string[200];
  2007.                 if(listitem == 1)
  2008.                     idt = 1;
  2009.                 if(listitem == 2)
  2010.                     idt = 2;
  2011.                 if(listitem == 3)
  2012.                     idt = 3;
  2013.                 if(listitem == 4)
  2014.                     idt = 4;
  2015.                 if(listitem == 5)
  2016.                     idt = 5;
  2017.                 if(listitem == 5)
  2018.                     idt = 5;
  2019.                 if(listitem == 6)
  2020.                     idt = 6;
  2021.                 if(listitem == 7)
  2022.                     idt = 7;
  2023.                 if(listitem == 8)
  2024.                     idt = 8;
  2025.                 if(listitem == 9)
  2026.                     idt = 9;
  2027.                 if(listitem == 10)
  2028.                     idt = 10;
  2029.                 if(listitem == 11)
  2030.                     idt = 11;
  2031.                 if(listitem == 12)
  2032.                     idt = 12;
  2033.                 format(cargo_marfa, sizeof(cargo_marfa), "{FFFFFF}** {F48651}Transporti: {67BDFC}%s \n{FFFFFF}** {F48651}Incarci la: {67BDFC}%s\n{FFFFFF}** {F48651}Descarci la: {67BDFC}%s", Curse_Fluid[idt][idx0], Curse_Fluid[idt][idx1], Curse_Fluid[idt][idx2]);
  2034.                 ShowPlayerDialog(playerid, MIS, DIALOG_STYLE_MSGBOX, "Informatii cursa", cargo_marfa, "Ok", "");
  2035.                 MisiuneInfo[playerid][mLoadp_x] = Curse_Fluid[idt][idx3];
  2036.                 MisiuneInfo[playerid][mLoadp_y] = Curse_Fluid[idt][idx4];
  2037.                 MisiuneInfo[playerid][mLoadp_z] = Curse_Fluid[idt][idx5];
  2038.                 MisiuneInfo[playerid][mUnLoadp_x] = Curse_Fluid[idt][idx6];
  2039.                 MisiuneInfo[playerid][mUnLoadp_y] = Curse_Fluid[idt][idx7];
  2040.                 MisiuneInfo[playerid][mUnLoadp_z] = Curse_Fluid[idt][idx8];
  2041.                 strcpy(MisiuneInfo[playerid][mMarfa], Curse_Fluid[idt][idx0], 40);
  2042.                 strcpy(MisiuneInfo[playerid][mLoadp], Curse_Fluid[idt][idx1], 40);
  2043.                 strcpy(MisiuneInfo[playerid][mUnloadp], Curse_Fluid[idt][idx2], 40);
  2044.                 SetPlayerCheckpoint(playerid, MisiuneInfo[playerid][mLoadp_x], MisiuneInfo[playerid][mLoadp_y], MisiuneInfo[playerid][mLoadp_z], 5.0);
  2045.                 CP[playerid] = 1;
  2046.                 cursa[playerid] = 1;
  2047.                 MisiuneInfo[playerid][mCastig] = Curse_Fluid[idt][idx9];
  2048.                 MisiuneInfo[playerid][mDistanta] = GetDistance(MisiuneInfo[playerid][mLoadp_x], MisiuneInfo[playerid][mLoadp_y], MisiuneInfo[playerid][mLoadp_z], MisiuneInfo[playerid][mUnLoadp_x], MisiuneInfo[playerid][mUnLoadp_y], MisiuneInfo[playerid][mUnLoadp_z])/100;
  2049.                 new nr = floatround(MisiuneInfo[playerid][mDistanta]);
  2050.                 new m[30], dl[30], l[30], d[40];
  2051.                 format(m, sizeof(m), "Marfa: %s", Curse_Fluid[idt][idx0]);
  2052.                 PlayerTextDrawSetString(playerid, Info[1][playerid], m);
  2053.                 format(dl, sizeof(dl), "De la: %s", Curse_Fluid[idt][idx1]);
  2054.                 PlayerTextDrawSetString(playerid, Info[2][playerid], dl);
  2055.                 format(l, sizeof(m), "La: %s", Curse_Fluid[idt][idx2]);
  2056.                 PlayerTextDrawSetString(playerid, Info[3][playerid], l);
  2057.                 format(d, sizeof(d), "Distanta: %i km", nr);
  2058.                 PlayerTextDrawSetString(playerid, Info[4][playerid], d);
  2059.                 for(new t; t != sizeof(Info); ++t)
  2060.                 {
  2061.                         PlayerTextDrawShow(playerid, Info[t][playerid]);
  2062.                 }
  2063.                 //format(string, sizeof(string), "{FFFFFF}[{DD0000}CMD{FFFFFF}] {F48651}%s {B1BBBE}a folosit {FFFFFF}'{67BDFC}/start{FFFFFF}'.", sendername);
  2064.                 //SAM(c_alb, string);
  2065.                 //}
  2066.                 //}
  2067.             } else SCM(playerid, c_alb, "Canceled");
  2068.         }
  2069.     }
  2070.     return 1;
  2071. }
  2072.  
  2073. /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
  2074. /*                                  * OnPlayerSpawn *                         */
  2075. /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
  2076. public OnPlayerSpawn(playerid)
  2077. {
  2078.     if(PlayerInfo[playerid][pSpawn] == 1)
  2079.         SetPlayerPos(playerid, 2262.1, -2250.6, 13.5);
  2080.     else if(PlayerInfo[playerid][pSpawn] == 2)
  2081.     {
  2082.         SetPlayerInterior(playerid, HouseInfo[playerid][hInt]);
  2083.         SetPlayerVirtualWorld(playerid, HouseInfo[playerid][hVir]);
  2084.         SetPlayerPos(playerid, HouseInfo[playerid][hExitX], HouseInfo[playerid][hExitY], HouseInfo[playerid][hExitZ]);
  2085.         SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Te-ai spawnat in casa.");
  2086.     }
  2087.     return 1;
  2088. }
  2089.  
  2090. /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
  2091. /*                          * OnPlayerDisconnect *                            */
  2092. /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
  2093. public OnPlayerDisconnect(playerid, reason)
  2094. {
  2095.     new pname[MAX_PLAYER_NAME], cstring[200 + MAX_PLAYER_NAME];
  2096.     GetPlayerName(playerid, pname, sizeof(pname));
  2097.     switch(reason)
  2098.     {
  2099.         case 0: format(cstring, sizeof(cstring), "{FFFFFF}[{67BDFC}System{FFFFFF}] {67BDFC}%s{FFFFFF}[{F48651}ID {67BDFC}%d{FFFFFF}] [{F48651}A pierdut conexiunea{FFFFFF}].", pname, playerid);
  2100.         case 1: format(cstring, sizeof(cstring), "{FFFFFF}[{67BDFC}System{FFFFFF}] {67BDFC}%s{FFFFFF}[{F48651}ID {67BDFC}%d{FFFFFF}] [{F48651}A iesit singur{FFFFFF}].", pname, playerid);
  2101.         case 2: format(cstring, sizeof(cstring), "{FFFFFF}[{67BDFC}System{FFFFFF}] {67BDFC}%s{FFFFFF}[{F48651}ID {67BDFC}%d{FFFFFF}] [{F48651}A primit kick{FFFFFF}].", pname, playerid);
  2102.     }
  2103.     SAM(c_alb, cstring);
  2104.     new query[700];//query[128] is for formatting our query and Float:pos[3] is for getting and saving player's position
  2105.     //GetPlayerPos(playerid, pos[0], pos[1], pos[2]); //let's get player's position when they leave your server
  2106.     mysql_format(mysql, query, sizeof(query), "UPDATE `players` SET `pLevel`=%d, `Money`=%d, `AdminLevel`=%d, `Kills`=%d, `Deaths`=%d, `HouseKey`=%d, `Spawn`=%d WHERE `ID`=%d", PlayerInfo[playerid][pLevel], PlayerInfo[playerid][pCash], PlayerInfo[playerid][pAdmin], PlayerInfo[playerid][pKills], PlayerInfo[playerid][pDeaths], PlayerInfo[playerid][pHouseKey], PlayerInfo[playerid][pSpawn], PlayerInfo[playerid][pID]);
  2107.     //We update the table(`players`) by getting player's admin level, vip level, money, and positions and save them in the database
  2108.     mysql_tquery(mysql, query, "", "");
  2109.     //let's execute the query.
  2110.     for(new t; t != sizeof (Logo); ++t)
  2111.     {
  2112.         TextDrawHideForPlayer(playerid, Logo[t]);
  2113.     }
  2114.     for(new t; t != sizeof(Info); ++t)
  2115.     {
  2116.         PlayerTextDrawDestroy(playerid, Info[t][playerid]);
  2117.     }
  2118.     return 1;
  2119. }
  2120.  
  2121. /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
  2122. /*                              * OnPlayerDeath *                             */
  2123. /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
  2124. public OnPlayerDeath(playerid, killerid, reason)
  2125. {
  2126.     //PlayerInfo[killerid][pKills] ++;
  2127.     PlayerInfo[playerid][pDeaths] ++;
  2128.     return 1;
  2129. }
  2130.  
  2131. //*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
  2132. /*                              * OnGameModeInit *                            */
  2133. /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
  2134. public OnGameModeInit()
  2135. {
  2136.     mysql_debug(1); //Let's enable debugging so we can detect a problem(if there is)
  2137.     mysql = mysql_connect(SQL_HOST, SQL_USER, SQL_DB, SQL_PASS); //This function will connect your server to database. Remember we have defined our host, username, database and password. It's time to use it here.
  2138.     if(mysql_errno(mysql) != 0)//This will tell if your connection to database is successful or not. If it's not, check your host, username, database and password. Make sure they all right.
  2139.     //else print("[Done] Serverul s-a conectat la baza de date!");
  2140.     //If we're cool, it's time to create a table for your database.
  2141. /*    mysql_tquery(mysql, "CREATE TABLE IF NOT EXISTS `players`(\
  2142.                         `ID` int(10) NOT NULL AUTO_INCREMENT, \
  2143.                         `Username` VARCHAR(24) NOT NULL, \
  2144.                         `Password` VARCHAR(129) NOT NULL, \
  2145.                         `IP` VARCHAR(16) NOT NULL, \
  2146.                         `pLevel` INT(5) NOT NULL, \
  2147.                         `Money` INT(10) NOT NULL, \
  2148.                         `AdminLevel` INT(3) NOT NULL, \
  2149.                         `Kills` INT(5) NOT NULL, \
  2150.                         `Deaths` INT(5) NOT NULL, \
  2151.                         `HouseKey` INT(4) NOT NULL, \
  2152.                         `Spawn` INT(3) NOT NULL, \
  2153.                         PRIMARY KEY (`ID`))", "", "");*/
  2154.     // 60000ms = 60 seconds = 1 minute
  2155.     addveh = 0;
  2156.     DisableInteriorEnterExits();
  2157.     UsePlayerPedAnims();
  2158.     SendRconCommand("gamemodetext RRT v0.1");
  2159.     SendRconCommand("mapname RRT v0.1");
  2160.     //SendRconCommand("loadfs object");
  2161.     SetTimer("SendMSG", 300000, true); // 5minute
  2162.     SetTimer("SeteazaTimp", 1000, true);
  2163.     SetTimer("RWeather", RWTime, true);
  2164.     //SetTimer("Zones_Update", 500, 1);
  2165.     vtimer = SetTimer("SpeedoMeter", 350, 1);
  2166.     AddPlayerClass(3, -516.1736, -540.3485, 25.5234, 0.0, 0, 1, 43, 999, 41, 1);
  2167.  
  2168.     orase = CreateMenu("Orase", 1, 200.0, 100.0, 150.0, 150.0);
  2169.     AddMenuItem(orase, 0, "Los Santos");
  2170.     AddMenuItem(orase, 0, "Las Venturas");
  2171.  
  2172.     oras_lv = CreateMenu("Job", 1, 200.0, 100.0, 150.0, 150.0);
  2173.     AddMenuItem(oras_lv, 0, "Cargo");
  2174.     AddMenuItem(oras_lv, 0, "Ore");
  2175.     AddMenuItem(oras_lv, 0, "Fluid");
  2176.  
  2177.     oras_ls = CreateMenu("Job", 1, 200.0, 100.0, 150.0, 150.0);
  2178.     AddMenuItem(oras_ls, 0, "Cargo");
  2179.     AddMenuItem(oras_ls, 0, "Ore");
  2180.     AddMenuItem(oras_ls, 0, "Fluid");
  2181.     //LoadProperty();
  2182.  
  2183.     for(new i=0; i<MAX_HOUSES; i++)
  2184.     {
  2185.         LoadHouse(i);
  2186.         OnPropUpdate(1, i);
  2187.     }
  2188.     for(new s=0; s<MAX_PLAYERS; s++)
  2189.     {
  2190.         LoadSeif(s);
  2191.         OnPropUpdate(2, s);
  2192.     }
  2193.  
  2194.     Logo[0] = TextDrawCreate(16.000000, 405.000000, "v0.0.1");
  2195.     TextDrawAlignment(Logo[0], 2);
  2196.     TextDrawBackgroundColor(Logo[0], 51);
  2197.     TextDrawFont(Logo[0], 1);
  2198.     TextDrawLetterSize(Logo[0], 0.160000, 1.099999);
  2199.     TextDrawColor(Logo[0], -192523828);
  2200.     TextDrawSetOutline(Logo[0], 1);
  2201.     TextDrawSetProportional(Logo[0], 1);
  2202.     TextDrawUseBox(Logo[0], 1);
  2203.     TextDrawBoxColor(Logo[0], 1740504115);
  2204.     TextDrawTextSize(Logo[0], 0.000000, -50.000000);
  2205.  
  2206.     Logo[1] = TextDrawCreate(16.000000, 378.000000, "Regional");
  2207.     TextDrawAlignment(Logo[1], 2);
  2208.     TextDrawBackgroundColor(Logo[1], 51);
  2209.     TextDrawFont(Logo[1], 1);
  2210.     TextDrawLetterSize(Logo[1], 0.220000, 1.099999);
  2211.     TextDrawColor(Logo[1], -192523828);
  2212.     TextDrawSetOutline(Logo[1], 1);
  2213.     TextDrawSetProportional(Logo[1], 1);
  2214.     TextDrawUseBox(Logo[1], 1);
  2215.     TextDrawBoxColor(Logo[1], 1740504115);
  2216.     TextDrawTextSize(Logo[1], 0.000000, -50.000000);
  2217.  
  2218.     Logo[2] = TextDrawCreate(16.000000, 392.000000, "Trucking");
  2219.     TextDrawAlignment(Logo[2], 2);
  2220.     TextDrawBackgroundColor(Logo[2], 51);
  2221.     TextDrawFont(Logo[2], 1);
  2222.     TextDrawLetterSize(Logo[2], 0.220000, 1.099999);
  2223.     TextDrawColor(Logo[2], -192523828);
  2224.     TextDrawSetOutline(Logo[2], 1);
  2225.     TextDrawSetProportional(Logo[2], 1);
  2226.     TextDrawUseBox(Logo[2], 1);
  2227.     TextDrawBoxColor(Logo[2], 1740504115);
  2228.     TextDrawTextSize(Logo[2], 0.000000, -50.000000);
  2229.  
  2230.     Logo[3] = TextDrawCreate(16.000000, 364.000000, "Romania");
  2231.     TextDrawAlignment(Logo[3], 2);
  2232.     TextDrawBackgroundColor(Logo[3], 51);
  2233.     TextDrawFont(Logo[3], 1);
  2234.     TextDrawLetterSize(Logo[3], 0.220000, 1.099999);
  2235.     TextDrawColor(Logo[3], -192523828);
  2236.     TextDrawSetOutline(Logo[3], 1);
  2237.     TextDrawSetProportional(Logo[3], 1);
  2238.     TextDrawUseBox(Logo[3], 1);
  2239.     TextDrawBoxColor(Logo[3], 1740504115);
  2240.     TextDrawTextSize(Logo[3], 0.000000, -50.000000);
  2241.  
  2242.     Data[0] = TextDrawCreate(547.000000, 11.000000, "--");
  2243.     TextDrawFont(Data[0], 3);
  2244.     TextDrawLetterSize(Data[0], 0.399999, 1.600000);
  2245.     TextDrawColor(Data[0], -192523828);
  2246.  
  2247.     Data[1] = TextDrawCreate(547.000000, 28.000000, "--");
  2248.     TextDrawFont(Data[1], 3);
  2249.     TextDrawLetterSize(Data[1], 0.399999, 1.600000);
  2250.     TextDrawColor(Data[1], -192523828);
  2251.    
  2252.     Anunt[0] = TextDrawCreate(318.000000, 359.000000, "Anunt:");
  2253.     TextDrawAlignment(Anunt[0], 2);
  2254.     TextDrawBackgroundColor(Anunt[0], 255);
  2255.     TextDrawFont(Anunt[0], 1);
  2256.     TextDrawLetterSize(Anunt[0], 0.310000, 1.199999);
  2257.     TextDrawColor(Anunt[0], -192523777);
  2258.     TextDrawSetOutline(Anunt[0], 1);
  2259.     TextDrawSetProportional(Anunt[0], 1);
  2260.     TextDrawUseBox(Anunt[0], 1);
  2261.     TextDrawBoxColor(Anunt[0], 1740504132);
  2262.     TextDrawTextSize(Anunt[0], 600.000000, 340.000000);
  2263.  
  2264.     Anunt[1] = TextDrawCreate(148.000000, 343.000000, "Anunt de la:");
  2265.     TextDrawBackgroundColor(Anunt[1], 255);
  2266.     TextDrawFont(Anunt[1], 2);
  2267.     TextDrawLetterSize(Anunt[1], 0.339999, 1.399999);
  2268.     TextDrawColor(Anunt[1], -192523777);
  2269.     TextDrawSetOutline(Anunt[1], 1);
  2270.     TextDrawSetProportional(Anunt[1], 1);
  2271.     TextDrawUseBox(Anunt[1], 1);
  2272.     TextDrawBoxColor(Anunt[1], 1740504132);
  2273.     TextDrawTextSize(Anunt[1], 488.000000, 340.000000);
  2274.  
  2275.     //============================== CreateObject ==============================
  2276.     new LosSantos1 = CreateObject(19353, 2141.7644, -2236.2141, 15.4652, 0.7000, 0.0000, 134.9909);
  2277.     SetObjectMaterialText(LosSantos1, "Los Santos", 0, 130, "ComicSansMS", 100, 1, -256, 0, 1);
  2278.     new CargoJob = CreateObject(19353, 2141.7653, -2236.2004, 14.8199, 0.0000, 0.0000, 134.9741);
  2279.     SetObjectMaterialText(CargoJob, "* cargo job *", 0, 140, "ComicSansMS", 100, 1, -65281, 0, 1);
  2280.     new RRT1 = CreateObject(19353, 2141.7377, -2236.2512, 13.1799, 0.0000, 0.0000, 135.0262);
  2281.     SetObjectMaterialText(RRT1, "{76D735}R.R.T.", 0, 140, "CourierNew", 100, 1, -16468988, 0, 1);
  2282.  
  2283.     vama_LSLV = CreateObject(968, 1730.41724, 462.13879, 31.90910,   0.00000, -90.00000, -19.00000);
  2284.     vama_LVLS = CreateObject(968, 1699.93262, 450.43240, 31.88910,   0.00000, 90.00000, -19.00000);
  2285.  
  2286.     // ============================= CreateVehicle =============================
  2287.     //Tiruri
  2288.     CreateVehicle(541, 2252.7896, -2278.0391, 14.3078, 45.0000, -1, -1, 1000); // LS _ Cargo _ RoadTrain
  2289.     CreateVehicle(515, 2257.4121, -2273.4370, 14.3078, 45.0000, -1, -1, 1000); // LS _ Cargo _ RoadTrain
  2290.     CreateVehicle(515, 2247.9534, -2282.9631, 14.3078, 45.0000, -1, -1, 1000); // LS _ Cargo _ RoadTrain
  2291.     CreateVehicle(515, 2243.2429, -2287.5835, 14.3078, 45.0000, -1, -1, 1000); // LS _ Cargo _ RoadTrain
  2292.     CreateVehicle(515, 2238.5066, -2292.3184, 14.3078, 45.0000, -1, -1, 1000); // LS _ Cargo _ RoadTrain
  2293.     CreateVehicle(515, 2233.8591, -2296.9128, 14.3078, 45.0000, -1, -1, 1000); // LS _ Cargo _ RoadTrain
  2294.     CreateVehicle(515, 2229.1243, -2301.7800, 14.3078, 45.0000, -1, -1, 1000); // LS _ Cargo _ RoadTrain
  2295.     CreateVehicle(515, 2224.1353, -2306.8665, 14.3078, 45.0000, -1, -1, 1000); // LS _ Cargo _ RoadTrain
  2296.     CreateVehicle(515, 2219.2432, -2311.7114, 14.3078, 45.0000, -1, -1, 1000); // LS _ Cargo _ RoadTrain
  2297.     CreateVehicle(515, 2882.7092, 945.0000, 11.7000, 90.0000, -1, -1, 1000); // LV _ Cargo _ RoadTrain
  2298.     CreateVehicle(515, 2882.7000, 960.0000, 11.7000, 90.0000, -1, -1, 1000); // LV _ Cargo _ RoadTrain
  2299.     CreateVehicle(515, 2882.7000, 955.0000, 11.7000, 90.0000, -1, -1, 1000); // LV _ Cargo _ RoadTrain
  2300.     CreateVehicle(515, 2882.7000, 950.0000, 11.7000, 90.0000, -1, -1, 1000); // LV _ Cargo _ RoadTrain
  2301.     CreateVehicle(515, 2882.7000, 940.0000, 11.7000, 90.0000, -1, -1, 1000); // LV _ Cargo _ RoadTrain
  2302.     CreateVehicle(515, 2882.7000, 935.0000, 11.7000, 90.0000, -1, -1, 1000); // LV _ Cargo _ RoadTrain
  2303.     CreateVehicle(515, 2882.7000, 930.0000, 11.7000, 90.0000, -1, -1, 1000); // LV _ Cargo _ RoadTrain
  2304.     CreateVehicle(515, 2882.7000, 925.0000, 11.7000, 90.0000, -1, -1, 1000); // LV _ Cargo _ RoadTrain
  2305.     CreateVehicle(515, 2882.7000, 920.0000, 11.7000, 90.0000, -1, -1, 1000); // LV _ Cargo _ RoadTrain
  2306.     CreateVehicle(515, 2882.7000, 915.0000, 11.7000, 90.0000, -1, -1, 1000); // LV _ Cargo _ RoadTrain
  2307.     CreateVehicle(515, 2882.7000, 910.0000, 11.7000, 90.0000, -1, -1, 1000); // LV _ Cargo _ RoadTrain
  2308.     CreateVehicle(515, 924.6030, 1669.3523, 11.0031, 240.0000, -1, -1, 1000); // LV _ ORE _ RoadTrain
  2309.     CreateVehicle(515, 924.6030, 1696.0000, 11.0031, 240.0000, -1, -1, 1000); // LV _ ORE _ RoadTrain
  2310.     CreateVehicle(515, 924.6030, 1688.7169, 11.0031, 240.0000, -1, -1, 1000); // LV _ ORE _ RoadTrain
  2311.     CreateVehicle(515, 924.6030, 1682.1368, 11.0031, 240.0000, -1, -1, 1000); // LV _ ORE _ RoadTrain
  2312.     CreateVehicle(515, 924.6030, 1675.4846, 11.0031, 240.0000, -1, -1, 1000); // LV _ ORE _ RoadTrain
  2313.     CreateVehicle(515, 924.6030, 1703.0000, 11.0031, 240.0000, -1, -1, 1000); // LV _ ORE _ RoadTrain
  2314.     CreateVehicle(514, 950.0000, 1629.0000, 10.4800, 0.0000, -1, -1, 1000); // LV _ ORE _ Taker
  2315.     CreateVehicle(514, 945.0000, 1629.0000, 10.4800, 0.0000, -1, -1, 1000); // LV _ ORE _ Taker
  2316.     CreateVehicle(514, 940.0000, 1629.0000, 10.4800, 0.0000, -1, -1, 1000); // LV _ ORE _ Taker
  2317.     CreateVehicle(514, 930.0000, 1629.0000, 10.4800, 0.0000, -1, -1, 1000); // LV _ ORE _ Taker
  2318.     CreateVehicle(514, 935.0000, 1629.0000, 10.4800, 0.0000, -1, -1, 1000); // LV _ ORE _ Taker
  2319.     CreateVehicle(514, 925.0000, 1629.0000, 10.4800, 0.0000, -1, -1, 1000); // LV _ ORE _ Taker
  2320.     CreateVehicle(515, 1663.0000, 1205.0000, 11.7800, 270.0000, -1, -1, 1000); // LV _ FUEL _ RoadTrain
  2321.     CreateVehicle(515, 1663.0000, 1200.0000, 11.7800, 270.0000, -1, -1, 1000); // LV _ FUEL _ RoadTrain
  2322.     CreateVehicle(515, 1663.0000, 1195.0000, 11.7800, 270.0000, -1, -1, 1000); // LV _ FUEL _ RoadTrain
  2323.     CreateVehicle(515, 1663.0000, 1190.0000, 11.7800, 270.0000, -1, -1, 1000); // LV _ FUEL _ RoadTrain
  2324.     CreateVehicle(515, 1663.0000, 1185.0000, 11.7800, 270.0000, -1, -1, 1000); // LV _ FUEL _ RoadTrain
  2325.     CreateVehicle(515, 1663.0000, 1180.0000, 11.7800, 270.0000, -1, -1, 1000); // LV _ FUEL _ RoadTrain
  2326.     CreateVehicle(515, 1663.0000, 1175.0000, 11.7800, 270.0000, -1, -1, 1000); // LV _ FUEL _ RoadTrain
  2327.     //Trailer
  2328.     CreateVehicle(435, 2240.0110, -2229.2168, 14.5, -225.0000, -1, -1, 1000); // LS _ Cargo _ Trailer
  2329.     CreateVehicle(435, 2234.3779, -2223.4226, 14.5, -225.0000, -1, -1, 1000); // LS _ Cargo _ Trailer
  2330.     CreateVehicle(435, 2229.2698, -2218.0518, 14.5, -225.0000, -1, -1, 1000); // LS _ Cargo _ Trailer
  2331.     CreateVehicle(435, 2223.7935, -2212.6113, 14.5, -225.0000, -1, -1, 1000); // LS _ Cargo _ Trailer
  2332.     CreateVehicle(435, 2212.8635, -2201.3330, 14.5, -225.0000, -1, -1, 1000); // LS _ Cargo _ Trailer
  2333.     CreateVehicle(435, 2218.4292, -2207.0735, 14.5, -225.0000, -1, -1, 1000); // LS _ Cargo _ Trailer
  2334.     CreateVehicle(435, 2207.2556, -2196.1536, 14.5, -225.0000, -1, -1, 1000); // LS _ Cargo _ Trailer
  2335.     CreateVehicle(435, 2177.8228, -2210.6594, 14.5, 170.0000, -1, -1, 1000); // LS _ Cargo _ Trailer
  2336.     CreateVehicle(435, 2197.5813, -2191.3069, 14.5, 170.0000, -1, -1, 1000); // LS _ Cargo _ Trailer
  2337.     CreateVehicle(435, 2190.6023, -2197.6255, 14.5, 170.0000, -1, -1, 1000); // LS _ Cargo _ Trailer
  2338.     CreateVehicle(435, 2184.0828, -2204.4814, 14.5, 170.0000, -1, -1, 1000); // LS _ Cargo _ Trailer
  2339.     CreateVehicle(435, 2171.9846, -2216.1304, 14.5, 170.0000, -1, -1, 1000); // LS _ Cargo _ Trailer
  2340.     CreateVehicle(435, 2245.2988, -2234.5396, 14.5, -225.0000, -1, -1, 1000); // LS _ Cargo _ Trailer
  2341.     CreateVehicle(435, 2223.4487, -2252.9355, 14.5, -225.0000, -1, -1, 1000); // LS _ Cargo _ Trailer
  2342.     CreateVehicle(435, 2218.6594, -2248.1018, 14.5, -225.0000, -1, -1, 1000); // LS _ Cargo _ Trailer
  2343.     CreateVehicle(435, 2213.4744, -2242.9456, 14.5, -225.0000, -1, -1, 1000); // LS _ Cargo _ Trailer
  2344.     CreateVehicle(435, 2208.2178, -2237.4695, 14.5, -225.0000, -1, -1, 1000); // LS _ Cargo _ Trailer
  2345.     CreateVehicle(435, 2202.6345, -2231.9873, 14.5, -225.0000, -1, -1, 1000); // LS _ Cargo _ Trailer
  2346.     CreateVehicle(435, 2786.4614, 971.5320, 11.3, -135.0000, -1, -1, 1000); // LV _ Cargo _ Trailer
  2347.     CreateVehicle(435, 2785.9741, 979.7285, 11.3, -135.0000, -1, -1, 1000); // LV _ Cargo _ Trailer
  2348.     CreateVehicle(435, 2786.4521, 986.7941, 11.3, -135.0000, -1, -1, 1000); // LV _ Cargo _ Trailer
  2349.     CreateVehicle(435, 2786.3574, 993.1647, 11.3, -135.0000, -1, -1, 1000); // LV _ Cargo _ Trailer
  2350.     CreateVehicle(435, 2786.3252, 999.5724, 11.3, -135.0000, -1, -1, 1000); // LV _ Cargo _ Trailer
  2351.     CreateVehicle(435, 2786.8430, 1006.2341, 11.3, -135.0000, -1, -1, 1000); // LV _ Cargo _ Trailer
  2352.     CreateVehicle(435, 2787.5334, 1013.3503, 11.3, -135.0000, -1, -1, 1000); // LV _ Cargo _ Trailer
  2353.     CreateVehicle(435, 2810.7585, 1013.6876, 11.3, 180.0000, -1, -1, 1000); // LV _ Cargo _ Trailer
  2354.     CreateVehicle(435, 2804.6987, 1013.5463, 11.3, 180.0000, -1, -1, 1000); // LV _ Cargo _ Trailer
  2355.     CreateVehicle(435, 2816.6812, 1013.7043, 11.3, 180.0000, -1, -1, 1000); // LV _ Cargo _ Trailer
  2356.     CreateVehicle(435, 2822.7178, 1013.8634, 11.3, 180.0000, -1, -1, 1000); // LV _ Cargo _ Trailer
  2357.     CreateVehicle(435, 2828.5789, 1013.4830, 11.3, 180.0000, -1, -1, 1000); // LV _ Cargo _ Trailer
  2358.     CreateVehicle(435, 2834.5049, 1013.6192, 11.3, 180.0000, -1, -1, 1000); // LV _ Cargo _ Trailer
  2359.     CreateVehicle(435, 2840.2200, 1013.7421, 11.3, 180.0000, -1, -1, 1000); // LV _ Cargo _ Trailer
  2360.     CreateVehicle(450, 945.9777, 1718.5000, 11.0031, 180.0000, -1, -1, 1000); // LV _ ORE _ Trailer
  2361.     CreateVehicle(450, 950.7542, 1718.5000, 11.0031, 180.0000, -1, -1, 1000); // LV _ ORE _ Trailer
  2362.     CreateVehicle(450, 955.8819, 1718.5000, 11.0031, 180.0000, -1, -1, 1000); // LV _ ORE _ Trailer
  2363.     CreateVehicle(450, 961.0938, 1718.5000, 11.0031, 180.0000, -1, -1, 1000); // LV _ ORE _ Trailer
  2364.     CreateVehicle(450, 966.1882, 1718.5000, 11.0031, 180.0000, -1, -1, 1000); // LV _ ORE _ Trailer
  2365.     CreateVehicle(450, 971.1977, 1718.5000, 11.0031, 180.0000, -1, -1, 1000); // LV _ ORE _ Trailer
  2366.     CreateVehicle(450, 985.0000, 1628.2000, 10.4800, 25.0000, -1, -1, 1000); // LV _ ORE _ Trailer
  2367.     CreateVehicle(450, 990.0000, 1628.2000, 10.4800, 25.0000, -1, -1, 1000); // LV _ ORE _ Trailer
  2368.     CreateVehicle(450, 980.0000, 1628.2000, 10.4800, 25.0000, -1, -1, 1000); // LV _ ORE _ Trailer
  2369.     CreateVehicle(450, 975.0000, 1628.2000, 10.4800, 25.0000, -1, -1, 1000); // LV _ ORE _ Trailer
  2370.     CreateVehicle(450, 970.0000, 1628.2000, 10.4800, 25.0000, -1, -1, 1000); // LV _ ORE _ Trailer
  2371.     CreateVehicle(450, 965.0000, 1628.2000, 10.4800, 25.0000, -1, -1, 1000); // LV _ ORE _ Trailer
  2372.     CreateVehicle(450, 960.0000, 1628.2000, 10.4800, 25.0000, -1, -1, 1000); // LV _ ORE _ Trailer
  2373.     CreateVehicle(584, 1664.4000, 1254.0000, 11.7800, 260.0000, -1, -1, 1000); // LV _ FLUID _ Trailer
  2374.     CreateVehicle(584, 1664.4000, 1259.0000, 11.7800, 260.0000, -1, -1, 1000); // LV _ FLUID _ Trailer
  2375.     CreateVehicle(584, 1664.4000, 1249.0000, 11.7800, 260.0000, -1, -1, 1000); // LV _ FLUID _ Trailer
  2376.     CreateVehicle(584, 1664.4000, 1244.0000, 11.7800, 260.0000, -1, -1, 1000); // LV _ FLUID _ Trailer
  2377.     CreateVehicle(584, 1664.4000, 1239.0000, 11.7800, 260.0000, -1, -1, 1000); // LV _ FLUID _ Trailer
  2378.     CreateVehicle(584, 1664.4000, 1234.0000, 11.7800, 260.0000, -1, -1, 1000); // LV _ FLUID _ Trailer
  2379.     CreateVehicle(584, 1664.4000, 1229.0000, 11.7800, 260.0000, -1, -1, 1000); // LV _ FLUID _ Trailer
  2380.     CreateVehicle(584, 1664.4000, 1224.0000, 11.7800, 260.0000, -1, -1, 1000); // LV _ FLUID _ Trailer
  2381.     CreateVehicle(584, 1664.4000, 1219.0000, 11.7800, 260.0000, -1, -1, 1000); // LV _ FLUID _ Trailer
  2382.     CreateVehicle(584, 1664.4000, 1214.0000, 11.7800, 260.0000, -1, -1, 1000); // LV _ FLUID _ Trailer
  2383.  
  2384.     for(new i=0; i<MAX_PLAYERS; i++)
  2385.     {
  2386.         Speedo[i] = 1;
  2387.  
  2388.         Name_V[i] = TextDrawCreate(534.000000, 341.000000, " ");
  2389.         TextDrawBackgroundColor(Name_V[i], 255);
  2390.         TextDrawFont(Name_V[i], 1);
  2391.         TextDrawLetterSize(Name_V[i], 0.270000, 1.200000);
  2392.         TextDrawColor(Name_V[i], -1);
  2393.         TextDrawSetOutline(Name_V[i], 1);
  2394.         TextDrawSetProportional(Name_V[i], 1);
  2395.  
  2396.         Speed[i] = TextDrawCreate(534.000000, 356.000000, " ");
  2397.         TextDrawBackgroundColor(Speed[i], 255);
  2398.         TextDrawFont(Speed[i], 1);
  2399.         TextDrawLetterSize(Speed[i], 0.270000, 1.200000);
  2400.         TextDrawColor(Speed[i], -1);
  2401.         TextDrawSetOutline(Speed[i], 1);
  2402.         TextDrawSetProportional(Speed[i], 1);
  2403.  
  2404.         HP[i] = TextDrawCreate(534.000000, 371.000000, " ");
  2405.         TextDrawBackgroundColor(HP[i], 255);
  2406.         TextDrawFont(HP[i], 1);
  2407.         TextDrawLetterSize(HP[i], 0.270000, 1.200000);
  2408.         TextDrawColor(HP[i], -1);
  2409.         TextDrawSetOutline(HP[i], 1);
  2410.         TextDrawSetProportional(HP[i], 1);
  2411.  
  2412.         HG[i] = TextDrawCreate(534.000000, 386.000000, " ");
  2413.         TextDrawBackgroundColor(HG[i], 255);
  2414.         TextDrawFont(HG[i], 1);
  2415.         TextDrawLetterSize(HG[i], 0.270000, 1.200000);
  2416.         TextDrawColor(HG[i], -1);
  2417.         TextDrawSetOutline(HG[i], 1);
  2418.         TextDrawSetProportional(HG[i], 1);
  2419.  
  2420.         Zones[i] = TextDrawCreate(534.000000, 401.000000, " ");
  2421.         TextDrawBackgroundColor(Zones[i], 255);
  2422.         TextDrawFont(Zones[i], 1);
  2423.         TextDrawLetterSize(Zones[i], 0.270000, 1.200000);
  2424.         TextDrawColor(Zones[i], -1);
  2425.         TextDrawSetOutline(Zones[i], 1);
  2426.         TextDrawSetProportional(Zones[i], 1);
  2427.     }
  2428.     return 1;
  2429. }
  2430.  
  2431. /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
  2432. /*                          * OnGameModeExit *                                */
  2433. /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
  2434. public OnGameModeExit()
  2435. {
  2436.  
  2437.     KillTimer(vtimer);
  2438.     for(new i=0; i<MAX_PLAYERS; i++)
  2439.     {
  2440.         TextDrawDestroy(HG[i]);
  2441.         TextDrawDestroy(HP[i]);
  2442.         TextDrawDestroy(Speed[i]);
  2443.         TextDrawDestroy(Name_V[i]);
  2444.         TextDrawDestroy(Zones[i]);
  2445. /*      new File[200]; format(File, sizeof(File), "Conturi/%s.ini", pNamee(i));
  2446.         dini_IntSet(File, "Level", GetPlayerScore(i));
  2447.         dini_IntSet(File, "Cash", GetPlayerMoney(i));
  2448.         dini_IntSet(File, "Admin", PlayerInfo[i][pAdmin]);
  2449.         dini_IntSet(File, "Kills", PlayerInfo[i][pKills]);
  2450.         dini_IntSet(File, "Deaths", PlayerInfo[i][pDeaths]);
  2451.         dini_IntSet(File, "HouseKey", PlayerInfo[i][pHouseKey]);
  2452.         dini_IntSet(File, "Spawn", PlayerInfo[i][pSpawn]);
  2453. */  }
  2454.  
  2455.     for(new i=0; i<MAX_HOUSES; i++)
  2456.     {
  2457.         SaveHouse(i);
  2458.     }
  2459.     for(new s=0; s<MAX_PLAYERS; s++)
  2460.     {
  2461.         SaveSeif(s);
  2462.     }
  2463.     //SendRconCommand("unloadfs object");
  2464.     //SendRconCommand("unloadfs tdimg");
  2465.     return 1;
  2466. }
  2467.  
  2468. /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
  2469. /*                          * OnPlayerKeyStateChange *                        */
  2470. /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
  2471. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  2472. {
  2473.     //Bariere
  2474.     if(newkeys & KEY_HORN && IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
  2475.     {
  2476.         if(IsPlayerInAnyVehicle(playerid))
  2477.         {
  2478.             if(IsPlayerInRangeOfPoint(playerid, 3.0, 1724.7449,458.2328,32.0400))
  2479.             {
  2480.                 SetObjectRot(vama_LSLV, 0.0, -10.0, -19.0);
  2481.                 GivePlayerMoney(playerid, -250);
  2482.                 SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] {FFFFFF}Ai platit la vama {F48651}250${FFFFFF}, iar bariera s-a deschis pentru {F48651}4 secunde{FFFFFF}!");
  2483.                 SetTimerEx("Inchide_vama_LSLV", 4000, false, "i", playerid);
  2484.             }
  2485.             if(IsPlayerInRangeOfPoint(playerid, 3.0, 1704.9524,454.5538,32.0400))
  2486.             {
  2487.                 SetObjectRot(vama_LVLS, 0.0, 10.0, -19.0);
  2488.                 GivePlayerMoney(playerid, -250);
  2489.                 SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] {FFFFFF}Ai platit la vama {F48651}250${FFFFFF}, iar bariera s-a deschis pentru {F48651}4 secunde{FFFFFF}!");
  2490.                 SetTimerEx("Inchide_vama_LVLS", 4000, false, "i", playerid);
  2491.             }
  2492.         }
  2493.     }
  2494.  
  2495.     //CruiseControl
  2496.     if (newkeys & KEY_SUBMISSION && IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)/* && !(oldkeys & CCKey)*/
  2497.     {
  2498.         new vid = GetPlayerVehicleID(playerid);
  2499.         if (GetVehicleSpeed(vid) == 0) return false;
  2500.         new Float:x, Float:y, Float:z;
  2501.         GetVehicleVelocity(vid, x, y, z);
  2502.         GetVehicleZAngle(vid, PlayerHeadingAngle[playerid]);
  2503.         DistanceFlat(0, 0, x, y, PlayerCruiseSpeed[playerid]);
  2504.         SetTimerEx("CruiseControl", 400, false, "d", playerid);
  2505.         SCM(playerid, c_alb, "{FFFFFF}Pilot automat: {67BDFC}activat{FFFFFF}."); // === Remove this if not needed ===
  2506.     }
  2507.     else if (PlayerCruiseSpeed[playerid] != 0.00 && (newkeys & KEY_HANDBRAKE))
  2508.     {
  2509.         PlayerCruiseSpeed[playerid] = 0.00;
  2510.     }
  2511.  
  2512.     //Enter-Exit House
  2513.     if(newkeys & 16 && !IsPlayerInAnyVehicle(playerid))
  2514.     {
  2515.         for(new i = 0; i < MAX_HOUSES; i++)
  2516.         {
  2517.             if(IsPlayerInRangeOfPoint(playerid, 1.7, HouseInfo[i][hEnterX], HouseInfo[i][hEnterY], HouseInfo[i][hEnterZ]))// && GetPlayerInterior(playerid) == HouseInfo[i][hOutsideInt] && GetPlayerVirtualWorld(playerid) == HouseInfo[i][hOutsideVir]) //Is player near house entrance, and if player is in interior of that house + virtual world
  2518.             {
  2519.                 SetPlayerPos(playerid, HouseInfo[i][hExitX], HouseInfo[i][hExitY], HouseInfo[i][hExitZ]);
  2520.                 SetPlayerInterior(playerid, HouseInfo[i][hInt]);
  2521.                 SetPlayerVirtualWorld(playerid, HouseInfo[i][hVir]);
  2522.             }
  2523.             else if(IsPlayerInRangeOfPoint(playerid, 1.7, HouseInfo[i][hExitX], HouseInfo[i][hExitY], HouseInfo[i][hExitZ]))// && GetPlayerInterior(playerid) == HouseInfo[i][hInt] && GetPlayerVirtualWorld(playerid) == HouseInfo[i][hVir]) //Same as the previous IsPlayerInRangeOfPoint, but now if the player is near the house exit+int+vir
  2524.             {
  2525.                 SetPlayerPos(playerid, HouseInfo[i][hEnterX], HouseInfo[i][hEnterY], HouseInfo[i][hEnterZ]);
  2526.                 SetPlayerInterior(playerid, 0);
  2527.                 SetPlayerVirtualWorld(playerid, 0);
  2528.             }
  2529.         }
  2530.     }
  2531.     return 1;
  2532. }
  2533.  
  2534.  
  2535. /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
  2536. /*                                    * SAM *                                 */
  2537. /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
  2538. public SAM(color, string[])
  2539. {
  2540.     for(new i = 0; i < MAX_PLAYERS; i++)
  2541.     {
  2542.         if(IsPlayerConnected(i))
  2543.         {
  2544.             if(PlayerInfo[i][pAdmin] >= 1)
  2545.             {
  2546.                 SCM(i, color, string);
  2547.             }
  2548.         }
  2549.     }
  2550. }
  2551.  
  2552. /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
  2553. /*                                * Zones_Update *                            */
  2554. /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
  2555. public Zones_Update()
  2556. {
  2557.     new zone[MAX_ZONE_NAME], string[30];
  2558.     for(new i=0; i<MAX_PLAYERS; i++)
  2559.     {
  2560.         GetPlayer2DZone(i, zone, MAX_ZONE_NAME);
  2561.         format(string,sizeof(string),"%s", zone);
  2562.         TextDrawSetString(Zones[i], string);
  2563.         //TextDrawShowForPlayer(i, Zones[i]);
  2564.     }
  2565.     return 1;
  2566. }
  2567.  
  2568. /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
  2569. /*                                * LoadHouse *                               */
  2570. /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
  2571. public LoadHouse(houseid)
  2572. {
  2573.     new File[512];
  2574.     format(File, 512, "Case/%d.ini", houseid);
  2575.     if(!dini_Exists(File)) return 0;
  2576.     HouseInfo[houseid][hID] = dini_Int(File, "ID");
  2577.     HouseInfo[houseid][hLevel] = dini_Int(File, "Level");
  2578.     HouseInfo[houseid][hPrice] = dini_Int(File, "Price");
  2579.     HouseInfo[houseid][hOwned] = dini_Bool(File, "Owned") ? true : false;
  2580.     strcpy(HouseInfo[houseid][hOwner], dini_Get(File, "Owner"), MAX_PLAYER_NAME);
  2581.     HouseInfo[houseid][hEnterX] = dini_Float(File, "EnterX");
  2582.     HouseInfo[houseid][hEnterY] = dini_Float(File, "EnterY");
  2583.     HouseInfo[houseid][hEnterZ] = dini_Float(File, "EnterZ");
  2584.     HouseInfo[houseid][hExitX] = dini_Float(File, "ExitX");
  2585.     HouseInfo[houseid][hExitY] = dini_Float(File, "ExitY");
  2586.     HouseInfo[houseid][hExitZ] = dini_Float(File, "ExitZ");
  2587.     HouseInfo[houseid][hInt] = dini_Int(File, "Int");
  2588.     HouseInfo[houseid][hVir] = dini_Int(File, "Vir");
  2589.     strcpy(HouseInfo[houseid][hDescriere], dini_Get(File, "Descriere"), 20);
  2590.     return 1;
  2591. }
  2592.  
  2593. /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
  2594. /*                                * LoadSeif *                                */
  2595. /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
  2596. public LoadSeif(seifid)
  2597. {
  2598.     new File[255];
  2599.     format(File, 255, "Seifuri/%d.ini", seifid);
  2600.     if(!dini_Exists(File)) return 0;
  2601.     SeifInfo[seifid][sID] = dini_Int(File, "ID");
  2602.     SeifInfo[seifid][sMoney] = dini_Int(File, "Money");
  2603.     strcpy(SeifInfo[seifid][sPass], dini_Get(File, "Password"), 50);
  2604.     SeifInfo[seifid][sEnterX] = dini_Float(File, "EnterX");
  2605.     SeifInfo[seifid][sEnterY] = dini_Float(File, "EnterY");
  2606.     SeifInfo[seifid][sEnterZ] = dini_Float(File, "EnterZ");
  2607.     return 1;
  2608. }
  2609. /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
  2610. /*                                * SaveHouse *                               */
  2611. /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
  2612. public SaveHouse(houseid)
  2613. {
  2614.     new File[512];
  2615.     format(File, 512, "Case/%d.ini", houseid);
  2616.     if(!dini_Exists(File)) return 0;
  2617.     dini_IntSet(File, "ID", HouseInfo[houseid][hID]);
  2618.     dini_IntSet(File, "Level", HouseInfo[houseid][hLevel]);
  2619.     dini_IntSet(File, "Price", HouseInfo[houseid][hPrice]);
  2620.     dini_BoolSet(File,"Owned" , HouseInfo[houseid][hOwned] ); // daca e bool stergi integer
  2621.     dini_Set(File, "Owner", HouseInfo[houseid][hOwner]);
  2622.     dini_FloatSet(File, "EnterX", HouseInfo[houseid][hEnterX]);
  2623.     dini_FloatSet(File, "EnterY", HouseInfo[houseid][hEnterY]);
  2624.     dini_FloatSet(File, "EnterZ", HouseInfo[houseid][hEnterZ]);
  2625.     dini_FloatSet(File, "ExitX", HouseInfo[houseid][hExitX]);
  2626.     dini_FloatSet(File, "ExitY", HouseInfo[houseid][hExitY]);
  2627.     dini_FloatSet(File, "ExitZ", HouseInfo[houseid][hExitZ]);
  2628.     dini_IntSet(File, "Int", HouseInfo[houseid][hInt]);
  2629.     dini_IntSet(File, "Vir", HouseInfo[houseid][hVir]);
  2630.     if(HouseInfo[houseid][hInt] == 3)
  2631.     {
  2632.         dini_Set(File, "Descriere", "Casa mare");
  2633.     }
  2634.     if(HouseInfo[houseid][hInt] == 5)
  2635.     {
  2636.         dini_Set(File, "Descriere", "Madd Doggs Mansion");
  2637.     }
  2638.     else if(HouseInfo[houseid][hInt] == 7)
  2639.     {
  2640.         dini_Set(File, "Descriere", "Casa foarte mare");
  2641.     }
  2642.     else if(HouseInfo[houseid][hInt] == 12)
  2643.     {
  2644.         dini_Set(File, "Descriere", "Unused safe house");
  2645.     }
  2646.     return 1;
  2647. }
  2648.  
  2649. /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
  2650. /*                                * SaveSeif *                                */
  2651. /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
  2652. public SaveSeif(seifid)
  2653. {
  2654.     new File[255];
  2655.     format(File, 255, "Seifuri/%d.ini", seifid);
  2656.     if(!dini_Exists(File)) return 0;
  2657.     dini_IntSet(File, "ID", SeifInfo[seifid][sID]);
  2658.     dini_IntSet(File, "Money", SeifInfo[seifid][sMoney]);
  2659.     dini_Set(File, "Password", SeifInfo[seifid][sPass]);
  2660.     dini_FloatSet(File, "EnterX", SeifInfo[seifid][sEnterX]);
  2661.     dini_FloatSet(File, "EnterY", SeifInfo[seifid][sEnterY]);
  2662.     dini_FloatSet(File, "EnterZ", SeifInfo[seifid][sEnterZ]);
  2663.     return 1;
  2664. }
  2665.  
  2666. /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
  2667. /*                        * OnPlayerEnterVehicle *                            */
  2668. /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
  2669. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  2670. {
  2671.     Speedo[playerid] = 1;
  2672.     return 1;
  2673. }
  2674.  
  2675. public AscundeTD()
  2676. {
  2677.     TextDrawHideForAll(Anunt[0]);TextDrawHideForAll(Anunt[1]);
  2678.     return 1;
  2679. }
  2680.  
  2681. /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
  2682. /*                           * SpeedoMeter *                                  */
  2683. /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
  2684. public SpeedoMeter()
  2685. {
  2686.     for(new i=0; i<MAX_PLAYERS; i++)
  2687.     {
  2688.         if(IsPlayerInAnyVehicle(i) && Speedo[i] == 1)
  2689.         {
  2690.             new sp[5][100];
  2691.             new Float:health, Float:xX, Float:yY, Float:zZ;
  2692.             new vehicleid = GetPlayerVehicleID(i);
  2693.             new viteza = GetVehicleSpeed(vehicleid);
  2694.             new zone[MAX_ZONE_NAME];
  2695.             GetVehicleHealth(vehicleid, health);
  2696.             GetPlayerPos(i, xX, yY, zZ);
  2697.             GetPlayer2DZone(i, zone, MAX_ZONE_NAME);
  2698.  
  2699.             format(sp[0], 100, "~p~Vehicul~w~: ~w~%s", VehicleNames[GetVehicleModel(vehicleid)-400]);
  2700.             if(viteza <= 120) format(sp[1], 100, "~p~Viteza~w~: ~w~%d ~p~km/h",GetVehicleSpeed(vehicleid));
  2701.             else format(sp[1], 100, "~p~Viteza~w~: ~r~%d ~p~km/h",GetVehicleSpeed(vehicleid));
  2702.             if(health >= 350) format(sp[2], 100, "~p~Viata~w~: ~w~%.2f ~p~hp",health);
  2703.             else format(sp[2], 100, "~p~Viata~w~: ~r~%.2f ~p~hp",health);
  2704.             format(sp[3], 100, "~p~Inaltime~w~: ~w~%.1f ~p~m",zZ);
  2705.             format(sp[4], 100 ,"~p~Zona~w~: \t~w~%s", zone);
  2706.  
  2707.             TextDrawSetString(Name_V[i],  sp[0]);
  2708.             TextDrawSetString(Speed[i], sp[1]);
  2709.             TextDrawSetString(HP[i],    sp[2]);
  2710.             TextDrawSetString(HG[i],    sp[3]);
  2711.             TextDrawSetString(Zones[i], sp[4]);
  2712.  
  2713.             TextDrawShowForPlayer(i, Name_V[i]);
  2714.             TextDrawShowForPlayer(i, Speed[i]);
  2715.             TextDrawShowForPlayer(i, HP[i]);
  2716.             TextDrawShowForPlayer(i, HG[i]);
  2717.             TextDrawShowForPlayer(i, Zones[i]);
  2718.         }
  2719.         else
  2720.         {
  2721.             TextDrawHideForPlayer(i, Name_V[i]);
  2722.             TextDrawHideForPlayer(i, Speed[i]);
  2723.             TextDrawHideForPlayer(i, HP[i]);
  2724.             TextDrawHideForPlayer(i, HG[i]);
  2725.             TextDrawHideForPlayer(i, Zones[i]);
  2726.         }
  2727.     }
  2728.     return 1;
  2729. }
  2730.  
  2731. /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
  2732. /*                          OnPlayerSelectedMenuRow                           */
  2733. /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
  2734. public OnPlayerSelectedMenuRow(playerid, row)
  2735. {
  2736.     new Menu:CurrentMenu = GetPlayerMenu(playerid);
  2737.     if (CurrentMenu == orase)
  2738.     {
  2739.         switch(row)
  2740.         {
  2741.             case 0: //LosSantos
  2742.             {
  2743.                 ShowMenuForPlayer(oras_ls,playerid);
  2744.             }
  2745.             case 1: //LasVenturas
  2746.             {
  2747.                 ShowMenuForPlayer(oras_lv,playerid);
  2748.             }
  2749.         }
  2750.     }
  2751.     if (CurrentMenu == oras_ls)
  2752.     {
  2753.         switch(row)
  2754.         {
  2755.             case 0: //Cargo
  2756.             {
  2757.                 SetPlayerPos(playerid, 2262.63, -2250.74, 13.40);
  2758.             }
  2759.             case 1: //Ore
  2760.             {
  2761.                 SetPlayerPos(playerid, 2262.63, -2250.74, 16.00);
  2762.             }
  2763.             case 2: //Fluids
  2764.             {
  2765.                 SetPlayerPos(playerid, 2262.63, -2250.74, 10.00);
  2766.             }
  2767.         }
  2768.     }
  2769.     if (CurrentMenu == oras_lv)
  2770.     {
  2771.         switch(row)
  2772.         {
  2773.             case 0: //Cargo
  2774.             {
  2775.                 SetPlayerPos(playerid, 2789.57, 851.57, 15.00);
  2776.             }
  2777.             case 1: //Ore
  2778.             {
  2779.                 SetPlayerPos(playerid, 922.18, 1718.27, 10.10);
  2780.             }
  2781.             case 2: //Fluids
  2782.             {
  2783.                 SetPlayerPos(playerid, 1667.37, 1153.16, 12.10);
  2784.             }
  2785.         }
  2786.     }
  2787. }
  2788.  
  2789. /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
  2790. /*                                  *   Kick    *                             */
  2791. /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
  2792. public KickPublic(playerid)
  2793. {
  2794.     Kick(playerid);
  2795. }
  2796.  
  2797. stock KickWithMessage(playerid, color, message[])
  2798. {
  2799.     SendClientMessage(playerid, color, message);
  2800.     SetTimerEx("KickPublic", 1000, false, "d", playerid); // Delay of 1 second before kicking the player so he receives the message
  2801. }
  2802. /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
  2803. /*                              *   OnPropUpdate    *                         */
  2804. /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
  2805. public OnPropUpdate(update, num)
  2806. {
  2807.     new pstring[200];
  2808.     if(update == 1)
  2809.     {
  2810.         if(HouseInfo[num][hOwned] == false)
  2811.         {
  2812.             DestroyDynamic3DTextLabel(HouseLabel[num]);
  2813.             DestroyPickup(HousePickup[num]);
  2814.             format(pstring, sizeof(pstring), "{67BDFC}Casa de vanzare \n {67BDFC}Level: {F48651}%d \n {67BDFC}Pret: {F48651}%d{18B614}$ \n {67BDFC}Descriere: {F48651}%s \n {FFFFFF}/buyhouse", HouseInfo[num][hLevel], HouseInfo[num][hPrice], HouseInfo[num][hDescriere]);
  2815.             HouseLabel[num] = CreateDynamic3DTextLabel(pstring, 0xFFFFFFEE, HouseInfo[num][hEnterX], HouseInfo[num][hEnterY], HouseInfo[num][hEnterZ], 25, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, -1, -1, -1, 35.0);
  2816.             HousePickup[num] = CreateDynamicPickup(1273, 2, HouseInfo[num][hEnterX], HouseInfo[num][hEnterY], HouseInfo[num][hEnterZ], -1, -1, -1, 40);
  2817.         }
  2818.         else if(HouseInfo[num][hOwned] == true)
  2819.         {
  2820.             DestroyPickup(HousePickup[num]);
  2821.             DestroyDynamic3DTextLabel(HouseLabel[num]);
  2822.             format(pstring, sizeof(pstring), "{F48651}Casa cumparata \n {67BDFC}Proprietar: {F48651}%s \n {67BDFC}Level: {F48651}%d \n {67BDFC}Pret: {F48651}%d{18B614}$ \n {67BDFC}Descriere: {F48651}%s", HouseInfo[num][hOwner], HouseInfo[num][hLevel], HouseInfo[num][hPrice], HouseInfo[num][hDescriere]);
  2823.             HouseLabel[num] = CreateDynamic3DTextLabel(pstring ,0xFFFFFFEE, HouseInfo[num][hEnterX], HouseInfo[num][hEnterY], HouseInfo[num][hEnterZ], 25, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, -1, -1, -1, 35.0);
  2824.             HousePickup[num] = CreateDynamicPickup(1272, 2, HouseInfo[num][hEnterX], HouseInfo[num][hEnterY], HouseInfo[num][hEnterZ], -1, -1, -1, 40);
  2825.         }
  2826.     }
  2827.     else if(update == 2)
  2828.     {
  2829.         DestroyDynamic3DTextLabel(SeifLabel[num]);
  2830.         DestroyPickup(SeifPickup[num]);
  2831.         format(pstring, sizeof(pstring), "{67BDFC}Seif {F48651}%d \n {FFFFFF}/seif", SeifInfo[num][sID]);
  2832.         SeifLabel[num] = CreateDynamic3DTextLabel(pstring, 0xFFFFFFEE, SeifInfo[num][sEnterX], SeifInfo[num][sEnterY], SeifInfo[num][sEnterZ], 25, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, -1, -1, -1, 5.0);
  2833.         SeifPickup[num] = CreateDynamicPickup(1274, 2, SeifInfo[num][sEnterX], SeifInfo[num][sEnterY], SeifInfo[num][sEnterZ], -1, -1, -1, 10.0);
  2834.     }
  2835.     return 1;
  2836. }
  2837. /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
  2838. /*                              *   Timere Vami     *                         */
  2839. /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
  2840. public Inchide_vama_LSLV(playerid)
  2841. {
  2842.     SetObjectRot(vama_LSLV, 0.0, -90.0, -19.0);
  2843. }
  2844. public Inchide_vama_LVLS(playerid)
  2845. {
  2846.     SetObjectRot(vama_LVLS, 0.0, 90.0, -19.0);
  2847. }
  2848.  
  2849. /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
  2850. /*                                  * SendMSG *                               */
  2851. /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
  2852. public SendMSG()
  2853. {
  2854.     new rand = random(sizeof(RandomMsg));
  2855.     SendClientMessageToAll(c_alb, RandomMsg[rand]);
  2856. }
  2857.  
  2858. /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
  2859. /*                              * OnRconLoginAttempt *                        */
  2860. /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
  2861. public OnRconLoginAttempt(ip[], password[], success)
  2862. {
  2863.     if(!success) //If the password was incorrect
  2864.     {
  2865.         printf("Jucatorul cu IP-ul %s a incercat sa se logheze RCON folosind parola %s.",ip, password);
  2866.         new pip[120];
  2867.         for(new i=1; i<=MAX_PLAYERS; i++) //Loop through all players
  2868.         {
  2869.             GetPlayerIp(i, pip, sizeof(pip));
  2870.             new idiot[MAX_PLAYER_NAME];
  2871.             GetPlayerName(i, idiot, sizeof(idiot));
  2872.             if(!strcmp(ip, pip, true)) //If a player's IP is the IP that failed the login
  2873.             {
  2874.                 SCM(i, 0xFFFFFFFF, "Curiosii mor repede!"); //Send a message
  2875.                 new string[100];
  2876.                 format(string, sizeof(string), "%s s-a conectat cu parola RCON", idiot);
  2877.                 SAM(c_alb, string);
  2878.                 Kick(i); //They are now banned.
  2879.             }
  2880.         }
  2881.     }
  2882.     else
  2883.     {
  2884.         for(new i=1; i<=MAX_PLAYERS; i++) //Loop through all players
  2885.         {
  2886.             SCM(i, 0xFFFFFFFF, "s-a logat folosind parola RCON."); //Send a message
  2887.         }
  2888.     }
  2889.     return 1;
  2890. }
  2891.  
  2892. /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
  2893. /*                                  * CruiseControl *                         */
  2894. /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
  2895. public CruiseControl(playerid)
  2896. {
  2897.     new vid = GetPlayerVehicleID(playerid);
  2898.     new Float:x, Float:y, Float:z;
  2899.     GetVehicleVelocity(vid, x, y, z);
  2900.  
  2901.     new keys, ud, lr;
  2902.     GetPlayerKeys(playerid, keys, ud, lr);
  2903.  
  2904.     new Float:angle, Float:heading, Float:speed;
  2905.     GetVehicleZAngle(vid, angle);
  2906.     GetVehicleHeadingAngle(vid, heading);
  2907.     DistanceFlat(0, 0, x, y, speed);
  2908.  
  2909.  
  2910.     if (PlayerCruiseSpeed[playerid] == 0.00 ||//!(keys & CCKey) //If player released LCTRL or CruiseSpeed got cancelled by other means (spacebar press)
  2911.     GetPlayerState(playerid) != PLAYER_STATE_DRIVER ||
  2912.     (speed < 0.5 * PlayerCruiseSpeed[playerid]) || //if player slowed down too much
  2913.     z > 1)// || //if car is going upwards too fast
  2914.     //(floatabs(angle - heading) > 50 && floatabs(angle - heading) < 310))//if vehicle goes sideways
  2915.     {                                   //Cruise control will turn off:
  2916.         PlayerCruiseSpeed[playerid] = 0.00;
  2917.         SCM(playerid, c_alb, "{FFFFFF}Pilot automat: {F48651}dezactivat{F48651}."); // === Remove this if not needed ===
  2918.         return false;
  2919.     }
  2920.     GetVehicleZAngle(vid, PlayerHeadingAngle[playerid]);
  2921.     GetXYVelocity(vid, x, y, PlayerCruiseSpeed[playerid]);
  2922.     SetVehicleVelocity(vid, x, y, z);
  2923.     return SetTimerEx("CruiseControl", 400, false, "d", playerid);
  2924. }
  2925.  
  2926. /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
  2927. /*                           * SeteazaTimp *                                  */
  2928. /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
  2929. public SeteazaTimp(playerid)
  2930. {
  2931.         new string[256], an, luna, zi, ora, minut, secunda;
  2932.         getdate(an, luna, zi);
  2933.         gettime(ora, minut, secunda);
  2934.         format(string, sizeof string, "%d.%s%d.%s%d", zi, ((luna < 10) ? ("0") : ("")), luna, (an < 10) ? ("0") : (""), an);
  2935.         TextDrawSetString(Data[0], string);
  2936.         format(string, sizeof string, "%s%d:%s%d:%s%d", (ora < 10) ? ("0") : (""), ora, (minut < 10) ? ("0") : (""), minut, (secunda < 10) ? ("0") : (""), secunda);
  2937.         TextDrawSetString(Data[1], string);
  2938. }
  2939.  
  2940. /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
  2941. /*                           * PlayerToPoint *                                */
  2942. /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
  2943. public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
  2944. {
  2945.     new Float:oldposx, Float:oldposy, Float:oldposz;
  2946.     new Float:tempposx, Float:tempposy, Float:tempposz;
  2947.     GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  2948.     tempposx = (oldposx -x);
  2949.     tempposy = (oldposy -y);
  2950.     tempposz = (oldposz -z);
  2951.     if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  2952.     {
  2953.         return 1;
  2954.     }
  2955.     return 0;
  2956. }
  2957.  
  2958. /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
  2959. /*                           * RWeather *                             */
  2960. /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
  2961. public RWeather()
  2962. {
  2963.     new rand = random(sizeof(RandomW));
  2964.     SendClientMessageToAll(c_alb, RandomW[rand]);
  2965.     SetWeather(rand);
  2966. }
  2967.  
  2968. GetXYVelocity(vehicleid, &Float:x, &Float:y, Float:speed)
  2969. {
  2970.     new Float:a;
  2971.     x = 0.0;
  2972.     y = 0.0;
  2973.     GetVehicleZAngle(vehicleid, a);
  2974.     x += (speed * floatsin(-a, degrees));
  2975.     y += (speed * floatcos(-a, degrees));
  2976. }
  2977.  
  2978. GetAngleToXY(Float:X, Float:Y, Float:CurrentX, Float:CurrentY, &Float:Angle)
  2979. {
  2980.     Angle = atan2(Y-CurrentY, X-CurrentX);
  2981.     Angle = floatsub(Angle, 90.0);
  2982.     if(Angle < 0.0) Angle = floatadd(Angle, 360.0);
  2983. }
  2984.  
  2985. GetVehicleHeadingAngle(vehicleid, &Float:a)
  2986. {
  2987.     new Float:x, Float:y, Float:z;
  2988.     GetVehicleVelocity(vehicleid, x, y, z);
  2989.     GetAngleToXY(x, y, 0, 0, a);
  2990. }
  2991. stock GetDistance( Float:x1, Float:y1, Float:z1, Float:x2, Float:y2, Float:z2 )
  2992. {
  2993.     return floatround( floatsqroot( ( ( x1 - x2 ) * ( x1 - x2 ) ) + ( ( y1 - y2 ) * ( y1 - y2 ) ) + ( ( z1 - z2 ) * ( z1 - z2 ) ) ) );
  2994. }
  2995.  
  2996. strtok(const string[], &index)
  2997. {
  2998.     new length = strlen(string);
  2999.     while ((index < length) && (string[index] <= ' '))
  3000.     {
  3001.         index++;
  3002.     }
  3003.  
  3004.     new offset = index;
  3005.     new result[20];
  3006.     while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
  3007.     {
  3008.         result[index - offset] = string[index];
  3009.         index++;
  3010.     }
  3011.     result[index - offset] = EOS;
  3012.     return result;
  3013. }
  3014. stock ReturnUser(text[], playerid = INVALID_PLAYER_ID)
  3015. {
  3016.     new pos = 0;
  3017.     while (text[pos] < 0x21) // Strip out leading spaces
  3018.     {
  3019.         if (text[pos] == 0) return INVALID_PLAYER_ID; // No passed text
  3020.         pos++;
  3021.     }
  3022.     new userid = INVALID_PLAYER_ID;
  3023.     if (IsNumeric(text[pos])) // Check whole passed string
  3024.     {
  3025.         // If they have a numeric name you have a problem (although names are checked on id failure)
  3026.         userid = strval(text[pos]);
  3027.         if (userid >=0 && userid < MAX_PLAYERS)
  3028.         {
  3029.             if(!IsPlayerConnected(userid))
  3030.             {
  3031.                 userid = INVALID_PLAYER_ID;
  3032.             }
  3033.             else
  3034.             {
  3035.                 return userid; // A player was found
  3036.             }
  3037.         }
  3038.     }
  3039.     // They entered [part of] a name or the id search failed (check names just incase)
  3040.     new len = strlen(text[pos]);
  3041.     new count = 0;
  3042.     new name[MAX_PLAYER_NAME];
  3043.     for (new i = 0; i < MAX_PLAYERS; i++)
  3044.     {
  3045.         if (IsPlayerConnected(i))
  3046.         {
  3047.             GetPlayerName(i, name, sizeof (name));
  3048.             if (strcmp(name, text[pos], true, len) == 0) // Check segment of name
  3049.             {
  3050.                 if (len == strlen(name)) // Exact match
  3051.                 {
  3052.                     return i; // Return the exact player on an exact match
  3053.                 }
  3054.                 else // Partial match
  3055.                 {
  3056.                     count++;
  3057.                     userid = i;
  3058.                 }
  3059.             }
  3060.         }
  3061.     }
  3062.     if (count != 1)
  3063.     {
  3064.         if (playerid != INVALID_PLAYER_ID)
  3065.         {
  3066.             if (count)
  3067.             {
  3068.                 SCM(playerid, 0xFF0000AA, "Multiple users found, please narrow search.");
  3069.             }
  3070.             else
  3071.             {
  3072.                 SCM(playerid, 0xFF0000AA, "No matching user found.");
  3073.             }
  3074.         }
  3075.         userid = INVALID_PLAYER_ID;
  3076.     }
  3077.     return userid; // INVALID_PLAYER_ID for bad return
  3078. }
  3079. IsNumeric(const string[])
  3080. {
  3081.     for (new i = 0, j = strlen(string); i < j; i++)
  3082.     {
  3083.         if (string[i] > '9' || string[i] < '0') return 0;
  3084.     }
  3085.     return 1;
  3086. }
  3087. stock pNamee(playerid)
  3088. {
  3089.     new Nume[MAX_PLAYER_NAME];
  3090.     GetPlayerName(playerid, Nume, sizeof(Nume));
  3091.     return Nume;
  3092. }
  3093.  
  3094.  
  3095. stock GetVehicleSpeed(vehicleid)
  3096. {
  3097.     new Float:vSpeed[3];
  3098.     GetVehicleVelocity( vehicleid, vSpeed[0], vSpeed[1], vSpeed[2] );
  3099.     new Float:vSpeed_Float;
  3100.     vSpeed_Float = floatsqroot( ((vSpeed[0] * vSpeed[0]) + (vSpeed[1] * vSpeed[1])) + (vSpeed[2] * vSpeed[2])) * 161;
  3101.     new vSpeed_Int;
  3102.     vSpeed_Int = floatround( vSpeed_Float, floatround_round);
  3103.     return vSpeed_Int;
  3104. }
  3105.  
  3106. DistanceFlat(Float:ax, Float:ay, Float:bx,Float:by, &Float:distance)
  3107. {
  3108.     distance = floatsqroot(floatpower(bx-ax,2)+floatpower(by-ay,2));
  3109.     return floatround(distance);
  3110. }
  3111.  
  3112. stock GetPlayer2DZone(playerid, zone[], len) //Credits to Cueball, Betamaster, Mabako, and Simon (for finetuning).
  3113. {
  3114.     new Float:x, Float:y, Float:z;
  3115.     GetPlayerPos(playerid, x, y, z);
  3116.     for(new i = 0; i != sizeof(gSAZones); i++ )
  3117.     {
  3118.         if(x >= gSAZones[i][SAZONE_AREA][0] && x <= gSAZones[i][SAZONE_AREA][3] && y >= gSAZones[i][SAZONE_AREA][1] && y <= gSAZones[i][SAZONE_AREA][4])
  3119.         {
  3120.             return format(zone, len, gSAZones[i][SAZONE_NAME], 0);
  3121.         }
  3122.     }
  3123.     return 0;
  3124. }
  3125.  
  3126. stock IsValidVehicleModel(vehiclemodel)
  3127. {
  3128.     if(vehiclemodel >= 400 && vehiclemodel <= 611)
  3129.         return true;
  3130.     return false;
  3131. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement