Advertisement
Guest User

Asta e pwn de la gamemode

a guest
Aug 25th, 2019
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 123.26 KB | None | 0 0
  1. #pragma tabsize 0
  2. #include <a_samp>
  3. #include <zcmd>
  4. #include <foreach>
  5. #define COL_WHITE 0xEFEFEFFF
  6. #define EMBED_WHITE {EFEFEF}
  7. #define CO_ORANGE 0xFF9900AA
  8. #define CO_YELLOW 0xFFFF00FF
  9. #define CO_RED 0xFF0000FF
  10. #define green 0x16EB43FF
  11. #define red 0xFF0000AA
  12. #define blue 0x33CCFFAA
  13. #define vBlue 0x0259EAAA
  14. #define vRed 0xFF0000AA
  15. #define vGreen 0x16EB43FF
  16. #define vPurple 0xB360FDFF
  17. #define vPink 0xCCFF00FF
  18. #define vYellow 0xFFFF00FF
  19. #define vGrey 0xC0C0C0FF
  20. #define vOrange 0xFFA500FF
  21. #define vBrown 0x800000FF
  22. #define COLOR_BLUE 0x375FFFFF
  23. #define COLOR_GREY 0xAFAFAFAA
  24. #define COLOR_GREEN 0x33AA33AA
  25. #define COLOR_RED 0xAA3333AA
  26. #define COLOR_YELLOW 0xFFFF00AA
  27. #define COLOR_MEDBLUE 0x0091FFFF
  28. #define COLOR_YELLOW 0xFFFF00AA
  29. #define COLOR_YELLOW2 0xF5DEB3AA
  30. #define MAX_RANDOM_GIFTS 3
  31. #define PRESSED(%0) \
  32. (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
  33.  
  34. new PlayersBeforePolice = 0;
  35. new XDeaths[MAX_PLAYERS];
  36. new LastDeath[MAX_PLAYERS];
  37. new GiftboxReset = 0;
  38. new Float:giftPos[4];
  39. new giftboxobject;
  40. new giftboxcreated = 0;
  41. new Text3D:giftbox3DText;
  42. new GiftboxReceived = 0;
  43. //Includes
  44. #include <dutils>
  45. #include <sscanf2>
  46. #include <streamer>
  47. #include <JunkBuster>
  48. #include <PPC_DefTexts>
  49. #include <PPC_ServerSettings>
  50. #include <PPC_Defines>
  51. #include <PPC_DefLocations>
  52. #include <PPC_DefLoads>
  53. #include <PPC_DefCars>
  54. #include <PPC_DefPlanes>
  55. #include <PPC_DefTrailers>
  56. #include <PPC_DefBuyableVehicles>
  57. #include <PPC_GlobalTimer>
  58. #include <PPC_Common>
  59. #include <PPC_Housing>
  60. #include <PPC_Business>
  61. #include <PPC_GameModeInit>
  62. #include <PPC_FileOperations>
  63. #include <PPC_Speedometer>
  64. #include <PPC_Extras>
  65. #include <PPC_MissionsTrucking>
  66. #include <PPC_MissionsBus>
  67. #include <PPC_MissionsPilot>
  68. #include <PPC_MissionsPolice>
  69. #include <PPC_MissionsMafia>
  70. #include <PPC_MissionsAssistance>
  71. #include <PPC_MissionsCourier>
  72. #include <PPC_MissionsRoadworker>
  73. #include <PPC_Convoys>
  74. #include <PPC_Dialogs>
  75. #include <PPC_PlayerCommands>
  76. #include <PPC_Toll>
  77. #include <PPC_MissionMedic>
  78. #include <PPC_MissionsFBY>
  79. #include <PPC_MissionsPboy>
  80. #include <PPC_MissionsSofer>
  81. #include <PPC_MissionsG>
  82. #include <PPC_MissionsMarinar>
  83. #include <PPC_MissionsTaxi>
  84. #include <PPC_MissionsPadurar>
  85.  
  86. public OnFilterScriptInit()
  87. {
  88. print("\n--------------------------------------");
  89. print("S-AFK system by Sami is loaded.");
  90. print("--------------------------------------\n");
  91. SetTimer("GiftBoxTimer", 1000, true);
  92. return 1;
  93. }
  94.  
  95. stock RandomGift(playerid)
  96. {
  97. new randomgift = random(MAX_RANDOM_GIFTS) + 1;
  98. switch (randomgift)
  99. {
  100. case 1:
  101. {
  102. GivePlayerMoney(playerid, 50000);
  103. SendClientMessage(playerid, COLOR_YELLOW, "Ai castigat 50.000$!.");
  104. }
  105. case 2:
  106. {
  107. GivePlayerMoney(playerid, 10000);
  108. SendClientMessage(playerid, COLOR_YELLOW, "Ai castigat 10.000$!.");
  109. }
  110. case 3:
  111. {
  112. SetPlayerScore(playerid, 100);
  113. SendClientMessage(playerid, COLOR_YELLOW, "Ai primit 100 Score!.");
  114. }
  115. }
  116. return 1;
  117. }
  118.  
  119. forward GiftBoxTimer( );
  120. public GiftBoxTimer( )
  121. {
  122. new hours,minutes,seconds,year,month,day;
  123. gettime(hours, minutes, seconds), getdate(year, month, day);
  124.  
  125. if(hours == 23 && minutes == 59)
  126. {
  127. if(GiftboxReset == 0)
  128. {
  129. foreach(new i: Player)
  130. {
  131. new name[MAX_PLAYER_NAME], file[256];
  132. GetPlayerName(i, name, MAX_PLAYER_NAME);
  133. format(file,sizeof(file),"MyServer/Users/%s.txt",name);
  134. APlayerData[i][GiftboxReceived] = 0;
  135. dini_IntSet(file,"GiftboxReceived",0);
  136. }
  137. GiftboxReset = 1;
  138. SetTimer("ResetGiftboxReset", 7 * 10000, false );
  139. }
  140. }
  141. return 1;
  142. }
  143.  
  144. function ResetQuestDat( ) return GiftboxReset = 0;
  145.  
  146.  
  147. // The main function (used only once when the server loads)
  148. main()
  149. {
  150. // Print some standard lines to the server's console
  151. print("\n----------------------------------");
  152. print("-----");
  153. print("Response: case 1");
  154. print("----------------------------------\n");
  155. }
  156. // This callback gets called when the server initializes the gamemode
  157. public OnGameModeInit()
  158. {
  159. GameModeInit_VehiclesPickups(); // Add all static vehicles and pickups when the server starts that are required (also load the houses)
  160. GameModeInit_Classes(); // Add character models to the class-selection (without weapons)
  161.  
  162. Convoys_Init(); // Setup textdraws and default data for convoys
  163.  
  164. ShowPlayerMarkers(1); // Show players on the entire map (and on the radar)
  165. ShowNameTags(1); // Show player names (and health) above their head
  166. ManualVehicleEngineAndLights(); // Let the server control the vehicle's engine and lights
  167. EnableStuntBonusForAll(0); // Disable stunt bonus for all players
  168. DisableInteriorEnterExits(); // Removes all building-entrances in the game
  169. UsePlayerPedAnims(); // Use CJ's walking animation
  170.  
  171. // Start the timer that will show timed messages every 2 minutes
  172. SetTimer("Timer_TimedMessages", 1000 * 60 * 5, true);
  173. // Start the timer that will show a random bonus mission for truckers every 5 minutes
  174. SetTimer("ShowRandomBonusMission", 1000 * 60 * 5, true);
  175. // Start the timer that checks the toll-gates
  176. SetTimer("Toll", 1000, true);
  177.  
  178.  
  179. // Fix the bugged houses (after fixing the houses, you can remove this line, as it's not needed anymore)
  180. FixHouses();
  181.  
  182. // While the gamemode starts, start the global timer, and run it every second
  183. SetTimer("GlobalTimer", 1000, true);
  184. //Semne de circulatie
  185. new Bucuresti = CreateObject(19353, -2466.9526, 2236.5502, 9.8563, 0.0000, 0.0000, 89.7577);
  186. SetObjectMaterialText(Bucuresti, "Bucuresti", 0, 90, "Arial", 24, 1, -65281, 0, 1);
  187.  
  188. new Cityville = CreateObject(19353, 2872.2746, -1975.9941, 18.1231, -0.2999, -1.2000, -179.5621);
  189. SetObjectMaterialText(Cityville, "CityVille", 0, 50, "Arial", 30, 0, -65536, 0, 1);
  190.  
  191. new CirtVille2 = CreateObject(19353, 2872.1218, -1969.6002, 18.0155, -0.7999, 1.6000, -179.3623);
  192. SetObjectMaterialText(CirtVille2, "CityVille", 0, 50, "Arial", 30, 0, -65536, 0, 1);
  193.  
  194. new Ls = CreateObject(19353, 2874.5537, -1958.7592, 18.2131, 0.0000, 0.0000, 0.1665);
  195. SetObjectMaterialText(Ls, "Los Santos", 0, 50, "Arial", 24, 0, -16776961, 0, 1);
  196.  
  197. new Ls2 = CreateObject(19353, 2874.5607, -1952.4980, 18.1431, 0.0000, 0.0000, 0.7731);
  198. SetObjectMaterialText(Ls2, "Los Santos", 0, 50, "Arial", 24, 0, -65536, 0, 1);
  199.  
  200. new welcome = CreateObject(19353, 1454.4317, 997.2934, 9.7993, -1.0999, -90.0998, -93.5626);
  201. SetObjectMaterialText(welcome, "RTO iti ureaza Distractie placuta! ", 0, 140, "Arial", 24, 0, -65536, 0, 1);
  202.  
  203. new Bucuresti3 = CreateObject(19353, -2469.3129, 1861.7662, 10.1755, -0.0999, 0.0000, 89.7867);
  204. SetObjectMaterialText(Bucuresti3, "Bucuresti >", 0, 50, "Arial", 24, 0, -65536, 0, 1);
  205.  
  206. new BucurestiConstanta = CreateObject(19353, -2496.6354, 1833.8712, 10.0333, -0.3000, 9.1999, -0.2132);
  207. SetObjectMaterialText(BucurestiConstanta, "^^Bucuresti^^Constanta^^", 0, 100, "Arial", 24, 0, -65536, 0, 1);
  208.  
  209. new CosBuc = CreateObject(19353, -3555.2246, 1834.0633, 10.2248, 0.0000, 0.0000, -0.7132);
  210. SetObjectMaterialText(CosBuc, "<<Constanta ^^>>Bucuresti^^", 0, 100, "Arial", 24, 0, -65536, 0, 1);
  211.  
  212. new Bucuresti7 = CreateObject(19353, -3613.9943, 1833.9085, 10.4303, -0.4999, 0.0000, -0.7132);
  213. SetObjectMaterialText(Bucuresti7, "^^Bucuresti^^", 0, 60, "Arial", 24, 0, -65536, 0, 1);
  214.  
  215. new Constantaint = CreateObject(19353, -3596.8090, 1618.6654, 10.7107, 0.0000, 0.0000, 90.4867);
  216. SetObjectMaterialText(Constantaint, "Constanta", 0, 60, "Arial", 24, 0, -65536, 0, 1);
  217.  
  218. new Bineaivenit = CreateObject(19353, 1450.1817, 994.3056, 9.7671, 0.0999, -90.0000, -89.9389);
  219. SetObjectMaterialText(Bineaivenit, "Bine Ai venit!", 0, 60, "Arial", 20, 0, -16776961, 0, 1);
  220.  
  221. return 1;
  222. }
  223. // This callback gets called when a player connects to the server
  224. public OnPlayerConnect(playerid)
  225. {
  226. // Always allow NPC's to login without password or account
  227.  
  228. if (IsPlayerNPC(playerid))
  229. return 1;
  230.  
  231. // Setup local variables
  232. new Name[MAX_PLAYER_NAME], NewPlayerMsg[128], HouseID;
  233.  
  234. // Setup a PVar to allow cross-script money-transfers (only from filterscript to this mainscript) and scorepoints
  235. SetPVarInt(playerid, "PVarMoney", 0);
  236. SetPVarInt(playerid, "PVarScore", 0);
  237.  
  238. // Get the playername
  239. GetPlayerName(playerid, Name, sizeof(Name));
  240. // Also store this name for the player
  241. GetPlayerName(playerid, APlayerData[playerid][PlayerName], 24);
  242.  
  243. // Send a message to all players to let them know somebody else joined the server
  244. format(NewPlayerMsg, 128, TXT_PlayerJoinedServer, Name, playerid);
  245. SendClientMessageToAll(0xFFFFFFFF, NewPlayerMsg);
  246.  
  247. // Try to load the player's datafile ("PlayerFile_Load" returns "1" is the file has been read, "0" when the file cannot be read)
  248. if (PlayerFile_Load(playerid) == 1)
  249. {
  250. // Check if the player is still banned
  251. if (APlayerData[playerid][BanTime] < gettime()) // Player ban-time is passed
  252. ShowPlayerDialog(playerid, DialogLogin, DIALOG_STYLE_PASSWORD, TXT_DialogLoginTitle, TXT_DialogLoginMsg, TXT_DialogLoginButton1, TXT_DialogButtonCancel);
  253. else // Player is still banned
  254. {
  255. ShowRemainingBanTime(playerid); // Show the remaining ban-time to the player is days, hours, minutes, seconds
  256. Kick(playerid); // Kick the player
  257. }
  258. }
  259. else
  260. ShowPlayerDialog(playerid, DialogRegister, DIALOG_STYLE_PASSWORD, TXT_DialogRegisterTitle, TXT_DialogRegisterMsg, TXT_DialogRegisterButton1, TXT_DialogButtonCancel);
  261.  
  262. // The houses have been loaded but not the cars, so load all vehicles assigned to the player's houses
  263. for (new HouseSlot; HouseSlot < MAX_HOUSESPERPLAYER; HouseSlot++)
  264. {
  265. // Get the HouseID from this slot
  266. HouseID = APlayerData[playerid][Houses][HouseSlot];
  267. // Check if there is a house in this slot
  268. if (HouseID != 0)
  269. HouseFile_Load(HouseID, true); // Load the cars of the house
  270. }
  271.  
  272. // Speedometer setup
  273. Speedometer_Setup(playerid);
  274.  
  275. // MissionText TextDraw setup
  276. APlayerData[playerid][MissionText] = TextDrawCreate(320.0, 430.0, " "); // Setup the missiontext at the bottom of the screen
  277. TextDrawAlignment(APlayerData[playerid][MissionText], 2); // Align the missiontext to the center
  278. TextDrawUseBox(APlayerData[playerid][MissionText], 1); // Set the missiontext to display inside a box
  279. TextDrawBoxColor(APlayerData[playerid][MissionText], 0x00000066); // Set the box color of the missiontext
  280. TextDrawFont(APlayerData[playerid][MissionText], 1);//set stilu de scris text
  281.  
  282.  
  283. // Display a message if the player hasn't accepted the rules yet
  284. if (APlayerData[playerid][RulesRead] == false)
  285. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Nu ai Acceptat {FFFF00}/rules{FF0000}");
  286.  
  287. //Objecte Scoase
  288. //Spawn LA lv LA Truckeri facut de mine arnold e super belea
  289. RemoveBuildingForPlayer(playerid, 8116, 1435.5859, 952.5859, 15.5234, 0.25);
  290. RemoveBuildingForPlayer(playerid, 8117, 1447.4141, 1056.1875, 15.7813, 0.25);
  291. RemoveBuildingForPlayer(playerid, 8118, 1343.6875, 1130.3906, 13.5313, 0.25);
  292. RemoveBuildingForPlayer(playerid, 8119, 1486.9766, 1104.5703, 13.8203, 0.25);
  293. RemoveBuildingForPlayer(playerid, 8160, 1417.6328, 1152.3438, 13.5547, 0.25);
  294. RemoveBuildingForPlayer(playerid, 8163, 1316.2578, 1129.3828, 15.8750, 0.25);
  295. RemoveBuildingForPlayer(playerid, 998, 1393.7734, 927.0938, 10.7344, 0.25);
  296. RemoveBuildingForPlayer(playerid, 1365, 1392.2188, 939.7188, 10.9609, 0.25);
  297. RemoveBuildingForPlayer(playerid, 1219, 1392.4531, 956.2109, 10.0625, 0.25);
  298. RemoveBuildingForPlayer(playerid, 1219, 1392.4531, 953.3828, 10.0625, 0.25);
  299. RemoveBuildingForPlayer(playerid, 1219, 1392.4531, 950.4844, 10.0625, 0.25);
  300. RemoveBuildingForPlayer(playerid, 1219, 1392.4531, 947.6641, 10.0625, 0.25);
  301. RemoveBuildingForPlayer(playerid, 998, 1393.8672, 969.4922, 10.7344, 0.25);
  302. RemoveBuildingForPlayer(playerid, 640, 1399.0078, 969.2734, 10.5156, 0.25);
  303. RemoveBuildingForPlayer(playerid, 1358, 1379.0313, 980.7656, 11.0703, 0.25);
  304. RemoveBuildingForPlayer(playerid, 8066, 1435.5859, 952.5859, 15.5234, 0.25);
  305. RemoveBuildingForPlayer(playerid, 1616, 1420.5469, 969.0547, 16.4297, 0.25);
  306. RemoveBuildingForPlayer(playerid, 640, 1436.0703, 969.2734, 10.5156, 0.25);
  307. RemoveBuildingForPlayer(playerid, 1420, 1432.7188, 1013.7109, 9.8203, 0.25);
  308. RemoveBuildingForPlayer(playerid, 1420, 1436.1953, 1013.7109, 9.8203, 0.25);
  309. RemoveBuildingForPlayer(playerid, 1616, 1430.9453, 1026.1875, 16.4297, 0.25);
  310. RemoveBuildingForPlayer(playerid, 1219, 1447.2422, 1012.7656, 10.0313, 0.25);
  311. RemoveBuildingForPlayer(playerid, 1219, 1444.4141, 1012.7656, 10.0313, 0.25);
  312. RemoveBuildingForPlayer(playerid, 1219, 1450.1406, 1012.7656, 10.0313, 0.25);
  313. RemoveBuildingForPlayer(playerid, 1219, 1452.9609, 1012.7656, 10.0313, 0.25);
  314. RemoveBuildingForPlayer(playerid, 1331, 1303.2188, 1102.7188, 10.6250, 0.25);
  315. RemoveBuildingForPlayer(playerid, 1338, 1303.2344, 1107.8906, 10.4922, 0.25);
  316. RemoveBuildingForPlayer(playerid, 1438, 1384.8828, 1101.3750, 9.8125, 0.25);
  317. RemoveBuildingForPlayer(playerid, 1420, 1384.0391, 1111.6250, 9.8203, 0.25);
  318. RemoveBuildingForPlayer(playerid, 1616, 1430.9453, 1063.3359, 16.4297, 0.25);
  319. RemoveBuildingForPlayer(playerid, 1338, 1430.5391, 1077.7813, 10.4922, 0.25);
  320. RemoveBuildingForPlayer(playerid, 1338, 1428.6172, 1075.2500, 10.4922, 0.25);
  321. RemoveBuildingForPlayer(playerid, 1684, 1429.2734, 1094.3203, 11.3281, 0.25);
  322. RemoveBuildingForPlayer(playerid, 1219, 1437.6797, 1099.3750, 10.0313, 0.25);
  323. RemoveBuildingForPlayer(playerid, 1219, 1447.2422, 1099.3750, 10.0313, 0.25);
  324. RemoveBuildingForPlayer(playerid, 1219, 1444.4141, 1099.3750, 10.0313, 0.25);
  325. RemoveBuildingForPlayer(playerid, 8067, 1447.4141, 1056.1875, 15.7813, 0.25);
  326. RemoveBuildingForPlayer(playerid, 1219, 1450.1406, 1099.3750, 10.0313, 0.25);
  327. RemoveBuildingForPlayer(playerid, 1219, 1312.8906, 1128.3594, 10.0625, 0.25);
  328. RemoveBuildingForPlayer(playerid, 1420, 1384.0391, 1125.2891, 9.8203, 0.25);
  329. RemoveBuildingForPlayer(playerid, 1338, 1405.9688, 1127.0938, 10.4922, 0.25);
  330. RemoveBuildingForPlayer(playerid, 1431, 1409.0469, 1126.0391, 10.3594, 0.25);
  331. RemoveBuildingForPlayer(playerid, 1219, 1312.8906, 1134.0781, 10.0625, 0.25);
  332. RemoveBuildingForPlayer(playerid, 1219, 1312.8906, 1136.8984, 10.0625, 0.25);
  333. RemoveBuildingForPlayer(playerid, 1219, 1312.8906, 1131.1719, 10.0625, 0.25);
  334. RemoveBuildingForPlayer(playerid, 8074, 1316.2578, 1129.3828, 15.8750, 0.25);
  335. RemoveBuildingForPlayer(playerid, 8065, 1343.6875, 1130.3906, 13.5313, 0.25);
  336. RemoveBuildingForPlayer(playerid, 1616, 1319.6719, 1152.8594, 14.8047, 0.25);
  337. RemoveBuildingForPlayer(playerid, 640, 1356.6484, 1152.9453, 10.5156, 0.25);
  338. RemoveBuildingForPlayer(playerid, 640, 1336.8672, 1158.6484, 10.5156, 0.25);
  339. RemoveBuildingForPlayer(playerid, 1420, 1384.0391, 1138.7891, 9.8203, 0.25);
  340. RemoveBuildingForPlayer(playerid, 1420, 1384.0391, 1151.9688, 9.8203, 0.25);
  341. RemoveBuildingForPlayer(playerid, 8069, 1417.6328, 1152.3438, 13.5547, 0.25);
  342. RemoveBuildingForPlayer(playerid, 640, 1348.5547, 1163.9063, 10.5156, 0.25);
  343. RemoveBuildingForPlayer(playerid, 1334, 1338.8047, 1164.1563, 10.9297, 0.25);
  344. RemoveBuildingForPlayer(playerid, 659, 1353.1328, 1181.4766, 10.0156, 0.25);
  345. RemoveBuildingForPlayer(playerid, 680, 1339.1328, 1181.4297, 9.7969, 0.25);
  346. RemoveBuildingForPlayer(playerid, 615, 1373.5469, 1181.2969, 7.1875, 0.25);
  347. RemoveBuildingForPlayer(playerid, 629, 1364.5781, 1179.6328, 10.0625, 0.25);
  348. RemoveBuildingForPlayer(playerid, 712, 1400.0313, 1180.0078, 18.9688, 0.25);
  349. RemoveBuildingForPlayer(playerid, 680, 1414.7344, 1180.2344, 9.7969, 0.25);
  350. RemoveBuildingForPlayer(playerid, 998, 1477.3828, 927.0938, 10.7344, 0.25);
  351. RemoveBuildingForPlayer(playerid, 1438, 1476.0078, 935.3594, 9.8125, 0.25);
  352. RemoveBuildingForPlayer(playerid, 1420, 1477.7813, 938.6484, 9.8203, 0.25);
  353. RemoveBuildingForPlayer(playerid, 1420, 1477.7813, 940.0156, 9.8203, 0.25);
  354. RemoveBuildingForPlayer(playerid, 1331, 1478.1250, 963.5625, 10.6250, 0.25);
  355. RemoveBuildingForPlayer(playerid, 1616, 1465.0391, 969.0547, 16.4297, 0.25);
  356. RemoveBuildingForPlayer(playerid, 640, 1471.7422, 969.2734, 10.5156, 0.25);
  357. RemoveBuildingForPlayer(playerid, 1331, 1478.1250, 967.0703, 10.6250, 0.25);
  358. RemoveBuildingForPlayer(playerid, 659, 1494.8750, 985.8516, 9.8203, 0.25);
  359. RemoveBuildingForPlayer(playerid, 674, 1487.3906, 1001.6719, 9.7656, 0.25);
  360. RemoveBuildingForPlayer(playerid, 998, 1464.3203, 1023.2734, 10.7344, 0.25);
  361. RemoveBuildingForPlayer(playerid, 640, 1463.8828, 1018.5469, 10.5156, 0.25);
  362. RemoveBuildingForPlayer(playerid, 640, 1463.8828, 1056.0703, 10.5156, 0.25);
  363. RemoveBuildingForPlayer(playerid, 1331, 1464.2188, 1081.7422, 10.6250, 0.25);
  364. RemoveBuildingForPlayer(playerid, 640, 1463.8828, 1092.7969, 10.5156, 0.25);
  365. RemoveBuildingForPlayer(playerid, 8073, 1486.9766, 1104.5703, 13.8203, 0.25);
  366. RemoveBuildingForPlayer(playerid, 1420, 1428.7500, 1127.5078, 9.8203, 0.25);
  367. RemoveBuildingForPlayer(playerid, 1420, 1427.8359, 1127.5078, 9.8203, 0.25);
  368. RemoveBuildingForPlayer(playerid, 1420, 1426.9219, 1127.5078, 9.8203, 0.25);
  369. RemoveBuildingForPlayer(playerid, 657, 1432.3203, 1180.0547, 9.9688, 0.25);
  370.  
  371. //aproape trukeri lv sapwen de al diez
  372. RemoveBuildingForPlayer(playerid, 8113, 1665.1719, 687.0469, 14.3906, 0.25);
  373. RemoveBuildingForPlayer(playerid, 8114, 1634.7188, 772.8438, 13.8203, 0.25);
  374. RemoveBuildingForPlayer(playerid, 8115, 1695.4922, 673.2188, 13.8203, 0.25);
  375. RemoveBuildingForPlayer(playerid, 8159, 1665.5625, 753.8281, 14.3906, 0.25);
  376. RemoveBuildingForPlayer(playerid, 8254, 1665.1719, 687.0469, 14.3906, 0.25);
  377. RemoveBuildingForPlayer(playerid, 8255, 1665.5625, 753.8281, 14.3906, 0.25);
  378. RemoveBuildingForPlayer(playerid, 1358, 1679.6953, 767.4297, 11.0078, 0.25);
  379. RemoveBuildingForPlayer(playerid, 8078, 1634.7188, 772.8438, 13.8203, 0.25);
  380. RemoveBuildingForPlayer(playerid, 1335, 1651.0547, 774.8047, 10.9453, 0.25);
  381. RemoveBuildingForPlayer(playerid, 8077, 1695.4922, 673.2188, 13.8203, 0.25);
  382. RemoveBuildingForPlayer(playerid, 1219, 1709.0547, 744.4297, 10.9141, 0.25);
  383. RemoveBuildingForPlayer(playerid, 1219, 1709.0547, 747.0781, 10.9141, 0.25);
  384. ///Objecte scoase
  385. RemoveBuildingForPlayer(playerid, 3276, -1427.8516, -1600.0859, 101.4844, 0.25);
  386. RemoveBuildingForPlayer(playerid, 3276, -1439.2656, -1600.3359, 101.4844, 0.25);
  387. RemoveBuildingForPlayer(playerid, 3276, -1451.1016, -1599.6016, 101.5547, 0.25);
  388. RemoveBuildingForPlayer(playerid, 3276, -1462.6484, -1599.2031, 101.6328, 0.25);
  389. RemoveBuildingForPlayer(playerid, 3276, -1420.6563, -1594.0313, 101.4844, 0.25);
  390. RemoveBuildingForPlayer(playerid, 3276, -1468.4766, -1593.0625, 101.4844, 0.25);
  391. RemoveBuildingForPlayer(playerid, 3276, -1417.7969, -1583.0313, 101.4844, 0.25);
  392. RemoveBuildingForPlayer(playerid, 3276, -1468.9766, -1581.4844, 101.4844, 0.25);
  393. RemoveBuildingForPlayer(playerid, 3276, -1470.7422, -1535.7734, 101.4844, 0.25);
  394. RemoveBuildingForPlayer(playerid, 3276, -1471.7031, -1524.7422, 101.4844, 0.25);
  395. RemoveBuildingForPlayer(playerid, 3276, -1469.2422, -1569.8125, 101.4844, 0.25);
  396. RemoveBuildingForPlayer(playerid, 3276, -1469.6250, -1558.2578, 101.4844, 0.25);
  397. RemoveBuildingForPlayer(playerid, 3276, -1470.0000, -1546.9766, 101.4844, 0.25);
  398. RemoveBuildingForPlayer(playerid, 3276, -1411.1641, -1561.1016, 101.4844, 0.25);
  399. RemoveBuildingForPlayer(playerid, 3276, -1414.6016, -1572.0938, 101.4844, 0.25);
  400. RemoveBuildingForPlayer(playerid, 3276, -1403.1719, -1528.8359, 101.4844, 0.25);
  401. RemoveBuildingForPlayer(playerid, 3276, -1402.6719, -1540.2031, 101.4844, 0.25);
  402. RemoveBuildingForPlayer(playerid, 3276, -1406.4219, -1550.8438, 101.4844, 0.25);
  403. RemoveBuildingForPlayer(playerid, 3276, -1405.3828, -1517.0469, 101.4844, 0.25);
  404. RemoveBuildingForPlayer(playerid, 3276, -1407.5938, -1505.7188, 101.4844, 0.25);
  405. RemoveBuildingForPlayer(playerid, 3276, -1472.4531, -1513.1563, 101.4844, 0.25);
  406. RemoveBuildingForPlayer(playerid, 3276, -1409.4922, -1494.2422, 101.4844, 0.25);
  407. RemoveBuildingForPlayer(playerid, 3276, -1472.0547, -1501.3281, 101.4844, 0.25);
  408. RemoveBuildingForPlayer(playerid, 3276, -1470.5313, -1489.8906, 101.4844, 0.25);
  409. RemoveBuildingForPlayer(playerid, 3276, -1411.0078, -1482.7969, 101.4844, 0.25);
  410. RemoveBuildingForPlayer(playerid, 3276, -1468.2656, -1478.3203, 101.4844, 0.25);
  411. RemoveBuildingForPlayer(playerid, 3276, -1467.5469, -1467.2422, 101.4844, 0.25);
  412. RemoveBuildingForPlayer(playerid, 3276, -1468.2188, -1455.6875, 101.4844, 0.25);
  413. RemoveBuildingForPlayer(playerid, 3276, -1411.9531, -1461.7578, 101.0391, 0.25);
  414. RemoveBuildingForPlayer(playerid, 17055, -1439.2422, -1446.6563, 102.9297, 0.25);
  415. RemoveBuildingForPlayer(playerid, 3276, -1412.2656, -1450.2266, 101.0391, 0.25);
  416. RemoveBuildingForPlayer(playerid, 3276, -1463.4297, -1447.6406, 101.4844, 0.25);
  417. RemoveBuildingForPlayer(playerid, 3276, -1452.9609, -1443.3516, 101.4844, 0.25);
  418. RemoveBuildingForPlayer(playerid, 3276, -1441.4609, -1440.7891, 101.4844, 0.25);
  419. RemoveBuildingForPlayer(playerid, 3276, -1417.9766, -1443.6797, 100.7969, 0.25);
  420. RemoveBuildingForPlayer(playerid, 3276, -1429.5313, -1441.8203, 101.0391, 0.25);
  421. RemoveBuildingForPlayer(playerid, 3276, -1399.4063, -1422.2891, 106.1641, 0.25);
  422. RemoveBuildingForPlayer(playerid, 8229, 1142.0313, 1362.5000, 12.4844, 0.25);
  423. RemoveBuildingForPlayer(playerid, 735, 1191.0859, 693.9922, 7.9297, 0.25);
  424. RemoveBuildingForPlayer(playerid, 615, 1128.3672, 728.2578, 9.8672, 0.25);
  425. RemoveBuildingForPlayer(playerid, 615, 1148.6172, 728.2578, 9.8672, 0.25);
  426. RemoveBuildingForPlayer(playerid, 673, 1162.8203, 733.7266, 9.2656, 0.25);
  427. RemoveBuildingForPlayer(playerid, 615, 1167.6016, 728.2578, 9.8672, 0.25);
  428. RemoveBuildingForPlayer(playerid, 775, 1199.5156, 733.8672, 9.6641, 0.25);
  429. RemoveBuildingForPlayer(playerid, 735, 1064.8359, 693.9922, 8.3906, 0.25);
  430. RemoveBuildingForPlayer(playerid, 735, 1100.1484, 693.9922, 7.9297, 0.25);
  431. RemoveBuildingForPlayer(playerid, 736, 1042.2969, 751.2656, 20.4063, 0.25);
  432. RemoveBuildingForPlayer(playerid, 736, 1060.3750, 751.2656, 20.4063, 0.25);
  433. RemoveBuildingForPlayer(playerid, 736, 1068.4063, 748.7266, 20.9922, 0.25);
  434. RemoveBuildingForPlayer(playerid, 736, 1069.1953, 761.9063, 20.4063, 0.25);
  435. RemoveBuildingForPlayer(playerid, 736, 1095.3750, 774.2891, 20.4063, 0.25);
  436. RemoveBuildingForPlayer(playerid, 3246, -378.8906, -1040.8828, 57.8594, 0.25);
  437. RemoveBuildingForPlayer(playerid, 3425, -365.8750, -1060.8359, 69.2891, 0.25);
  438. RemoveBuildingForPlayer(playerid, 3250, -348.6719, -1041.9609, 58.3125, 0.25);
  439. RemoveBuildingForPlayer(playerid, 727, -343.4219, -1077.3281, 59.1172, 0.25);
  440. RemoveBuildingForPlayer(playerid, 1447, -89.9297, -1133.7500, 1.3906, 0.25);
  441. RemoveBuildingForPlayer(playerid, 1438, -87.0547, -1132.6797, 0.0469, 0.25);
  442. RemoveBuildingForPlayer(playerid, 1462, -84.3750, -1116.0938, 0.2578, 0.25);
  443. RemoveBuildingForPlayer(playerid, 1447, -84.0547, -1117.2188, 1.3906, 0.25);
  444.  
  445. // trucking deport sf remov object
  446. RemoveBuildingForPlayer(playerid, 11372, -2076.4375, -107.9297, 36.9688, 0.25);
  447. RemoveBuildingForPlayer(playerid, 11014, -2076.4375, -107.9297, 36.9688, 0.25);
  448.  
  449. //de la argon in lv aproape spawn trukeri
  450. RemoveBuildingForPlayer(playerid, 785, -1629.0781, -2269.7188, 27.5156, 0.25);
  451. RemoveBuildingForPlayer(playerid, 785, -1585.3984, -2211.6406, 8.1328, 0.25);
  452. RemoveBuildingForPlayer(playerid, 791, -1629.0781, -2269.7188, 27.5156, 0.25);
  453. RemoveBuildingForPlayer(playerid, 18258, -1638.3594, -2239.4297, 30.7500, 0.25);
  454. RemoveBuildingForPlayer(playerid, 18259, -1633.2266, -2238.8359, 30.3906, 0.25);
  455. RemoveBuildingForPlayer(playerid, 791, -1585.3984, -2211.6406, 8.1328, 0.25);
  456. RemoveBuildingForPlayer(playerid, 791, -1622.8438, -2211.5938, 21.8750, 0.25);
  457. RemoveBuildingForPlayer(playerid, 8120, 1610.8594, 902.8750, 13.5547, 0.25);
  458. RemoveBuildingForPlayer(playerid, 8121, 1737.3281, 905.1172, 13.8203, 0.25);
  459. RemoveBuildingForPlayer(playerid, 8122, 1727.7031, 950.5391, 13.2109, 0.25);
  460. RemoveBuildingForPlayer(playerid, 8123, 1668.1484, 1101.7500, 13.8203, 0.25);
  461. RemoveBuildingForPlayer(playerid, 8156, 1715.5000, 1094.7969, 14.8203, 0.25);
  462. RemoveBuildingForPlayer(playerid, 8157, 1621.6328, 1094.7969, 14.8203, 0.25);
  463. RemoveBuildingForPlayer(playerid, 8158, 1727.8047, 1018.6328, 14.8203, 0.25);
  464. RemoveBuildingForPlayer(playerid, 8162, 1606.6797, 1031.6563, 13.0859, 0.25);
  465. RemoveBuildingForPlayer(playerid, 8166, 1608.9141, 971.7188, 13.2109, 0.25);
  466. RemoveBuildingForPlayer(playerid, 8259, 1693.0000, 902.8750, 13.5547, 0.25);
  467. RemoveBuildingForPlayer(playerid, 1438, 1685.5625, 889.8359, 9.8125, 0.25);
  468. RemoveBuildingForPlayer(playerid, 1358, 1689.1641, 889.2813, 11.0078, 0.25);
  469. RemoveBuildingForPlayer(playerid, 1438, 1702.8906, 889.9531, 9.8125, 0.25);
  470. RemoveBuildingForPlayer(playerid, 1334, 1635.9844, 892.2109, 10.9297, 0.25);
  471. RemoveBuildingForPlayer(playerid, 8063, 1610.8594, 902.8750, 13.5547, 0.25);
  472. RemoveBuildingForPlayer(playerid, 1420, 1602.2813, 955.0313, 9.8203, 0.25);
  473. RemoveBuildingForPlayer(playerid, 8059, 1608.9141, 971.7188, 13.2109, 0.25);
  474. RemoveBuildingForPlayer(playerid, 1420, 1605.1797, 955.0313, 9.8203, 0.25);
  475. RemoveBuildingForPlayer(playerid, 8057, 1606.6797, 1031.6563, 13.0859, 0.25);
  476. RemoveBuildingForPlayer(playerid, 1420, 1618.0469, 1003.1406, 9.8203, 0.25);
  477. RemoveBuildingForPlayer(playerid, 8294, 1599.9531, 1039.2578, 17.3203, 0.25);
  478. RemoveBuildingForPlayer(playerid, 1687, 1595.8047, 1052.4609, 17.6016, 0.25);
  479. RemoveBuildingForPlayer(playerid, 1687, 1595.8047, 1046.4375, 17.6016, 0.25);
  480. RemoveBuildingForPlayer(playerid, 1334, 1598.6250, 1060.6563, 10.9297, 0.25);
  481. RemoveBuildingForPlayer(playerid, 1215, 1592.7578, 1074.1250, 10.2891, 0.25);
  482. RemoveBuildingForPlayer(playerid, 1334, 1603.0078, 1060.6563, 10.9297, 0.25);
  483. RemoveBuildingForPlayer(playerid, 1215, 1610.8438, 1074.1250, 10.2891, 0.25);
  484. RemoveBuildingForPlayer(playerid, 1215, 1618.9297, 1074.1250, 10.2891, 0.25);
  485. RemoveBuildingForPlayer(playerid, 659, 1651.9219, 900.3594, 9.8203, 0.25);
  486. RemoveBuildingForPlayer(playerid, 676, 1654.5078, 900.3906, 10.1328, 0.25);
  487. RemoveBuildingForPlayer(playerid, 676, 1649.3281, 900.3906, 10.1328, 0.25);
  488. RemoveBuildingForPlayer(playerid, 1687, 1630.5938, 909.1953, 17.7188, 0.25);
  489. RemoveBuildingForPlayer(playerid, 1687, 1624.9219, 909.1953, 17.7188, 0.25);
  490. RemoveBuildingForPlayer(playerid, 1440, 1667.9375, 907.2500, 10.2109, 0.25);
  491. RemoveBuildingForPlayer(playerid, 1440, 1666.7734, 905.2344, 10.2109, 0.25);
  492. RemoveBuildingForPlayer(playerid, 1421, 1668.3438, 899.6875, 10.5000, 0.25);
  493. RemoveBuildingForPlayer(playerid, 1334, 1668.0547, 911.7969, 10.9297, 0.25);
  494. RemoveBuildingForPlayer(playerid, 1215, 1669.6875, 915.3906, 10.2578, 0.25);
  495. RemoveBuildingForPlayer(playerid, 1215, 1676.9375, 915.3906, 10.2578, 0.25);
  496. RemoveBuildingForPlayer(playerid, 1215, 1685.0078, 915.3906, 10.2578, 0.25);
  497. RemoveBuildingForPlayer(playerid, 8062, 1693.0000, 902.8750, 13.5547, 0.25);
  498. RemoveBuildingForPlayer(playerid, 640, 1688.9453, 915.5234, 10.5156, 0.25);
  499. RemoveBuildingForPlayer(playerid, 1215, 1692.9766, 915.3906, 10.2578, 0.25);
  500. RemoveBuildingForPlayer(playerid, 1420, 1710.0859, 904.2344, 14.3906, 0.25);
  501. RemoveBuildingForPlayer(playerid, 1420, 1713.7500, 904.2344, 14.3906, 0.25);
  502. RemoveBuildingForPlayer(playerid, 1420, 1709.5156, 913.0547, 9.8203, 0.25);
  503. RemoveBuildingForPlayer(playerid, 1420, 1708.6016, 913.0547, 9.8203, 0.25);
  504. RemoveBuildingForPlayer(playerid, 1498, 1713.7656, 912.3516, 9.8125, 0.25);
  505. RemoveBuildingForPlayer(playerid, 1215, 1700.3438, 915.3906, 10.2578, 0.25);
  506. RemoveBuildingForPlayer(playerid, 1219, 1725.8125, 933.0234, 10.9141, 0.25);
  507. RemoveBuildingForPlayer(playerid, 1219, 1727.0078, 933.0234, 10.4688, 0.25);
  508. RemoveBuildingForPlayer(playerid, 1219, 1725.7578, 933.0234, 10.0625, 0.25);
  509. RemoveBuildingForPlayer(playerid, 1219, 1724.1016, 933.0234, 10.4688, 0.25);
  510. RemoveBuildingForPlayer(playerid, 1219, 1722.9375, 933.0234, 10.0625, 0.25);
  511. RemoveBuildingForPlayer(playerid, 1219, 1726.8750, 932.8828, 11.3594, 0.25);
  512. RemoveBuildingForPlayer(playerid, 1219, 1728.6641, 933.0234, 10.0625, 0.25);
  513. RemoveBuildingForPlayer(playerid, 1219, 1728.4688, 933.0234, 10.9141, 0.25);
  514. RemoveBuildingForPlayer(playerid, 1219, 1729.8203, 933.0234, 10.4688, 0.25);
  515. RemoveBuildingForPlayer(playerid, 1219, 1731.4766, 933.0234, 10.0625, 0.25);
  516. RemoveBuildingForPlayer(playerid, 1616, 1707.3047, 950.0391, 14.1328, 0.25);
  517. RemoveBuildingForPlayer(playerid, 1687, 1712.0703, 941.9766, 17.4141, 0.25);
  518. RemoveBuildingForPlayer(playerid, 8064, 1727.7031, 950.5391, 13.2109, 0.25);
  519. RemoveBuildingForPlayer(playerid, 1334, 1732.7422, 967.8359, 10.9297, 0.25);
  520. RemoveBuildingForPlayer(playerid, 1438, 1723.3281, 987.6563, 9.8125, 0.25);
  521. RemoveBuildingForPlayer(playerid, 1215, 1707.3359, 990.5234, 10.2891, 0.25);
  522. RemoveBuildingForPlayer(playerid, 8075, 1737.3281, 905.1172, 13.8203, 0.25);
  523. RemoveBuildingForPlayer(playerid, 1365, 1745.0703, 987.1328, 10.9609, 0.25);
  524. RemoveBuildingForPlayer(playerid, 1358, 1752.8984, 980.3984, 10.9844, 0.25);
  525. RemoveBuildingForPlayer(playerid, 1420, 1620.9531, 1003.1406, 9.8203, 0.25);
  526. RemoveBuildingForPlayer(playerid, 674, 1657.3516, 1013.5313, 9.7656, 0.25);
  527. RemoveBuildingForPlayer(playerid, 657, 1644.2422, 1013.9531, 9.9688, 0.25);
  528. RemoveBuildingForPlayer(playerid, 676, 1650.0469, 1013.1250, 10.1406, 0.25);
  529. RemoveBuildingForPlayer(playerid, 676, 1652.1719, 1013.1250, 10.1406, 0.25);
  530. RemoveBuildingForPlayer(playerid, 1231, 1652.6406, 1033.9844, 12.5859, 0.25);
  531. RemoveBuildingForPlayer(playerid, 1684, 1632.3203, 1035.3047, 11.3281, 0.25);
  532. RemoveBuildingForPlayer(playerid, 1245, 1631.4375, 1045.1328, 11.1719, 0.25);
  533. RemoveBuildingForPlayer(playerid, 1231, 1661.9922, 1033.9844, 12.5859, 0.25);
  534. RemoveBuildingForPlayer(playerid, 659, 1667.3203, 1055.7109, 9.8203, 0.25);
  535. RemoveBuildingForPlayer(playerid, 1231, 1671.3516, 1033.9844, 12.5859, 0.25);
  536. RemoveBuildingForPlayer(playerid, 1231, 1680.7031, 1033.9844, 12.5859, 0.25);
  537. RemoveBuildingForPlayer(playerid, 680, 1672.3516, 1055.7344, 9.7969, 0.25);
  538. RemoveBuildingForPlayer(playerid, 1215, 1632.4688, 1074.1250, 10.2891, 0.25);
  539. RemoveBuildingForPlayer(playerid, 1215, 1649.9063, 1074.1250, 10.2891, 0.25);
  540. RemoveBuildingForPlayer(playerid, 1358, 1653.0234, 1076.9688, 11.0078, 0.25);
  541. RemoveBuildingForPlayer(playerid, 8058, 1621.6328, 1094.7969, 14.8203, 0.25);
  542. RemoveBuildingForPlayer(playerid, 8076, 1668.1484, 1101.7500, 13.8203, 0.25);
  543. RemoveBuildingForPlayer(playerid, 998, 1677.4609, 1079.3906, 10.6094, 0.25);
  544. RemoveBuildingForPlayer(playerid, 998, 1677.4609, 1069.0938, 10.6094, 0.25);
  545. RemoveBuildingForPlayer(playerid, 998, 1677.4609, 1110.2813, 10.6094, 0.25);
  546. RemoveBuildingForPlayer(playerid, 998, 1677.4609, 1099.9844, 10.6094, 0.25);
  547. RemoveBuildingForPlayer(playerid, 998, 1677.4609, 1089.6875, 10.6094, 0.25);
  548. RemoveBuildingForPlayer(playerid, 1219, 1684.1016, 1084.9531, 10.0625, 0.25);
  549. RemoveBuildingForPlayer(playerid, 1219, 1684.1016, 1086.6094, 10.4688, 0.25);
  550. RemoveBuildingForPlayer(playerid, 1219, 1684.1016, 1087.8594, 10.0625, 0.25);
  551. RemoveBuildingForPlayer(playerid, 1219, 1684.1016, 1085.1484, 10.9141, 0.25);
  552. RemoveBuildingForPlayer(playerid, 1219, 1684.1016, 1087.7969, 10.9141, 0.25);
  553. RemoveBuildingForPlayer(playerid, 1219, 1684.1016, 1083.7891, 10.4688, 0.25);
  554. RemoveBuildingForPlayer(playerid, 1219, 1684.1016, 1089.5156, 10.4688, 0.25);
  555. RemoveBuildingForPlayer(playerid, 1219, 1684.1016, 1090.6797, 10.0625, 0.25);
  556. RemoveBuildingForPlayer(playerid, 1219, 1684.1016, 1082.1328, 10.0625, 0.25);
  557. RemoveBuildingForPlayer(playerid, 998, 1682.9219, 1063.2891, 10.6094, 0.25);
  558. RemoveBuildingForPlayer(playerid, 1358, 1683.8828, 1112.9844, 10.9453, 0.25);
  559. RemoveBuildingForPlayer(playerid, 998, 1693.2188, 1063.2891, 10.6094, 0.25);
  560. RemoveBuildingForPlayer(playerid, 1215, 1686.5078, 1074.1250, 10.2891, 0.25);
  561. RemoveBuildingForPlayer(playerid, 1438, 1706.7344, 1005.3125, 9.8125, 0.25);
  562. RemoveBuildingForPlayer(playerid, 1215, 1707.3359, 1007.8203, 10.2891, 0.25);
  563. RemoveBuildingForPlayer(playerid, 8061, 1727.8047, 1018.6328, 14.8203, 0.25);
  564. RemoveBuildingForPlayer(playerid, 1215, 1707.3359, 1021.3828, 10.2891, 0.25);
  565. RemoveBuildingForPlayer(playerid, 1215, 1707.3359, 1047.5938, 10.2891, 0.25);
  566. RemoveBuildingForPlayer(playerid, 1215, 1707.3359, 1029.4063, 10.2891, 0.25);
  567. RemoveBuildingForPlayer(playerid, 1616, 1708.0234, 1049.0469, 16.0781, 0.25);
  568. RemoveBuildingForPlayer(playerid, 998, 1713.8047, 1063.2891, 10.6094, 0.25);
  569. RemoveBuildingForPlayer(playerid, 998, 1703.5078, 1063.2891, 10.6094, 0.25);
  570. RemoveBuildingForPlayer(playerid, 8060, 1715.5000, 1094.7969, 14.8203, 0.25);
  571. RemoveBuildingForPlayer(playerid, 1215, 1704.5859, 1074.1250, 10.2891, 0.25);
  572. RemoveBuildingForPlayer(playerid, 1215, 1712.6797, 1074.1250, 10.2891, 0.25);
  573. RemoveBuildingForPlayer(playerid, 1219, 1719.7891, 1050.0156, 10.0625, 0.25);
  574. RemoveBuildingForPlayer(playerid, 1219, 1718.1328, 1050.0156, 10.4688, 0.25);
  575. RemoveBuildingForPlayer(playerid, 1219, 1716.8828, 1050.0156, 10.0625, 0.25);
  576. RemoveBuildingForPlayer(playerid, 1219, 1719.5938, 1050.0156, 10.9141, 0.25);
  577. RemoveBuildingForPlayer(playerid, 1219, 1720.9453, 1050.0156, 10.4688, 0.25);
  578. RemoveBuildingForPlayer(playerid, 1219, 1722.6016, 1050.0156, 10.0625, 0.25);
  579. RemoveBuildingForPlayer(playerid, 998, 1724.1016, 1063.2891, 10.6094, 0.25);
  580. RemoveBuildingForPlayer(playerid, 1215, 1726.4609, 1074.1250, 10.2891, 0.25);
  581. RemoveBuildingForPlayer(playerid, 1334, 1745.3594, 1049.3906, 10.9297, 0.25);
  582. RemoveBuildingForPlayer(playerid, 1219, 1740.2344, 1050.0156, 10.0625, 0.25);
  583. RemoveBuildingForPlayer(playerid, 1219, 1738.5781, 1050.0156, 10.4688, 0.25);
  584. RemoveBuildingForPlayer(playerid, 1219, 1737.3281, 1050.0156, 10.0625, 0.25);
  585. RemoveBuildingForPlayer(playerid, 1219, 1740.0391, 1050.0156, 10.9141, 0.25);
  586. RemoveBuildingForPlayer(playerid, 1219, 1741.3906, 1050.0156, 10.4688, 0.25);
  587. RemoveBuildingForPlayer(playerid, 1219, 1743.0469, 1050.0156, 10.0625, 0.25);
  588. RemoveBuildingForPlayer(playerid, 998, 1744.6953, 1063.2891, 10.6094, 0.25);
  589. RemoveBuildingForPlayer(playerid, 998, 1734.3984, 1063.2891, 10.6094, 0.25);
  590. RemoveBuildingForPlayer(playerid, 1616, 1745.1094, 1074.3984, 16.0781, 0.25);
  591. RemoveBuildingForPlayer(playerid, 1215, 1743.6719, 1074.1250, 10.2891, 0.25);
  592. RemoveBuildingForPlayer(playerid, 1503, 1584.1875, 1115.3516, 10.2109, 0.25);
  593. //la G la spawn
  594. RemoveBuildingForPlayer(playerid, 18499, -1849.5156, -1701.1563, 32.9531, 0.25);
  595. RemoveBuildingForPlayer(playerid, 18555, -1813.8047, -1615.5625, 29.8516, 0.25);
  596. RemoveBuildingForPlayer(playerid, 18556, -1907.6172, -1666.6797, 29.8516, 0.25);
  597. RemoveBuildingForPlayer(playerid, 18557, -1857.2969, -1617.9766, 26.8125, 0.25);
  598. RemoveBuildingForPlayer(playerid, 18560, -1874.3438, -1680.9531, 25.4375, 0.25);
  599. RemoveBuildingForPlayer(playerid, 18255, -1939.9141, -1731.4844, 24.9453, 0.25);
  600. RemoveBuildingForPlayer(playerid, 18251, -1907.6172, -1666.6797, 29.8516, 0.25);
  601. RemoveBuildingForPlayer(playerid, 18252, -1888.9766, -1633.2734, 24.4844, 0.25);
  602. RemoveBuildingForPlayer(playerid, 18253, -1888.8047, -1604.1328, 23.3750, 0.25);
  603. RemoveBuildingForPlayer(playerid, 18247, -1874.3438, -1680.9531, 25.4375, 0.25);
  604. RemoveBuildingForPlayer(playerid, 18245, -1849.5156, -1701.1563, 32.9531, 0.25);
  605. RemoveBuildingForPlayer(playerid, 18248, -1852.2578, -1676.2188, 28.6172, 0.25);
  606. RemoveBuildingForPlayer(playerid, 18249, -1818.8125, -1675.5391, 27.0703, 0.25);
  607. RemoveBuildingForPlayer(playerid, 18246, -1857.8359, -1573.3750, 23.3125, 0.25);
  608. RemoveBuildingForPlayer(playerid, 18250, -1857.2969, -1617.9766, 26.8125, 0.25);
  609. RemoveBuildingForPlayer(playerid, 18254, -1813.8047, -1615.5625, 29.8516, 0.25);
  610. RemoveBuildingForPlayer(playerid, 18608, -1818.4531, -1613.0391, 32.7891, 0.25);
  611. //la Gunoier load lv O groapa Gunoi
  612. RemoveBuildingForPlayer(playerid, 7693, 1517.3906, 2343.2813, 9.8203, 0.25);
  613. RemoveBuildingForPlayer(playerid, 1413, 1400.4922, 2323.0703, 11.0938, 0.25);
  614. RemoveBuildingForPlayer(playerid, 1412, 1405.7656, 2323.0781, 11.0938, 0.25);
  615. RemoveBuildingForPlayer(playerid, 1412, 1411.0391, 2323.0781, 11.0938, 0.25);
  616. RemoveBuildingForPlayer(playerid, 1412, 1421.5938, 2323.0781, 11.0938, 0.25);
  617. RemoveBuildingForPlayer(playerid, 1412, 1416.3203, 2323.0781, 11.0938, 0.25);
  618. RemoveBuildingForPlayer(playerid, 1413, 1426.8750, 2323.0703, 11.0938, 0.25);
  619. RemoveBuildingForPlayer(playerid, 3474, 1425.1328, 2334.2813, 16.7422, 0.25);
  620. RemoveBuildingForPlayer(playerid, 1412, 1447.9766, 2323.0781, 11.0938, 0.25);
  621. RemoveBuildingForPlayer(playerid, 1412, 1442.6953, 2323.0781, 11.0938, 0.25);
  622. RemoveBuildingForPlayer(playerid, 1412, 1437.4219, 2323.0781, 11.0938, 0.25);
  623. RemoveBuildingForPlayer(playerid, 1412, 1432.1484, 2323.0781, 11.0938, 0.25);
  624. RemoveBuildingForPlayer(playerid, 1412, 1469.0781, 2323.0781, 11.0938, 0.25);
  625. RemoveBuildingForPlayer(playerid, 1412, 1463.8047, 2323.0781, 11.0938, 0.25);
  626. RemoveBuildingForPlayer(playerid, 1412, 1458.5234, 2323.0781, 11.0938, 0.25);
  627. RemoveBuildingForPlayer(playerid, 1413, 1453.2500, 2323.0703, 11.0938, 0.25);
  628. RemoveBuildingForPlayer(playerid, 3460, 1482.7500, 2388.8438, 13.7656, 0.25);
  629. RemoveBuildingForPlayer(playerid, 7513, 1517.3906, 2343.2813, 9.8203, 0.25);
  630. XDeaths[playerid] = 0;
  631. LastDeath[playerid] = 0;
  632. return 1;
  633. }
  634. // This function shows the player how long his ban still is when he tries to login (in days, hours, minutes, seconds)
  635. ShowRemainingBanTime(playerid)
  636. {
  637. // Setup local variables
  638. new TotalBanTime, Days, Hours, Minutes, Seconds, Msg[128];
  639.  
  640. // Get the total ban-time
  641. TotalBanTime = APlayerData[playerid][BanTime] - gettime();
  642.  
  643. // Calculate days
  644. if (TotalBanTime >= 86400)
  645. {
  646. Days = TotalBanTime / 86400;
  647. TotalBanTime = TotalBanTime - (Days * 86400);
  648. }
  649. // Calculate hours
  650. if (TotalBanTime >= 3600)
  651. {
  652. Hours = TotalBanTime / 3600;
  653. TotalBanTime = TotalBanTime - (Hours * 3600);
  654. }
  655. // Calculate minutes
  656. if (TotalBanTime >= 60)
  657. {
  658. Minutes = TotalBanTime / 60;
  659. TotalBanTime = TotalBanTime - (Minutes * 60);
  660. }
  661. // Calculate seconds
  662. Seconds = TotalBanTime;
  663.  
  664. // Display the remaining ban-time for this player
  665. SendClientMessage(playerid, 0xFFFFFFFF, TXT_StillBanned);
  666. format(Msg, 128, TXT_BannedDuration, Days, Hours, Minutes, Seconds);
  667. SendClientMessage(playerid, 0xFFFFFFFF, Msg);
  668. }
  669. // This callback gets called when a player disconnects from the server
  670. public OnPlayerDisconnect(playerid, reason)
  671. {
  672. // Always allow NPC's to logout without password or account
  673. if (IsPlayerNPC(playerid))
  674. return 1;
  675.  
  676. // Setup local variables
  677. new Name[24], Msg[128], HouseID;
  678.  
  679. // Get the playername
  680. GetPlayerName(playerid, Name, sizeof(Name));
  681.  
  682. // Stop spectate mode for all players who are spectating this player
  683. for (new i; i < MAX_PLAYERS; i++)
  684. if (IsPlayerConnected(i)) // Check if the player is connected
  685. if (GetPlayerState(i) == PLAYER_STATE_SPECTATING) // Check if this player is spectating somebody
  686. if (APlayerData[i][SpectateID] == playerid) // Check if this player is spectating me
  687. {
  688. TogglePlayerSpectating(i, 0); // Turn off spectate-mode
  689. APlayerData[i][SpectateID] = INVALID_PLAYER_ID;
  690. APlayerData[i][SpectateType] = ADMIN_SPEC_TYPE_NONE;
  691. SendClientMessage(i, 0xFFFFFFFF, "{FF0000}Target player has logged off, ending spectate mode");
  692. }
  693.  
  694. // Send a message to all players to let them know somebody left the server
  695. format(Msg, 128, TXT_PlayerLeftServer, Name, playerid);
  696. SendClientMessageToAll(0xFFFFFFFF, Msg);
  697.  
  698. // If the player entered a proper password (the player has an account)
  699. if (strlen(APlayerData[playerid][PlayerPassword]) != 0)
  700. {
  701. // Save the player data and his houses
  702. PlayerFile_Save(playerid);
  703. }
  704.  
  705. // Stop any job that may have started (this also clears all mission data)
  706. switch (APlayerData[playerid][PlayerClass])
  707. {
  708. case ClassTruckDriver: Trucker_EndJob(playerid); // Stop any trucker job
  709. case ClassBusDriver: BusDriver_EndJob(playerid); // Stop any busdriver job
  710. case ClassPilot: Pilot_EndJob(playerid); // Stop any pilot job
  711. case ClassPolice: Police_EndJob(playerid); // Stop any police job
  712. case ClassFBY: FBY_EndJob(playerid); // Stop any FBY job
  713. case ClassMafia: Mafia_EndJob(playerid); // Stop any mafia job
  714. case ClassAssistance: Assistance_EndJob(playerid);
  715. case ClassRoadWorker: Roadworker_EndJob(playerid);
  716. case ClassMedic: Medic_EndJob(playerid); // Stop any Medic job
  717. case ClassSofer: Sofer_EndJob(playerid); // Stop any Sofer job
  718. case ClassMarinar: Marinar_EndJob(playerid); // Stop any Marinar job
  719. case ClassTaxi: Taxi_EndJob(playerid); // Stop any Taxi job
  720. case ClassPadurar: Padurar_EndJob(playerid); // Stop any Padurar job
  721. case ClassG: G_EndJob(playerid); // Stop any G job
  722. }
  723.  
  724. // If the player is part of a convoy, kick him from it
  725. Convoy_Leave(playerid);
  726.  
  727. // Unload all the player's house-vehicles to make room for other player's vehicles
  728. for (new HouseSlot; HouseSlot < MAX_HOUSESPERPLAYER; HouseSlot++)
  729. {
  730. // Get the HouseID from this slot
  731. HouseID = APlayerData[playerid][Houses][HouseSlot];
  732. // Check if there is a house in this slot
  733. if (HouseID != 0)
  734. {
  735. // Unload the cars of the house
  736. House_RemoveVehicles(HouseID);
  737. // Set the house so it cannot be entered by anyone (close the house)
  738. AHouseData[HouseID][HouseOpened] = false;
  739. }
  740. }
  741.  
  742. // Clear the data in the APlayerData array to make sure the next player with the same id doesn't hold wrong data
  743. APlayerData[playerid][SpectateID] = -1;
  744. APlayerData[playerid][SpectateVehicle] = -1;
  745. APlayerData[playerid][SpectateType] = ADMIN_SPEC_TYPE_NONE;
  746. APlayerData[playerid][LoggedIn] = false;
  747. APlayerData[playerid][AssistanceNeeded] = false;
  748. APlayerData[playerid][PlayerPassword] = 0;
  749. APlayerData[playerid][PlayerLevel] = 0;
  750. APlayerData[playerid][VPlayerLevel] = 0;
  751. APlayerData[playerid][PlayerJailed] = 0;
  752. APlayerData[playerid][PlayerFrozen] = 0; // Clearing this variable automatically kills the frozentimer
  753. APlayerData[playerid][Bans] = 0;
  754. APlayerData[playerid][BanTime] = 0;
  755. APlayerData[playerid][Muted] = false;
  756. APlayerData[playerid][RulesRead] = false;
  757. APlayerData[playerid][AutoReportTime] = 0;
  758. APlayerData[playerid][TruckerLicense] = 0;
  759. APlayerData[playerid][SoferLicense] = 0;
  760. APlayerData[playerid][MarinarLicense] = 0;
  761. APlayerData[playerid][TaxiLicense] = 0;
  762. APlayerData[playerid][PadurarLicense] = 0;
  763. APlayerData[playerid][BusLicense] = 0;
  764. APlayerData[playerid][PlayerClass] = 0;
  765. APlayerData[playerid][Warnings] = 0;
  766. APlayerData[playerid][PlayerMoney] = 0;
  767. APlayerData[playerid][PlayerScore] = 0;
  768. for (new HouseSlot; HouseSlot < MAX_HOUSESPERPLAYER; HouseSlot++)
  769. APlayerData[playerid][Houses][HouseSlot] = 0;
  770. for (new BusSlot; BusSlot < MAX_BUSINESSPERPLAYER; BusSlot++)
  771. APlayerData[playerid][Business][BusSlot] = 0;
  772. APlayerData[playerid][CurrentHouse] = 0;
  773.  
  774. // Clear bank account info
  775. APlayerData[playerid][BankPassword] = 0;
  776. APlayerData[playerid][BankLoggedIn] = false;
  777. APlayerData[playerid][BankMoney] = 0;
  778.  
  779. // Clear stats
  780. APlayerData[playerid][StatsTruckerJobs] = 0;
  781. APlayerData[playerid][StatsConvoyJobs] = 0;
  782. APlayerData[playerid][StatsBusDriverJobs] = 0;
  783. APlayerData[playerid][StatsPilotJobs] = 0;
  784. APlayerData[playerid][StatsSoferJobs] = 0;
  785. APlayerData[playerid][StatsMarinarJobs] = 0;
  786. APlayerData[playerid][StatsTaxiJobs] = 0;
  787. APlayerData[playerid][StatsPadurarJobs] = 0;
  788. APlayerData[playerid][StatsGJobs] = 0;
  789. APlayerData[playerid][StatsMedicJobs] = 0;
  790. APlayerData[playerid][StatsMafiaJobs] = 0;
  791. APlayerData[playerid][StatsMafiaStolen] = 0;
  792. APlayerData[playerid][StatsPoliceFined] = 0;
  793. APlayerData[playerid][StatsFBYFined] = 0;
  794. APlayerData[playerid][StatsPoliceJailed] = 0;
  795. APlayerData[playerid][StatsFBYJailed] = 0;
  796. APlayerData[playerid][StatsCourierJobs] = 0;
  797. APlayerData[playerid][StatsPboyJobs] = 0;
  798. APlayerData[playerid][StatsRoadworkerJobs] = 0;
  799. APlayerData[playerid][StatsAssistance] = 0;
  800. APlayerData[playerid][StatsMetersDriven] = 0.0;
  801.  
  802. // Clear police warnings
  803. APlayerData[playerid][PoliceCanJailMe] = false;
  804. APlayerData[playerid][PoliceWarnedMe] = false;
  805. APlayerData[playerid][Value_PoliceCanJailMe] = 0;
  806.  
  807. APlayerData[playerid][FBYCanJailMe] = false;
  808. APlayerData[playerid][FBYWarnedMe] = false;
  809. APlayerData[playerid][Value_FBYCanJailMe] = 0;
  810.  
  811. // Make sure the jailtimer has been destroyed
  812. KillTimer(APlayerData[playerid][PlayerJailedTimer]);
  813. KillTimer(APlayerData[playerid][Timer_PoliceCanJailMe]);
  814. KillTimer(APlayerData[playerid][Timer_FBYCanJailMe]);
  815.  
  816. // Destroy the speedometer TextDraw for this player and the timer, also set the speed to 0
  817. Speedometer_Cleanup(playerid);
  818.  
  819. // Also destroy the missiontext TextDraw for this player
  820. TextDrawDestroy(APlayerData[playerid][MissionText]);
  821.  
  822. // Destroy a rented vehicle is the player had any
  823. if (APlayerData[playerid][RentedVehicleID] != 0)
  824. {
  825. // Clear the data for the already rented vehicle
  826. AVehicleData[APlayerData[playerid][RentedVehicleID]][Model] = 0;
  827. AVehicleData[APlayerData[playerid][RentedVehicleID]][Fuel] = 0;
  828. AVehicleData[APlayerData[playerid][RentedVehicleID]][Owned] = false;
  829. AVehicleData[APlayerData[playerid][RentedVehicleID]][Owner] = 0;
  830. AVehicleData[APlayerData[playerid][RentedVehicleID]][PaintJob] = 0;
  831. for (new j; j < 14; j++)
  832. {
  833. AVehicleData[APlayerData[playerid][RentedVehicleID]][Components][j] = 0;
  834. }
  835. // Destroy the vehicle
  836. DestroyVehicle(APlayerData[playerid][RentedVehicleID]);
  837. // Clear the RentedVehicleID
  838. APlayerData[playerid][RentedVehicleID] = 0;
  839. }
  840.  
  841. return 1;
  842. }
  843. // This callback gets called whenever a player uses the chat-box
  844. public OnPlayerText(playerid, text[])
  845. {
  846. // Block the player's text if he has been muted
  847. if (APlayerData[playerid][Muted] == true || APlayerData[playerid][LoggedIn] == false)
  848. {
  849. // Let the player know he's still muted
  850. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Inca esti mut");
  851.  
  852. // Don't allow his text to be sent to the chatbox
  853. return 0;
  854. }
  855. if(stringContainsIP(text))
  856. {
  857. new
  858. szMsg[128]
  859. ;
  860. GetPlayerName(playerid, szMsg, MAX_PLAYER_NAME);
  861.  
  862. format(szMsg, sizeof(szMsg), "ATENTIE! %s Incearca sa faca Reclama!", szMsg);
  863. SendClientMessageToAll(0xFF0000FF, szMsg);
  864. Kick(playerid);
  865.  
  866. return 0;
  867. }
  868. //return 1;
  869. new msg[600]; // The string. We do not need to have it larger than 128, because a message can't be larger than that.
  870. if(IsPlayerAdmin(playerid))
  871. {
  872. format(msg, sizeof(msg),"{FFFF00}(id:%d):{D20E1C}%s", playerid, text);
  873. }
  874. else
  875. if (APlayerData[playerid][PlayerLevel] >= 1)
  876. {
  877. format(msg, sizeof(msg),"{FFFF00}(id:%d):{00FFFF}%s", playerid, text);
  878. }
  879. else
  880. if (APlayerData[playerid][VPlayerLevel] >= 1)
  881. {
  882. format(msg, sizeof(msg),"{FFFF00}(id:%d):{616F8C}%s", playerid, text);
  883. }
  884. else
  885. format(msg, sizeof(msg),"{FF80FF}(id:%d):{FFFFFF}%s", playerid, text); // The formatted message. Remember, %d means integer (whole number) and %s is string - they are associated with playerid, respectively text.
  886. SendPlayerMessageToAll(playerid, msg); // SendPlayerMessageToAll will send a message from the player to everyone, like what would happen normally when a player chats, but with the message we choose.
  887. return 0;
  888. }
  889. // This callback gets called when a player interacts with a dialog
  890. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  891. {
  892. // Select the proper dialog to process
  893. switch (dialogid)
  894. {
  895. case DialogRegister: Dialog_Register(playerid, response, inputtext); // The "Register"-dialog
  896. case DialogLogin: Dialog_Login(playerid, response, inputtext); // The "Login"-dialog
  897. case DialogStatsOtherPlayer: Dialog_StatsOtherPlayer(playerid, response, listitem);
  898. case DialogStatsHouse: Dialog_StatsHouse(playerid, response, listitem);
  899. case DialogStatsGoHouse: Dialog_StatsGoHouse(playerid, response, listitem);
  900. case DialogStatsGoBusiness: Dialog_StatsGoBusiness(playerid, response, listitem);
  901. case DialogRescue: Dialog_Rescue(playerid, response, listitem); // The rescue-dialog
  902. case DialogBuyLicenses: Dialog_BuyLicenses(playerid, response, listitem); // The license-dialog (allows the player to buy trucker/busdriver licenses)
  903. case DialogRules: Dialog_Rules(playerid, response);
  904. case DialogComezile1: Dialog_Comezile1(playerid, response);
  905. case DialogComezile2: Dialog_Comezile2(playerid, response);
  906. case DialogTruckerJobMethod: Dialog_TruckerSelectJobMethod(playerid, response, listitem); // The work-dialog for truckers (shows the loads he can carry and lets the player choose the load)
  907. case DialogTruckerSelectLoad: Dialog_TruckerSelectLoad(playerid, response, listitem); // The load-selection dialog for truckers (shows the startlocations for the selected load and let the player choose his startlocation)
  908. case DialogTruckerStartLoc: Dialog_TruckerSelectStartLoc(playerid, response, listitem); // The start-location dialog for truckers (shows the endlocations for the selected load and let the player choose his endlocation)
  909. case DialogTruckerEndLoc: Dialog_TruckerSelectEndLoc(playerid, response, listitem); // The end-location dialog for truckers (processes the selected endlocation and starts the job)
  910.  
  911. //Conducator tren licenta
  912. case DialogSoferJobMethod: Dialog_SoferSelectJobMethod(playerid, response, listitem); //
  913. case DialogSoferSelectLoad: Dialog_SoferSelectLoad(playerid, response, listitem); //
  914. case DialogSoferStartLoc: Dialog_SoferSelectStartLoc(playerid, response, listitem); //
  915. case DialogSoferEndLoc: Dialog_SoferSelectEndLoc(playerid, response, listitem); //
  916.  
  917. //Marinar Licenta
  918. case DialogMarinarJobMethod: Dialog_MarinarSelectJobMethod(playerid, response, listitem); //
  919. case DialogMarinarSelectLoad: Dialog_MarinarSelectLoad(playerid, response, listitem); //
  920. case DialogMarinarStartLoc: Dialog_MarinarSelectStartLoc(playerid, response, listitem); //
  921. case DialogMarinarEndLoc: Dialog_MarinarSelectEndLoc(playerid, response, listitem); //
  922.  
  923. //Taxi Licenta
  924. case DialogTaxiJobMethod: Dialog_TaxiSelectJobMethod(playerid, response, listitem); //
  925. case DialogTaxiSelectLoad: Dialog_TaxiSelectLoad(playerid, response, listitem); //
  926. case DialogTaxiStartLoc: Dialog_TaxiSelectStartLoc(playerid, response, listitem); //
  927. case DialogTaxiEndLoc: Dialog_TaxiSelectEndLoc(playerid, response, listitem); //
  928.  
  929.  
  930.  
  931. //Padurar Licenta
  932. case DialogPadurarJobMethod: Dialog_PadurarSelectJobMethod(playerid, response, listitem); //Padurar
  933. case DialogPadurarSelectLoad: Dialog_PadurarSelectLoad(playerid, response, listitem); //Padurar
  934. case DialogPadurarStartLoc: Dialog_PadurarSelectStartLoc(playerid, response, listitem); //Padurar
  935. case DialogPadurarEndLoc: Dialog_PadurarSelectEndLoc(playerid, response, listitem); //Padurar
  936.  
  937.  
  938. case DialogBusJobMethod: Dialog_BusSelectJobMethod(playerid, response, listitem); // The work-dialog for busdrivers (process the options to choose own busroute or auto-assigned busroute)
  939. case DialogBusSelectRoute: Dialog_BusSelectRoute(playerid, response, listitem); // Choose the busroute and start the job
  940.  
  941. case DialogCourierSelectQuant: Dialog_CourierSelectQuant(playerid, response, listitem);
  942. case DialogPboySelectQuant: Dialog_PboySelectQuant(playerid, response, listitem);
  943.  
  944. case DialogBike: Dialog_Bike(playerid, response, listitem); // The bike-dialog
  945. case DialogCar: Dialog_Car(playerid, response, listitem); // The car-dialog (which uses a split dialog structure)
  946. case DialogPlane: Dialog_Plane(playerid, response, listitem); // The plane-dialog (which uses a split dialog structure)
  947. case DialogTrailer: Dialog_Trailer(playerid, response, listitem); // The trailer-dialog (which uses a split dialog structure)
  948. case DialogBoat: Dialog_Boat(playerid, response, listitem); // The boat-dialog
  949. case DialogNeon: Dialog_Neon(playerid, response, listitem); // The neon-dialog
  950.  
  951. case DialogRentCarClass: Dialog_RentProcessClass(playerid, response, listitem); // The player chose a vehicleclass from where he can rent a vehicle
  952. case DialogRentCar: Dialog_RentCar(playerid, response, listitem); // The player chose a vehicle from the list of vehicles from the vehicleclass he chose before
  953.  
  954. case DialogPrimaryCarColor: Dialog_PrimaryCarColor(playerid, response, listitem);
  955. case DialogSedundaryCarColor: Dialog_SedundaryCarColor(playerid, response, listitem);
  956.  
  957. case DialogWeather: Dialog_Weather(playerid, response, listitem); // The weather dialog
  958. case DialogCarOption: Dialog_CarOption(playerid, response, listitem); // The caroption dialog
  959.  
  960. case DialogSelectConvoy: Dialog_SelectConvoy(playerid, response, listitem);
  961.  
  962. case DialogHouseMenu: Dialog_HouseMenu(playerid, response, listitem); // Process the main housemenu
  963. case DialogUpgradeHouse: Dialog_UpgradeHouse(playerid, response, listitem); // Process the house-upgrade menu
  964. case DialogGoHome: Dialog_GoHome(playerid, response, listitem); // Port to one of your houses
  965. case DialogHouseNameChange: Dialog_ChangeHouseName(playerid, response, inputtext); // Change the name of your house
  966. case DialogSellHouse: Dialog_SellHouse(playerid, response); // Sell the house
  967. case DialogBuyCarClass: Dialog_BuyCarClass(playerid, response, listitem); // The player chose a vehicleclass from where he can buy a vehicle
  968. case DialogBuyCar: Dialog_BuyCar(playerid, response, listitem); // The player chose a vehicle from the list of vehicles from the vehicleclass he chose before
  969. case DialogSellCar: Dialog_SellCar(playerid, response, listitem);
  970. case DialogBuyInsurance: Dialog_BuyInsurance(playerid, response);
  971. case DialogGetCarSelectHouse: Dialog_GetCarSelectHouse(playerid, response, listitem);
  972. case DialogGetCarSelectCar: Dialog_GetCarSelectCar(playerid, response, listitem);
  973. case DialogUnclampVehicles: Dialog_UnclampVehicles(playerid, response);
  974.  
  975. case DialogCreateBusSelType: Dialog_CreateBusSelType(playerid, response, listitem);
  976. case DialogBusinessMenu: Dialog_BusinessMenu(playerid, response, listitem);
  977. case DialogGoBusiness: Dialog_GoBusiness(playerid, response, listitem);
  978. case DialogBusinessNameChange: Dialog_ChangeBusinessName(playerid, response, inputtext); // Change the name of your business
  979. case DialogSellBusiness: Dialog_SellBusiness(playerid, response); // Sell the business
  980.  
  981. case DialogBankPasswordRegister: Dialog_BankPasswordRegister(playerid, response, inputtext);
  982. case DialogBankPasswordLogin: Dialog_BankPasswordLogin(playerid, response, inputtext);
  983. case DialogBankOptions: Dialog_BankOptions(playerid, response, listitem);
  984. case DialogBankDeposit: Dialog_BankDeposit(playerid, response, inputtext);
  985. case DialogBankWithdraw: Dialog_BankWithdraw(playerid, response, inputtext);
  986. case DialogBankTransferMoney: Dialog_BankTransferMoney(playerid, response, inputtext);
  987. case DialogBankTransferName: Dialog_BankTransferName(playerid, response, inputtext);
  988. case DialogBankCancel: Dialog_BankCancel(playerid, response);
  989.  
  990. case DialogHelpItemChosen: Dialog_HelpItemChosen(playerid, response, listitem);
  991. case DialogHelpItem: Dialog_HelpItem(playerid, response);
  992.  
  993. case DialogOldPassword: Dialog_OldPassword(playerid, response, inputtext);
  994. case DialogNewPassword: Dialog_NewPassword(playerid, response, inputtext);
  995. case DialogConfirmPassword: Dialog_ConfirmPassword(playerid, response);
  996.  
  997. }
  998. if(dialogid == DialogWEAPONS) {
  999. if(response) {
  1000. if(listitem == 0) {
  1001. RewardPlayer(playerid, -10000, 0);
  1002. GivePlayerWeapon(playerid, 22, 500);
  1003. SendClientMessage(playerid, COLOR_GREEN, "*Ai cumparat 9mm with 500 Ammo!*");
  1004. }
  1005. if(listitem == 1) {
  1006. RewardPlayer(playerid, -12000, 0);
  1007. GivePlayerWeapon(playerid, 23, 500);
  1008. SendClientMessage(playerid, COLOR_GREEN, "*Ai cumparat Silenced 9mm with 500 Ammo!*");
  1009. }
  1010. if(listitem == 2) {
  1011. RewardPlayer(playerid, -50000, 0);
  1012. GivePlayerWeapon(playerid, 24, 500);
  1013. SendClientMessage(playerid, COLOR_GREEN, "*Ai cumparat Desert Deagle with 500 Ammo!*");
  1014. }
  1015. if(listitem == 3) {
  1016. RewardPlayer(playerid, -300000, 0);
  1017. GivePlayerWeapon(playerid, 25, 550);
  1018. SendClientMessage(playerid, COLOR_GREEN, "*Ai cumparat Shotgun with 550 Ammo!*");
  1019. }
  1020. if(listitem == 4) {
  1021. RewardPlayer(playerid, -120000, 0);
  1022. GivePlayerWeapon(playerid, 26, 550);
  1023. SendClientMessage(playerid, COLOR_GREEN, "*Ai cumparat Sawnoff Shotgun with 550 Ammo!*");
  1024. }
  1025. if(listitem == 5) {
  1026. RewardPlayer(playerid, -140000, 0);
  1027. GivePlayerWeapon(playerid, 27, 550);
  1028. SendClientMessage(playerid, COLOR_GREEN, "*Ai cumparat Combat Shotgun with 550 Ammo!*");
  1029. }
  1030. if(listitem == 6) {
  1031. RewardPlayer(playerid, -160000, 0);
  1032. GivePlayerWeapon(playerid, 28, 750);
  1033. SendClientMessage(playerid, COLOR_GREEN, "*Ai cumparat Micro SMG/Uzi with 750 Ammo!*");
  1034. }
  1035. if(listitem == 7) {
  1036. RewardPlayer(playerid, -180000, 0);
  1037. GivePlayerWeapon(playerid, 32, 750);
  1038. SendClientMessage(playerid, COLOR_GREEN, "*Ai cumparat Tec-9 with 750 Ammo!*");
  1039. }
  1040. if(listitem == 8) {
  1041. RewardPlayer(playerid, -200000, 0);
  1042. GivePlayerWeapon(playerid, 29, 750);
  1043. SendClientMessage(playerid, COLOR_GREEN, "*Ai cumparat MP5 with 750 Ammo!*");
  1044. }
  1045. if(listitem == 9) {
  1046. RewardPlayer(playerid, -230000, 0);
  1047. GivePlayerWeapon(playerid, 30, 750);
  1048. SendClientMessage(playerid, COLOR_GREEN, "*Ai cumparat AK-47 with 750 Ammo!*");
  1049. }
  1050. if(listitem == 10) {
  1051. RewardPlayer(playerid, -260000, 0);
  1052. GivePlayerWeapon(playerid, 31, 750);
  1053. SendClientMessage(playerid, COLOR_GREEN, "*Ai cumparat M4 with 750 Ammo!*");
  1054. }
  1055. if(listitem == 11) {
  1056. RewardPlayer(playerid, -280000, 0);
  1057. GivePlayerWeapon(playerid, 34, 50);
  1058. SendClientMessage(playerid, COLOR_GREEN, "*Ai cumparat Sniper Rifle with 50 Ammo!*");
  1059. }
  1060. if(listitem == 12) {
  1061. RewardPlayer(playerid, -10000, 0);
  1062. GivePlayerWeapon(playerid, 46, 1);
  1063. SendClientMessage(playerid, COLOR_GREEN, "*Ai cumparat Parachute!*");
  1064. }
  1065. }
  1066. }
  1067. return 1;
  1068. }
  1069.  
  1070. // this callback gets called when a player clicks on another player on the scoreboard
  1071. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  1072. {
  1073. if (APlayerData[playerid][PlayerLevel] >= 1)
  1074. {
  1075. new Name[24], DialogTitle[128], PlayerStatList[3000], PlayerIP[16], NumHouses, NumBusinesses;
  1076. GetPlayerName(clickedplayerid, Name, sizeof(Name));
  1077. format(DialogTitle, 128, "Statistics of player: %s", Name);
  1078. GetPlayerIp(clickedplayerid, PlayerIP, sizeof(PlayerIP));
  1079. format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}IP Jucator: {00FF00}%s\n", PlayerStatList, PlayerIP);
  1080. format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Nivel admin: {FF0000}%i\n", PlayerStatList, APlayerData[clickedplayerid][PlayerLevel]);
  1081. format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Nivel VIP: {00FF00}%i\n", PlayerStatList, APlayerData[clickedplayerid][VPlayerLevel]);
  1082. switch(APlayerData[clickedplayerid][PlayerClass])
  1083. {
  1084. case ClassTruckDriver: format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Clasa: {00FF00}Camionagiu\n", PlayerStatList);
  1085. case ClassBusDriver: format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Clasa: {00FF00}Sofer de Autobuz\n", PlayerStatList);
  1086. case ClassPilot: format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Clasa: {00FF00}Pilot\n", PlayerStatList);
  1087. case ClassSofer: format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Clasa: {00FF00}Conducator de Tren\n", PlayerStatList);
  1088. case ClassG: format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Clasa: {00FF00}Gunoier\n", PlayerStatList);
  1089. case ClassMarinar: format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Clasa: {00FF00}Marinar\n", PlayerStatList);
  1090. case ClassTaxi: format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Clasa: {00FF00}Taximetrist\n", PlayerStatList);
  1091. case ClassPadurar: format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Clasa: {00FF00}Padurar\n", PlayerStatList);
  1092. case ClassPolice: format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Clasa: {00FF00}Politist\n", PlayerStatList);
  1093. case ClassFBY: format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Clasa: {00FF00}FBI\n", PlayerStatList);
  1094. case ClassMafia: format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Clasa: {00FF00}Mafia\n", PlayerStatList);
  1095. case ClassCourier: format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Clasa: {00FF00}Curier\n", PlayerStatList);
  1096. case ClassPboy: format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Clasa: {00FF00}Baiat cu Pizza\n", PlayerStatList);
  1097. case ClassAssistance: format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Clasa: {00FF00}Mecanic\n", PlayerStatList);
  1098. case ClassMedic: format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Clasa: {00FF00}Medic\n", PlayerStatList);
  1099. }
  1100. // Add money and score of the player to the list
  1101. format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Bani: {00FF00}%i\n", PlayerStatList, APlayerData[clickedplayerid][PlayerMoney]);
  1102. format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Scor: {00FF00}%i\n", PlayerStatList, APlayerData[clickedplayerid][PlayerScore]);
  1103. // Add wanted-level of the player to the list
  1104. format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Nivel wanted: {00FF00}%i\n", PlayerStatList, GetPlayerWantedLevel(clickedplayerid));
  1105. // Add truckerlicense and busdriver license of the player to the list
  1106. if (APlayerData[clickedplayerid][TruckerLicense] == 1)
  1107. format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Licenta camionagiu: {00FF00}Da\n", PlayerStatList);
  1108. else
  1109. format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Licenta camionagiu: {00FF00}Nu\n", PlayerStatList);
  1110.  
  1111. if (APlayerData[clickedplayerid][SoferLicense] == 1)
  1112. format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Licenta conducator de tren: {00FF00}Da\n", PlayerStatList);
  1113. else
  1114. format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Licenta conducator de tren: {00FF00}Nu\n", PlayerStatList);
  1115. if (APlayerData[clickedplayerid][BusLicense] == 1)
  1116. format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Licenta sofer de autobuz: {00FF00}Da\n", PlayerStatList);
  1117. else
  1118. format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Licenta sofer de autobuz: {00FF00}Nu\n", PlayerStatList);
  1119. if (APlayerData[clickedplayerid][MarinarLicense] == 1)
  1120. format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Licenta marinar: {00FF00}Da\n", PlayerStatList);
  1121. else
  1122. format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Licenta marinar: {00FF00}Nu\n", PlayerStatList);
  1123. if (APlayerData[clickedplayerid][TaxiLicense] == 1)
  1124. format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Licenta taximetrist: {00FF00}Da\n", PlayerStatList);
  1125. else
  1126. format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Licenta taximetrist: {00FF00}Nu\n", PlayerStatList);
  1127. if (APlayerData[clickedplayerid][PadurarLicense] == 1)
  1128. format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Licenta padurar: {00FF00}Da\n", PlayerStatList);
  1129. else
  1130. format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Licenta padurar: {00FF00}Nu\n", PlayerStatList);
  1131.  
  1132. format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Completed trucker jobs: {00FF00}%i\n", PlayerStatList, APlayerData[clickedplayerid][StatsTruckerJobs]);
  1133. format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Completed convoy jobs: {00FF00}%i\n", PlayerStatList, APlayerData[clickedplayerid][StatsConvoyJobs]);
  1134. format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Completed busdriver jobs: {00FF00}%i\n", PlayerStatList, APlayerData[clickedplayerid][StatsBusDriverJobs]);
  1135. format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Completed pilot jobs: {00FF00}%i\n", PlayerStatList, APlayerData[clickedplayerid][StatsPilotJobs]);
  1136. format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Completed Conducator Tren jobs: {00FF00}%i\n", PlayerStatList, APlayerData[clickedplayerid][StatsSoferJobs]);
  1137. format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Completed Medic jobs: {00FF00}%i\n", PlayerStatList, APlayerData[clickedplayerid][StatsMedicJobs]);
  1138. format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Completed Gunoier jobs: {00FF00}%i\n", PlayerStatList, APlayerData[clickedplayerid][StatsGJobs]);
  1139. format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Completed Marinar jobs: {00FF00}%i\n", PlayerStatList, APlayerData[clickedplayerid][StatsMarinarJobs]);
  1140. format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Completed Taxi jobs: {00FF00}%i\n", PlayerStatList, APlayerData[clickedplayerid][StatsTaxiJobs]);
  1141. format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Completed Padurar jobs: {00FF00}%i\n", PlayerStatList, APlayerData[clickedplayerid][StatsPadurarJobs]);
  1142. format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Completed mafia jobs: {00FF00}%i\n", PlayerStatList, APlayerData[clickedplayerid][StatsMafiaJobs]);
  1143. format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Stolen mafia-loads: {00FF00}%i\n", PlayerStatList, APlayerData[clickedplayerid][StatsMafiaStolen]);
  1144. format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Fined players: {00FF00}%i\n", PlayerStatList, APlayerData[clickedplayerid][StatsPoliceFined]);
  1145. format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Fined players Fbi: {00FF00}%i\n", PlayerStatList, APlayerData[clickedplayerid][StatsFBYFined]);
  1146. format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Jailed players: {00FF00}%i\n", PlayerStatList, APlayerData[clickedplayerid][StatsPoliceJailed]);
  1147. format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Jailed players Fbi: {00FF00}%i\n", PlayerStatList, APlayerData[clickedplayerid][StatsFBYJailed]);
  1148. format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Completed courier jobs: {00FF00}%i\n", PlayerStatList, APlayerData[clickedplayerid][StatsCourierJobs]);
  1149. format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Completed Pizza Boy jobs: {00FF00}%i\n", PlayerStatList, APlayerData[clickedplayerid][StatsPboyJobs]);
  1150. format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Completed roadworker jobs: {00FF00}%i\n", PlayerStatList, APlayerData[clickedplayerid][StatsRoadworkerJobs]);
  1151. format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Assisted players: {00FF00}%i\n", PlayerStatList, APlayerData[clickedplayerid][StatsAssistance]);
  1152. format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Meters driven: {00FF00}%f\n", PlayerStatList, APlayerData[clickedplayerid][StatsMetersDriven]);
  1153. for (new i; i < MAX_HOUSESPERPLAYER; i++)
  1154. if (APlayerData[clickedplayerid][Houses][i] != 0)
  1155. NumHouses++;
  1156. for (new i; i < MAX_BUSINESSPERPLAYER; i++)
  1157. if (APlayerData[clickedplayerid][Business][i] != 0)
  1158. NumBusinesses++;
  1159. format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Case: {00FF00}%i\n", PlayerStatList, NumHouses);
  1160. format(PlayerStatList, sizeof(PlayerStatList), "%s{FFFFFF}Afaceri: {00FF00}%i\n", PlayerStatList, NumBusinesses);
  1161. APlayerData[playerid][DialogOtherPlayer] = clickedplayerid;
  1162. ShowPlayerDialog(playerid, DialogStatsOtherPlayer, DIALOG_STYLE_LIST, DialogTitle, PlayerStatList, TXT_DialogButtonSelect, TXT_DialogButtonCancel); // Let the player buy a license
  1163. }
  1164. return 1;
  1165. }
  1166. // This callback gets called when a player picks up any pickup
  1167. public OnPlayerPickUpPickup(playerid, pickupid)
  1168. {
  1169. // If the player picks up the Buy_License pickup at the driving school in Doherty
  1170. if (pickupid == Pickup_License)
  1171. // Ask the player which license he wants to buy
  1172. ShowPlayerDialog(playerid, DialogBuyLicenses, DIALOG_STYLE_LIST, TXT_DialogLicenseTitle, TXT_DialogLicenseList, TXT_DialogButtonBuy, TXT_DialogButtonCancel); // Let the player buy a license
  1173.  
  1174. return 1;
  1175. }
  1176. // This callback gets called when a player spawns somewhere
  1177. public OnPlayerSpawn(playerid)
  1178. {
  1179.  
  1180. SetPlayerWorldBounds(playerid, 20000.0000, -20000.0000, 20000.0000, -20000.0000);
  1181. // Always allow NPC's to spawn without logging in
  1182. if (IsPlayerNPC(playerid))
  1183. return 1;
  1184.  
  1185. // Check if the player properly logged in by typing his password
  1186. if (APlayerData[playerid][LoggedIn] == false)
  1187. {
  1188. SendClientMessage(playerid, 0xFFFFFFFF, TXT_FailedLoginProperly);
  1189. Kick(playerid); // Kick the player if he didn't log in properly
  1190. }
  1191.  
  1192. // Setup local variables
  1193. new missiontext[200];
  1194.  
  1195. // Spawn the player in the global world (where everybody plays the game)
  1196. SetPlayerVirtualWorld(playerid, 0);
  1197. SetPlayerInterior(playerid, 0);
  1198. // Also set a variable that tracks in which house the player currently is
  1199. APlayerData[playerid][CurrentHouse] = 0;
  1200.  
  1201. // Disable the clock
  1202. TogglePlayerClock(playerid, 0);
  1203.  
  1204. // Delete all weapons from the player
  1205. ResetPlayerWeapons(playerid);
  1206.  
  1207. // Set the missiontext based on the chosen class
  1208. switch (APlayerData[playerid][PlayerClass])
  1209. {
  1210. case ClassTruckDriver: // Truck-driver class
  1211. {
  1212. format(missiontext, sizeof(missiontext), Trucker_NoJobText); // Preset the missiontext
  1213. SetPlayerColor(playerid, ColorClassTruckDriver); // Set the playercolor (chatcolor for the player and color on the map)
  1214. }
  1215. case ClassBusDriver: // Bus-driver class
  1216. {
  1217. format(missiontext, sizeof(missiontext), BusDriver_NoJobText); // Preset the missiontext
  1218. SetPlayerColor(playerid, ColorClassBusDriver); // Set the playercolor (chatcolor for the player and color on the map)
  1219. }
  1220. case ClassPilot: // Pilot class
  1221. {
  1222. format(missiontext, sizeof(missiontext), Pilot_NoJobText); // Preset the missiontext
  1223. SetPlayerColor(playerid, ColorClassPilot); // Set the playercolor (chatcolor for the player and color on the map)
  1224. }
  1225. case ClassPolice: // Police class
  1226. {
  1227. format(missiontext, sizeof(missiontext), Police_NoJobText); // Preset the missiontext
  1228. SetPlayerColor(playerid, ColorClassPolice); // Set the playercolor (chatcolor for the player and color on the map)
  1229. // Start the PlayerCheckTimer to scan for wanted players (be sure the timer has been destroyed first)
  1230. KillTimer(APlayerData[playerid][PlayerCheckTimer]);
  1231. APlayerData[playerid][PlayerCheckTimer] = SetTimerEx("Police_CheckWantedPlayers", 1000, true, "i", playerid);
  1232. // Check if the police player can get weapons
  1233. if (PoliceGetsWeapons == true)
  1234. {
  1235. // Give up to 12 weapons to the player
  1236. for (new i; i < 12; i++)
  1237. GivePlayerWeapon(playerid, APoliceWeapons[i], PoliceWeaponsAmmo);
  1238. }
  1239. }
  1240. case ClassFBY: // FBY class
  1241. {
  1242. format(missiontext, sizeof(missiontext), FBY_NoJobText); // Preset the missiontext
  1243. SetPlayerColor(playerid, ColorClassFBY); // Set the playercolor (chatcolor for the player and color on the map)
  1244. // Start the PlayerCheckTimer to scan for wanted players (be sure the timer has been destroyed first)
  1245. KillTimer(APlayerData[playerid][PlayerCheckTimer]);
  1246. APlayerData[playerid][PlayerCheckTimer] = SetTimerEx("FBY_CheckWantedPlayers", 1000, true, "i", playerid);
  1247. // Check if the police player can get weapons
  1248. if (FBYGetsWeapons == true)
  1249. {
  1250. // Give up to 12 weapons to the player
  1251. for (new i; i < 12; i++)
  1252. GivePlayerWeapon(playerid, AFBYWeapons[i], FBYWeaponsAmmo);
  1253. }
  1254. }
  1255. case ClassMafia: // Mafia class
  1256. {
  1257. format(missiontext, sizeof(missiontext), Mafia_NoJobText); // Preset the missiontext
  1258. SetPlayerColor(playerid, ColorClassMafia); // Set the playercolor (chatcolor for the player and color on the map)
  1259. // Start the PlayerCheckTimer to scan for players that carry mafia-loads (be sure the timer has been destroyed first)
  1260. KillTimer(APlayerData[playerid][PlayerCheckTimer]);
  1261. APlayerData[playerid][PlayerCheckTimer] = SetTimerEx("Mafia_CheckMafiaLoads", 1000, true, "i", playerid);
  1262. if (MafiaGetsWeapons == true)
  1263. {
  1264. // Give up to 12 weapons to the player
  1265. for (new i; i < 12; i++)
  1266. GivePlayerWeapon(playerid, AMafiaWeapons[i], MafiaWeaponsAmmo);
  1267. }
  1268. }
  1269. case ClassCourier: // Courier class
  1270. {
  1271. format(missiontext, sizeof(missiontext), Courier_NoJobText); // Preset the missiontext
  1272. SetPlayerColor(playerid, ColorClassCourier); // Set the playercolor (chatcolor for the player and color on the map)
  1273. }
  1274. case ClassPboy: // Pizza Boy class
  1275. {
  1276. format(missiontext, sizeof(missiontext), Pboy_NoJobText); // Preset the missiontext
  1277. SetPlayerColor(playerid, ColorClassPboy); // Set the playercolor (chatcolor for the player and color on the map)
  1278. }
  1279. case ClassAssistance: // Assistance class
  1280. {
  1281. format(missiontext, sizeof(missiontext), Assistance_NoJobText); // Preset the missiontext
  1282. SetPlayerColor(playerid, ColorClassAssistance); // Set the playercolor (chatcolor for the player and color on the map)
  1283. // Start the PlayerCheckTimer to scan for players who need assistance (be sure the timer has been destroyed first)
  1284. KillTimer(APlayerData[playerid][PlayerCheckTimer]);
  1285. APlayerData[playerid][PlayerCheckTimer] = SetTimerEx("Assistance_CheckPlayers", 1000, true, "i", playerid);
  1286. }
  1287. case ClassRoadWorker: // Roadworker class
  1288. {
  1289. format(missiontext, sizeof(missiontext), RoadWorker_NoJobText); // Preset the missiontext
  1290. SetPlayerColor(playerid, ColorClassRoadWorker); // Set the playercolor (chatcolor for the player and color on the map)
  1291. }
  1292. case ClassMedic: // Medic class
  1293. {
  1294. format(missiontext, sizeof(missiontext), Medic_NoJobText); // Preset the missiontext
  1295. SetPlayerColor(playerid, ColorClassMedic); // Set the playercolor (chatcolor for the player and color on the map)
  1296. }
  1297. case ClassSofer: // Conducator Tren class
  1298. {
  1299. format(missiontext, sizeof(missiontext), Sofer_NoJobText); // Preset the missiontext
  1300. SetPlayerColor(playerid, ColorClassSofer); // Set the playercolor (chatcolor for the player and color on the map)
  1301. }
  1302. case ClassG: // G class
  1303. {
  1304. format(missiontext, sizeof(missiontext), Trucker_NoJobText); // Preset the missiontext
  1305. SetPlayerColor(playerid, ColorClassG); // Set the playercolor (chatcolor for the player and color on the map)
  1306. }
  1307. case ClassMarinar: // Marinar class
  1308. {
  1309. format(missiontext, sizeof(missiontext), Marinar_NoJobText);
  1310. SetPlayerColor(playerid, ColorClassMarinar);
  1311. }
  1312. case ClassTaxi: // Taxi class
  1313. {
  1314. format(missiontext, sizeof(missiontext), Taxi_NoJobText);
  1315. SetPlayerColor(playerid, ColorClassTaxi);
  1316. }
  1317. case ClassPadurar: // Taxi class
  1318. {
  1319. format(missiontext, sizeof(missiontext), Padurar_NoJobText);
  1320. SetPlayerColor(playerid, ColorClassPadurar);
  1321. }
  1322. }
  1323.  
  1324. // Set the missiontext
  1325. TextDrawSetString(APlayerData[playerid][MissionText], missiontext);
  1326. // Show the missiontext for this player
  1327. TextDrawShowForPlayer(playerid, APlayerData[playerid][MissionText]);
  1328.  
  1329. // If the player spawns and his jailtime hasn't passed yet, put him back in jail
  1330. if (APlayerData[playerid][PlayerJailed] != 0)
  1331. Police_JailPlayer(playerid, APlayerData[playerid][PlayerJailed]);
  1332.  
  1333. if (APlayerData[playerid][PlayerJailed] != 0)
  1334. FBY_JailPlayer(playerid, APlayerData[playerid][PlayerJailed]);
  1335.  
  1336.  
  1337. return 1;
  1338. }
  1339. // This callback gets called whenever a player enters a checkpoint
  1340. public OnPlayerEnterCheckpoint(playerid)
  1341. {
  1342. // Check the player's class
  1343. switch (APlayerData[playerid][PlayerClass])
  1344. {
  1345. case ClassTruckDriver: // Truckdriver class
  1346. Trucker_OnPlayerEnterCheckpoint(playerid); // Process the checkpoint (load or unload goods)
  1347. case ClassBusDriver: // BusDriver class
  1348. {
  1349. GameTextForPlayer(playerid, TXT_BusDriverMissionPassed, 3000, 4); // Show a message to let the player know he finished his job
  1350. BusDriver_EndJob(playerid); // End the current mission
  1351. }
  1352. case ClassPilot: // Pilot class
  1353. Pilot_OnPlayerEnterCheckpoint(playerid); // Process the checkpoint (load or unload)
  1354. case ClassMafia: // Mafia class
  1355. Mafia_OnPlayerEnterCheckpoint(playerid);
  1356. case ClassCourier: // Courier class
  1357. Courier_OnPlayerEnterCheckpoint(playerid);
  1358. case ClassPboy: // Pizza Boy class
  1359. Pboy_OnPlayerEnterCheckpoint(playerid);
  1360. case ClassMedic: // Medic class
  1361. Medic_OnPlayerEnterCheckpoint(playerid); // Process the checkpoint (load or unload)
  1362. case ClassSofer: // Conducator tren class
  1363. Sofer_OnPlayerEnterCheckpoint(playerid); // Process the checkpoint (load or unload)
  1364. case ClassG: // G class
  1365. G_OnPlayerEnterCheckpoint(playerid); // Process the checkpoint (load or unload)
  1366. case ClassMarinar: // Marinar class
  1367. Marinar_OnPlayerEnterCheckpoint(playerid); // Process the checkpoint (load or unload)
  1368. case ClassTaxi: // Taxi class
  1369. Taxi_OnPlayerEnterCheckpoint(playerid); // Process the checkpoint (load or unload)
  1370. case ClassPadurar: // Padurar class
  1371. Padurar_OnPlayerEnterCheckpoint(playerid); // Process the checkpoint (load or unload)
  1372.  
  1373. case ClassRoadWorker: // Roadworker class
  1374. {
  1375. // Only end the mission when doing "repair-speedcamera" jobtype (checkpoint is the base of the roadworker)
  1376. if (APlayerData[playerid][JobID] == 1) // Repairing speedcamera's
  1377. {
  1378. GameTextForPlayer(playerid, TXT_RoadworkerMissionPassed, 3000, 4); // Show a message to let the player know he finished his job
  1379. Roadworker_EndJob(playerid); // End the current mission
  1380. }
  1381. if (APlayerData[playerid][JobID] == 2) // Towing broken vehicle to shredder
  1382. Roadworker_EnterCheckpoint(playerid);
  1383. }
  1384. }
  1385.  
  1386. return 1;
  1387. }
  1388. // This callback gets called when a player enters a race-checkpoint
  1389. public OnPlayerEnterRaceCheckpoint(playerid)
  1390. {
  1391. // Check the player's class
  1392. switch (APlayerData[playerid][PlayerClass])
  1393. {
  1394. case ClassBusDriver: // BusDriver class
  1395. Bus_EnterRaceCheckpoint(playerid); // Process the checkpoint
  1396. case ClassRoadWorker: // Roadworker class
  1397. Roadworker_EnterRaceCheckpoint(playerid);
  1398. }
  1399.  
  1400. return 1;
  1401. }
  1402. // This callback gets called whenever a player dies
  1403. public OnPlayerDeath(playerid, killerid, reason)
  1404. {
  1405. // Setup local variables
  1406. new VictimName[24], KillerName[24], Msg[128];
  1407. // Clear the missiontext
  1408. TextDrawSetString(APlayerData[playerid][MissionText], " ");
  1409. // Hide the missiontext for this player (when the player is choosing a class, it's not required to show any mission-text)
  1410. TextDrawHideForPlayer(playerid, APlayerData[playerid][MissionText]);
  1411.  
  1412. // Stop any job that may have started
  1413. switch (APlayerData[playerid][PlayerClass])
  1414. {
  1415. case ClassTruckDriver: Trucker_EndJob(playerid);
  1416. case ClassBusDriver: BusDriver_EndJob(playerid);
  1417. case ClassPilot: Pilot_EndJob(playerid);
  1418. case ClassPolice: Police_EndJob(playerid);
  1419. case ClassFBY: FBY_EndJob(playerid);
  1420. case ClassMafia: Mafia_EndJob(playerid);
  1421. case ClassCourier: Courier_EndJob(playerid);
  1422. case ClassPboy: Pboy_EndJob(playerid);
  1423. case ClassAssistance: Assistance_EndJob(playerid);
  1424. case ClassRoadWorker: Roadworker_EndJob(playerid);
  1425. case ClassMedic: Medic_EndJob(playerid);
  1426. case ClassSofer: Sofer_EndJob(playerid);
  1427. case ClassG: G_EndJob(playerid);
  1428. case ClassMarinar: Marinar_EndJob(playerid);
  1429. case ClassTaxi: Taxi_EndJob(playerid);
  1430. case ClassPadurar: Padurar_EndJob(playerid);
  1431. }
  1432.  
  1433. // If the player is part of a convoy, kick him from it
  1434. Convoy_Leave(playerid);
  1435.  
  1436. // If another player kills you, he'll get an extra star of his wanted level if he's isn't a police officer
  1437. if (killerid != INVALID_PLAYER_ID && APlayerData[killerid][PlayerClass] != ClassPolice)
  1438. if (killerid != INVALID_PLAYER_ID && APlayerData[playerid][PlayerClass] != ClassFBY)
  1439. {
  1440. // Increase the wanted level of the killer by one star
  1441. SetPlayerWantedLevel(killerid, GetPlayerWantedLevel(killerid) + 1);
  1442. // Get the name of the killed player and the killer
  1443. GetPlayerName(playerid, VictimName, sizeof(VictimName));
  1444. GetPlayerName(killerid, KillerName, sizeof(KillerName));
  1445. // Let the killed know the police are informed about the kill
  1446. format(Msg, 128, "{FF0000}Ai omorat pe {FFFF00}%s{FF0000},iar acum esti cautat de politie / FBY", VictimName);
  1447. SendClientMessage(killerid, 0xFFFFFFFF, Msg);
  1448. // Inform all police players about the kill
  1449. format(Msg, 128, "{00FF00}Jucatorul {FFFF00}%s{00FF00} a omorat pe {FFFF00}%s{00FF00}, urmareste-l si amendeaza-l.", KillerName, VictimName);
  1450. Police_SendMessage(Msg);
  1451. FBY_SendMessage(Msg);
  1452. }
  1453. if(XDeaths[playerid] == 0)
  1454. {
  1455. LastDeath[playerid] = gettime();
  1456. }
  1457. XDeaths[playerid]++;
  1458. if(XDeaths[playerid] == 5)
  1459. {
  1460. if((gettime() - LastDeath[playerid]) <= 5)
  1461. {
  1462. SendClientMessage(playerid,0,"{FFBF00}Buna Nobule, Flodeaz-o Pe Mata!");
  1463. format(Msg, 128, "[Junkbuster]Am Dat ipban pt Flood (fakekill) la un Idiot care acum o Flodeaza Pe Ma-sa");
  1464. SendClientMessageToAll(0xFF0080C8, Msg);
  1465. for (new i; i < MAX_PLAYERS; i++)
  1466. if (IsPlayerConnected(i)) // Check if the player is connected
  1467. SetPlayerWantedLevel(i, 0);
  1468. else
  1469. BanEx(playerid,"Bannat pentru FakeKill");
  1470. }else
  1471. if((gettime() - LastDeath[playerid]) > 5)
  1472. {
  1473. XDeaths[playerid]=0;
  1474. }
  1475. }
  1476. return 1;
  1477. }
  1478. // This callback gets called when the player is selecting a class (but hasn't clicked "Spawn" yet)
  1479. public OnPlayerRequestClass(playerid, classid)
  1480. {
  1481. SetPlayerInterior(playerid,0);
  1482. SetPlayerPos(playerid,1415.493041, -808.613891, 91.853370);
  1483. SetPlayerFacingAngle(playerid, 179.568847);
  1484. SetPlayerCameraPos(playerid,1415.493041 + (10 * floatsin(-179.568847, degrees)), -808.613891 + (10 * floatcos(-179.568847, degrees)), 91.853370);
  1485. SetPlayerCameraLookAt(playerid,1415.493041, -808.613891, 91.853370);
  1486.  
  1487. // Display a short message to inform the player about the class he's about to choose
  1488. switch (classid)
  1489. {
  1490. case 0, 1, 2, 3, 4, 5, 6, 7: // Classes that will be truckdrivers
  1491. {
  1492. // Display the name of the class
  1493. GameTextForPlayer(playerid, TXT_ClassTrucker, 3000, 4);
  1494. // Store the class for the player (truckdriver)
  1495. APlayerData[playerid][PlayerClass] = ClassTruckDriver;
  1496. }
  1497. case 8, 9: // Classes that will be bus-drivers
  1498. {
  1499. // Display the name of the class
  1500. GameTextForPlayer(playerid, TXT_ClassBusDriver, 3000, 4);
  1501. // Store the class for the player (busdriver)
  1502. APlayerData[playerid][PlayerClass] = ClassBusDriver;
  1503. }
  1504. case 10: // Classes that will be Pilot
  1505. {
  1506. // Display the name of the class
  1507. GameTextForPlayer(playerid, TXT_ClassPilot, 3000, 4);
  1508. // Store the class for the player (pilot)
  1509. APlayerData[playerid][PlayerClass] = ClassPilot;
  1510. }
  1511. case 11, 12, 13: // Classes that will be police
  1512. {
  1513. // Display the name of the class
  1514. GameTextForPlayer(playerid, TXT_ClassPolice, 3000, 4);
  1515. // Store the class for the player (police)
  1516. APlayerData[playerid][PlayerClass] = ClassPolice;
  1517. }
  1518. case 14, 15, 16: // Classes that will be mafia
  1519. {
  1520. // Display the name of the class
  1521. GameTextForPlayer(playerid, TXT_ClassMafia, 3000, 4);
  1522. // Store the class for the player (mafia)
  1523. APlayerData[playerid][PlayerClass] = ClassMafia;
  1524. }
  1525. case 17, 18: // Classes that will be courier
  1526. {
  1527. // Display the name of the class
  1528. GameTextForPlayer(playerid, TXT_ClassCourier, 3000, 4);
  1529. // Store the class for the player (courier)
  1530. APlayerData[playerid][PlayerClass] = ClassCourier;
  1531. }
  1532. case 19: // Classes that will be assistance
  1533. {
  1534. // Display the name of the class
  1535. GameTextForPlayer(playerid, TXT_ClassAssistance, 3000, 4);
  1536. // Store the class for the player (assistance)
  1537. APlayerData[playerid][PlayerClass] = ClassAssistance;
  1538. }
  1539. case 20, 21, 22: // Classes that will be roadworker
  1540. {
  1541. // Display the name of the class
  1542. GameTextForPlayer(playerid, TXT_ClassRoadWorker, 3000, 4);
  1543. // Store the class for the player (roadworker)
  1544. APlayerData[playerid][PlayerClass] = ClassRoadWorker;
  1545. }
  1546. case 23, 24: // Classes that will be Medic
  1547. {
  1548. // Display the name of the class
  1549. GameTextForPlayer(playerid, TXT_ClassMedic, 3000, 4);
  1550. // Store the class for the player (roadworker)
  1551. APlayerData[playerid][PlayerClass] = ClassMedic;
  1552.  
  1553. }
  1554. case 25, 26, 27: // Classes that will be FBY
  1555. {
  1556. // Display the name of the class
  1557. GameTextForPlayer(playerid, TXT_ClassFBY, 3000, 4);
  1558. // Store the class for the player (FBY)
  1559. APlayerData[playerid][PlayerClass] = ClassFBY;
  1560. }
  1561. case 28, 29, 30: // Classes that will be Pizza Boy
  1562. {
  1563. // Display the name of the class
  1564. GameTextForPlayer(playerid, TXT_ClassPboy, 3000, 4);
  1565. // Store the class for the player (Pizza Boy)
  1566. APlayerData[playerid][PlayerClass] = ClassPboy;
  1567. }
  1568. case 31, 32, 33: // Classes that will be Conducator Tren
  1569. {
  1570. // Display the name of the class
  1571. GameTextForPlayer(playerid, TXT_ClassSofer, 3000, 4);
  1572. // Store the class for the player (Conducator Tren)
  1573. APlayerData[playerid][PlayerClass] = ClassSofer;
  1574. }
  1575. case 34, 35, 36: // Classes that will be G
  1576. {
  1577. // Display the name of the class
  1578. GameTextForPlayer(playerid, TXT_ClassG, 3000, 4);
  1579. // Store the class for the player (G)
  1580. APlayerData[playerid][PlayerClass] = ClassG;
  1581. }
  1582. case 37, 38, 39: // Classes that will be Marinar
  1583. {
  1584. // Display the name of the class
  1585. GameTextForPlayer(playerid, TXT_ClassMarinar, 3000, 4);
  1586. // Store the class for the player (Marinar)
  1587. APlayerData[playerid][PlayerClass] = ClassMarinar;
  1588. }
  1589. case 40, 41, 42: // Classes that will be Taxi
  1590. {
  1591. // Display the name of the class
  1592. GameTextForPlayer(playerid, TXT_ClassTaxi, 3000, 4);
  1593. // Store the class for the player (Marinar)
  1594. APlayerData[playerid][PlayerClass] = ClassTaxi;
  1595. }
  1596. case 43, 44, 45: // Classes that will be Padurar
  1597. {
  1598. // Display the name of the class
  1599. GameTextForPlayer(playerid, TXT_ClassPadurar, 3000, 4);
  1600. // Store the class for the player (Padurar)
  1601. APlayerData[playerid][PlayerClass] = ClassPadurar;
  1602. }
  1603.  
  1604. }
  1605. return 1;
  1606. }
  1607. // This callback is called when the player attempts to spawn via class-selection
  1608. public OnPlayerRequestSpawn(playerid)
  1609. {
  1610. new Index, Float:x, Float:y, Float:z, Float:Angle, Name[24], Msg[128];
  1611.  
  1612. // Get the player's name
  1613. GetPlayerName(playerid, Name, sizeof(Name));
  1614.  
  1615. // Choose a random spawnlocation based on the player's class
  1616. switch (APlayerData[playerid][PlayerClass])
  1617. {
  1618. case ClassTruckDriver:
  1619. {
  1620. Index = random(sizeof(ASpawnLocationsTrucker)); // Get a random array-index to chose a random spawnlocation
  1621. x = ASpawnLocationsTrucker[Index][SpawnX]; // Get the X-position for the spawnlocation
  1622. y = ASpawnLocationsTrucker[Index][SpawnY]; // Get the Y-position for the spawnlocation
  1623. z = ASpawnLocationsTrucker[Index][SpawnZ]; // Get the Z-position for the spawnlocation
  1624. Angle = ASpawnLocationsTrucker[Index][SpawnAngle]; // Get the rotation-angle for the spawnlocation
  1625. format(Msg, 128, "{00FF00}Jucatorul {FFFF00}%s{00FF00} s-a alaturat {FFFF00}Tiristilor", Name);
  1626. }
  1627. case ClassBusDriver:
  1628. {
  1629. Index = random(sizeof(ASpawnLocationsBusDriver));
  1630. x = ASpawnLocationsBusDriver[Index][SpawnX]; // Get the X-position for the spawnlocation
  1631. y = ASpawnLocationsBusDriver[Index][SpawnY]; // Get the Y-position for the spawnlocation
  1632. z = ASpawnLocationsBusDriver[Index][SpawnZ]; // Get the Z-position for the spawnlocation
  1633. Angle = ASpawnLocationsBusDriver[Index][SpawnAngle]; // Get the rotation-angle for the spawnlocation
  1634. format(Msg, 128, "{00FF00}Jucatorul {FFFF00}%s{00FF00} s-a alaturat {FFFF00}Soferilor de Autobuz", Name);
  1635. }
  1636. case ClassPilot:
  1637. {
  1638. Index = random(sizeof(ASpawnLocationsPilot));
  1639. x = ASpawnLocationsPilot[Index][SpawnX]; // Get the X-position for the spawnlocation
  1640. y = ASpawnLocationsPilot[Index][SpawnY]; // Get the Y-position for the spawnlocation
  1641. z = ASpawnLocationsPilot[Index][SpawnZ]; // Get the Z-position for the spawnlocation
  1642. Angle = ASpawnLocationsPilot[Index][SpawnAngle]; // Get the rotation-angle for the spawnlocation
  1643. format(Msg, 128, "{00FF00}Jucatorul {FFFF00}%s{00FF00} s-a alaturat {FFFF00}Pilotilor", Name);
  1644. }
  1645. case ClassPolice:
  1646. {
  1647. // Count the number of normal players (all classes except police) and count the amount of police players
  1648. new NormalPlayers, PolicePlayers, bool:CanSpawnAsCop = false;
  1649.  
  1650. // Block this check if PlayersBeforePolice is set to 0 (this allows anyone to join as police)
  1651. if (PlayersBeforePolice > 0)
  1652. {
  1653. // Loop through all players
  1654. for (new pid; pid < MAX_PLAYERS; pid++)
  1655. {
  1656. // Exclude this player, as he doesn't have a class yet, he's still choosing here
  1657. if (pid != playerid)
  1658. {
  1659. // Also exclude all players who are still in the class-selection screen, as they don't have a class selected yet
  1660. if (GetPlayerInterior(pid) != 14)
  1661. {
  1662. // Check if this player is logged in
  1663. if (APlayerData[pid][LoggedIn] == true)
  1664. {
  1665. // Count the amount of normal players and police players
  1666. switch (APlayerData[pid][PlayerClass])
  1667. {
  1668. case ClassPolice:
  1669. PolicePlayers++;
  1670. case ClassTruckDriver, ClassBusDriver, ClassPilot, ClassMafia, ClassCourier, ClassAssistance, ClassRoadWorker, ClassMedic, ClassG, ClassPboy:
  1671. NormalPlayers++;
  1672. }
  1673. }
  1674. }
  1675. }
  1676. }
  1677. // Check if there are less police players than allowed
  1678. if (PolicePlayers < (NormalPlayers / PlayersBeforePolice))
  1679. CanSpawnAsCop = true; // There are less police players than allowed, so the player can choose this class
  1680. else
  1681. CanSpawnAsCop = false; // The maximum amount of police players has been reached, the player can't choose to be a cop
  1682.  
  1683. // Check if the player isn't allowed to spawn as police
  1684. if (CanSpawnAsCop == false)
  1685. {
  1686. // Let the player know the maximum amount of cops has been reached
  1687. GameTextForPlayer(playerid, "Numarul maxim de politisti a fost atins.", 5000, 4);
  1688. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}The maximum amount of cops has been reached already, please select another class");
  1689. return 0; // Don't allow the player to spawn as police player
  1690. }
  1691. }
  1692.  
  1693. // If the player has less than 100 scorepoints
  1694. if (APlayerData[playerid][PlayerScore] < 1700)
  1695. {
  1696. // Let the player know he needs 100 scorepoints
  1697. GameTextForPlayer(playerid, "Ai nevoie de 1700 scor pentru a te alatura Politistilor", 5000, 4);
  1698. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Ai nevoie de 1700 scor pentru a te alatura politistilor.");
  1699. return 0; // Don't allow the player to spawn as police player
  1700. }
  1701. // If the player has a wanted level
  1702. if (GetPlayerWantedLevel(playerid) > 0)
  1703. {
  1704. // Let the player know he cannot have a wanted level to join police
  1705. GameTextForPlayer(playerid, "You are not allowed to choose police class when you're wanted", 5000, 4);
  1706. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}You are not allowed to choose police class when you're wanted");
  1707. return 0; // Don't allow the player to spawn as police player
  1708. }
  1709.  
  1710. Index = random(sizeof(ASpawnLocationsPolice));
  1711. x = ASpawnLocationsPolice[Index][SpawnX]; // Get the X-position for the spawnlocation
  1712. y = ASpawnLocationsPolice[Index][SpawnY]; // Get the Y-position for the spawnlocation
  1713. z = ASpawnLocationsPolice[Index][SpawnZ]; // Get the Z-position for the spawnlocation
  1714. Angle = ASpawnLocationsPolice[Index][SpawnAngle]; // Get the rotation-angle for the spawnlocation
  1715. format(Msg, 128, "{00FF00}Jucatorul {FFFF00}%s{00FF00} s-a alaturat {FFFF00}Politistilor", Name);
  1716. }
  1717. case ClassFBY:
  1718. {
  1719. // If the player has less than 100 scorepoints
  1720. if (APlayerData[playerid][PlayerScore] < 3000)
  1721. {
  1722. // Let the player know he needs 100 scorepoints
  1723. GameTextForPlayer(playerid, "Ai nevoie de 3000 scor pentru a te alatura FBY-ului", 5000, 4);
  1724. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Ai nevoie de 3000 scor pentru a te alatura FBY-ului");
  1725. return 0; // Don't allow the player to spawn as police player
  1726. }
  1727. // If the player has a wanted level
  1728. if (GetPlayerWantedLevel(playerid) > 0)
  1729. {
  1730. // Let the player know he cannot have a wanted level to join police
  1731. GameTextForPlayer(playerid, "You are not allowed to choose FBY class when you're wanted", 5000, 4);
  1732. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}You are not allowed to choose FBI class when you're wanted");
  1733. return 0; // Don't allow the player to spawn as police player
  1734. }
  1735.  
  1736. Index = random(sizeof(ASpawnLocationsFBY));
  1737. x = ASpawnLocationsFBY[Index][SpawnX]; // Get the X-position for the spawnlocation
  1738. y = ASpawnLocationsFBY[Index][SpawnY]; // Get the Y-position for the spawnlocation
  1739. z = ASpawnLocationsFBY[Index][SpawnZ]; // Get the Z-position for the spawnlocation
  1740. Angle = ASpawnLocationsFBY[Index][SpawnAngle]; // Get the rotation-angle for the spawnlocation
  1741. format(Msg, 128, "{00FF00}Jucatorul {FFFF00}%s{00FF00} s-a alaturat {FFFF00}FBI-ului", Name);
  1742. }
  1743. case ClassMafia:
  1744. {
  1745. Index = random(sizeof(ASpawnLocationsMafia));
  1746. x = ASpawnLocationsMafia[Index][SpawnX]; // Get the X-position for the spawnlocation
  1747. y = ASpawnLocationsMafia[Index][SpawnY]; // Get the Y-position for the spawnlocation
  1748. z = ASpawnLocationsMafia[Index][SpawnZ]; // Get the Z-position for the spawnlocation
  1749. Angle = ASpawnLocationsMafia[Index][SpawnAngle]; // Get the rotation-angle for the spawnlocation
  1750. format(Msg, 128, "{00FF00}Jucatorul {FFFF00}%s{00FF00} s-a alaturat {FFFF00}Mafiei", Name);
  1751. }
  1752. case ClassCourier:
  1753. {
  1754. Index = random(sizeof(ASpawnLocationsCourier));
  1755. x = ASpawnLocationsCourier[Index][SpawnX]; // Get the X-position for the spawnlocation
  1756. y = ASpawnLocationsCourier[Index][SpawnY]; // Get the Y-position for the spawnlocation
  1757. z = ASpawnLocationsCourier[Index][SpawnZ]; // Get the Z-position for the spawnlocation
  1758. Angle = ASpawnLocationsCourier[Index][SpawnAngle]; // Get the rotation-angle for the spawnlocation
  1759. format(Msg, 128, "{00FF00}Jucatorul {FFFF00}%s{00FF00} s-a alaturat {FFFF00}Curierilor", Name);
  1760. }
  1761. case ClassPboy:
  1762. {
  1763. Index = random(sizeof(ASpawnLocationsPboy));
  1764. x = ASpawnLocationsPboy[Index][SpawnX]; // Get the X-position for the spawnlocation
  1765. y = ASpawnLocationsPboy[Index][SpawnY]; // Get the Y-position for the spawnlocation
  1766. z = ASpawnLocationsPboy[Index][SpawnZ]; // Get the Z-position for the spawnlocation
  1767. Angle = ASpawnLocationsPboy[Index][SpawnAngle]; // Get the rotation-angle for the spawnlocation
  1768. format(Msg, 128, "{00FF00}Jucatorul {FFFF00}%s{00FF00} s-a alaturat {FFFF00}Baietilor cu Pizza", Name);
  1769. }
  1770. case ClassAssistance:
  1771. {
  1772. Index = random(sizeof(ASpawnLocationsAssistance));
  1773. x = ASpawnLocationsAssistance[Index][SpawnX]; // Get the X-position for the spawnlocation
  1774. y = ASpawnLocationsAssistance[Index][SpawnY]; // Get the Y-position for the spawnlocation
  1775. z = ASpawnLocationsAssistance[Index][SpawnZ]; // Get the Z-position for the spawnlocation
  1776. Angle = ASpawnLocationsAssistance[Index][SpawnAngle]; // Get the rotation-angle for the spawnlocation
  1777. format(Msg, 128, "{00FF00}Jucatorul {FFFF00}%s{00FF00} s-a alaturat {FFFF00}Mecanicilor", Name);
  1778. }
  1779. case ClassRoadWorker:
  1780. {
  1781. Index = random(sizeof(ASpawnLocationsRoadWorker));
  1782. x = ASpawnLocationsRoadWorker[Index][SpawnX]; // Get the X-position for the spawnlocation
  1783. y = ASpawnLocationsRoadWorker[Index][SpawnY]; // Get the Y-position for the spawnlocation
  1784. z = ASpawnLocationsRoadWorker[Index][SpawnZ]; // Get the Z-position for the spawnlocation
  1785. Angle = ASpawnLocationsRoadWorker[Index][SpawnAngle]; // Get the rotation-angle for the spawnlocation
  1786. format(Msg, 128, "{00FF00}Jucatorul {FFFF00}%s{00FF00} s-a alaturat {FFFF00}Lucratorilor rutieri", Name);
  1787. }
  1788. case ClassMedic:
  1789. {
  1790. Index = random(sizeof(ASpawnLocationsMedic));
  1791. x = ASpawnLocationsMedic[Index][SpawnX]; // Get the X-position for the spawnlocation
  1792. y = ASpawnLocationsMedic[Index][SpawnY]; // Get the Y-position for the spawnlocation
  1793. z = ASpawnLocationsMedic[Index][SpawnZ]; // Get the Z-position for the spawnlocation
  1794. Angle = ASpawnLocationsMedic[Index][SpawnAngle]; // Get the rotation-angle for the spawnlocation
  1795. format(Msg, 128, "{00FF00}Jucatorul {FFFF00}%s{00FF00} s-a alaturat {FFFF00}Medicilor", Name);
  1796. }
  1797. case ClassG:
  1798. {
  1799. Index = random(sizeof(ASpawnLocationsG));
  1800. x = ASpawnLocationsG[Index][SpawnX]; // Get the X-position for the spawnlocation
  1801. y = ASpawnLocationsG[Index][SpawnY]; // Get the Y-position for the spawnlocation
  1802. z = ASpawnLocationsG[Index][SpawnZ]; // Get the Z-position for the spawnlocation
  1803. Angle = ASpawnLocationsG[Index][SpawnAngle]; // Get the rotation-angle for the spawnlocation
  1804. format(Msg, 128, "{00FF00}Jucatorul {FFFF00}%s{00FF00} s-a alaturat {FFFF00}Gunoierilor", Name);
  1805. }
  1806. case ClassSofer:
  1807. {
  1808. Index = random(sizeof(ASpawnLocationsSofer));
  1809. x = ASpawnLocationsSofer[Index][SpawnX]; // Get the X-position for the spawnlocation
  1810. y = ASpawnLocationsSofer[Index][SpawnY]; // Get the Y-position for the spawnlocation
  1811. z = ASpawnLocationsSofer[Index][SpawnZ]; // Get the Z-position for the spawnlocation
  1812. Angle = ASpawnLocationsSofer[Index][SpawnAngle]; // Get the rotation-angle for the spawnlocation
  1813. format(Msg, 128, "{00FF00}Jucatorul {FFFF00}%s{00FF00} s-a alaturat {FFFFFF}Conducatorilor de Tren", Name);
  1814. }
  1815. case ClassMarinar:
  1816. {
  1817. Index = random(sizeof(ASpawnLocationsMarinar));
  1818. x = ASpawnLocationsMarinar[Index][SpawnX]; // Get the X-position for the spawnlocation
  1819. y = ASpawnLocationsMarinar[Index][SpawnY]; // Get the Y-position for the spawnlocation
  1820. z = ASpawnLocationsMarinar[Index][SpawnZ]; // Get the Z-position for the spawnlocation
  1821. Angle = ASpawnLocationsMarinar[Index][SpawnAngle]; // Get the rotation-angle for the spawnlocation
  1822. format(Msg, 128, "{00FF00}Jucatorul {FFFF00}%s{00FF00} s-a alaturat {FFFF00}Marinarilor", Name);
  1823. }
  1824. case ClassTaxi:
  1825. {
  1826. Index = random(sizeof(ASpawnLocationsTaxi));
  1827. x = ASpawnLocationsTaxi[Index][SpawnX]; // Get the X-position for the spawnlocation
  1828. y = ASpawnLocationsTaxi[Index][SpawnY]; // Get the Y-position for the spawnlocation
  1829. z = ASpawnLocationsTaxi[Index][SpawnZ]; // Get the Z-position for the spawnlocation
  1830. Angle = ASpawnLocationsTaxi[Index][SpawnAngle]; // Get the rotation-angle for the spawnlocation
  1831. format(Msg, 128, "{00FF00}Jucatorul {FFFF00}%s{00FF00} s-a alaturat {FFFF00}Taximetristilor", Name);
  1832. }
  1833. case ClassPadurar:
  1834. {
  1835. Index = random(sizeof(ASpawnLocationsPadurar));
  1836. x = ASpawnLocationsPadurar[Index][SpawnX]; // Get the X-position for the spawnlocation
  1837. y = ASpawnLocationsPadurar[Index][SpawnY]; // Get the Y-position for the spawnlocation
  1838. z = ASpawnLocationsPadurar[Index][SpawnZ]; // Get the Z-position for the spawnlocation
  1839. Angle = ASpawnLocationsPadurar[Index][SpawnAngle]; // Get the rotation-angle for the spawnlocation
  1840. format(Msg, 128, "{00FF00}Jucatorul {FFFF00}%s{00FF00} s-a alaturat {FFFF00}Padurarilor", Name);
  1841. }
  1842.  
  1843.  
  1844. }
  1845.  
  1846. // Spawn the player with his chosen skin at a random location based on his class
  1847. SetSpawnInfo(playerid, 0, GetPlayerSkin(playerid), x, y, z, Angle, 0, 0, 0, 0, 0, 0);
  1848. // Send the message to all players (who joined which class)
  1849. SendClientMessageToAll(0xFFFFFFFF, Msg);
  1850.  
  1851. return 1;
  1852. }
  1853.  
  1854.  
  1855. // This callback gets called when a vehicle respawns at it's spawn-location (where it was created)
  1856. public OnVehicleSpawn(vehicleid)
  1857. {
  1858. // Set the vehicle as not-wanted by the mafia
  1859. AVehicleData[vehicleid][MafiaLoad] = false;
  1860. // Also reset the fuel to maximum (only for non-owned vehicles)
  1861. if (AVehicleData[vehicleid][Owned] == false)
  1862. AVehicleData[vehicleid][Fuel] = MaxFuel;
  1863.  
  1864. // Re-apply the paintjob (if any was applied)
  1865. if (AVehicleData[vehicleid][PaintJob] != 0)
  1866. {
  1867. // Re-apply the paintjob
  1868. ChangeVehiclePaintjob(vehicleid, AVehicleData[vehicleid][PaintJob] - 1);
  1869. }
  1870.  
  1871. // Also update the car-color
  1872. ChangeVehicleColor(vehicleid, AVehicleData[vehicleid][Color1], AVehicleData[vehicleid][Color2]);
  1873.  
  1874. // Re-add all components that were installed (if they were there)
  1875. for (new i; i < 14; i++)
  1876. {
  1877. // Remove all mods from the vehicle (all added mods applied by hackers will hopefully be removed this way when the vehicle respawns)
  1878. RemoveVehicleComponent(vehicleid, GetVehicleComponentInSlot(vehicleid, i));
  1879.  
  1880. // Check if the componentslot has a valid component-id
  1881. if (AVehicleData[vehicleid][Components][i] != 0)
  1882. AddVehicleComponent(vehicleid, AVehicleData[vehicleid][Components][i]); // Add the component to the vehicle
  1883. }
  1884.  
  1885. return 1;
  1886. }
  1887.  
  1888.  
  1889.  
  1890. // This callback is called when the vehicle leaves a mod shop
  1891. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  1892. {
  1893. // Let the player pay $150 for changing the color (if they have been changed)
  1894. if ((AVehicleData[vehicleid][Color1] != color1) || (AVehicleData[vehicleid][Color2] != color2))
  1895. {
  1896. RewardPlayer(playerid, -15000, 0);
  1897. SendClientMessage(playerid, 0xFFFFFFFF, "{00FF00}Ai schimbat culoarea masini pentru $15000");
  1898. }
  1899.  
  1900. // Save the colors
  1901. AVehicleData[vehicleid][Color1] = color1;
  1902. AVehicleData[vehicleid][Color2] = color2;
  1903.  
  1904. // If the primary color is black, remove the paintjob
  1905. if (color1 == 0)
  1906. AVehicleData[vehicleid][PaintJob] = 0;
  1907.  
  1908. return 1;
  1909. }
  1910.  
  1911.  
  1912.  
  1913. // This callback gets called when a player enters or exits a mod-shop
  1914. public OnEnterExitModShop(playerid, enterexit, interiorid)
  1915. {
  1916. return 1;
  1917. }
  1918.  
  1919.  
  1920.  
  1921. // This callback gets called whenever a player mods his vehicle
  1922. public OnVehicleMod(playerid, vehicleid, componentid)
  1923. {
  1924. // When the player changes a component of his vehicle, reduce the price of the component from the player's money
  1925. APlayerData[playerid][PlayerMoney] = APlayerData[playerid][PlayerMoney] - AVehicleModPrices[componentid - 1000];
  1926.  
  1927. // Store the component in the AVehicleData array
  1928. AVehicleData[vehicleid][Components][GetVehicleComponentType(componentid)] = componentid;
  1929.  
  1930. return 1;
  1931. }
  1932.  
  1933.  
  1934.  
  1935. // This callback gets called whenever a player VIEWS at a paintjob in a mod garage (viewing automatically applies it)
  1936. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  1937. {
  1938. // Store the paintjobid for the vehicle (add 1 to the value, otherwise checking for an applied paintjob is difficult)
  1939. AVehicleData[vehicleid][PaintJob] = paintjobid + 1;
  1940.  
  1941. return 1;
  1942. }
  1943. // This callback gets called whenever a player enters a vehicle
  1944. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  1945. {
  1946. // Setup local variables
  1947. new engine, lights, alarm, doors, bonnet, boot, objective;
  1948.  
  1949. // Check if the vehicle has fuel
  1950. if (AVehicleData[vehicleid][Fuel] > 0)
  1951. {
  1952. // Start the engine and turn on the lights
  1953. GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
  1954. SetVehicleParamsEx(vehicleid, 1, 1, alarm, doors, bonnet, boot, objective);
  1955. }
  1956.  
  1957. // Store the player's current location and interior-id, otherwise anti-airbreak hack code could kick you
  1958. GetPlayerPos(playerid, APlayerData[playerid][PreviousX], APlayerData[playerid][PreviousY], APlayerData[playerid][PreviousZ]);
  1959. APlayerData[playerid][PreviousInt] = GetPlayerInterior(playerid);
  1960.  
  1961. return 1;
  1962. }
  1963. // This callback gets called when a player exits his vehicle
  1964. public OnPlayerExitVehicle(playerid, vehicleid)
  1965. {
  1966. // Setup local variables
  1967. new engine, lights, alarm, doors, bonnet, boot, objective;
  1968.  
  1969. // Check if the player is the driver of the vehicle
  1970. if (GetPlayerVehicleSeat(playerid) == 0)
  1971. {
  1972. // Turn off the lights and engine
  1973. GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
  1974. SetVehicleParamsEx(vehicleid, 0, 0, alarm, doors, bonnet, boot, objective);
  1975. }
  1976.  
  1977. // Chech if the player is a pilot
  1978. if (APlayerData[playerid][PlayerClass] == ClassPilot)
  1979. {
  1980. // If the pilot started a job --> as soon as a pilot leaves his plane while doing a job, he fails his mission
  1981. if (APlayerData[playerid][JobStarted] == true)
  1982. {
  1983. // End the job (clear data)
  1984. Pilot_EndJob(playerid);
  1985. // Inform the player that he failed the mission
  1986. GameTextForPlayer(playerid, TXT_FailedMission, 5000, 4);
  1987. // Reduce the player's cash by 1000
  1988. RewardPlayer(playerid, -1000, 0);
  1989. }
  1990. }
  1991. if (APlayerData[playerid][PlayerClass] == ClassMedic)
  1992. {
  1993. // If the Medic started a job --> as soon as a pilot leaves his plane while doing a job, he fails his mission
  1994. if (APlayerData[playerid][JobStarted] == true)
  1995. {
  1996. // End the job (clear data)
  1997. Medic_EndJob(playerid);
  1998. // Inform the player that he failed the mission
  1999. GameTextForPlayer(playerid, TXT_FailedMission, 5000, 4);
  2000. // Reduce the player's cash by 1000
  2001. RewardPlayer(playerid, -1000, 0);
  2002. }
  2003. }
  2004. if (APlayerData[playerid][PlayerClass] == ClassG)
  2005. {
  2006. // If the G started a job --> as soon as a pilot leaves his plane while doing a job, he fails his mission
  2007. if (APlayerData[playerid][JobStarted] == true)
  2008. {
  2009. // End the job (clear data)
  2010. G_EndJob(playerid);
  2011. // Inform the player that he failed the mission
  2012. GameTextForPlayer(playerid, TXT_FailedMission, 5000, 4);
  2013. // Reduce the player's cash by 1000
  2014. RewardPlayer(playerid, -1000, 0);
  2015. }
  2016. }
  2017. return 1;
  2018. }
  2019. // This callback gets called whenever a vehicle enters the water or is destroyed (explodes)
  2020. public OnVehicleDeath(vehicleid)
  2021. {
  2022. // Get the houseid to which this vehicle belongs
  2023. new HouseID = AVehicleData[vehicleid][BelongsToHouse];
  2024.  
  2025. // Check if this vehicle belongs to a house
  2026. if (HouseID != 0)
  2027. {
  2028. // If the house doesn't have insurance for it's vehicles
  2029. if (AHouseData[HouseID][Insurance] == 0)
  2030. {
  2031. // Delete the vehicle, clear the data and remove it from the house it belongs to
  2032. Vehicle_Delete(vehicleid);
  2033.  
  2034. // Save the house (and linked vehicles)
  2035. HouseFile_Save(HouseID);
  2036. }
  2037. }
  2038.  
  2039. return 1;
  2040. }
  2041. // This callback gets called when the player changes state
  2042. public OnPlayerStateChange(playerid,newstate,oldstate)
  2043. {
  2044. // Setup local variables
  2045. new vid, Name[24], Msg[128], engine, lights, alarm, doors, bonnet, boot, objective;
  2046.  
  2047. switch (newstate)
  2048. {
  2049. case PLAYER_STATE_DRIVER: // Player became the driver of a vehicle
  2050. {
  2051. // Get the ID of the player's vehicle
  2052. vid = GetPlayerVehicleID(playerid);
  2053. // Get the player's name (the one who is trying to enter the vehicle)
  2054. GetPlayerName(playerid, Name, sizeof(Name));
  2055.  
  2056. // Check if the vehicle is owned
  2057. if (AVehicleData[vid][Owned] == true)
  2058. {
  2059. // Check if the vehicle is owned by somebody else (strcmp will not be 0)
  2060. if (strcmp(AVehicleData[vid][Owner], Name, false) != 0)
  2061. {
  2062. // Force the player out of the vehicle
  2063. RemovePlayerFromVehicle(playerid);
  2064. // Turn off the lights and engine
  2065. GetVehicleParamsEx(vid, engine, lights, alarm, doors, bonnet, boot, objective);
  2066. SetVehicleParamsEx(vid, 0, 0, alarm, doors, bonnet, boot, objective);
  2067. // Let the player know he cannot use somebody else's vehicle
  2068. format(Msg, 128, TXT_SpeedometerCannotUseVehicle, AVehicleData[vid][Owner]);
  2069. SendClientMessage(playerid, 0xFFFFFFFF, Msg);
  2070. }
  2071. // Check if the vehicle is clamped
  2072. if (AVehicleData[vid][Clamped] == true)
  2073. {
  2074. // Force the player out of the vehicle
  2075. RemovePlayerFromVehicle(playerid);
  2076. // Turn off the lights and engine
  2077. GetVehicleParamsEx(vid, engine, lights, alarm, doors, bonnet, boot, objective);
  2078. SetVehicleParamsEx(vid, 0, 0, alarm, doors, bonnet, boot, objective);
  2079. // Let the player know he cannot use a clamped vehicle
  2080. format(Msg, 128, TXT_SpeedometerClampedVehicle);
  2081. SendClientMessage(playerid, 0xFFFFFFFF, Msg);
  2082. format(Msg, 128, TXT_SpeedometerClampedVehicle2);
  2083. SendClientMessage(playerid, 0xFFFFFFFF, Msg);
  2084. }
  2085. }
  2086.  
  2087. // Check if the player is not a cop
  2088. if (APlayerData[playerid][PlayerClass] != ClassPolice)
  2089. {
  2090. // First check if the vehicle is a static vehicle (player can still use a bought cop-car that he bought in his house,
  2091. // as a bought vehicle isn't static)
  2092. if (AVehicleData[vid][StaticVehicle] == true)
  2093. {
  2094. // Check if the entered vehicle is a cop vehicle
  2095. switch (GetVehicleModel(vid))
  2096. {
  2097. case VehiclePoliceLSPD, VehiclePoliceSFPD, VehiclePoliceLVPD, VehicleHPV1000, VehiclePoliceRanger:
  2098. {
  2099. // Force the player out of the vehicle
  2100. RemovePlayerFromVehicle(playerid);
  2101. // Turn off the lights and engine
  2102. GetVehicleParamsEx(vid, engine, lights, alarm, doors, bonnet, boot, objective);
  2103. SetVehicleParamsEx(vid, 0, 0, alarm, doors, bonnet, boot, objective);
  2104. // Let the player know he cannot use a cop car
  2105. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Nu poti folosi o masina a politiei daca nu esti politist");
  2106. }
  2107. }
  2108. }
  2109. }
  2110. if (APlayerData[playerid][PlayerClass] != ClassFBY)
  2111. {
  2112. // First check if the vehicle is a static vehicle (player can still use a bought cop-car that he bought in his house,
  2113. // as a bought vehicle isn't static)
  2114. if (AVehicleData[vid][StaticVehicle] == true)
  2115. {
  2116. // Check if the entered vehicle is a FBY vehicle
  2117. switch (GetVehicleModel(vid))
  2118. {
  2119. case VehiclePoliceLSPD:
  2120. {
  2121. // Force the player out of the vehicle
  2122. RemovePlayerFromVehicle(playerid);
  2123. // Turn off the lights and engine
  2124. GetVehicleParamsEx(vid, engine, lights, alarm, doors, bonnet, boot, objective);
  2125. SetVehicleParamsEx(vid, 0, 0, alarm, doors, bonnet, boot, objective);
  2126. // Let the player know he cannot use a cop car
  2127. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Nu poti folosi o masina a FBY-ului daca nu esti unui dintre ei");
  2128. }
  2129. }
  2130. }
  2131. }
  2132. // Check if the player is not a pilot
  2133. if (APlayerData[playerid][PlayerClass] != ClassPilot)
  2134. {
  2135. // First check if the vehicle is a static vehicle (player can still use a bought plane that he bought in his house,
  2136. // as a bought vehicle isn't static)
  2137. if (AVehicleData[vid][StaticVehicle] == true)
  2138. {
  2139. // Check if the entered vehicle is a plane or helicopter vehicle
  2140. switch (GetVehicleModel(vid))
  2141. {
  2142. case VehicleShamal, VehicleNevada, VehicleStuntPlane, VehicleDodo, VehicleMaverick, VehicleCargobob:
  2143. {
  2144. // Force the player out of the vehicle
  2145. RemovePlayerFromVehicle(playerid);
  2146. // Turn off the lights and engine
  2147. GetVehicleParamsEx(vid, engine, lights, alarm, doors, bonnet, boot, objective);
  2148. SetVehicleParamsEx(vid, 0, 0, alarm, doors, bonnet, boot, objective);
  2149. // Let the player know he cannot use a cop car
  2150. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Nu poti folosi un avion / elicopter daca nu esti pilot");
  2151. }
  2152. }
  2153. }
  2154. }
  2155. }
  2156. }
  2157.  
  2158. return 1;
  2159. }
  2160. // This callback gets called whenever a player presses a key
  2161. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  2162. {
  2163. // Debug the keypresses
  2164. // DebugKeys(playerid, newkeys, oldkeys);
  2165.  
  2166. // ****************************************************************************************
  2167. // NOTE: the keys are messed up, so the code may look strange when testing for certain keys
  2168. // ****************************************************************************************
  2169.  
  2170. // Fining and jailing players when you're police and press the correct keys
  2171. // Check the class of the player
  2172. switch (APlayerData[playerid][PlayerClass])
  2173. {
  2174. case ClassPolice:
  2175. {
  2176. // If the police-player pressed the RMB key (AIM key) when OUTSIDE his vehicle
  2177. if (((newkeys & KEY_HANDBRAKE) && !(oldkeys & KEY_HANDBRAKE)) && (GetPlayerVehicleID(playerid) == 0))
  2178. Police_FineNearbyPlayers(playerid);
  2179.  
  2180. // If the police-player pressed the LCTRL (SECUNDAIRY key) key when INSIDE his vehicle
  2181. if (((newkeys & KEY_ACTION) && !(oldkeys & KEY_ACTION)) && (GetPlayerVehicleID(playerid) != 0))
  2182. Police_WarnNearbyPlayers(playerid);
  2183. }
  2184. case ClassFBY:
  2185. {
  2186. // If the police-player pressed the RMB key (AIM key) when OUTSIDE his vehicle
  2187. if (((newkeys & KEY_HANDBRAKE) && !(oldkeys & KEY_HANDBRAKE)) && (GetPlayerVehicleID(playerid) == 0))
  2188. FBY_FineNearbyPlayers(playerid);
  2189.  
  2190. // If the FBY-player pressed the LCTRL (SECUNDAIRY key) key when INSIDE his vehicle
  2191. if (((newkeys & KEY_ACTION) && !(oldkeys & KEY_ACTION)) && (GetPlayerVehicleID(playerid) != 0))
  2192. FBY_WarnNearbyPlayers(playerid);
  2193. }
  2194. case ClassAssistance:
  2195. {
  2196. // If the assistance-player pressed the RMB key (AIM key) when OUTSIDE his vehicle
  2197. if (((newkeys & KEY_HANDBRAKE) && !(oldkeys & KEY_HANDBRAKE)) && (GetPlayerVehicleID(playerid) == 0))
  2198. Assistance_FixVehicle(playerid);
  2199.  
  2200. // If the police-player pressed the LCTRL (SECUNDAIRY key) key when INSIDE his vehicle
  2201. if (((newkeys & KEY_ACTION) && !(oldkeys & KEY_ACTION)) && (GetPlayerVehicleID(playerid) != 0))
  2202. Assistance_FixOwnVehicle(playerid);
  2203. }
  2204. }
  2205.  
  2206. // Trying to attach the closest vehicle to the towtruck when the player pressed FIRE when inside a towtruck
  2207. // Check if the player is inside a towtruck
  2208. if(GetVehicleModel(GetPlayerVehicleID(playerid)) == VehicleTowTruck)
  2209. {
  2210. // Check if the player pushed the fire-key
  2211. if(newkeys & KEY_FIRE)
  2212. {
  2213. // Get the vehicle-id of the closest vehicle
  2214. new closest = GetClosestVehicle(playerid);
  2215. if(VehicleToPlayer(playerid, closest) < 10) // Check if the closest vehicle is within 10m from the player
  2216. AttachTrailerToVehicle(closest, GetPlayerVehicleID(playerid)); // Attach the vehicle to the towtruck
  2217. }
  2218. }
  2219. //Motorul de pe N
  2220. if(PRESSED(KEY_NO))
  2221. {
  2222. if(IsPlayerInAnyVehicle(playerid))
  2223. if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
  2224. {
  2225. new vehid;
  2226. vehid = GetPlayerVehicleID(playerid);
  2227. new
  2228. iEngine, iLights, iAlarm,
  2229. iDoors, iBonnet, iBoot,
  2230. iObjective;
  2231. GetVehicleParamsEx(vehid, iEngine, iLights, iAlarm, iDoors, iBonnet, iBoot, iObjective);
  2232. if(iEngine == 1) // Engine is on
  2233. {
  2234. SetVehicleParamsEx(vehid, 0, iLights, iAlarm, iDoors, iBonnet, iBoot, iObjective); // Turn it off
  2235. SendClientMessage(playerid, 0xFFFFFFFF, "[RTO]{FF0000}Ai oprit motorul");
  2236. return 1;
  2237. }
  2238. else // Engine is off
  2239. {
  2240. SetVehicleParamsEx(vehid, 1, iLights, iAlarm, iDoors, iBonnet, iBoot, iObjective); // Turn it on
  2241. SendClientMessage(playerid, 0xFFFFFFFF, "[RTO]{FF0000}Ai pornit motorul");
  2242. return 1;
  2243. }
  2244. }
  2245. }
  2246. //Porbagaj Num 6
  2247. if(PRESSED(KEY_ANALOG_RIGHT))
  2248. {
  2249. if(IsPlayerInAnyVehicle(playerid))
  2250. if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
  2251. {
  2252. new vehid;
  2253. vehid = GetPlayerVehicleID(playerid);
  2254. new
  2255. iEngine, iLights, iAlarm,
  2256. iDoors, iBonnet, iBoot,
  2257. iObjective;
  2258. GetVehicleParamsEx(vehid, iEngine, iLights, iAlarm, iDoors, iBonnet, iBoot, iObjective);
  2259. if(iBoot == 1) // porbagaj inchis
  2260. {
  2261. SetVehicleParamsEx(vehid, iEngine, iLights, iAlarm, iDoors, iBonnet, 0, iObjective); // Turn it off
  2262. SendClientMessage(playerid, 0xFFFFFFFF, "[RTO]{FF0000}Ai inchis portbajaul");
  2263. return 1;
  2264. }
  2265. else // porbagaj deschis
  2266. {
  2267. SetVehicleParamsEx(vehid, iEngine, iLights, iAlarm, iDoors, iBonnet, 1, iObjective); // Turn it on
  2268. SendClientMessage(playerid, 0xFFFFFFFF, "[RTO]{FF0000}Ai deschis portbagajul");
  2269. return 1;
  2270. }
  2271. }
  2272. }
  2273. //Capota Num 4
  2274. if(PRESSED(KEY_ANALOG_LEFT))
  2275. {
  2276. if(IsPlayerInAnyVehicle(playerid))
  2277. if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
  2278. {
  2279. new vehid;
  2280. vehid = GetPlayerVehicleID(playerid);
  2281. new
  2282. iEngine, iLights, iAlarm,
  2283. iDoors, iBonnet, iBoot,
  2284. iObjective;
  2285. GetVehicleParamsEx(vehid, iEngine, iLights, iAlarm, iDoors, iBonnet, iBoot, iObjective);
  2286. if(iBonnet == 1) // capota jos
  2287. {
  2288. SetVehicleParamsEx(vehid, iEngine, iLights, iAlarm, iDoors, 0, iBoot, iObjective); // Turn it off
  2289. SendClientMessage(playerid, 0xFFFFFFFF, "[RTO]{FF0000}Ai închis capota");
  2290. return 1;
  2291. }
  2292. else // capota sus
  2293. {
  2294. SetVehicleParamsEx(vehid, iEngine, iLights, iAlarm, iDoors, 1, iBoot, iObjective); // Turn it on
  2295. SendClientMessage(playerid, 0xFFFFFFFF, "[RTO]{FF0000}Ai deschis capota");
  2296. return 1;
  2297. }
  2298. }
  2299. }
  2300. //Faruri de pe Y
  2301. if(PRESSED(KEY_YES))
  2302. {
  2303. if(IsPlayerInAnyVehicle(playerid))
  2304. if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
  2305. {
  2306. new vehid;
  2307. vehid = GetPlayerVehicleID(playerid);
  2308. new
  2309. iEngine, iLights, iAlarm,
  2310. iDoors, iBonnet, iBoot,
  2311. iObjective;
  2312. GetVehicleParamsEx(vehid, iEngine, iLights, iAlarm, iDoors, iBonnet, iBoot, iObjective);
  2313. if(iLights == 1) // capota jos
  2314. {
  2315. SetVehicleParamsEx(vehid, iEngine, 0, iAlarm, iDoors, iBonnet, iBoot, iObjective); // Turn it off
  2316. SendClientMessage(playerid, 0xFFFFFFFF, "[RTO]{FF0000}Ai oprit farurile");
  2317. return 1;
  2318. }
  2319. else // capota sus
  2320. {
  2321. SetVehicleParamsEx(vehid, iEngine, 1, iAlarm, iDoors, iBonnet, iBoot, iObjective); // Turn it on
  2322. SendClientMessage(playerid, 0xFFFFFFFF, "[RTO]{FF0000}Ai aprins farurile");
  2323. return 1;
  2324. }
  2325. }
  2326. }
  2327. // Refuel a vehicle when driving a vehicle and pressing the HORN key
  2328. // Check if the player presses the HORN key
  2329. if ((newkeys & KEY_CROUCH) && !(oldkeys & KEY_CROUCH))
  2330. {
  2331. // Check if the player is driving a vehicle
  2332. if (GetPlayerVehicleSeat(playerid) == 0)
  2333. {
  2334. // Loop through all ARefuelPickups
  2335. for (new i; i < sizeof(ARefuelPickups); i++)
  2336. {
  2337. // Check if the player is in range of a refuelpickup
  2338. if(IsPlayerInRangeOfPoint(playerid, 2.5, ARefuelPickups[i][pux], ARefuelPickups[i][puy], ARefuelPickups[i][puz]))
  2339. {
  2340. // Show a message that the player's vehicle is refuelling
  2341. GameTextForPlayer(playerid, TXT_Refuelling, 3000, 4);
  2342. // Don't allow the player to move again (the timer will allow it after refuelling)
  2343. TogglePlayerControllable(playerid, 0);
  2344. // Start a timer (let the player wait until the vehicle is refuelled)
  2345. SetTimerEx("RefuelVehicle", 5000, false, "i", playerid);
  2346. // Stop the search
  2347. break;
  2348. }
  2349. }
  2350. }
  2351. }
  2352.  
  2353. return 1;
  2354. }
  2355. forward VehicleToPlayer(playerid,vehicleid);
  2356. // Get the distance between the vehicle and the player
  2357. public VehicleToPlayer(playerid, vehicleid)
  2358. {
  2359. // Setup local variables
  2360. new Float:pX, Float:pY, Float:pZ, Float:cX, Float:cY, Float:cZ, Float:distance;
  2361. // Get the player position
  2362. GetPlayerPos(playerid, pX, pY, pZ);
  2363. // Get the vehicle position
  2364. GetVehiclePos(vehicleid, cX, cY, cZ);
  2365. // Calculate the distance
  2366. distance = floatsqroot(floatpower(floatabs(floatsub(cX, pX)), 2) + floatpower(floatabs(floatsub(cY, pY)), 2) + floatpower(floatabs(floatsub(cZ, pZ)), 2));
  2367. // Return the distance to the calling routine
  2368. return floatround(distance);
  2369. }
  2370.  
  2371.  
  2372.  
  2373. forward GetClosestVehicle(playerid);
  2374. // Find the vehicle closest to the player
  2375. public GetClosestVehicle(playerid)
  2376. {
  2377. // Setup local variables
  2378. new Float:distance = 99999.000+1, Float:distance2, result = -1;
  2379. // Loop through all vehicles
  2380. for(new i = 0; i < MAX_VEHICLES; i++)
  2381. {
  2382. // First check if the player isn't driving the current vehicle that needs to be checked for it's distance to the player
  2383. if (GetPlayerVehicleID(playerid) != i)
  2384. {
  2385. // Get the distance between player and vehicle
  2386. distance2 = VehicleToPlayer(playerid, i);
  2387. // Check if the distance is smaller than the previous distance
  2388. if(distance2 < distance)
  2389. {
  2390. // Store the distance
  2391. distance = distance2;
  2392. // Store the vehicle-id
  2393. result = i;
  2394. }
  2395. }
  2396. }
  2397.  
  2398. // Return the vehicle-id of the closest vehicle
  2399. return result;
  2400. }
  2401. forward NitroReset();
  2402. public NitroReset()
  2403. {
  2404. for(new i = 0; i<MAX_PLAYERS; i++)
  2405. {
  2406. if(!IsPlayerInInvalidNosVehicle(i,GetPlayerVehicleID(i))) //ty @ [fackin'] luke //notice the "!"
  2407. {
  2408. new vehicle = GetPlayerVehicleID(i);
  2409. AddVehicleComponent(vehicle, 1010);
  2410. }
  2411. }
  2412. }
  2413. //-------------------------[ IsPlayerInValidNosVehicle ]-------------------------------
  2414. IsPlayerInInvalidNosVehicle(playerid,vehicleid)
  2415. {
  2416. #define MAX_INVALID_NOS_VEHICLES 29
  2417.  
  2418. new InvalidNosVehicles[MAX_INVALID_NOS_VEHICLES] =
  2419. {
  2420. 581,523,462,521,463,522,461,448,468,586,
  2421. 509,481,510,472,473,493,595,484,430,453,
  2422. 452,446,454,590,569,537,538,570,449
  2423. };
  2424.  
  2425. vehicleid = GetPlayerVehicleID(playerid);
  2426.  
  2427. if(IsPlayerInVehicle(playerid,vehicleid))
  2428. {
  2429. for(new i = 0; i < MAX_INVALID_NOS_VEHICLES; i++)
  2430. {
  2431. if(GetVehicleModel(vehicleid) == InvalidNosVehicles[i])
  2432. {
  2433. return true;
  2434. }
  2435. }
  2436. }
  2437. return false;
  2438. }
  2439. // end of it!
  2440. // This function is used to debug the key-presses
  2441. stock DebugKeys(playerid, newkeys, oldkeys)
  2442. {
  2443. // Debug keys
  2444. if ((newkeys & KEY_FIRE) && !(oldkeys & KEY_FIRE))
  2445. SendClientMessage(playerid, 0x0000FFFF, "You pressed the KEY_FIRE key");
  2446. if ((newkeys & KEY_ACTION) && !(oldkeys & KEY_ACTION))
  2447. SendClientMessage(playerid, 0x0000FFFF, "You pressed the KEY_ACTION key");
  2448. if ((newkeys & KEY_CROUCH) && !(oldkeys & KEY_CROUCH))
  2449. SendClientMessage(playerid, 0x0000FFFF, "You pressed the KEY_CROUCH key");
  2450. if ((newkeys & KEY_SPRINT) && !(oldkeys & KEY_SPRINT))
  2451. SendClientMessage(playerid, 0x0000FFFF, "You pressed the KEY_SPRINT key");
  2452. if ((newkeys & KEY_SECONDARY_ATTACK) && !(oldkeys & KEY_SECONDARY_ATTACK))
  2453. SendClientMessage(playerid, 0x0000FFFF, "You pressed the KEY_SECONDARY_ATTACK key");
  2454. if ((newkeys & KEY_JUMP) && !(oldkeys & KEY_JUMP))
  2455. SendClientMessage(playerid, 0x0000FFFF, "You pressed the KEY_JUMP key");
  2456. if ((newkeys & KEY_LOOK_RIGHT) && !(oldkeys & KEY_LOOK_RIGHT))
  2457. SendClientMessage(playerid, 0x0000FFFF, "You pressed the KEY_LOOK_RIGHT key");
  2458. if ((newkeys & KEY_HANDBRAKE) && !(oldkeys & KEY_HANDBRAKE))
  2459. SendClientMessage(playerid, 0x0000FFFF, "You pressed the KEY_HANDBRAKE key");
  2460. if ((newkeys & KEY_LOOK_LEFT) && !(oldkeys & KEY_LOOK_LEFT))
  2461. SendClientMessage(playerid, 0x0000FFFF, "You pressed the KEY_LOOK_LEFT key");
  2462. if ((newkeys & KEY_SUBMISSION) && !(oldkeys & KEY_SUBMISSION))
  2463. SendClientMessage(playerid, 0x0000FFFF, "You pressed the KEY_SUBMISSION key");
  2464. if ((newkeys & KEY_LOOK_BEHIND) && !(oldkeys & KEY_LOOK_BEHIND))
  2465. SendClientMessage(playerid, 0x0000FFFF, "You pressed the KEY_LOOK_BEHIND key");
  2466. if ((newkeys & KEY_WALK) && !(oldkeys & KEY_WALK))
  2467. SendClientMessage(playerid, 0x0000FFFF, "You pressed the KEY_WALK key");
  2468. if ((newkeys & KEY_ANALOG_UP) && !(oldkeys & KEY_ANALOG_UP))
  2469. SendClientMessage(playerid, 0x0000FFFF, "You pressed the KEY_ANALOG_UP key");
  2470. if ((newkeys & KEY_ANALOG_DOWN) && !(oldkeys & KEY_ANALOG_DOWN))
  2471. SendClientMessage(playerid, 0x0000FFFF, "You pressed the KEY_ANALOG_DOWN key");
  2472. if ((newkeys & KEY_ANALOG_LEFT) && !(oldkeys & KEY_ANALOG_LEFT))
  2473. SendClientMessage(playerid, 0x0000FFFF, "You pressed the KEY_ANALOG_LEFT key");
  2474. if ((newkeys & KEY_ANALOG_RIGHT) && !(oldkeys & KEY_ANALOG_RIGHT))
  2475. SendClientMessage(playerid, 0x0000FFFF, "You pressed the KEY_ANALOG_RIGHT key");
  2476. if ((newkeys & KEY_UP) && !(oldkeys & KEY_UP))
  2477. SendClientMessage(playerid, 0x0000FFFF, "You pressed the KEY_UP key");
  2478. if ((newkeys & KEY_DOWN) && !(oldkeys & KEY_DOWN))
  2479. SendClientMessage(playerid, 0x0000FFFF, "You pressed the KEY_DOWN key");
  2480. if ((newkeys & KEY_LEFT) && !(oldkeys & KEY_LEFT))
  2481. SendClientMessage(playerid, 0x0000FFFF, "You pressed the KEY_LEFT key");
  2482. if ((newkeys & KEY_RIGHT) && !(oldkeys & KEY_RIGHT))
  2483. SendClientMessage(playerid, 0x0000FFFF, "You pressed the KEY_RIGHT key");
  2484.  
  2485. return 1;
  2486. }
  2487. stock stringContainsIP(const szStr[])
  2488. {
  2489. new
  2490. iDots,
  2491. i
  2492. ;
  2493. while(szStr[i] != EOS)
  2494. {
  2495. if('0' <= szStr[i] <= '9')
  2496. {
  2497. do
  2498. {
  2499. if(szStr[i] == '.')
  2500. iDots++;
  2501.  
  2502. i++;
  2503. }
  2504. while(('0' <= szStr[i] <= '9') || szStr[i] == '.' || szStr[i] == ':');
  2505. }
  2506. if(iDots > 2)
  2507. return 1;
  2508. else
  2509. iDots = 0;
  2510.  
  2511. i++;
  2512. }
  2513. return 0;
  2514. }
  2515.  
  2516. stock IsVehicleEmpty(vid)
  2517. {
  2518. for(new i=0; i<MAX_PLAYERS; i++)
  2519. {
  2520. if(IsPlayerInVehicle(i, vid)) return 0;
  2521. }
  2522. return 1;
  2523. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement