Advertisement
Akila_Wijesiriwardan

server

Feb 21st, 2018
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 300.74 KB | None | 0 0
  1. //================================[INCLUDES]====================================
  2. #include <a_samp>
  3. #include <YSI\y_ini>
  4. #include <zcmd>
  5. #include <dini>
  6. #include <foreach>
  7. //================================[DEFINES]=====================================
  8. #define PRESSED(%0) \
  9. (((newkeys&(%0))==(%0)) && ((oldkeys & (%0)) != (%0)))
  10. #define PATH "/Users/%s.ini"
  11. #if defined strcpy
  12. #undef strcpy
  13. #endif
  14. #define strcpy(%0,%1,%2) %0="",strcat(%0,%2,%1)
  15. //=========================DEALERSHIP SETTINGS==================================
  16. #undef MAX_PLAYERS
  17. #define MAX_PLAYERS 100
  18. #define MAX_DVEHICLES 200
  19. #define MAX_DEALERSHIPS 10
  20. #define MAX_FUEL_STATIONS 10
  21. #define MAX_FACTIONS 8
  22. #define VEHICLE_File_PATH "DSHIP/Vehicles/"
  23. #define DEALERSHIP_File_PATH "DSHIP/Dealerships/"
  24. #define FUEL_STATION_File_PATH "DSHIP/FuelStations/"
  25. #define MAX_PLAYER_VEHICLES 3
  26. #define FUEL_PRICE 5
  27. #define GAS_CAN_PRICE 500
  28. #define ALARM_TIME 10000 // alarm duration in milliseconds (1 second = 1000 milliseconds)
  29. #define DEFAULT_NUMBER_PLATE "123 ABC"
  30. #define VEHICLE_DEALERSHIP 1
  31. #define VEHICLE_PLAYER 2
  32. #define DIALOG_NONE 12345
  33. #define DIALOG_ERROR 12346
  34. #define DIALOG_VEHICLE 500
  35. #define DIALOG_VEHICLE_BUY 501
  36. #define DIALOG_VEHICLE_SELL 502
  37. #define DIALOG_FINDVEHICLE 503
  38. #define DIALOG_TRUNK 504
  39. #define DIALOG_TRUNK_ACTION 505
  40. #define DIALOG_VEHICLE_PLATE 507
  41. #define DIALOG_FUEL 510
  42. #define DIALOG_EDITVEHICLE 606
  43. #define ShowErrorDialog(%1,%2) ShowPlayerDialog(%1, DIALOG_ERROR, DIALOG_STYLE_MSGBOX, "ERROR", %2, "OK", "")
  44. //==============================[COLORS DEFINES]================================
  45. #define ResetMoneyBar ResetPlayerMoney
  46. #define UpdateMoneyBar GivePlayerMoney
  47. #define SCM SendClientMessage
  48. #define LIGHTBLUE "{00CED1}"
  49. #define ALB "{ffffff}"
  50. #define RED "{F81414}"
  51. #define GREEN "{00FF22}"
  52. #define COLOR_GREY 0xAFAFAFAA
  53. #define COLOR_GRAD1 0xFFFFFFFF
  54. #define COLOR_NEWS 0x049C7100
  55. #define COLOR_PURPLE 0xC2A2DAAA
  56. #define COLOR_PINK 0xFF66FFAA
  57. #define COLOR_LIGHTRED 0xFF6347AA
  58. #define COLOR_BLUE 0x2641FEAA
  59. #define COLOR_FADE1 0xE6E6E6E6
  60. #define COLOR_FADE2 0xC8C8C8C8
  61. #define COLOR_FADE3 0xAAAAAAAA
  62. #define COLOR_FADE4 0x8C8C8C8C
  63. #define COLOR_YELLOW3 0xFFFF00FF
  64. #define COLOR_FADE5 0x6E6E6E6E
  65. #define COLOR_WHITE 0xFFFFFFAA
  66. #define COLOR_CHAT1 0xF9B7FFAA
  67. #define COLOR_CHAT2 0xE6A9ECAA
  68. #define COLOR_CHAT3 0xC38EC7AA
  69. #define COLOR_CHAT4 0xD2B9D3AA
  70. #define COLOR_CHAT5 0xC6AEC7AA
  71. #define COLOR_GRAD2 0xBFC0C2FF
  72. #define COLOR_YELLOW 0xFFFF00AA
  73. #define COLOR_YELLOW2 0xF5DEB3AA
  74. #define COLOR_GOLD 0xF6C861AA
  75. #define COLOR_DBLUE 0x2641FEAA
  76. #define COLOR_OOC 0xE0FFFFAA
  77. #define TEAM_GREEN_COLOR 0xFFFFFFAA
  78. #define PURPLE "{7A378B}"
  79. #define COLOR_GREEN 0x008000FF
  80. #define COLOR_LIGHTBLUE 0xADD8E6FF
  81. #define COLOR_RED 0xFF0000FF
  82. #define COLOR_LIGHTGREEN 0x9ACD32AA
  83. #define CYELLOW "{9DBD1E}"
  84. #define CORANGE "{E68C0E}"
  85. #define CBLUE "{39AACC}"
  86. #define CDGREEN "{6FA828}"
  87. #define CWHITE "{FFFFFF}"
  88. #define CRED "{FF0000}"
  89. #define COBJS1 "{D0A5D1}"
  90. #define COBJS2 "{8FC95F}"
  91. #define CSALMON "{FA8072}"
  92. #define COL_WHITE "{FFFFFF}"
  93. #define COL_RED "{F81414}"
  94. #define COL_GREEN "{00FF22}"
  95. #define COL_LIGHTBLUE "{00CED1}"
  96. //=====================================[FORWARDS]===============================
  97. forward SetPlayerSpawn(playerid);
  98. forward ShowStats(playerid,targetid);
  99. forward Payday();
  100. forward SyncTime();
  101. forward SetPlayerUnMute();
  102. forward ScoreUpdate();
  103. forward FixHour(hour);
  104. forward newbietimer();
  105. forward Unfreeze(playerid);
  106. forward SendAdminMessage(color, string[]);
  107. forward ABroadCast(color,const string[],level);
  108. forward TBroadCast(color,const string[], level);
  109. forward SendTesterMessage(color, string[]);
  110. forward RACtime(playerid);
  111. forward ClearChatboxToAll(playerid, lines);
  112. forward ClearChatboxToAll2(playerid, lines);
  113. forward OOCOff(color,const string[]);
  114. forward ProxDetectorS(Float:radi, playerid, targetid);
  115. forward ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5);
  116. forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
  117. forward split(const strsrc[], strdest[][], delimiter);
  118. forward SetOriginalColor(playerid);
  119. forward OnPlayerShootPlayer(Shooter,Target,Float:HealthLost,Float:ArmourLost);
  120. OnePlayAnim(playerid,animlib[],animname[], Float:Speed, looping, lockx, locky, lockz, lp)
  121. {
  122. ApplyAnimation(playerid, animlib, animname, Speed, looping, lockx, locky, lockz, lp);
  123. }
  124. LoopingAnim(playerid,animlib[],animname[], Float:Speed, looping, lockx, locky, lockz, lp)
  125. {
  126. ApplyAnimation(playerid, animlib, animname, Speed, looping, lockx, locky, lockz, lp);
  127. }
  128. //==================================DEALERSHIP==================================
  129. forward MainTimer();
  130. forward SaveTimer();
  131. forward StopAlarm(vehicleid);
  132. //===================================ENGINE=====================================
  133. forward StartEngine(playerid);
  134. forward DamagedEngine(playerid);
  135. new reg1[ ] = "Welcome To DC SA-MP ROLEPLAY! \nThis is a RolePlay Server.\n{FFFFFF}DeathMatch {F81414}isn't accepted {FFFFFF}only if you have a good RP reason!.\n",
  136. reg2[ ] = "When you start to play you must know the basic rules.\nFor that is the next {F81414}tutorial.\n\n",
  137. reg3[ ] = "•Cheats or Bug Abuse is forbidden, you will end up with {F81414}Ban PERMANENT.\n",
  138. reg4[ ] = "•Keep a decent {F81414}language {FFFFFF}on the server.\n",
  139. reg5[ ] = "•Spamming will lead you to {F81414}mute/kick.\n",
  140. reg6[ ] = "•DriveBy isn't allowed, only with a {F81414}good {FFFFFF}RP reason.\n",
  141. reg7[ ] = "•Remember, ALWAYS RolePlay.\n",
  142. reg8[ ] = "\n\n{F81414}This Server Create By djcabo And Nikz {F3FF02}wishes you good luck!";
  143.  
  144. // News
  145. new IsPlayerLoggedIn;
  146. new SPECIAL_ACTION_CUFFED;
  147. new NewsMoney;
  148. new TaxMoney;
  149. new TaxPercent;
  150. new Tax= 0;
  151. // Tazer
  152. new Tazer[MAX_PLAYERS];
  153. new Tazed[MAX_PLAYERS];
  154. new ReplaceTazer[MAX_PLAYERS];
  155. new TazeTimeout[MAX_PLAYERS];
  156. new TazeCountDown[MAX_PLAYERS];
  157. // Cuff
  158. new CuffTimeout[MAX_PLAYERS];
  159. new Cuffed[MAX_PLAYERS];
  160. new CuffCountDown[MAX_PLAYERS];
  161. new Uncuffed[MAX_PLAYERS];
  162. new GunsBeingRemoved[MAX_PLAYERS];
  163. // Tied
  164. new Tied[MAX_PLAYERS];
  165. // OldWeapon
  166. new OldGun[MAX_PLAYERS];
  167. new OldAmmo[MAX_PLAYERS];
  168. new TempGuns[13];
  169. new TempGunsAmmo[13];
  170. // Factions
  171. new Invited[MAX_PLAYERS];
  172. new Inviter[MAX_PLAYERS];
  173. new Faction[MAX_PLAYERS];
  174. //==================================[ENUMS]=====================================
  175. enum pInfo
  176. {
  177. pPass,
  178. pLevel,
  179. pSex,
  180. pAge,
  181. pOrigin,
  182. pPlace,
  183. pCash,
  184. pFacMod,
  185. pFacRank,
  186. pFacDiv,
  187. pFacDuty,
  188. pFac,
  189. pFacDivLeader,
  190. pFacLeader,
  191. pExp,
  192. pAdmin,
  193. pNumber,
  194. pTester,
  195. pWarns,
  196. pSelected,
  197. pMuted,
  198. pMuteTime,
  199. pFirstJoined,
  200. pModel,
  201. pVip,
  202. pWeapon[13],
  203. pWeaponAmmo[13],
  204. pSpawn,
  205. pLocked,
  206. pDriveLic,
  207. };
  208.  
  209. // Factions Settings
  210. enum facInfo
  211. {
  212. fRank0[32],
  213. fRank1[32],
  214. fRank2[32],
  215. fRank3[32],
  216. fRank4[32],
  217. fRank5[32],
  218. fRank6[32],
  219. fCars[26],
  220. fDiv1[8],
  221. fDiv2[8],
  222. fDiv3[8],
  223. fDiv4[8]
  224.  
  225. }
  226. new FacInfo[MAX_FACTIONS][facInfo];
  227.  
  228. new PlayerInfo[MAX_PLAYERS][pInfo];
  229. forward LoadUser_data(playerid,name[],value[]);
  230. public LoadUser_data(playerid,name[],value[])
  231. {
  232. INI_Int("Password",PlayerInfo[playerid][pPass]);
  233. INI_Int("Level",PlayerInfo[playerid][pLevel]);
  234. INI_Int("Cash",PlayerInfo[playerid][pCash]);
  235. INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
  236. INI_Int("Age",PlayerInfo[playerid][pAge]);
  237. INI_Int("Origin",PlayerInfo[playerid][pOrigin]);
  238. INI_Int("Sex",PlayerInfo[playerid][pSex]);
  239. INI_Int("Model",PlayerInfo[playerid][pModel]);
  240. INI_Int("DriveLic",PlayerInfo[playerid][pDriveLic]);
  241. INI_Int("Place",PlayerInfo[playerid][pPlace]);
  242. INI_Int("Exp",PlayerInfo[playerid][pExp]);
  243. INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
  244. INI_Int("Number",PlayerInfo[playerid][pNumber]);
  245. INI_Int("Tester",PlayerInfo[playerid][pTester]);
  246. INI_Int("Warns",PlayerInfo[playerid][pWarns]);
  247. INI_Int("Selected",PlayerInfo[playerid][pSelected]);
  248. INI_Int("Muted",PlayerInfo[playerid][pMuted]);
  249. INI_Int("MuteTime",PlayerInfo[playerid][pMuteTime]);
  250. INI_Int("FirstJoined",PlayerInfo[playerid][pFirstJoined]);
  251. INI_Int("Vip",PlayerInfo[playerid][pVip]);
  252. INI_Int("Spawn",PlayerInfo[playerid][pSpawn]);
  253. INI_Int("Locked",PlayerInfo[playerid][pLocked]);
  254. return 1;
  255. }
  256. stock UserPath(playerid)
  257. {
  258. new string[128],playername[MAX_PLAYER_NAME];
  259. GetPlayerName(playerid,playername,sizeof(playername));
  260. format(string,sizeof(string),PATH,playername);
  261. return string;
  262. }
  263.  
  264. stock udb_hash(buf[]) { // Credits to DracoBlue
  265. new length=strlen(buf);
  266. new s1 = 1;
  267. new s2 = 0;
  268. new n;
  269. for (n=0; n<length; n++)
  270. {
  271. s1 = (s1 + buf[n]) % 65521;
  272. s2 = (s2 + s1) % 65521;
  273. }
  274. return (s2 << 16) + s1;
  275. }
  276.  
  277. //==============================[SYMBOLS MAX_PLAYERS]===========================
  278. new gPlayerLogged[MAX_PLAYERS];
  279. new gPlayerLogTries[MAX_PLAYERS];
  280. new ntimer[MAX_PLAYERS];
  281. new PlayerNeedsHelp[MAX_PLAYERS];
  282. new Mobile[MAX_PLAYERS];
  283. new RingTone[MAX_PLAYERS];
  284. new CellTime[MAX_PLAYERS];
  285. new gPlayerRegStep[MAX_PLAYERS];
  286. new AdminDuty[MAX_PLAYERS];
  287. //========================================[DMV]=================================
  288. new dmvc;
  289. new dmvc1;
  290. new dmvc2;
  291. new CP[MAX_PLAYERS];
  292. new TakingLesson[MAX_PLAYERS];
  293. //==============================================================================
  294. new TesterDuty[MAX_PLAYERS];
  295. new gPlayerTutorialing[MAX_PLAYERS];
  296. new gOoc[MAX_PLAYERS];
  297. new BigEar[MAX_PLAYERS];
  298. new Text:Textdraw98[MAX_PLAYERS];
  299. //==================================[SYMBOLS AMMOUNT]===========================
  300. new Menu:Paper;
  301. new Menu:Paper2;
  302. new levelcost = 25000;
  303. new noooc = 1;
  304. new realchat = 1;
  305. new levelexp = 4;
  306. new ghour = 0;
  307. new gminute = 0;
  308. new gsecond = 0;
  309. new realtime = 1;
  310. new timeshift = -1;
  311. new ScoreOld;
  312. new shifthour;
  313. //=========================================DEALERSHIP=================================================================
  314. new SaveVehicleIndex;
  315. new RefuelTime[MAX_PLAYERS];
  316. new TrackCar[MAX_PLAYERS];
  317. new Float:Fuel[MAX_VEHICLES] = {100.0, ...};
  318. new VehicleSecurity[MAX_VEHICLES];
  319. new VehicleCreated[MAX_DVEHICLES];
  320. new VehicleID[MAX_DVEHICLES];
  321. new VehicleModel[MAX_DVEHICLES];
  322. new Float:VehiclePos[MAX_DVEHICLES][4];
  323. new VehicleColor[MAX_DVEHICLES][2];
  324. new VehicleInterior[MAX_DVEHICLES];
  325. new VehicleWorld[MAX_DVEHICLES];
  326. new VehicleOwner[MAX_DVEHICLES][MAX_PLAYER_NAME];
  327. new VehicleNumberPlate[MAX_DVEHICLES][16];
  328. new VehicleValue[MAX_DVEHICLES];
  329. new VehicleTrunk[MAX_DVEHICLES][5][2];
  330. new VehicleMods[MAX_DVEHICLES][14];
  331. new VehiclePaintjob[MAX_DVEHICLES] = {255, ...};
  332. new Text3D:VehicleLabel[MAX_DVEHICLES];
  333. new DealershipCreated[MAX_DEALERSHIPS];
  334. new Float:DealershipPos[MAX_DEALERSHIPS][3];
  335. new Text3D:DealershipLabel[MAX_DEALERSHIPS];
  336. new FuelStationCreated[MAX_FUEL_STATIONS];
  337. new Float:FuelStationPos[MAX_FUEL_STATIONS][3];
  338. new Text3D:FuelStationLabel[MAX_FUEL_STATIONS];
  339. new VehicleNames[][] = {
  340. "Landstalker","Bravura","Buffalo","Linerunner","Perennial","Sentinel","Dumper","Firetruck","Trashmaster","Stretch","Manana","Infernus",
  341. "Voodoo","Pony","Mule","Cheetah","Ambulance","Leviathan","Moonbeam","Esperanto","Taxi","Washington","Bobcat","Mr Whoopee","BF Injection",
  342. "Hunter","Premier","Enforcer","Securicar","Banshee","Predator","Bus","Rhino","Barracks","Hotknife","Trailer","Previon","Coach","Cabbie",
  343. "Stallion","Rumpo","RC Bandit","Romero","Packer","Monster","Admiral","Squalo","Seasparrow","Pizzaboy","Tram","Trailer","Turismo","Speeder",
  344. "Reefer","Tropic","Flatbed","Yankee","Caddy","Solair","Berkley's RC Van","Skimmer","PCJ-600","Faggio","Freeway","RC Baron","RC Raider",
  345. "Glendale","Oceanic","Sanchez","Sparrow","Patriot","Quad","Coastguard","Dinghy","Hermes","Sabre","Rustler","ZR3 50","Walton","Regina",
  346. "Comet","BMX","Burrito","Camper","Marquis","Baggage","Dozer","Maverick","News Chopper","Rancher","FBI Rancher","Virgo","Greenwood",
  347. "Jetmax","Hotring","Sandking","Blista Compact","Police Maverick","Boxville","Benson","Mesa","RC Goblin","Hotring Racer A","Hotring Racer B",
  348. "Bloodring Banger","Rancher","Super GT","Elegant","Journey","Bike","Mountain Bike","Beagle","Cropdust","Stunt","Tanker","RoadTrain",
  349. "Nebula","Majestic","Buccaneer","Shamal","Hydra","FCR-900","NRG-500","HPV1000","Cement Truck","Tow Truck","Fortune","Cadrona","FBI Truck",
  350. "Willard","Forklift","Tractor","Combine","Feltzer","Remington","Slamvan","Blade","Freight","Streak","Vortex","Vincent","Bullet","Clover",
  351. "Sadler","Firetruck","Hustler","Intruder","Primo","Cargobob","Tampa","Sunrise","Merit","Utility","Nevada","Yosemite","Windsor","Monster A",
  352. "Monster B","Uranus","Jester","Sultan","Stratum","Elegy","Raindance","RC Tiger","Flash","Tahoma","Savanna","Bandito","Freight","Trailer",
  353. "Kart","Mower","Duneride","Sweeper","Broadway","Tornado","AT-400","DFT-30","Huntley","Stafford","BF-400","Newsvan","Tug","Trailer A","Emperor",
  354. "Wayfarer","Euros","Hotdog","Club","Trailer B","Trailer C","Andromada","Dodo","RC Cam","Launch","Police Car (LSPD)","Police Car (SFPD)",
  355. "Police Car (LVPD)","Police Ranger","Picador","S.W.A.T. Van","Alpha","Phoenix","Glendale","Sadler","Luggage Trailer A","Luggage Trailer B",
  356. "Stair Trailer","Boxville","Farm Plow","Utility Trailer"
  357. };
  358. enum MainZone
  359. {
  360. Zone_Name[28],
  361. Float:Zone_Area[6]
  362. }
  363.  
  364. static const SanAndreasZones[][MainZone] = {
  365.  
  366. {"The Big Ear", {-410.00,1403.30,-3.00,-137.90,1681.20,200.00}},
  367. {"Aldea Malvada", {-1372.10,2498.50,0.00,-1277.50,2615.30,200.00}},
  368. {"Angel Pine", {-2324.90,-2584.20,-6.10,-1964.20,-2212.10,200.00}},
  369. {"Arco del Oeste", {-901.10,2221.80,0.00,-592.00,2571.90,200.00}},
  370. {"Avispa Country Club", {-2646.40,-355.40,0.00,-2270.00,-222.50,200.00}},
  371. {"Avispa Country Club", {-2831.80,-430.20,-6.10,-2646.40,-222.50,200.00}},
  372. {"Avispa Country Club", {-2361.50,-417.10,0.00,-2270.00,-355.40,200.00}},
  373. {"Avispa Country Club", {-2667.80,-302.10,-28.80,-2646.40,-262.30,71.10}},
  374. {"Avispa Country Club", {-2470.00,-355.40,0.00,-2270.00,-318.40,46.10}},
  375. {"Avispa Country Club", {-2550.00,-355.40,0.00,-2470.00,-318.40,39.70}},
  376. {"Back o Beyond", {-1166.90,-2641.10,0.00,-321.70,-1856.00,200.00}},
  377. {"Battery Point", {-2741.00,1268.40,-4.50,-2533.00,1490.40,200.00}},
  378. {"Bayside", {-2741.00,2175.10,0.00,-2353.10,2722.70,200.00}},
  379. {"Bayside Marina", {-2353.10,2275.70,0.00,-2153.10,2475.70,200.00}},
  380. {"Beacon Hill", {-399.60,-1075.50,-1.40,-319.00,-977.50,198.50}},
  381. {"Blackfield", {964.30,1203.20,-89.00,1197.30,1403.20,110.90}},
  382. {"Blackfield", {964.30,1403.20,-89.00,1197.30,1726.20,110.90}},
  383. {"Blackfield Chapel", {1375.60,596.30,-89.00,1558.00,823.20,110.90}},
  384. {"Blackfield Chapel", {1325.60,596.30,-89.00,1375.60,795.00,110.90}},
  385. {"Blackfield Intersection", {1197.30,1044.60,-89.00,1277.00,1163.30,110.90}},
  386. {"Blackfield Intersection", {1166.50,795.00,-89.00,1375.60,1044.60,110.90}},
  387. {"Blackfield Intersection", {1277.00,1044.60,-89.00,1315.30,1087.60,110.90}},
  388. {"Blackfield Intersection", {1375.60,823.20,-89.00,1457.30,919.40,110.90}},
  389. {"Blueberry", {104.50,-220.10,2.30,349.60,152.20,200.00}},
  390. {"Blueberry", {19.60,-404.10,3.80,349.60,-220.10,200.00}},
  391. {"Blueberry Acres", {-319.60,-220.10,0.00,104.50,293.30,200.00}},
  392. {"Caligula's Palace", {2087.30,1543.20,-89.00,2437.30,1703.20,110.90}},
  393. {"Caligula's Palace", {2137.40,1703.20,-89.00,2437.30,1783.20,110.90}},
  394. {"Calton Heights", {-2274.10,744.10,-6.10,-1982.30,1358.90,200.00}},
  395. {"Chinatown", {-2274.10,578.30,-7.60,-2078.60,744.10,200.00}},
  396. {"City Hall", {-2867.80,277.40,-9.10,-2593.40,458.40,200.00}},
  397. {"Come-A-Lot", {2087.30,943.20,-89.00,2623.10,1203.20,110.90}},
  398. {"Commerce", {1323.90,-1842.20,-89.00,1701.90,-1722.20,110.90}},
  399. {"Commerce", {1323.90,-1722.20,-89.00,1440.90,-1577.50,110.90}},
  400. {"Commerce", {1370.80,-1577.50,-89.00,1463.90,-1384.90,110.90}},
  401. {"Commerce", {1463.90,-1577.50,-89.00,1667.90,-1430.80,110.90}},
  402. {"Commerce", {1583.50,-1722.20,-89.00,1758.90,-1577.50,110.90}},
  403. {"Commerce", {1667.90,-1577.50,-89.00,1812.60,-1430.80,110.90}},
  404. {"Conference Center", {1046.10,-1804.20,-89.00,1323.90,-1722.20,110.90}},
  405. {"Conference Center", {1073.20,-1842.20,-89.00,1323.90,-1804.20,110.90}},
  406. {"Cranberry Station", {-2007.80,56.30,0.00,-1922.00,224.70,100.00}},
  407. {"Creek", {2749.90,1937.20,-89.00,2921.60,2669.70,110.90}},
  408. {"Dillimore", {580.70,-674.80,-9.50,861.00,-404.70,200.00}},
  409. {"Doherty", {-2270.00,-324.10,-0.00,-1794.90,-222.50,200.00}},
  410. {"Doherty", {-2173.00,-222.50,-0.00,-1794.90,265.20,200.00}},
  411. {"Downtown", {-1982.30,744.10,-6.10,-1871.70,1274.20,200.00}},
  412. {"Downtown", {-1871.70,1176.40,-4.50,-1620.30,1274.20,200.00}},
  413. {"Downtown", {-1700.00,744.20,-6.10,-1580.00,1176.50,200.00}},
  414. {"Downtown", {-1580.00,744.20,-6.10,-1499.80,1025.90,200.00}},
  415. {"Downtown", {-2078.60,578.30,-7.60,-1499.80,744.20,200.00}},
  416. {"Downtown", {-1993.20,265.20,-9.10,-1794.90,578.30,200.00}},
  417. {"Downtown Los Santos", {1463.90,-1430.80,-89.00,1724.70,-1290.80,110.90}},
  418. {"Downtown Los Santos", {1724.70,-1430.80,-89.00,1812.60,-1250.90,110.90}},
  419. {"Downtown Los Santos", {1463.90,-1290.80,-89.00,1724.70,-1150.80,110.90}},
  420. {"Downtown Los Santos", {1370.80,-1384.90,-89.00,1463.90,-1170.80,110.90}},
  421. {"Downtown Los Santos", {1724.70,-1250.90,-89.00,1812.60,-1150.80,110.90}},
  422. {"Downtown Los Santos", {1370.80,-1170.80,-89.00,1463.90,-1130.80,110.90}},
  423. {"Downtown Los Santos", {1378.30,-1130.80,-89.00,1463.90,-1026.30,110.90}},
  424. {"Downtown Los Santos", {1391.00,-1026.30,-89.00,1463.90,-926.90,110.90}},
  425. {"Downtown Los Santos", {1507.50,-1385.20,110.90,1582.50,-1325.30,335.90}},
  426. {"East Beach", {2632.80,-1852.80,-89.00,2959.30,-1668.10,110.90}},
  427. {"East Beach", {2632.80,-1668.10,-89.00,2747.70,-1393.40,110.90}},
  428. {"East Beach", {2747.70,-1668.10,-89.00,2959.30,-1498.60,110.90}},
  429. {"East Beach", {2747.70,-1498.60,-89.00,2959.30,-1120.00,110.90}},
  430. {"East Los Santos", {2421.00,-1628.50,-89.00,2632.80,-1454.30,110.90}},
  431. {"East Los Santos", {2222.50,-1628.50,-89.00,2421.00,-1494.00,110.90}},
  432. {"East Los Santos", {2266.20,-1494.00,-89.00,2381.60,-1372.00,110.90}},
  433. {"East Los Santos", {2381.60,-1494.00,-89.00,2421.00,-1454.30,110.90}},
  434. {"East Los Santos", {2281.40,-1372.00,-89.00,2381.60,-1135.00,110.90}},
  435. {"East Los Santos", {2381.60,-1454.30,-89.00,2462.10,-1135.00,110.90}},
  436. {"East Los Santos", {2462.10,-1454.30,-89.00,2581.70,-1135.00,110.90}},
  437. {"Easter Basin", {-1794.90,249.90,-9.10,-1242.90,578.30,200.00}},
  438. {"Easter Basin", {-1794.90,-50.00,-0.00,-1499.80,249.90,200.00}},
  439. {"Easter Bay Airport", {-1499.80,-50.00,-0.00,-1242.90,249.90,200.00}},
  440. {"Easter Bay Airport", {-1794.90,-730.10,-3.00,-1213.90,-50.00,200.00}},
  441. {"Easter Bay Airport", {-1213.90,-730.10,0.00,-1132.80,-50.00,200.00}},
  442. {"Easter Bay Airport", {-1242.90,-50.00,0.00,-1213.90,578.30,200.00}},
  443. {"Easter Bay Airport", {-1213.90,-50.00,-4.50,-947.90,578.30,200.00}},
  444. {"Easter Bay Airport", {-1315.40,-405.30,15.40,-1264.40,-209.50,25.40}},
  445. {"Easter Bay Airport", {-1354.30,-287.30,15.40,-1315.40,-209.50,25.40}},
  446. {"Easter Bay Airport", {-1490.30,-209.50,15.40,-1264.40,-148.30,25.40}},
  447. {"Easter Bay Chemicals", {-1132.80,-768.00,0.00,-956.40,-578.10,200.00}},
  448. {"Easter Bay Chemicals", {-1132.80,-787.30,0.00,-956.40,-768.00,200.00}},
  449. {"El Castillo del Diablo", {-464.50,2217.60,0.00,-208.50,2580.30,200.00}},
  450. {"El Castillo del Diablo", {-208.50,2123.00,-7.60,114.00,2337.10,200.00}},
  451. {"El Castillo del Diablo", {-208.50,2337.10,0.00,8.40,2487.10,200.00}},
  452. {"El Corona", {1812.60,-2179.20,-89.00,1970.60,-1852.80,110.90}},
  453. {"El Corona", {1692.60,-2179.20,-89.00,1812.60,-1842.20,110.90}},
  454. {"El Quebrados", {-1645.20,2498.50,0.00,-1372.10,2777.80,200.00}},
  455. {"Esplanade East", {-1620.30,1176.50,-4.50,-1580.00,1274.20,200.00}},
  456. {"Esplanade East", {-1580.00,1025.90,-6.10,-1499.80,1274.20,200.00}},
  457. {"Esplanade East", {-1499.80,578.30,-79.60,-1339.80,1274.20,20.30}},
  458. {"Esplanade North", {-2533.00,1358.90,-4.50,-1996.60,1501.20,200.00}},
  459. {"Esplanade North", {-1996.60,1358.90,-4.50,-1524.20,1592.50,200.00}},
  460. {"Esplanade North", {-1982.30,1274.20,-4.50,-1524.20,1358.90,200.00}},
  461. {"Fallen Tree", {-792.20,-698.50,-5.30,-452.40,-380.00,200.00}},
  462. {"Fallow Bridge", {434.30,366.50,0.00,603.00,555.60,200.00}},
  463. {"Fern Ridge", {508.10,-139.20,0.00,1306.60,119.50,200.00}},
  464. {"Financial", {-1871.70,744.10,-6.10,-1701.30,1176.40,300.00}},
  465. {"Fisher's Lagoon", {1916.90,-233.30,-100.00,2131.70,13.80,200.00}},
  466. {"Flint Intersection", {-187.70,-1596.70,-89.00,17.00,-1276.60,110.90}},
  467. {"Flint Range", {-594.10,-1648.50,0.00,-187.70,-1276.60,200.00}},
  468. {"Fort Carson", {-376.20,826.30,-3.00,123.70,1220.40,200.00}},
  469. {"Foster Valley", {-2270.00,-430.20,-0.00,-2178.60,-324.10,200.00}},
  470. {"Foster Valley", {-2178.60,-599.80,-0.00,-1794.90,-324.10,200.00}},
  471. {"Foster Valley", {-2178.60,-1115.50,0.00,-1794.90,-599.80,200.00}},
  472. {"Foster Valley", {-2178.60,-1250.90,0.00,-1794.90,-1115.50,200.00}},
  473. {"Frederick Bridge", {2759.20,296.50,0.00,2774.20,594.70,200.00}},
  474. {"Gant Bridge", {-2741.40,1659.60,-6.10,-2616.40,2175.10,200.00}},
  475. {"Gant Bridge", {-2741.00,1490.40,-6.10,-2616.40,1659.60,200.00}},
  476. {"Ganton", {2222.50,-1852.80,-89.00,2632.80,-1722.30,110.90}},
  477. {"Ganton", {2222.50,-1722.30,-89.00,2632.80,-1628.50,110.90}},
  478. {"Garcia", {-2411.20,-222.50,-0.00,-2173.00,265.20,200.00}},
  479. {"Garcia", {-2395.10,-222.50,-5.30,-2354.00,-204.70,200.00}},
  480. {"Garver Bridge", {-1339.80,828.10,-89.00,-1213.90,1057.00,110.90}},
  481. {"Garver Bridge", {-1213.90,950.00,-89.00,-1087.90,1178.90,110.90}},
  482. {"Garver Bridge", {-1499.80,696.40,-179.60,-1339.80,925.30,20.30}},
  483. {"Glen Park", {1812.60,-1449.60,-89.00,1996.90,-1350.70,110.90}},
  484. {"Glen Park", {1812.60,-1100.80,-89.00,1994.30,-973.30,110.90}},
  485. {"Glen Park", {1812.60,-1350.70,-89.00,2056.80,-1100.80,110.90}},
  486. {"Green Palms", {176.50,1305.40,-3.00,338.60,1520.70,200.00}},
  487. {"Greenglass College", {964.30,1044.60,-89.00,1197.30,1203.20,110.90}},
  488. {"Greenglass College", {964.30,930.80,-89.00,1166.50,1044.60,110.90}},
  489. {"Hampton Barns", {603.00,264.30,0.00,761.90,366.50,200.00}},
  490. {"Hankypanky Point", {2576.90,62.10,0.00,2759.20,385.50,200.00}},
  491. {"Harry Gold Parkway", {1777.30,863.20,-89.00,1817.30,2342.80,110.90}},
  492. {"Hashbury", {-2593.40,-222.50,-0.00,-2411.20,54.70,200.00}},
  493. {"Hilltop Farm", {967.30,-450.30,-3.00,1176.70,-217.90,200.00}},
  494. {"Hunter Quarry", {337.20,710.80,-115.20,860.50,1031.70,203.70}},
  495. {"Idlewood", {1812.60,-1852.80,-89.00,1971.60,-1742.30,110.90}},
  496. {"Idlewood", {1812.60,-1742.30,-89.00,1951.60,-1602.30,110.90}},
  497. {"Idlewood", {1951.60,-1742.30,-89.00,2124.60,-1602.30,110.90}},
  498. {"Idlewood", {1812.60,-1602.30,-89.00,2124.60,-1449.60,110.90}},
  499. {"Idlewood", {2124.60,-1742.30,-89.00,2222.50,-1494.00,110.90}},
  500. {"Idlewood", {1971.60,-1852.80,-89.00,2222.50,-1742.30,110.90}},
  501. {"Jefferson", {1996.90,-1449.60,-89.00,2056.80,-1350.70,110.90}},
  502. {"Jefferson", {2124.60,-1494.00,-89.00,2266.20,-1449.60,110.90}},
  503. {"Jefferson", {2056.80,-1372.00,-89.00,2281.40,-1210.70,110.90}},
  504. {"Jefferson", {2056.80,-1210.70,-89.00,2185.30,-1126.30,110.90}},
  505. {"Jefferson", {2185.30,-1210.70,-89.00,2281.40,-1154.50,110.90}},
  506. {"Jefferson", {2056.80,-1449.60,-89.00,2266.20,-1372.00,110.90}},
  507. {"Julius Thruway East", {2623.10,943.20,-89.00,2749.90,1055.90,110.90}},
  508. {"Julius Thruway East", {2685.10,1055.90,-89.00,2749.90,2626.50,110.90}},
  509. {"Julius Thruway East", {2536.40,2442.50,-89.00,2685.10,2542.50,110.90}},
  510. {"Julius Thruway East", {2625.10,2202.70,-89.00,2685.10,2442.50,110.90}},
  511. {"Julius Thruway North", {2498.20,2542.50,-89.00,2685.10,2626.50,110.90}},
  512. {"Julius Thruway North", {2237.40,2542.50,-89.00,2498.20,2663.10,110.90}},
  513. {"Julius Thruway North", {2121.40,2508.20,-89.00,2237.40,2663.10,110.90}},
  514. {"Julius Thruway North", {1938.80,2508.20,-89.00,2121.40,2624.20,110.90}},
  515. {"Julius Thruway North", {1534.50,2433.20,-89.00,1848.40,2583.20,110.90}},
  516. {"Julius Thruway North", {1848.40,2478.40,-89.00,1938.80,2553.40,110.90}},
  517. {"Julius Thruway North", {1704.50,2342.80,-89.00,1848.40,2433.20,110.90}},
  518. {"Julius Thruway North", {1377.30,2433.20,-89.00,1534.50,2507.20,110.90}},
  519. {"Julius Thruway South", {1457.30,823.20,-89.00,2377.30,863.20,110.90}},
  520. {"Julius Thruway South", {2377.30,788.80,-89.00,2537.30,897.90,110.90}},
  521. {"Julius Thruway West", {1197.30,1163.30,-89.00,1236.60,2243.20,110.90}},
  522. {"Julius Thruway West", {1236.60,2142.80,-89.00,1297.40,2243.20,110.90}},
  523. {"Juniper Hill", {-2533.00,578.30,-7.60,-2274.10,968.30,200.00}},
  524. {"Juniper Hollow", {-2533.00,968.30,-6.10,-2274.10,1358.90,200.00}},
  525. {"K.A.C.C. Military Fuels", {2498.20,2626.50,-89.00,2749.90,2861.50,110.90}},
  526. {"Kincaid Bridge", {-1339.80,599.20,-89.00,-1213.90,828.10,110.90}},
  527. {"Kincaid Bridge", {-1213.90,721.10,-89.00,-1087.90,950.00,110.90}},
  528. {"Kincaid Bridge", {-1087.90,855.30,-89.00,-961.90,986.20,110.90}},
  529. {"King's", {-2329.30,458.40,-7.60,-1993.20,578.30,200.00}},
  530. {"King's", {-2411.20,265.20,-9.10,-1993.20,373.50,200.00}},
  531. {"King's", {-2253.50,373.50,-9.10,-1993.20,458.40,200.00}},
  532. {"LVA Freight Depot", {1457.30,863.20,-89.00,1777.40,1143.20,110.90}},
  533. {"LVA Freight Depot", {1375.60,919.40,-89.00,1457.30,1203.20,110.90}},
  534. {"LVA Freight Depot", {1277.00,1087.60,-89.00,1375.60,1203.20,110.90}},
  535. {"LVA Freight Depot", {1315.30,1044.60,-89.00,1375.60,1087.60,110.90}},
  536. {"LVA Freight Depot", {1236.60,1163.40,-89.00,1277.00,1203.20,110.90}},
  537. {"Las Barrancas", {-926.10,1398.70,-3.00,-719.20,1634.60,200.00}},
  538. {"Las Brujas", {-365.10,2123.00,-3.00,-208.50,2217.60,200.00}},
  539. {"Las Colinas", {1994.30,-1100.80,-89.00,2056.80,-920.80,110.90}},
  540. {"Las Colinas", {2056.80,-1126.30,-89.00,2126.80,-920.80,110.90}},
  541. {"Las Colinas", {2185.30,-1154.50,-89.00,2281.40,-934.40,110.90}},
  542. {"Las Colinas", {2126.80,-1126.30,-89.00,2185.30,-934.40,110.90}},
  543. {"Las Colinas", {2747.70,-1120.00,-89.00,2959.30,-945.00,110.90}},
  544. {"Las Colinas", {2632.70,-1135.00,-89.00,2747.70,-945.00,110.90}},
  545. {"Las Colinas", {2281.40,-1135.00,-89.00,2632.70,-945.00,110.90}},
  546. {"Las Payasadas", {-354.30,2580.30,2.00,-133.60,2816.80,200.00}},
  547. {"Las Venturas Airport", {1236.60,1203.20,-89.00,1457.30,1883.10,110.90}},
  548. {"Las Venturas Airport", {1457.30,1203.20,-89.00,1777.30,1883.10,110.90}},
  549. {"Las Venturas Airport", {1457.30,1143.20,-89.00,1777.40,1203.20,110.90}},
  550. {"Las Venturas Airport", {1515.80,1586.40,-12.50,1729.90,1714.50,87.50}},
  551. {"Last Dime Motel", {1823.00,596.30,-89.00,1997.20,823.20,110.90}},
  552. {"Leafy Hollow", {-1166.90,-1856.00,0.00,-815.60,-1602.00,200.00}},
  553. {"Liberty City", {-1000.00,400.00,1300.00,-700.00,600.00,1400.00}},
  554. {"Lil' Probe Inn", {-90.20,1286.80,-3.00,153.80,1554.10,200.00}},
  555. {"Linden Side", {2749.90,943.20,-89.00,2923.30,1198.90,110.90}},
  556. {"Linden Station", {2749.90,1198.90,-89.00,2923.30,1548.90,110.90}},
  557. {"Linden Station", {2811.20,1229.50,-39.50,2861.20,1407.50,60.40}},
  558. {"Little Mexico", {1701.90,-1842.20,-89.00,1812.60,-1722.20,110.90}},
  559. {"Little Mexico", {1758.90,-1722.20,-89.00,1812.60,-1577.50,110.90}},
  560. {"Los Flores", {2581.70,-1454.30,-89.00,2632.80,-1393.40,110.90}},
  561. {"Los Flores", {2581.70,-1393.40,-89.00,2747.70,-1135.00,110.90}},
  562. {"Los Santos International", {1249.60,-2394.30,-89.00,1852.00,-2179.20,110.90}},
  563. {"Los Santos International", {1852.00,-2394.30,-89.00,2089.00,-2179.20,110.90}},
  564. {"Los Santos International", {1382.70,-2730.80,-89.00,2201.80,-2394.30,110.90}},
  565. {"Los Santos International", {1974.60,-2394.30,-39.00,2089.00,-2256.50,60.90}},
  566. {"Los Santos International", {1400.90,-2669.20,-39.00,2189.80,-2597.20,60.90}},
  567. {"Los Santos International", {2051.60,-2597.20,-39.00,2152.40,-2394.30,60.90}},
  568. {"Marina", {647.70,-1804.20,-89.00,851.40,-1577.50,110.90}},
  569. {"Marina", {647.70,-1577.50,-89.00,807.90,-1416.20,110.90}},
  570. {"Marina", {807.90,-1577.50,-89.00,926.90,-1416.20,110.90}},
  571. {"Market", {787.40,-1416.20,-89.00,1072.60,-1310.20,110.90}},
  572. {"Market", {952.60,-1310.20,-89.00,1072.60,-1130.80,110.90}},
  573. {"Market", {1072.60,-1416.20,-89.00,1370.80,-1130.80,110.90}},
  574. {"Market", {926.90,-1577.50,-89.00,1370.80,-1416.20,110.90}},
  575. {"Market Station", {787.40,-1410.90,-34.10,866.00,-1310.20,65.80}},
  576. {"Martin Bridge", {-222.10,293.30,0.00,-122.10,476.40,200.00}},
  577. {"Missionary Hill", {-2994.40,-811.20,0.00,-2178.60,-430.20,200.00}},
  578. {"Montgomery", {1119.50,119.50,-3.00,1451.40,493.30,200.00}},
  579. {"Montgomery", {1451.40,347.40,-6.10,1582.40,420.80,200.00}},
  580. {"Montgomery Intersection", {1546.60,208.10,0.00,1745.80,347.40,200.00}},
  581. {"Montgomery Intersection", {1582.40,347.40,0.00,1664.60,401.70,200.00}},
  582. {"Mulholland", {1414.00,-768.00,-89.00,1667.60,-452.40,110.90}},
  583. {"Mulholland", {1281.10,-452.40,-89.00,1641.10,-290.90,110.90}},
  584. {"Mulholland", {1269.10,-768.00,-89.00,1414.00,-452.40,110.90}},
  585. {"Mulholland", {1357.00,-926.90,-89.00,1463.90,-768.00,110.90}},
  586. {"Mulholland", {1318.10,-910.10,-89.00,1357.00,-768.00,110.90}},
  587. {"Mulholland", {1169.10,-910.10,-89.00,1318.10,-768.00,110.90}},
  588. {"Mulholland", {768.60,-954.60,-89.00,952.60,-860.60,110.90}},
  589. {"Mulholland", {687.80,-860.60,-89.00,911.80,-768.00,110.90}},
  590. {"Mulholland", {737.50,-768.00,-89.00,1142.20,-674.80,110.90}},
  591. {"Mulholland", {1096.40,-910.10,-89.00,1169.10,-768.00,110.90}},
  592. {"Mulholland", {952.60,-937.10,-89.00,1096.40,-860.60,110.90}},
  593. {"Mulholland", {911.80,-860.60,-89.00,1096.40,-768.00,110.90}},
  594. {"Mulholland", {861.00,-674.80,-89.00,1156.50,-600.80,110.90}},
  595. {"Mulholland Intersection", {1463.90,-1150.80,-89.00,1812.60,-768.00,110.90}},
  596. {"North Rock", {2285.30,-768.00,0.00,2770.50,-269.70,200.00}},
  597. {"Ocean Docks", {2373.70,-2697.00,-89.00,2809.20,-2330.40,110.90}},
  598. {"Ocean Docks", {2201.80,-2418.30,-89.00,2324.00,-2095.00,110.90}},
  599. {"Ocean Docks", {2324.00,-2302.30,-89.00,2703.50,-2145.10,110.90}},
  600. {"Ocean Docks", {2089.00,-2394.30,-89.00,2201.80,-2235.80,110.90}},
  601. {"Ocean Docks", {2201.80,-2730.80,-89.00,2324.00,-2418.30,110.90}},
  602. {"Ocean Docks", {2703.50,-2302.30,-89.00,2959.30,-2126.90,110.90}},
  603. {"Ocean Docks", {2324.00,-2145.10,-89.00,2703.50,-2059.20,110.90}},
  604. {"Ocean Flats", {-2994.40,277.40,-9.10,-2867.80,458.40,200.00}},
  605. {"Ocean Flats", {-2994.40,-222.50,-0.00,-2593.40,277.40,200.00}},
  606. {"Ocean Flats", {-2994.40,-430.20,-0.00,-2831.80,-222.50,200.00}},
  607. {"Octane Springs", {338.60,1228.50,0.00,664.30,1655.00,200.00}},
  608. {"Old Venturas Strip", {2162.30,2012.10,-89.00,2685.10,2202.70,110.90}},
  609. {"Palisades", {-2994.40,458.40,-6.10,-2741.00,1339.60,200.00}},
  610. {"Palomino Creek", {2160.20,-149.00,0.00,2576.90,228.30,200.00}},
  611. {"Paradiso", {-2741.00,793.40,-6.10,-2533.00,1268.40,200.00}},
  612. {"Pershing Square", {1440.90,-1722.20,-89.00,1583.50,-1577.50,110.90}},
  613. {"Pilgrim", {2437.30,1383.20,-89.00,2624.40,1783.20,110.90}},
  614. {"Pilgrim", {2624.40,1383.20,-89.00,2685.10,1783.20,110.90}},
  615. {"Pilson Intersection", {1098.30,2243.20,-89.00,1377.30,2507.20,110.90}},
  616. {"Pirates in Men's Pants", {1817.30,1469.20,-89.00,2027.40,1703.20,110.90}},
  617. {"Playa del Seville", {2703.50,-2126.90,-89.00,2959.30,-1852.80,110.90}},
  618. {"Prickle Pine", {1534.50,2583.20,-89.00,1848.40,2863.20,110.90}},
  619. {"Prickle Pine", {1117.40,2507.20,-89.00,1534.50,2723.20,110.90}},
  620. {"Prickle Pine", {1848.40,2553.40,-89.00,1938.80,2863.20,110.90}},
  621. {"Prickle Pine", {1938.80,2624.20,-89.00,2121.40,2861.50,110.90}},
  622. {"Queens", {-2533.00,458.40,0.00,-2329.30,578.30,200.00}},
  623. {"Queens", {-2593.40,54.70,0.00,-2411.20,458.40,200.00}},
  624. {"Queens", {-2411.20,373.50,0.00,-2253.50,458.40,200.00}},
  625. {"Randolph Industrial", {1558.00,596.30,-89.00,1823.00,823.20,110.90}},
  626. {"Redsands East", {1817.30,2011.80,-89.00,2106.70,2202.70,110.90}},
  627. {"Redsands East", {1817.30,2202.70,-89.00,2011.90,2342.80,110.90}},
  628. {"Redsands East", {1848.40,2342.80,-89.00,2011.90,2478.40,110.90}},
  629. {"Redsands West", {1236.60,1883.10,-89.00,1777.30,2142.80,110.90}},
  630. {"Redsands West", {1297.40,2142.80,-89.00,1777.30,2243.20,110.90}},
  631. {"Redsands West", {1377.30,2243.20,-89.00,1704.50,2433.20,110.90}},
  632. {"Redsands West", {1704.50,2243.20,-89.00,1777.30,2342.80,110.90}},
  633. {"Regular Tom", {-405.70,1712.80,-3.00,-276.70,1892.70,200.00}},
  634. {"Richman", {647.50,-1118.20,-89.00,787.40,-954.60,110.90}},
  635. {"Richman", {647.50,-954.60,-89.00,768.60,-860.60,110.90}},
  636. {"Richman", {225.10,-1369.60,-89.00,334.50,-1292.00,110.90}},
  637. {"Richman", {225.10,-1292.00,-89.00,466.20,-1235.00,110.90}},
  638. {"Richman", {72.60,-1404.90,-89.00,225.10,-1235.00,110.90}},
  639. {"Richman", {72.60,-1235.00,-89.00,321.30,-1008.10,110.90}},
  640. {"Richman", {321.30,-1235.00,-89.00,647.50,-1044.00,110.90}},
  641. {"Richman", {321.30,-1044.00,-89.00,647.50,-860.60,110.90}},
  642. {"Richman", {321.30,-860.60,-89.00,687.80,-768.00,110.90}},
  643. {"Richman", {321.30,-768.00,-89.00,700.70,-674.80,110.90}},
  644. {"Robada Intersection", {-1119.00,1178.90,-89.00,-862.00,1351.40,110.90}},
  645. {"Roca Escalante", {2237.40,2202.70,-89.00,2536.40,2542.50,110.90}},
  646. {"Roca Escalante", {2536.40,2202.70,-89.00,2625.10,2442.50,110.90}},
  647. {"Rockshore East", {2537.30,676.50,-89.00,2902.30,943.20,110.90}},
  648. {"Rockshore West", {1997.20,596.30,-89.00,2377.30,823.20,110.90}},
  649. {"Rockshore West", {2377.30,596.30,-89.00,2537.30,788.80,110.90}},
  650. {"Rodeo", {72.60,-1684.60,-89.00,225.10,-1544.10,110.90}},
  651. {"Rodeo", {72.60,-1544.10,-89.00,225.10,-1404.90,110.90}},
  652. {"Rodeo", {225.10,-1684.60,-89.00,312.80,-1501.90,110.90}},
  653. {"Rodeo", {225.10,-1501.90,-89.00,334.50,-1369.60,110.90}},
  654. {"Rodeo", {334.50,-1501.90,-89.00,422.60,-1406.00,110.90}},
  655. {"Rodeo", {312.80,-1684.60,-89.00,422.60,-1501.90,110.90}},
  656. {"Rodeo", {422.60,-1684.60,-89.00,558.00,-1570.20,110.90}},
  657. {"Rodeo", {558.00,-1684.60,-89.00,647.50,-1384.90,110.90}},
  658. {"Rodeo", {466.20,-1570.20,-89.00,558.00,-1385.00,110.90}},
  659. {"Rodeo", {422.60,-1570.20,-89.00,466.20,-1406.00,110.90}},
  660. {"Rodeo", {466.20,-1385.00,-89.00,647.50,-1235.00,110.90}},
  661. {"Rodeo", {334.50,-1406.00,-89.00,466.20,-1292.00,110.90}},
  662. {"Royal Casino", {2087.30,1383.20,-89.00,2437.30,1543.20,110.90}},
  663. {"San Andreas Sound", {2450.30,385.50,-100.00,2759.20,562.30,200.00}},
  664. {"Santa Flora", {-2741.00,458.40,-7.60,-2533.00,793.40,200.00}},
  665. {"Santa Maria Beach", {342.60,-2173.20,-89.00,647.70,-1684.60,110.90}},
  666. {"Santa Maria Beach", {72.60,-2173.20,-89.00,342.60,-1684.60,110.90}},
  667. {"Shady Cabin", {-1632.80,-2263.40,-3.00,-1601.30,-2231.70,200.00}},
  668. {"Shady Creeks", {-1820.60,-2643.60,-8.00,-1226.70,-1771.60,200.00}},
  669. {"Shady Creeks", {-2030.10,-2174.80,-6.10,-1820.60,-1771.60,200.00}},
  670. {"Sobell Rail Yards", {2749.90,1548.90,-89.00,2923.30,1937.20,110.90}},
  671. {"Spinybed", {2121.40,2663.10,-89.00,2498.20,2861.50,110.90}},
  672. {"Starfish Casino", {2437.30,1783.20,-89.00,2685.10,2012.10,110.90}},
  673. {"Starfish Casino", {2437.30,1858.10,-39.00,2495.00,1970.80,60.90}},
  674. {"Starfish Casino", {2162.30,1883.20,-89.00,2437.30,2012.10,110.90}},
  675. {"Temple", {1252.30,-1130.80,-89.00,1378.30,-1026.30,110.90}},
  676. {"Temple", {1252.30,-1026.30,-89.00,1391.00,-926.90,110.90}},
  677. {"Temple", {1252.30,-926.90,-89.00,1357.00,-910.10,110.90}},
  678. {"Temple", {952.60,-1130.80,-89.00,1096.40,-937.10,110.90}},
  679. {"Temple", {1096.40,-1130.80,-89.00,1252.30,-1026.30,110.90}},
  680. {"Temple", {1096.40,-1026.30,-89.00,1252.30,-910.10,110.90}},
  681. {"The Camel's Toe", {2087.30,1203.20,-89.00,2640.40,1383.20,110.90}},
  682. {"The Clown's Pocket", {2162.30,1783.20,-89.00,2437.30,1883.20,110.90}},
  683. {"The Emerald Isle", {2011.90,2202.70,-89.00,2237.40,2508.20,110.90}},
  684. {"The Farm", {-1209.60,-1317.10,114.90,-908.10,-787.30,251.90}},
  685. {"Four Dragons Casino", {1817.30,863.20,-89.00,2027.30,1083.20,110.90}},
  686. {"The High Roller", {1817.30,1283.20,-89.00,2027.30,1469.20,110.90}},
  687. {"The Mako Span", {1664.60,401.70,0.00,1785.10,567.20,200.00}},
  688. {"The Panopticon", {-947.90,-304.30,-1.10,-319.60,327.00,200.00}},
  689. {"The Pink Swan", {1817.30,1083.20,-89.00,2027.30,1283.20,110.90}},
  690. {"The Sherman Dam", {-968.70,1929.40,-3.00,-481.10,2155.20,200.00}},
  691. {"The Strip", {2027.40,863.20,-89.00,2087.30,1703.20,110.90}},
  692. {"The Strip", {2106.70,1863.20,-89.00,2162.30,2202.70,110.90}},
  693. {"The Strip", {2027.40,1783.20,-89.00,2162.30,1863.20,110.90}},
  694. {"The Strip", {2027.40,1703.20,-89.00,2137.40,1783.20,110.90}},
  695. {"The Visage", {1817.30,1863.20,-89.00,2106.70,2011.80,110.90}},
  696. {"The Visage", {1817.30,1703.20,-89.00,2027.40,1863.20,110.90}},
  697. {"Unity Station", {1692.60,-1971.80,-20.40,1812.60,-1932.80,79.50}},
  698. {"Valle Ocultado", {-936.60,2611.40,2.00,-715.90,2847.90,200.00}},
  699. {"Verdant Bluffs", {930.20,-2488.40,-89.00,1249.60,-2006.70,110.90}},
  700. {"Verdant Bluffs", {1073.20,-2006.70,-89.00,1249.60,-1842.20,110.90}},
  701. {"Verdant Bluffs", {1249.60,-2179.20,-89.00,1692.60,-1842.20,110.90}},
  702. {"Verdant Meadows", {37.00,2337.10,-3.00,435.90,2677.90,200.00}},
  703. {"Verona Beach", {647.70,-2173.20,-89.00,930.20,-1804.20,110.90}},
  704. {"Verona Beach", {930.20,-2006.70,-89.00,1073.20,-1804.20,110.90}},
  705. {"Verona Beach", {851.40,-1804.20,-89.00,1046.10,-1577.50,110.90}},
  706. {"Verona Beach", {1161.50,-1722.20,-89.00,1323.90,-1577.50,110.90}},
  707. {"Verona Beach", {1046.10,-1722.20,-89.00,1161.50,-1577.50,110.90}},
  708. {"Vinewood", {787.40,-1310.20,-89.00,952.60,-1130.80,110.90}},
  709. {"Vinewood", {787.40,-1130.80,-89.00,952.60,-954.60,110.90}},
  710. {"Vinewood", {647.50,-1227.20,-89.00,787.40,-1118.20,110.90}},
  711. {"Vinewood", {647.70,-1416.20,-89.00,787.40,-1227.20,110.90}},
  712. {"Whitewood Estates", {883.30,1726.20,-89.00,1098.30,2507.20,110.90}},
  713. {"Whitewood Estates", {1098.30,1726.20,-89.00,1197.30,2243.20,110.90}},
  714. {"Willowfield", {1970.60,-2179.20,-89.00,2089.00,-1852.80,110.90}},
  715. {"Willowfield", {2089.00,-2235.80,-89.00,2201.80,-1989.90,110.90}},
  716. {"Willowfield", {2089.00,-1989.90,-89.00,2324.00,-1852.80,110.90}},
  717. {"Willowfield", {2201.80,-2095.00,-89.00,2324.00,-1989.90,110.90}},
  718. {"Willowfield", {2541.70,-1941.40,-89.00,2703.50,-1852.80,110.90}},
  719. {"Willowfield", {2324.00,-2059.20,-89.00,2541.70,-1852.80,110.90}},
  720. {"Willowfield", {2541.70,-2059.20,-89.00,2703.50,-1941.40,110.90}},
  721. {"Yellow Bell Station", {1377.40,2600.40,-21.90,1492.40,2687.30,78.00}},
  722. // Citys Zones
  723. {"Los Santos", {44.60,-2892.90,-242.90,2997.00,-768.00,900.00}},
  724. {"Las Venturas", {869.40,596.30,-242.90,2997.00,2993.80,900.00}},
  725. {"Bone County", {-480.50,596.30,-242.90,869.40,2993.80,900.00}},
  726. {"Tierra Robada", {-2997.40,1659.60,-242.90,-480.50,2993.80,900.00}},
  727. {"Tierra Robada", {-1213.90,596.30,-242.90,-480.50,1659.60,900.00}},
  728. {"San Fierro", {-2997.40,-1115.50,-242.90,-1213.90,1659.60,900.00}},
  729. {"Red County", {-1213.90,-768.00,-242.90,2997.00,596.30,900.00}},
  730. {"Flint County", {-1213.90,-2892.90,-242.90,44.60,-768.00,900.00}},
  731. {"Whetstone", {-2997.40,-2892.90,-242.90,-1213.90,-1115.50,900.00}}
  732. };
  733. //=================================Engine=======================================
  734. new vehEngine[MAX_VEHICLES];
  735. //===========================[MAIN]=============================================
  736. main()
  737. {
  738. printf("-------------------------------------");
  739. printf("DC SA-MP ROLEPLAY ");
  740. printf("-------------------------------------");
  741. printf("DC:RP");
  742. }
  743. //==========================[CALLBACKS]=========================================
  744. public Unfreeze(playerid)
  745. {
  746. TogglePlayerControllable(playerid, 1);
  747. return 1;
  748. }
  749. public SyncTime()
  750. {
  751. new string[64];
  752. new tmphour;
  753. new tmpminute;
  754. new tmpsecond;
  755. gettime(tmphour, tmpminute, tmpsecond);
  756. FixHour(tmphour);
  757. tmphour = shifthour;
  758. if ((tmphour > ghour) || (tmphour == 0 && ghour == 23))
  759. {
  760. format(string, sizeof(string), "SERVER: The time is now %d:00 hours",tmphour);
  761. SendClientMessageToAll(COLOR_WHITE,string);
  762. ghour = tmphour;
  763. Payday();
  764. if (realtime)
  765. {
  766. SetWorldTime(tmphour);
  767. }
  768. }
  769. }
  770. public OnPlayerEnterCheckpoint(playerid)
  771. {
  772. if(CP[playerid]==200)//dmv_01
  773. {
  774. if(IsPlayerInVehicle(playerid, dmvc) || IsPlayerInVehicle(playerid, dmvc1) || IsPlayerInVehicle(playerid, dmvc2))
  775. {
  776. DisablePlayerCheckpoint(playerid);
  777. CP[playerid] = 201;
  778. SetPlayerCheckpoint(playerid, 1432.4354,-1658.6343,13.1245, 5.0);
  779. }
  780. else
  781. {
  782. SendClientMessage(playerid, COLOR_LIGHTBLUE,"DMV: You are not in the car!");
  783. SendClientMessage(playerid, COLOR_LIGHTBLUE,"DMV: You didn't passed the test, please try again!");
  784. DisablePlayerCheckpoint(playerid);
  785. RemovePlayerFromVehicle(playerid);
  786. SetVehicleToRespawn(GetPlayerVehicleID(playerid));
  787. TakingLesson[playerid] = 0;
  788. }
  789. }
  790. else if(CP[playerid]==201)//dmv_02
  791. {
  792. DisablePlayerCheckpoint(playerid);
  793. CP[playerid] = 202;
  794. SetPlayerCheckpoint(playerid, 1432.3827,-1588.9227,13.1318, 5.0);
  795. }
  796. else if(CP[playerid]==202)//dmv_03
  797. {
  798. DisablePlayerCheckpoint(playerid);
  799. CP[playerid] = 203;
  800. SetPlayerCheckpoint(playerid, 1454.7500,-1480.2014,13.0978, 5.0);
  801. }
  802. else if(CP[playerid]==203)//dmv_04
  803. {
  804. DisablePlayerCheckpoint(playerid);
  805. CP[playerid] = 204;
  806. SetPlayerCheckpoint(playerid, 1457.2000,-1439.2382,13.1303, 5.0);
  807. }
  808. else if(CP[playerid]==204)//dmv_05
  809. {
  810. DisablePlayerCheckpoint(playerid);
  811. CP[playerid] = 205;
  812. SetPlayerCheckpoint(playerid, 1429.9436,-1437.6150,13.1244, 5.0);
  813. }
  814. else if(CP[playerid]==205)//dmv_06
  815. {
  816. DisablePlayerCheckpoint(playerid);
  817. CP[playerid] = 206;
  818. SetPlayerCheckpoint(playerid, 1423.7155,-1398.9248,13.1238, 5.0);
  819. }
  820. else if(CP[playerid]==206)//dmv_07
  821. {
  822. DisablePlayerCheckpoint(playerid);
  823. CP[playerid] = 207;
  824. SetPlayerCheckpoint(playerid, 1350.0922,-1393.0492,13.1469, 5.0);
  825. }
  826. else if(CP[playerid]==207)//dmv_08
  827. {
  828. DisablePlayerCheckpoint(playerid);
  829. CP[playerid] = 208;
  830. SetPlayerCheckpoint(playerid, 1106.5748,-1397.0431,13.1716, 5.0);
  831. }
  832. else if(CP[playerid]==208)//dmv_09
  833. {
  834. DisablePlayerCheckpoint(playerid);
  835. CP[playerid] = 209;
  836. SetPlayerCheckpoint(playerid, 1059.6833,-1419.8898,13.1155, 5.0);
  837. }
  838. else if(CP[playerid]==209)//dmv_10
  839. {
  840. DisablePlayerCheckpoint(playerid);
  841. CP[playerid] = 210;
  842. SetPlayerCheckpoint(playerid, 1035.0563,-1571.5737,13.1341, 5.0);
  843. }
  844. else if(CP[playerid]==210)//dmv_11
  845. {
  846. DisablePlayerCheckpoint(playerid);
  847. CP[playerid] = 211;
  848. SetPlayerCheckpoint(playerid, 1143.5441,-1574.9717,13.0121, 5.0);
  849. }
  850. else if(CP[playerid]==211)//dmv_12
  851. {
  852. DisablePlayerCheckpoint(playerid);
  853. CP[playerid] = 212;
  854. SetPlayerCheckpoint(playerid, 1289.9336,-1574.8125,13.1246, 5.0);
  855. }
  856. else if(CP[playerid]==212)//dmv_13
  857. {
  858. DisablePlayerCheckpoint(playerid);
  859. CP[playerid] = 213;
  860. SetPlayerCheckpoint(playerid, 1295.0909,-1659.1091,13.1246, 5.0);
  861. }
  862. else if(CP[playerid]==213)//dmv_14
  863. {
  864. DisablePlayerCheckpoint(playerid);
  865. CP[playerid] = 214;
  866. SetPlayerCheckpoint(playerid, 1295.0031,-1704.4797,13.1240, 5.0);
  867. }
  868. else if(CP[playerid]==214)//dmv_15
  869. {
  870. DisablePlayerCheckpoint(playerid);
  871. CP[playerid] = 215;
  872. SetPlayerCheckpoint(playerid, 1299.5117,-1817.1479,13.1245, 5.0);
  873. }
  874. else if(CP[playerid]==215)//dmv_16
  875. {
  876. DisablePlayerCheckpoint(playerid);
  877. CP[playerid] = 216;
  878. SetPlayerCheckpoint(playerid, 1300.8134,-1855.0059,13.1245, 5.0);
  879. }
  880. else if(CP[playerid]==216)//dmv_17
  881. {
  882. DisablePlayerCheckpoint(playerid);
  883. CP[playerid] = 217;
  884. SetPlayerCheckpoint(playerid, 1389.0083,-1874.1768,13.1245, 5.0);
  885. }
  886. else if(CP[playerid]==217)//dmv_18
  887. {
  888. DisablePlayerCheckpoint(playerid);
  889. CP[playerid] = 218;
  890. SetPlayerCheckpoint(playerid, 1523.0303,-1874.8875,13.1266, 5.0);
  891. }
  892. else if(CP[playerid]==218)//dmv_19
  893. {
  894. DisablePlayerCheckpoint(playerid);
  895. CP[playerid] = 219;
  896. SetPlayerCheckpoint(playerid, 1571.1161,-1872.5188,13.1252, 5.0);
  897. }
  898. else if(CP[playerid]==219)//dmv_20
  899. {
  900. DisablePlayerCheckpoint(playerid);
  901. CP[playerid] = 220;
  902. SetPlayerCheckpoint(playerid, 1572.3271,-1733.9789,13.1269, 5.0);
  903. }
  904. else if(CP[playerid]==220)//dmv_21
  905. {
  906. DisablePlayerCheckpoint(playerid);
  907. CP[playerid] = 221;
  908. SetPlayerCheckpoint(playerid, 1531.4258,-1730.1346,13.1245, 5.0);
  909. }
  910. else if(CP[playerid]==221)//dmv_22
  911. {
  912. DisablePlayerCheckpoint(playerid);
  913. CP[playerid] = 222;
  914. SetPlayerCheckpoint(playerid, 1437.5671,-1730.2736,13.1254, 5.0);
  915. }
  916. else if(CP[playerid]==222)//dmv_23
  917. {
  918. DisablePlayerCheckpoint(playerid);
  919. CP[playerid] = 223;
  920. SetPlayerCheckpoint(playerid, 1424.2367,-1694.3533,13.2030, 5.0);
  921. }
  922. else if(CP[playerid]==223)//dmv_Final
  923. {
  924. new pName[24];
  925. new str[128];
  926. GetPlayerName(playerid, pName, 24);
  927. pName[strfind(pName,"_")] = ' ';
  928. GivePlayerCash(playerid, -500);
  929. format(str, 128,"DMV: Congratulations %s! You passed the test.", pName);
  930. SendClientMessage(playerid, COLOR_LIGHTBLUE, str);
  931. RemovePlayerFromVehicle(playerid);
  932. SetVehicleToRespawn(GetPlayerVehicleID(playerid));
  933. TakingLesson[playerid] = 0;
  934. PlayerInfo[playerid][pDriveLic] = 1;
  935. DisablePlayerCheckpoint(playerid);
  936. }
  937. else
  938. {
  939. DisablePlayerCheckpoint(playerid);
  940. }
  941. return 1;
  942. }
  943. public OnPlayerSelectedMenuRow(playerid, row)
  944. {
  945. new Menu:current;
  946. current = GetPlayerMenu(playerid);
  947. if(current == Paper)
  948. {
  949. switch(row)
  950. {
  951. case 0:
  952. {
  953. HideMenuForPlayer(Paper, playerid);
  954. ShowMenuForPlayer(Paper2, playerid);
  955. }
  956. case 2:
  957. {
  958. ShowMenuForPlayer(Paper, playerid);
  959. SendClientMessage(playerid,COLOR_GREEN,"____________How to call a taxi:_________________");
  960. SendClientMessage(playerid,COLOR_WHITE,"/call 444");
  961. SendClientMessage(playerid,COLOR_WHITE,"To stand up type /stopanim and press ENTER");
  962. }
  963. case 1:
  964. {
  965. ShowMenuForPlayer(Paper, playerid);
  966. SendClientMessage(playerid,COLOR_GREEN,"____________How to get a license:______________");
  967. SendClientMessage(playerid,COLOR_WHITE,"- The license costs 500$");
  968. SendClientMessage(playerid,COLOR_WHITE,"- On your radar has been placed a checkpoint where you can get license");
  969. SendClientMessage(playerid,COLOR_GREEN,"________________________");
  970. SendClientMessage(playerid,COLOR_WHITE,"To stand up type /stopanim and press ENTER");
  971. SetPlayerCheckpoint(playerid, 1432.4354,-1658.6343,13.1245,10.0);
  972. }
  973. case 3:
  974. {
  975. ShowMenuForPlayer(Paper, playerid);
  976. SendClientMessage(playerid,COLOR_GREEN,"____________Where To Live:______________");
  977. SendClientMessage(playerid,COLOR_WHITE,"- Rent a room in one of the houses");
  978. SendClientMessage(playerid,COLOR_WHITE,"- Or stay in LS Airport motel");
  979. SendClientMessage(playerid,COLOR_GREEN,"________________________");
  980. SendClientMessage(playerid,COLOR_WHITE,"To stand up type /stopanim and press ENTER");
  981. }
  982. case 4:
  983. {
  984. ShowMenuForPlayer(Paper, playerid);
  985. SendClientMessage(playerid,COLOR_GREEN,"____________Need a Medic?:______________");
  986. SendClientMessage(playerid,COLOR_WHITE,"/call 911");
  987. SendClientMessage(playerid,COLOR_GREEN,"________________________");
  988. SendClientMessage(playerid,COLOR_WHITE,"To stand up type /stopanim and press ENTER");
  989. }
  990. case 5:
  991. {
  992. ShowMenuForPlayer(Paper, playerid);
  993. SendClientMessage(playerid,COLOR_GREEN,"____________Need the Police?:______________");
  994. SendClientMessage(playerid,COLOR_WHITE,"/call 911");
  995. SendClientMessage(playerid,COLOR_GREEN,"________________________");
  996. SendClientMessage(playerid,COLOR_WHITE,"To stand up type /stopanim and press ENTER");
  997. }
  998. case 6:
  999. {
  1000. ShowMenuForPlayer(Paper, playerid);
  1001. SendClientMessage(playerid,COLOR_GREEN,"_____True RP Forums:_________");
  1002. SendClientMessage(playerid,COLOR_WHITE,"(Read rules and guides there)");
  1003. SendClientMessage(playerid,COLOR_WHITE,"forums...");
  1004. SendClientMessage(playerid,COLOR_GREEN,"________________________");
  1005. SendClientMessage(playerid,COLOR_WHITE,"To stand up type /stopanim and press ENTER");
  1006. }
  1007. }
  1008. }
  1009. if(current == Paper2)
  1010. {
  1011. switch(row)
  1012. {
  1013. case 0:
  1014. {
  1015. HideMenuForPlayer(Paper2, playerid);
  1016. ShowMenuForPlayer(Paper, playerid);
  1017. }
  1018. case 1:
  1019. {
  1020. ShowMenuForPlayer(Paper, playerid);
  1021. SendClientMessage(playerid,COLOR_GREEN,"_____________Garbage Collector_____________");
  1022. SendClientMessage(playerid,COLOR_GREEN,"Head to the checkpoint to join this job!");
  1023. SendClientMessage(playerid,COLOR_GREEN,"Every job has requirements,you can see them when you arrive there");
  1024. SendClientMessage(playerid,COLOR_GREEN,"________________________");
  1025. SendClientMessage(playerid,COLOR_WHITE,"To stand up type /stopanim and press ENTER");
  1026. SetPlayerCheckpoint(playerid,1381.2228,-1088.7719,27.3906,5.0);
  1027. }
  1028. case 2:
  1029. {
  1030. ShowMenuForPlayer(Paper, playerid);
  1031. SendClientMessage(playerid,COLOR_GREEN,"_____________Taximeter_____________");
  1032. SendClientMessage(playerid,COLOR_GREEN,"Head to the checkpoint to join this job!");
  1033. SendClientMessage(playerid,COLOR_GREEN,"Every job has requirements,you can see them when you arrive there");
  1034. SendClientMessage(playerid,COLOR_GREEN,"________________________");
  1035. SendClientMessage(playerid,COLOR_WHITE,"To stand up type /stopanim and press ENTER");
  1036. SetPlayerCheckpoint(playerid,1381.2228,-1088.7719,27.3906,5.0);
  1037. }
  1038. case 3:
  1039. {
  1040. ShowMenuForPlayer(Paper, playerid);
  1041. SendClientMessage(playerid,COLOR_GREEN,"_____________Fishing[Temporary Job]_____________");
  1042. SendClientMessage(playerid,COLOR_GREEN,"Your searching for the fishing job?You found it.!");
  1043. SendClientMessage(playerid,COLOR_GREEN,"/gofishing to get all the information.Shortly,it is a temporary job,you don't get payday from it and you can");
  1044. SendClientMessage(playerid,COLOR_GREEN,"fish all the time without getting a contract .");
  1045. SendClientMessage(playerid,COLOR_GREEN,"________________________");
  1046. SendClientMessage(playerid,COLOR_WHITE,"To stand up type /stopanim and press ENTER");
  1047. }
  1048. case 4:
  1049. {
  1050. ShowMenuForPlayer(Paper, playerid);
  1051. SendClientMessage(playerid,COLOR_GREEN,"_____________Mechanic[Temporary Job]_____________");
  1052. SendClientMessage(playerid,COLOR_GREEN,"You will need a towing vehicle for this.!");
  1053. SendClientMessage(playerid,COLOR_GREEN,"You will have to answer citizens calls and help them with their car");
  1054. SendClientMessage(playerid,COLOR_GREEN,"Command: /mechanic");
  1055. SendClientMessage(playerid,COLOR_GREEN,"________________________");
  1056. SendClientMessage(playerid,COLOR_WHITE,"To stand up type /stopanim and press ENTER");
  1057. }
  1058. }
  1059. }
  1060. return 1;
  1061. }
  1062. public SetPlayerUnMute()
  1063. {
  1064. for(new i = 0; i < MAX_PLAYERS; i++)
  1065. {
  1066. if(IsPlayerConnected(i))
  1067. {
  1068. if(PlayerInfo[i][pMuted] > 0)
  1069. {
  1070. if(PlayerInfo[i][pMuteTime] > 0)
  1071. {
  1072. PlayerInfo[i][pMuteTime]--;
  1073. }
  1074. if(PlayerInfo[i][pMuteTime] <= 0)
  1075. {
  1076. PlayerInfo[i][pMuteTime] = 0;
  1077. if(PlayerInfo[i][pMuted] == 1)
  1078. {
  1079. PlayerInfo[i][pMuted] = 0;
  1080. }
  1081. PlayerInfo[i][pMuted] = 0;
  1082. SendClientMessage(i,COLOR_LIGHTRED,"Your silence time has expired.You can now talk again ");
  1083. }
  1084. }
  1085. }
  1086. }
  1087. }
  1088.  
  1089. public ScoreUpdate()
  1090. {
  1091. new Score;
  1092. new name[MAX_PLAYER_NAME];
  1093. for(new i=0; i<MAX_PLAYERS; i++)
  1094. {
  1095. if (IsPlayerConnected(i))
  1096. {
  1097. GetPlayerName(i, name, sizeof(name));
  1098. Score = PlayerInfo[i][pLevel];
  1099. SetPlayerScore(i, Score);
  1100. if (Score > ScoreOld)
  1101. {
  1102. ScoreOld = Score;
  1103. }
  1104. }
  1105. }
  1106. }
  1107. public OnGameModeInit()
  1108. {
  1109. //===============================DEALERSHIP=====================================
  1110. LoadVehicles();
  1111. LoadDealerships();
  1112. LoadFuelStations();
  1113. LoadFactions();
  1114. for(new i=1; i < MAX_DVEHICLES; i++)
  1115. {
  1116. UpdateVehicle(i, 0);
  1117. }
  1118. for(new i=1; i < MAX_DEALERSHIPS; i++)
  1119. {
  1120. UpdateDealership(i, 0);
  1121. }
  1122. for(new i=1; i < MAX_FUEL_STATIONS; i++)
  1123. {
  1124. UpdateFuelStation(i, 0);
  1125. }
  1126. SetTimer("MainTimer", 1000, true);
  1127. SetTimer("SaveTimer", 2222, true);
  1128. //==============================================================================
  1129. printf("------ Engine System Started------- ");
  1130. SetGameModeText("DC:RP");
  1131. gettime(ghour, gminute, gsecond);
  1132. FixHour(ghour);
  1133. ghour = shifthour;
  1134. if (realtime)
  1135. {
  1136. new tmphour;
  1137. new tmpminute;
  1138. new tmpsecond;
  1139. gettime(tmphour, tmpminute, tmpsecond);
  1140. FixHour(tmphour);
  1141. tmphour = shifthour;
  1142. SetWorldTime(tmphour);
  1143. }
  1144. DisableInteriorEnterExits();
  1145. //============================[Menus]===========================================
  1146. Paper = CreateMenu("Paper", 2, 200.0, 100.0, 150.0, 150.0);
  1147. AddMenuItem(Paper, 0, "Next Page");
  1148. AddMenuItem(Paper, 0, "How to get a license");
  1149. AddMenuItem(Paper, 0, "How to call a taxi");
  1150. AddMenuItem(Paper, 0, "Where to live");
  1151. AddMenuItem(Paper, 0, "Medic Help");
  1152. AddMenuItem(Paper, 0, "SAPD help");
  1153. AddMenuItem(Paper, 0, "OOC:Forums");
  1154. Paper2 = CreateMenu("Paper2", 2, 200.0, 100.0, 150.0, 150.0);
  1155. AddMenuItem(Paper2, 0, "Next Page");
  1156. AddMenuItem(Paper2, 0, "Garbage Collector");
  1157. AddMenuItem(Paper2, 0, "Taximeter");
  1158. AddMenuItem(Paper2, 0, "Fishing");
  1159. AddMenuItem(Paper2, 0, "Mechanic");
  1160. Create3DTextLabel("/newspaper for information",COLOR_GREEN, 1707.8434,-2331.6506,-2.6797, 20.0,0,0);
  1161. //================================[TIMERS]=========================================
  1162. SetTimer("SyncTime", 60000, 1);
  1163. SetTimer("ScoreUpdate", 1000, 1);
  1164. SetTimer("SetPlayerUnMute", 1000, 1);
  1165. SetTimer("newbietimer", 30000, 1);
  1166. //===============================[PICKUPS]==========================================
  1167. AddStaticPickup(1239, 23, 1707.8434,-2331.6506,-2.6797);
  1168. AddStaticPickup(1240, 23, 1173.112426, -1320.917602, 15.396226);
  1169. AddStaticPickup(1318, 23, 1172.914794, -1325.471313, 15.398929);
  1170. AddStaticPickup(1318, 23, 1482.534423, -1771.555541, 18.795755);
  1171. AddStaticPickup(1318, 23, 1555.134277, -1675.773071, 16.195312);
  1172. AddStaticPickup(1318, 23, 1565.185180, -1666.162963, 28.395606);
  1173. AddStaticPickup(1318, 23, 1653.883056, -1655.420898, 22.515625);
  1174. AddStaticPickup(1247, 23, 1525.285278, -1677.911865, 5.890625);
  1175. AddStaticPickup(1318, 23, 1568.560302, -1690.335815, 5.890625);
  1176. AddStaticPickup(1318, 23, 1727.056884, -1636.913208, 20.217334);
  1177. AddStaticPickup(1318, 23, 1797.998046, -1578.819091, 14.090865);
  1178. AddStaticPickup(1240, 23, 2034.583374, -1405.004516, 17.244943);
  1179. AddStaticPickup(1318, 23, 2233.053955, -1333.350463, 23.981575);
  1180. AddStaticPickup(1318, 23, 2232.929931, -1159.893554, 25.890625);
  1181. AddStaticPickup(1318, 23, 2351.947021, -1170.659545, 28.074401);
  1182. AddStaticPickup(1318, 23, 2421.583496, -1219.243041, 25.561477);
  1183. AddStaticPickup(1318, 23, 2166.275634, -1671.659545, 15.073946);
  1184. AddStaticPickup(1239, 23, 2165.229736, -1672.992187, 15.077716);
  1185. AddStaticPickup(1239, 23, 1666.597900, -1524.166992, 13.546875);
  1186. AddStaticPickup(1318, 23, 1667.901611, -1521.946777, 13.546875);
  1187. AddStaticPickup(1318, 23, 1568.028320, -1898.009155, 13.560886);
  1188. AddStaticPickup(1239, 23, 2162.161376, -102.522369, 2.750000);
  1189. //==============================[VEHICLES]==========================================
  1190. AddStaticVehicle(596,1535.8279,-1667.0283,13.1042,1.2749,0,1); // //Copcar 1
  1191. AddStaticVehicle(596,1535.7777,-1678.2174,13.1041,359.0435,0,1); // //Copcar 2
  1192. AddStaticVehicle(596,1602.2314,-1688.1366,5.6119,88.9127,0,1); // //Copcar 3
  1193. AddStaticVehicle(596,1602.3998,-1696.2252,5.6117,89.5110,0,1); // //Copcar 4
  1194. AddStaticVehicle(596,1602.2968,-1704.6088,5.6114,89.2925,0,1); // //Copcar 5
  1195. AddStaticVehicle(596,1591.6299,-1711.7292,5.6110,0.5575,0,1); // //Copcar 6
  1196. AddStaticVehicle(596,1583.3506,-1711.8403,5.6123,359.9798,0,1); // //Copcar 7
  1197. AddStaticVehicle(596,1574.4407,-1711.5636,5.6112,0.4981,0,1); // //Copcar 8
  1198. AddStaticVehicle(596,1564.4946,-1711.8907,5.6117,0.0557,0,1); // //Copcar 9
  1199. AddStaticVehicle(597,1602.1552,-1691.9513,5.6600,90.2862,1,0); // //Copcar 10
  1200. AddStaticVehicle(597,1602.1045,-1684.0902,5.6588,89.9887,1,0); // //Copcar 11
  1201. AddStaticVehicle(597,1602.5887,-1700.3116,5.6600,90.1532,1,0); // //Copcar 12
  1202. AddStaticVehicle(597,1595.2753,-1711.4293,5.6598,1.4325,1,93); // //Copcar 13
  1203. AddStaticVehicle(597,1587.3236,-1711.8318,5.6587,359.5460,1,93); // //Copcar 14
  1204. AddStaticVehicle(598,1578.6815,-1712.0513,5.6365,358.1766,1,93); // //Copcar 15
  1205. AddStaticVehicle(598,1570.2655,-1711.8102,5.6356,359.8264,1,93); // //Copcar 16
  1206. AddStaticVehicle(596,1558.4491,-1711.7164,5.6120,0.7168,1,93); // //Copcar 17
  1207. AddStaticVehicle(596,1584.6483,-1671.5382,5.6145,270.2792,1,93); // //Copcar 18
  1208. AddStaticVehicle(596,1584.6222,-1667.4482,5.6145,270.0910,1,93); // //Copcar 19
  1209. AddStaticVehicle(599,1546.2502,-1650.8398,6.0786,90.8912,0,1); // //cop car 20
  1210. AddStaticVehicle(599,1546.8645,-1659.1162,6.0787,90.3100,0,1); // //cop car 21
  1211. AddStaticVehicle(599,1546.6399,-1667.8623,6.0780,90.4493,0,1); // //cop car 22
  1212. AddStaticVehicle(601,1545.8365,-1655.1222,5.6494,89.7686,0,1); // //cop car Swat Tank 23
  1213. AddStaticVehicle(528,1546.2603,-1662.9534,5.9328,89.3495,0,1); // //cop FBI truck(blue one) 24
  1214. AddStaticVehicle(427,1530.1572,-1644.9054,6.0225,179.7986,0,1); // //SWAT Enforcer 25
  1215. AddStaticVehicle(427,1538.6517,-1644.5701,6.0426,180.0564,0,1); // //SWAT Enforcer 26
  1216. AddStaticVehicle(427,1534.6859,-1645.0800,6.0228,178.4550,0,1); // //SWAT Enforcer 27
  1217. AddStaticVehicle(427,1526.0662,-1645.3656,6.0223,180.0917,0,1); // //SWAT Enforcer 28
  1218. AddStaticVehicle(428,570.7433,-1252.2587,17.6663,292.1557,24,1); // //Bank Truck in Rodeo Car 29
  1219. AddStaticVehicle(428,608.0444,-1237.8926,18.4802,111.9092,24,1); // //Bank Truck in Rodeo Car 30
  1220. AddStaticVehicle(426,1543.2870,-1612.4788,13.1262,269.5055,25,25); // //Cop Undercover Car 31
  1221. AddStaticVehicle(426,1543.1644,-1606.7509,13.1253,269.9076,25,25); // //Cop Undercover Car 32
  1222. AddStaticVehicle(421,1555.6886,-1605.9546,13.2653,180.6853,53,53); // //Cop Undercover Car 33
  1223. AddStaticVehicle(421,1561.6571,-1606.0315,13.2653,180.1476,53,53); // //Cop Undercover Car 34
  1224. AddStaticVehicle(416,1177.8341,-1338.3657,14.0368,270.3866,1,3); // //Ambulance EMS Car 35
  1225. AddStaticVehicle(416,1176.9736,-1308.6931,14.0205,267.3689,1,3); // //Ambulance EMS Car 36
  1226. AddStaticVehicle(442,1146.2450,-1295.7229,13.4723,90.3940,1,3); // Hearse for EMS Car 37
  1227. AddStaticVehicle(489,1146.2805,-1302.9196,13.8021,88.5398,1,3); // Rancher for EMS Car 38
  1228. AddStaticVehicle(489,1146.2393,-1309.4309,13.8083,91.4548,1,3); // Rancher for EMS Car 39
  1229. AddStaticVehicle(442,1145.8127,-1316.3143,13.4507,92.9838,1,3); // Hearse for EMS Car 40
  1230. AddStaticVehicle(563,1162.4646,-1301.3418,32.2003,277.2430,1,3); // EMS Heli 41
  1231. AddStaticVehicle(563,1163.9746,-1318.8575,32.1941,271.8757,1,3); // EMS Heli 42
  1232. AddStaticVehicle(490,1666.7798,-1719.3749,20.6192,0.9672,0,0); // FBI 43
  1233. AddStaticVehicle(490,1660.0472,-1719.5132,20.6102,359.8513,0,0); // FBI 44
  1234. AddStaticVehicle(490,1671.4838,-1710.0861,20.6083,90.5516,0,0); // FBI 45
  1235. AddStaticVehicle(490,1671.6444,-1702.4733,20.6114,92.2191,0,0); // FBI 46
  1236. AddStaticVehicle(541,1645.6516,-1695.8042,20.0834,270.8706,0,0); // FBI Bullet Car 47
  1237. AddStaticVehicle(541,1645.8918,-1700.3801,20.1054,270.4592,0,1); // FBI Bullet Car 48
  1238. AddStaticVehicle(421,1646.3101,-1709.2988,20.3669,269.9211,0,1); // FBI Washington Car 49
  1239. AddStaticVehicle(421,1646.3663,-1704.7172,20.3669,268.8617,0,1); // FBI Washington Car 50
  1240. AddStaticVehicle(416,2037.2849,-1425.5010,17.1416,359.6898,1,3); // //County hospital ambulance Car 51
  1241. AddStaticVehicle(416,2007.9158,-1410.9948,17.1415,90.1937,1,3); // //County hospital ambulance Car 52
  1242. AddStaticVehicle(416,2001.8311,-1399.1924,18.3391,181.5330,1,3); // //County hospital ambulance Car 53
  1243. AddStaticVehicle(416,2033.9324,-1447.6057,17.3766,270.3489,1,3); // //County hospital ambulance Car 54
  1244. dmvc = AddStaticVehicle(405,1415.5630,-1706.7310,13.4196,267.9858,1,1); // license1
  1245. dmvc1 = AddStaticVehicle(405,1416.1293,-1712.1976,13.4219,271.2856,1,1); // license2
  1246. dmvc2 = AddStaticVehicle(405,1415.3511,-1718.4138,13.4218,267.3419,1,1); // license3
  1247. return 1;
  1248. }
  1249. public OnGameModeExit()
  1250. {
  1251. SaveFactions();
  1252. return 1;
  1253. }
  1254. public OnPlayerConnect(playerid)
  1255. {
  1256. if(!IsValidName(playerid))
  1257. {
  1258. SCM(playerid,COLOR_RED,"Please change your name into the following format: Firstname_Lastname");
  1259. Kick(playerid);
  1260. }
  1261. new string[128];
  1262. new plname[MAX_PLAYER_NAME];
  1263. GetPlayerName(playerid, plname, sizeof(plname));
  1264. PlayerInfo[playerid][pLevel] = 0;
  1265. PlayerInfo[playerid][pCash] = 0;
  1266. PlayerInfo[playerid][pDriveLic] = 0;
  1267. PlayerInfo[playerid][pVip] = 0;
  1268. PlayerInfo[playerid][pAdmin] = 0;
  1269. PlayerInfo[playerid][pTester] = 0;
  1270. PlayerInfo[playerid][pSpawn] = 0;
  1271. PlayerInfo[playerid][pSex] = 0;
  1272. RefuelTime[playerid] = 0;
  1273. TrackCar[playerid] = 0;
  1274. PlayerInfo[playerid][pAge] = 0;
  1275. PlayerInfo[playerid][pOrigin] = 0;
  1276. PlayerInfo[playerid][pModel] = 23;
  1277. PlayerInfo[playerid][pLocked] = 0;
  1278. PlayerInfo[playerid][pExp] = 0;
  1279. PlayerInfo[playerid][pWarns] = 0;
  1280. PlayerNeedsHelp[playerid] = 0;
  1281. Mobile[playerid] = 255;
  1282. PlayerInfo[playerid][pMuted] = 0;
  1283. PlayerInfo[playerid][pMuteTime] = 0;
  1284. gPlayerTutorialing[playerid] = 0;
  1285. format(string, sizeof(string), "/Users/%s.ini", plname);
  1286. new DialogString[1024];
  1287. format(DialogString, sizeof DialogString, "%s%s%s%s%s%s%s%s", reg1, reg2, reg3, reg4, reg5, reg6, reg7, reg8);
  1288. ShowPlayerDialog(playerid,1234, DIALOG_STYLE_MSGBOX,"Introduction...", DialogString,"Accept","Refuse");
  1289. //===================================[MAPICONS]=================================
  1290. SetPlayerMapIcon(playerid, 1, 597.559509, -1249.448608, 18.307994, 52, 1);
  1291. SetPlayerMapIcon(playerid, 2, 529.425354, -1293.921752, 17.242187, 55, 1);
  1292. SetPlayerMapIcon(playerid, 3, 2127.629394, -1151.914794, 23.988607, 55, 1);
  1293. SetPlayerMapIcon(playerid, 4, 1612.057739, -1892.647338, 13.477849, 55, 1);
  1294. SetPlayerMapIcon(playerid, 5, 2102.669677, -1807.184570, 13.494323, 29, 1);
  1295. SetPlayerMapIcon(playerid, 6, 2218.005126, -1168.782226, 25.655542, 31, 1);
  1296. SetPlayerMapIcon(playerid, 7, 2229.195556, -1722.237670, 13.492409, 54, 1);
  1297. SetPlayerMapIcon(playerid, 8, 2176.778076, -1808.995361, 13.314004, 31, 1);
  1298. SetPlayerMapIcon(playerid, 9, 1552.876464, -1675.246948, 15.951610, 30, 1);
  1299. SetPlayerMapIcon(playerid, 10, 1481.554321, -1769.964111, 18.725217, 32, 1);
  1300. SetPlayerMapIcon(playerid, 11, 1931.436523, -1775.963378, 13.387728, 17, 1);
  1301. SetPlayerMapIcon(playerid, 12, 1832.088745, -1842.122924, 13.516613, 17, 1);
  1302. SetPlayerMapIcon(playerid, 13, 1834.615966, -1682.229736, 13.356820, 49, 1);
  1303. SetPlayerMapIcon(playerid, 14, 1804.492553, -1574.485961, 13.355642, 30, 1);
  1304. SetPlayerMapIcon(playerid, 15, 330.078857, -1518.715820, 35.798629, 30, 1);
  1305. SetPlayerMapIcon(playerid, 16, 212.736221, 1903.069580, 18.079984, 30, 1);
  1306. SetPlayerMapIcon(playerid, 17, 1383.189453, 465.504455, 20.192749, 17, 1);
  1307. SetPlayerMapIcon(playerid, 18, 1365.520019, 249.286941, 19.257095, 29, 1);
  1308. SetPlayerMapIcon(playerid, 19, 1315.100585, -899.391479, 39.282302, 17, 1);
  1309. SetPlayerMapIcon(playerid, 20, 2034.685791, -1404.085327, 16.970668, 22, 1);
  1310. SetPlayerMapIcon(playerid, 21, 1412.8313, -1700.3066, 13.5395, 55, 1);
  1311. //==============================================================================
  1312. Textdraw98[playerid] = TextDrawCreate(146.000000, 203.000000, " "); // Tutorial
  1313. TextDrawBackgroundColor(Textdraw98[playerid], 255);
  1314. TextDrawUseBox(Textdraw98[playerid] , 1);
  1315. TextDrawFont(Textdraw98[playerid], 1);
  1316. TextDrawBoxColor(Textdraw98[playerid] ,0x00000066);
  1317. TextDrawLetterSize(Textdraw98[playerid], 0.289899, 1.099900);
  1318. TextDrawColor(Textdraw98[playerid], 13107455);
  1319. TextDrawSetOutline(Textdraw98[playerid], 1);
  1320. TextDrawSetProportional(Textdraw98[playerid], 1);
  1321. TextDrawAlignment(Textdraw98[playerid],2);
  1322. GivePlayerCash(playerid, PlayerInfo[playerid][pCash]);
  1323. SetPlayerSkin(playerid, PlayerInfo[playerid][pModel]);
  1324. SetOriginalColor(playerid);
  1325. return 1;
  1326. }
  1327.  
  1328. public OnPlayerRequestClass(playerid, classid)
  1329. {
  1330. SetPlayerCameraPos(playerid, 1677.4528,-1502.6893,152.1802);
  1331. SetPlayerCameraLookAt(playerid, 1677.4528,-1502.6893,152.1802);
  1332. SetPlayerSkin(playerid, PlayerInfo[playerid][pModel]);
  1333. return 1;
  1334. }
  1335. //==================================[PAYDAY]====================================
  1336. public Payday()
  1337. {
  1338. for(new i = 0; i < MAX_PLAYERS; i++)
  1339. {
  1340. if(IsPlayerConnected(i))
  1341. {
  1342. new nxtlevel;
  1343. nxtlevel = PlayerInfo[i][pLevel]+1;
  1344. new string[128];
  1345. format(string, sizeof(string), "~y~PayDay~n~~w~Paycheck");
  1346. GameTextForPlayer(i, string, 5000, 1);
  1347. new payday = nxtlevel*1000;
  1348. GivePlayerCash(i,payday);
  1349. PlayerInfo[i][pExp]++;
  1350. }
  1351. }
  1352. return 1;
  1353. }
  1354. //==============================================================================
  1355. public OnPlayerSpawn(playerid)
  1356. {
  1357. if(PlayerInfo[playerid][pSelected] == 0)
  1358. {
  1359. new sexthings[] = "1\tMale \n2\tFemale";
  1360. ShowPlayerDialog(playerid,155,DIALOG_STYLE_LIST,"Hello sir,please select your Sex:((This information is IC.))",sexthings,"Select","Leave Game");
  1361. SetPlayerPos(playerid, 1685.620117,-2331.537353,-2.679687);
  1362. gPlayerRegStep[playerid] = 1;
  1363. new randphone = 100000 + random(899999);
  1364. PlayerInfo[playerid][pNumber] = randphone;
  1365. return 1;
  1366. }
  1367. if(PlayerInfo[playerid][pFirstJoined] == 0)
  1368. {
  1369. new string[512];
  1370. gPlayerTutorialing[playerid] = 1;
  1371. SetPlayerHealth(playerid,100);
  1372. SetPlayerPos(playerid,1693.0609,-2292.1968,-1.2228);
  1373. SetPlayerCameraPos(playerid,1668.9324,-2285.8130,21.3266);//The airport
  1374. SetPlayerCameraLookAt(playerid,1693.0609,-2292.1968,-1.2228);
  1375. format(string,sizeof(string),"This is the airport,your first spawn place ~n~ You will be able to change it if~n~you will get into a faction~n~or if you will buy a house~n~Basic Commands:/help.");
  1376. TextDrawSetString(Textdraw98[playerid],string);
  1377. TextDrawShowForPlayer(playerid,Textdraw98[playerid]);
  1378. SendClientMessage(playerid,COLOR_WHITE,"{248B10}Tutorial:{FFFFFF}Use SPACEBAR to continue,SHIFT to go back.");
  1379. SetPlayerSkin(playerid, PlayerInfo[playerid][pModel]);
  1380. return 1;
  1381. }
  1382. if(gPlayerLogged[playerid] == 0)
  1383. {
  1384. SendClientMessage(playerid, COLOR_LIGHTRED, "** This server requires a Login BEFORE spawn (Kicked) **");
  1385. Kick(playerid);
  1386. }
  1387. SetPlayerPos(playerid, 1685.620117,-2331.537353,-2.679687);
  1388. SetPlayerInterior(playerid,0);
  1389. SetPlayerVirtualWorld(playerid, 0);
  1390. SetOriginalColor(playerid);
  1391. SetPlayerSkin(playerid, PlayerInfo[playerid][pModel]);
  1392. return 1;
  1393. }
  1394. public OnPlayerDisconnect(playerid, reason)
  1395. {
  1396. new INI:File = INI_Open(UserPath(playerid));
  1397. INI_SetTag(File,"data");
  1398. INI_WriteInt(File, "Level",PlayerInfo[playerid][pLevel]);
  1399. INI_WriteInt(File, "Money",PlayerInfo[playerid][pCash]);
  1400. INI_WriteInt(File, "Admin",PlayerInfo[playerid][pAdmin]);
  1401. INI_WriteInt(File, "Tester",PlayerInfo[playerid][pTester]);
  1402. INI_WriteInt(File, "Vip",PlayerInfo[playerid][pVip]);
  1403. INI_WriteInt(File, "Spawn",PlayerInfo[playerid][pSpawn]);
  1404. INI_WriteInt(File, "Model",PlayerInfo[playerid][pModel]);
  1405. INI_WriteInt(File, "Locked",PlayerInfo[playerid][pLocked]);
  1406. INI_WriteInt(File, "FirstJoined", PlayerInfo[playerid][pFirstJoined]);
  1407. INI_WriteInt(File, "Sex", PlayerInfo[playerid][pSex]);
  1408. INI_WriteInt(File, "Age", PlayerInfo[playerid][pAge]);
  1409. INI_WriteInt(File, "Origin", PlayerInfo[playerid][pOrigin]);
  1410. INI_WriteInt(File, "Respect", PlayerInfo[playerid][pExp]);
  1411. INI_WriteInt(File, "Warns", PlayerInfo[playerid][pWarns]);
  1412. INI_WriteInt(File, "Selected", PlayerInfo[playerid][pSelected]);
  1413. INI_WriteInt(File, "Continent", PlayerInfo[playerid][pPlace]);
  1414. INI_WriteInt(File, "Muted", PlayerInfo[playerid][pMuted]);
  1415. INI_WriteInt(File, "MuteTime", PlayerInfo[playerid][pMuteTime]);
  1416. INI_WriteInt(File, "Ph", PlayerInfo[playerid][pNumber]);
  1417. INI_WriteInt(File, "DriveLic", PlayerInfo[playerid][pDriveLic]);
  1418. INI_Close(File);
  1419. return 1;
  1420. }
  1421.  
  1422. public OnPlayerStateChange(playerid, newstate, oldstate)
  1423. {
  1424. //==================================DEALERSHIP=====================================
  1425. if(IsPlayerInAnyVehicle(playerid) && !IsBicycle(GetPlayerVehicleID(playerid)))
  1426. {
  1427. new vehicleid = GetPlayerVehicleID(playerid);
  1428. if(VehicleSecurity[vehicleid] == 1)
  1429. {
  1430. ToggleAlarm(vehicleid, VEHICLE_PARAMS_ON);
  1431. SetTimerEx("StopAlarm", ALARM_TIME, false, "d", vehicleid);
  1432. }
  1433. }
  1434. else
  1435. {
  1436. }
  1437. if(newstate == PLAYER_STATE_DRIVER)
  1438. {
  1439. new car = GetPlayerVehicleID(playerid);
  1440. if(car == dmvc || car == dmvc1 || car == dmvc2)
  1441. {
  1442. SCM(playerid, COLOR_GOLD,"Type /takeexam to start the Drivers License test or /exitcar to exit");
  1443. }
  1444. else
  1445. {
  1446. if(PlayerInfo[playerid][pDriveLic] < 1)
  1447. {
  1448. SendClientMessage(playerid, COLOR_GREY, "Get a driving license from DMV, read the newspaper !");
  1449. RemovePlayerFromVehicle(playerid);
  1450. TogglePlayerControllable(playerid, 0);
  1451. SetTimer("Unfreeze", 2000, 0);
  1452. }
  1453. }
  1454. new vehicleid = GetPlayerVehicleID(playerid);
  1455. new id = GetVehicleID(vehicleid);
  1456. if(IsValidVehicle(id))
  1457. {
  1458. if(VehicleCreated[id] == VEHICLE_DEALERSHIP)
  1459. {
  1460. SetPVarInt(playerid, "DialogValue1", id);
  1461. ShowDialog(playerid, DIALOG_VEHICLE_BUY);
  1462. return 1;
  1463. }
  1464. }
  1465. if(IsBicycle(vehicleid))
  1466. {
  1467. ToggleEngine(vehicleid, VEHICLE_PARAMS_ON);
  1468. }
  1469. if(Fuel[vehicleid] <= 0)
  1470. {
  1471. ToggleEngine(vehicleid, VEHICLE_PARAMS_OFF);
  1472. }
  1473. //=======================================ENGINE=================================
  1474. if(vehEngine[vehicleid] == 0)
  1475. {
  1476. TogglePlayerControllable(playerid, 0);
  1477. SendClientMessage(playerid, COLOR_GOLD, "To start the vehicle's engine press \"Shift\" or type \"/engine\"");
  1478. }
  1479. else if(vehEngine[vehicleid] == 1)
  1480. {
  1481. TogglePlayerControllable(playerid, 1);
  1482. SendClientMessage(playerid, COLOR_GREEN, "Vehicle engine running");
  1483. }
  1484. }
  1485. return 1;
  1486. }
  1487. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  1488. {
  1489. new string[512];
  1490. if(PRESSED(KEY_SPRINT))
  1491. {
  1492. if(gPlayerTutorialing[playerid] >= 1)
  1493. {
  1494. if(gPlayerTutorialing[playerid] == 1)
  1495. {
  1496. gPlayerTutorialing[playerid] = 2;
  1497. SetPlayerPos(playerid,1412.8313, -1700.3066, 13.5395);
  1498. SetPlayerCameraPos(playerid,1412.8313, -1700.3066, 13.5395);//Driving School
  1499. SetPlayerCameraLookAt(playerid,1412.8313, -1700.3066, 13.5395);
  1500. format(string,sizeof(string),"This is the Driving School,you will be able ~n~to take a drive test wich will cost you~n~500$ so you will get a Driving License.~n~REMEBER:The police stops you if you~n~don't have one.");
  1501. TextDrawSetString(Textdraw98[playerid],string);
  1502. TextDrawShowForPlayer(playerid,Textdraw98[playerid]);
  1503. SendClientMessage(playerid,COLOR_WHITE,"{248B10}Tutorial:{FFFFFF}Use SPACEBAR to continue,SHIFT to go back.");
  1504. return 1;
  1505. }
  1506. if(gPlayerTutorialing[playerid] == 2)
  1507. {
  1508. gPlayerTutorialing[playerid] = 3;
  1509. SetPlayerPos(playerid,1380.7892,-1088.5284,27.3844);
  1510. SetPlayerCameraPos(playerid,1349.7155,-1115.9375,47.7593);//Jobs Building
  1511. SetPlayerCameraLookAt(playerid,1380.7892,-1088.5284,27.3844);
  1512. format(string,sizeof(string),"If you want to earn money,you will be able to ~n~get a job.There will be a list so you~n~will have to choose one job.~n~REMEBER:Some of these jobs requests~n~a owned vehicle!");
  1513. TextDrawSetString(Textdraw98[playerid],string);
  1514. TextDrawShowForPlayer(playerid,Textdraw98[playerid]);
  1515. SendClientMessage(playerid,COLOR_WHITE,"{248B10}Tutorial:{FFFFFF}Use SPACEBAR to continue,SHIFT to go back.");
  1516. return 1;
  1517. }
  1518. if(gPlayerTutorialing[playerid] == 3)
  1519. {
  1520. gPlayerTutorialing[playerid] = 4;
  1521. SetPlayerPos(playerid,1482.2841,-1025.5725,24.352);
  1522. SetPlayerCameraPos(playerid,1522.6703,-1041.8273,60.2691);//Casino
  1523. SetPlayerCameraLookAt(playerid,1482.2841,-1025.5725,24.3520);
  1524. format(string,sizeof(string),"If you got tired of working ~n~for someone or for your job~n~you have the possibility to play.~n~here,at the Casino!~n~Commands:/casino");
  1525. TextDrawSetString(Textdraw98[playerid],string);
  1526. TextDrawShowForPlayer(playerid,Textdraw98[playerid]);
  1527. SendClientMessage(playerid,COLOR_WHITE,"{248B10}Tutorial:{FFFFFF}Use SPACEBAR to continue,SHIFT to go back.");
  1528. return 1;
  1529. }
  1530. if(gPlayerTutorialing[playerid] == 4)
  1531. {
  1532. gPlayerTutorialing[playerid] = 5;
  1533. SetPlayerPos(playerid,590.7849,-1243.1808,17.9521);
  1534. SetPlayerCameraPos(playerid,609.0580,-1219.5914,29.2979);//Bank
  1535. SetPlayerCameraLookAt(playerid,590.7849,-1243.1808,17.9521);
  1536. format(string,sizeof(string),"Your paydays,your money will be deposited ~n~here,at the Bank.~n~You have the possibility to:.~n~/bank deposit,withdraw,transfer,savings,etc.~n~Remember:Minimum savings value:50.000$.");
  1537. TextDrawSetString(Textdraw98[playerid],string);
  1538. TextDrawShowForPlayer(playerid,Textdraw98[playerid]);
  1539. SendClientMessage(playerid,COLOR_WHITE,"{248B10}Tutorial:{FFFFFF}Use SPACEBAR to continue,SHIFT to go back.");
  1540. return 1;
  1541. }
  1542. if(gPlayerTutorialing[playerid] == 5)
  1543. {
  1544. gPlayerTutorialing[playerid] = 6;
  1545. SetPlayerPos(playerid,543.6426,-1277.8851,17.2422);
  1546. SetPlayerCameraPos(playerid,538.1927,-1259.2106,29.4667);//Grotti Dealership
  1547. SetPlayerCameraLookAt(playerid,543.6426,-1277.8851,17.2422);
  1548. format(string,sizeof(string),"If you have enough money,you will ~n~be able to buy a new car.");
  1549. TextDrawSetString(Textdraw98[playerid],string);
  1550. TextDrawShowForPlayer(playerid,Textdraw98[playerid]);
  1551. SendClientMessage(playerid,COLOR_WHITE,"{248B10}Tutorial:{FFFFFF}Use SPACEBAR to continue,SHIFT to go back.");
  1552. return 1;
  1553. }
  1554. if(gPlayerTutorialing[playerid] == 6)
  1555. {
  1556. gPlayerTutorialing[playerid] = 7;
  1557. SetPlayerPos(playerid,617.2159,-1330.5415,13.6447);
  1558. SetPlayerCameraPos(playerid,652.8370,-1335.8909,28.2059);//Sector 1 Jail
  1559. SetPlayerCameraLookAt(playerid,617.2159,-1330.5415,13.6447);
  1560. format(string,sizeof(string),"If the police officers catch you ~n~they will jail you in one~n~of the jails around the city.");
  1561. TextDrawSetString(Textdraw98[playerid],string);
  1562. TextDrawShowForPlayer(playerid,Textdraw98[playerid]);
  1563. SendClientMessage(playerid,COLOR_WHITE,"{248B10}Tutorial:{FFFFFF}Use SPACEBAR to continue,SHIFT to go back.");
  1564. return 1;
  1565. }
  1566. if(gPlayerTutorialing[playerid] == 7)
  1567. {
  1568. gPlayerTutorialing[playerid] = 8;
  1569. SetPlayerPos(playerid,1187.1349,-1323.7538,13.5591);
  1570. SetPlayerCameraPos(playerid,1206.7904,-1365.1343,27.3433);//Al Saints Hospital
  1571. SetPlayerCameraLookAt(playerid,1187.1349,-1323.7538,13.5591);
  1572. format(string,sizeof(string),"If you die,you will be asked to /accept death ~n~.When your really dead ,you will be ~n~spawned here,at Al Saints Hospital.");
  1573. TextDrawSetString(Textdraw98[playerid],string);
  1574. TextDrawShowForPlayer(playerid,Textdraw98[playerid]);
  1575. SendClientMessage(playerid,COLOR_WHITE,"{248B10}Tutorial:{FFFFFF}Use SPACEBAR to continue,SHIFT to go back.");
  1576. return 1;
  1577. }
  1578. if(gPlayerTutorialing[playerid] == 8)
  1579. {
  1580. gPlayerTutorialing[playerid] = 9;
  1581. SetPlayerPos(playerid,1479.8079,-1674.9541,14.6260);
  1582. SetPlayerCameraPos(playerid,1396.1614,-1650.0144,59.4351);//Pershing Square
  1583. SetPlayerCameraLookAt(playerid,1479.8079,-1674.9541,14.6260);
  1584. format(string,sizeof(string),"This place is the most ~n~ safest place in Los Santos.~n~You have no right to kill/rob/rape noone here");
  1585. TextDrawSetString(Textdraw98[playerid],string);
  1586. TextDrawShowForPlayer(playerid,Textdraw98[playerid]);
  1587. SendClientMessage(playerid,COLOR_WHITE,"{248B10}Tutorial:{FFFFFF}Use SPACEBAR to continue,SHIFT to go back.");
  1588. return 1;
  1589. }
  1590. if(gPlayerTutorialing[playerid] == 9)
  1591. {
  1592. gPlayerTutorialing[playerid] = 0;
  1593. PlayerInfo[playerid][pFirstJoined] = 1;
  1594. PlayerInfo[playerid][pSelected] = 0;
  1595. SpawnPlayer(playerid);
  1596. SetPlayerVirtualWorld(playerid,0);
  1597. TextDrawHideForPlayer(playerid,Textdraw98[playerid]);
  1598. SetCameraBehindPlayer(playerid);
  1599. TogglePlayerControllable(playerid, 1);
  1600. SendClientMessage(playerid,COLOR_WHITE,"{248B10}Tutorial:{FFFFFF}Now we will need some data from you!.");
  1601. return 1;
  1602. }
  1603. }
  1604. }
  1605.  
  1606.  
  1607. if(PRESSED(KEY_JUMP))
  1608. {
  1609. if(gPlayerTutorialing[playerid] >= 1)
  1610. {
  1611. if(gPlayerTutorialing[playerid] == 9)
  1612. {
  1613. gPlayerTutorialing[playerid] = 8;
  1614. SetPlayerPos(playerid,1187.1349,-1323.7538,13.5591);
  1615. SetPlayerCameraPos(playerid,1206.7904,-1365.1343,27.3433);//Al Saints Hospital
  1616. SetPlayerCameraLookAt(playerid,1187.1349,-1323.7538,13.5591);
  1617. format(string,sizeof(string),"If you die,you will be asked to /accept death ~n~.When your really dead ,you will be ~n~spawned here,at Al Saints Hospital.");
  1618. TextDrawSetString(Textdraw98[playerid],string);
  1619. TextDrawShowForPlayer(playerid,Textdraw98[playerid]);
  1620. SendClientMessage(playerid,COLOR_WHITE,"{248B10}Tutorial:{FFFFFF}Use SPACEBAR to continue,SHIFT to go back.");
  1621. return 1;
  1622. }
  1623. if(gPlayerTutorialing[playerid] == 8)
  1624. {
  1625. gPlayerTutorialing[playerid] = 7;
  1626. SetPlayerPos(playerid,617.2159,-1330.5415,13.6447);
  1627. SetPlayerCameraPos(playerid,652.8370,-1335.8909,28.2059);//Sector 1 Jail
  1628. SetPlayerCameraLookAt(playerid,617.2159,-1330.5415,13.6447);
  1629. format(string,sizeof(string),"If the police officers catch you ~n~they will jail you in one~n~of the jails around the city.");
  1630. TextDrawSetString(Textdraw98[playerid],string);
  1631. TextDrawShowForPlayer(playerid,Textdraw98[playerid]);
  1632. SendClientMessage(playerid,COLOR_WHITE,"{248B10}Tutorial:{FFFFFF}Use SPACEBAR to continue,SHIFT to go back.");
  1633. return 1;
  1634. }
  1635. if(gPlayerTutorialing[playerid] == 7)
  1636. {
  1637. gPlayerTutorialing[playerid] = 6;
  1638. SetPlayerPos(playerid,543.6426,-1277.8851,17.2422);
  1639. SetPlayerCameraPos(playerid,538.1927,-1259.2106,29.4667);//Grotti Dealership
  1640. SetPlayerCameraLookAt(playerid,543.6426,-1277.8851,17.2422);
  1641. format(string,sizeof(string),"If you have enough money,you will ~n~be able to buy a new car.~n~Command:/v.");
  1642. TextDrawSetString(Textdraw98[playerid],string);
  1643. TextDrawShowForPlayer(playerid,Textdraw98[playerid]);
  1644. SendClientMessage(playerid,COLOR_WHITE,"{248B10}Tutorial:{FFFFFF}Use SPACEBAR to continue,SHIFT to go back.");
  1645. return 1;
  1646. }
  1647. if(gPlayerTutorialing[playerid] == 6)
  1648. {
  1649. gPlayerTutorialing[playerid] = 5;
  1650. SetPlayerPos(playerid,590.7849,-1243.1808,17.9521);
  1651. SetPlayerCameraPos(playerid,609.0580,-1219.5914,29.2979);//Bank
  1652. SetPlayerCameraLookAt(playerid,590.7849,-1243.1808,17.9521);
  1653. format(string,sizeof(string),"Your paydays,your money will be deposited ~n~here,at the Bank.~n~You have the possibility to:.~n~/bank deposit,withdraw,transfer,savings,etc.~n~Remember:Minimum savings value:50.000$.");
  1654. TextDrawSetString(Textdraw98[playerid],string);
  1655. TextDrawShowForPlayer(playerid,Textdraw98[playerid]);
  1656. SendClientMessage(playerid,COLOR_WHITE,"{248B10}Tutorial:{FFFFFF}Use SPACEBAR to continue,SHIFT to go back.");
  1657. return 1;
  1658. }
  1659. if(gPlayerTutorialing[playerid] == 5)
  1660. {
  1661. gPlayerTutorialing[playerid] = 4;
  1662. SetPlayerPos(playerid,1482.2841,-1025.5725,24.352);
  1663. SetPlayerCameraPos(playerid,1522.6703,-1041.8273,60.2691);//Casino
  1664. SetPlayerCameraLookAt(playerid,1482.2841,-1025.5725,24.3520);
  1665. format(string,sizeof(string),"If you got tired of working ~n~for someone or for your job~n~you have the possibility to play.~n~here,at the Casino!~n~Commands:/casino");
  1666. TextDrawSetString(Textdraw98[playerid],string);
  1667. TextDrawShowForPlayer(playerid,Textdraw98[playerid]);
  1668. SendClientMessage(playerid,COLOR_WHITE,"{248B10}Tutorial:{FFFFFF}Use SPACEBAR to continue,SHIFT to go back.");
  1669. return 1;
  1670. }
  1671. if(gPlayerTutorialing[playerid] == 4)
  1672. {
  1673. gPlayerTutorialing[playerid] = 3;
  1674. SetPlayerPos(playerid,1380.7892,-1088.5284,27.3844);
  1675. SetPlayerCameraPos(playerid,1349.7155,-1115.9375,47.7593);//Jobs Building
  1676. SetPlayerCameraLookAt(playerid,1380.7892,-1088.5284,27.3844);
  1677. format(string,sizeof(string),"If you want to earn money,you will be able to ~n~get a job.There will be a list so you~n~will have to choose one job.~n~REMEBER:Some of these jobs requests~n~a owned vehicle!");
  1678. TextDrawSetString(Textdraw98[playerid],string);
  1679. TextDrawShowForPlayer(playerid,Textdraw98[playerid]);
  1680. SendClientMessage(playerid,COLOR_WHITE,"{248B10}Tutorial:{FFFFFF}Use SPACEBAR to continue,SHIFT to go back.");
  1681. return 1;
  1682. }
  1683. if(gPlayerTutorialing[playerid] == 3)
  1684. {
  1685. gPlayerTutorialing[playerid] = 2;
  1686. SetPlayerPos(playerid,1412.8313, -1700.3066, 13.5395);
  1687. SetPlayerCameraPos(playerid,1412.8313, -1700.3066, 13.5395);//Driving School
  1688. SetPlayerCameraLookAt(playerid,1412.8313, -1700.3066, 13.5395);
  1689. format(string,sizeof(string),"This is the Driving School,you will be able ~n~to take a drive test wich will cost you~n~5.000$ so you will get a Driving License.~n~REMEBER:The police stops you if you~n~don't have one.");
  1690. TextDrawSetString(Textdraw98[playerid],string);
  1691. TextDrawShowForPlayer(playerid,Textdraw98[playerid]);
  1692. SendClientMessage(playerid,COLOR_WHITE,"{248B10}Tutorial:{FFFFFF}Use SPACEBAR to continue,SHIFT to go back.");
  1693. return 1;
  1694. }
  1695. if(gPlayerTutorialing[playerid] == 2)
  1696. {
  1697. gPlayerTutorialing[playerid] = 1;
  1698. SetPlayerPos(playerid,1479.8079,-1674.9541,14.6260);
  1699. SetPlayerCameraPos(playerid,1396.1614,-1650.0144,59.4351);//Pershing Square
  1700. SetPlayerCameraLookAt(playerid,1479.8079,-1674.9541,14.6260);
  1701. format(string,sizeof(string),"This place is the most ~n~ safest place in Los Santos.~n~You have no right to kill/rob/rape noone here");
  1702. TextDrawSetString(Textdraw98[playerid],string);
  1703. TextDrawShowForPlayer(playerid,Textdraw98[playerid]);
  1704. SendClientMessage(playerid,COLOR_WHITE,"{248B10}Tutorial:{FFFFFF}Use SPACEBAR to continue,SHIFT to go back.");
  1705. return 1;
  1706. }
  1707. }
  1708. }
  1709. //==================================ENGINE======================================
  1710. new vehicleid = GetPlayerVehicleID(playerid);
  1711. if(IsPlayerInAnyVehicle(playerid))
  1712. {
  1713. if(vehEngine[vehicleid] == 0)
  1714. {
  1715. if(newkeys == KEY_JUMP)
  1716. {
  1717. new vid, sendername[MAX_PLAYER_NAME], vmodel[128];
  1718. vehEngine[vehicleid] = 2;
  1719. SetTimerEx("StartEngine", 3000, 0, "i", playerid);
  1720. SendClientMessage(playerid, COLOR_GREEN, "Vehicle engine starting");
  1721. vid = GetPlayerVehicleID(playerid);
  1722. GetVehicleName(vid,vmodel,sizeof(vmodel));
  1723. GetPlayerName(playerid,sendername,sizeof(sendername));
  1724. format(string, sizeof(string), "* %s is starting the engine of the %s", sendername, vmodel);
  1725. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1726. }
  1727. if(newkeys == KEY_SECONDARY_ATTACK)
  1728. {
  1729. RemovePlayerFromVehicle(playerid);
  1730. TogglePlayerControllable(playerid, 1);
  1731. }
  1732. }
  1733. }
  1734. return 1;
  1735. }
  1736. //========================================DEALERSHIP============================
  1737. public OnVehicleMod(playerid, vehicleid, componentid)
  1738. {
  1739. new id = GetVehicleID(vehicleid);
  1740. if(IsValidVehicle(id))
  1741. {
  1742. VehicleMods[id][GetVehicleComponentType(componentid)] = componentid;
  1743. SaveVehicle(id);
  1744. }
  1745. return 1;
  1746. }
  1747.  
  1748. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  1749. {
  1750. new id = GetVehicleID(vehicleid);
  1751. if(IsValidVehicle(id))
  1752. {
  1753. VehiclePaintjob[id] = paintjobid;
  1754. SaveVehicle(id);
  1755. }
  1756. return 1;
  1757. }
  1758.  
  1759. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  1760. {
  1761. new id = GetVehicleID(vehicleid);
  1762. if(IsValidVehicle(id))
  1763. {
  1764. VehicleColor[id][0] = color1;
  1765. VehicleColor[id][1] = color2;
  1766. SaveVehicle(id);
  1767. }
  1768. return 1;
  1769. }
  1770.  
  1771. ShowDialog(playerid, dialogid)
  1772. {
  1773. switch(dialogid)
  1774. {
  1775. case DIALOG_VEHICLE:
  1776. {
  1777. new vehicleid = GetPVarInt(playerid, "DialogValue1");
  1778. new caption[32], info[256];
  1779. format(caption, sizeof(caption), "Vehicle ID %d", vehicleid);
  1780. strcat(info, "\nTrunk", sizeof(info));
  1781. strcat(info, "\nFill Tank", sizeof(info));
  1782. switch(GetPlayerVehicleAccess(playerid, vehicleid))
  1783. {
  1784. case 1:
  1785. {
  1786. new value = VehicleValue[vehicleid]/2;
  1787. format(info, sizeof(info), "%s\nSell Vehicle ($%d)\nPark Vehicle\nEdit License Plate", info, value);
  1788. }
  1789. }
  1790. ShowPlayerDialog(playerid, dialogid, DIALOG_STYLE_LIST, caption, info, "Select", "Cancel");
  1791. }
  1792. case DIALOG_VEHICLE_BUY:
  1793. {
  1794. new vehicleid = GetPVarInt(playerid, "DialogValue1");
  1795. new caption[32], info[256];
  1796. format(caption, sizeof(caption), "Vehicle ID %d", vehicleid);
  1797. format(info, sizeof(info), "This vehicle is for sale ($%d)\nWould you like to buy it?", VehicleValue[vehicleid]);
  1798. ShowPlayerDialog(playerid, dialogid, DIALOG_STYLE_MSGBOX, caption, info, "Yes", "No");
  1799. }
  1800. case DIALOG_VEHICLE_SELL:
  1801. {
  1802. new targetid = GetPVarInt(playerid, "DialogValue1");
  1803. new id = GetPVarInt(playerid, "DialogValue2");
  1804. new price = GetPVarInt(playerid, "DialogValue3");
  1805. new info[256];
  1806. format(info, sizeof(info), "%s (%d) wants to sell you a %s for $%d.", PlayerName(targetid), targetid,
  1807. VehicleNames[VehicleModel[id]-400], price);
  1808. strcat(info, "\n\nWould you like to buy?", sizeof(info));
  1809. ShowPlayerDialog(playerid, dialogid, DIALOG_STYLE_MSGBOX, "Buy Vehicle", info, "Yes", "No");
  1810. }
  1811. case DIALOG_TRUNK:
  1812. {
  1813. new vehicleid = GetPVarInt(playerid, "DialogValue1");
  1814. new name[32], info[256];
  1815. for(new i=0; i < sizeof(VehicleTrunk[]); i++)
  1816. {
  1817. if(VehicleTrunk[vehicleid][i][1] > 0)
  1818. {
  1819. GetWeaponName(VehicleTrunk[vehicleid][i][0], name, sizeof(name));
  1820. format(info, sizeof(info), "%s%d. %s (%d)\n", info, i+1, name, VehicleTrunk[vehicleid][i][1]);
  1821. }
  1822. else
  1823. {
  1824. format(info, sizeof(info), "%s%d. Empty\n", info, i+1);
  1825. }
  1826. }
  1827. ShowPlayerDialog(playerid, dialogid, DIALOG_STYLE_LIST, "Trunk", info, "Select", "Cancel");
  1828. }
  1829. case DIALOG_TRUNK_ACTION:
  1830. {
  1831. new info[128];
  1832. strcat(info, "Put Into Trunk\nTake From Trunk", sizeof(info));
  1833. ShowPlayerDialog(playerid, dialogid, DIALOG_STYLE_LIST, "Trunk", info, "Select", "Cancel");
  1834. }
  1835. case DIALOG_VEHICLE_PLATE:
  1836. {
  1837. ShowPlayerDialog(playerid, dialogid, DIALOG_STYLE_INPUT, "Edit License Plate", "Enter new license plate:", "Change", "Back");
  1838. }
  1839. case DIALOG_FUEL:
  1840. {
  1841. new info[128];
  1842. strcat(info, "Refuel Vehicle ($" #FUEL_PRICE ")\nBuy Gas Can ($" #GAS_CAN_PRICE ")", sizeof(info));
  1843. ShowPlayerDialog(playerid, dialogid, DIALOG_STYLE_LIST, "Fuel Station", info, "OK", "Cancel");
  1844. }
  1845. case DIALOG_EDITVEHICLE:
  1846. {
  1847. new vehicleid = GetPVarInt(playerid, "DialogValue1");
  1848. new caption[32], info[256];
  1849. format(caption, sizeof(caption), "Edit Vehicle ID %d", vehicleid);
  1850. format(info, sizeof(info), "1. Value: [$%d]\n2. Model: [%d (%s)]\n3. Colors: [%d] [%d]\n4. License Plate: [%s]",
  1851. VehicleValue[vehicleid], VehicleModel[vehicleid], VehicleNames[VehicleModel[vehicleid]-400],
  1852. VehicleColor[vehicleid][0], VehicleColor[vehicleid][1], VehicleNumberPlate[vehicleid]);
  1853. strcat(info, "\n5. Delete Vehicle\n6. Park Vehicle\n7. Go To Vehicle", sizeof(info));
  1854. strcat(info, "\n\nEnter: [nr] [value1] [value2]", sizeof(info));
  1855. ShowPlayerDialog(playerid, dialogid, DIALOG_STYLE_INPUT, caption, info, "OK", "Cancel");
  1856. }
  1857. }
  1858. }
  1859. public OnVehicleSpawn(vehicleid)
  1860. {
  1861. VehicleSecurity[vehicleid] = 0;
  1862. new id = GetVehicleID(vehicleid);
  1863. if(IsValidVehicle(id))
  1864. {
  1865. if(VehicleColor[id][0] >= 0 && VehicleColor[id][1] >= 0)
  1866. ChangeVehicleColor(vehicleid, VehicleColor[id][0], VehicleColor[id][1]);
  1867. LinkVehicleToInterior(vehicleid, VehicleInterior[id]);
  1868. SetVehicleVirtualWorld(vehicleid, VehicleWorld[id]);
  1869. for(new i=0; i < sizeof(VehicleMods[]); i++)
  1870. {
  1871. AddVehicleComponent(vehicleid, VehicleMods[id][i]);
  1872. }
  1873. ChangeVehiclePaintjob(vehicleid, VehiclePaintjob[id]);
  1874. }
  1875. return 1;
  1876. }
  1877. public MainTimer()
  1878. {
  1879. new string[128];
  1880. new Float:x, Float:y, Float:z;
  1881.  
  1882. for(new i=0; i < MAX_PLAYERS; i++)
  1883. {
  1884. if(IsPlayerConnected(i))
  1885. {
  1886. if(GetPlayerState(i) == PLAYER_STATE_DRIVER)
  1887. {
  1888. new vehicleid = GetPlayerVehicleID(i);
  1889. if(!IsBicycle(vehicleid) && Fuel[vehicleid] > 0)
  1890. {
  1891. if(Fuel[vehicleid] <= 0)
  1892. {
  1893. ToggleEngine(vehicleid, VEHICLE_PARAMS_OFF);
  1894. GameTextForPlayer(i, "~r~out of fuel", 3000, 3);
  1895. SendClientMessage(i, COLOR_RED, "This vehicle is out of fuel!");
  1896. }
  1897. }
  1898. }
  1899. if(RefuelTime[i] > 0 && GetPVarInt(i, "FuelStation"))
  1900. {
  1901. new vehicleid = GetPlayerVehicleID(i);
  1902. Fuel[vehicleid] += 2.0;
  1903. RefuelTime[i]--;
  1904. if(RefuelTime[i] == 0)
  1905. {
  1906. if(Fuel[vehicleid] >= 100.0) Fuel[vehicleid] = 100.0;
  1907. new stationid = GetPVarInt(i, "FuelStation");
  1908. new cost = floatround(Fuel[vehicleid]-GetPVarFloat(i, "Fuel"))*FUEL_PRICE;
  1909. if(GetPlayerState(i) != PLAYER_STATE_DRIVER || Fuel[vehicleid] >= 100.0 || GetPlayerMoney(i) < cost
  1910. || !IsPlayerInRangeOfPoint(i, 10.0, FuelStationPos[stationid][0], FuelStationPos[stationid][1], FuelStationPos[stationid][2]))
  1911. {
  1912. if(GetPlayerMoney(i) < cost) cost = GetPlayerMoney(i);
  1913. GivePlayerCash(i, -cost);
  1914. format(string, sizeof(string), "~r~-$%d", cost);
  1915. GameTextForPlayer(i, string, 2000, 3);
  1916. format(string, sizeof(string), "You pay $%d for fuel", cost);
  1917. SendClientMessage(i, COLOR_WHITE, string);
  1918. SetPVarInt(i, "FuelStation", 0);
  1919. SetPVarFloat(i, "Fuel", 0.0);
  1920. }
  1921. else
  1922. {
  1923. RefuelTime[i] = 5;
  1924. format(string, sizeof(string), "~w~refueling...~n~~r~-$%d", cost);
  1925. GameTextForPlayer(i, string, 2000, 3);
  1926. }
  1927. }
  1928. }
  1929. if(TrackCar[i])
  1930. {
  1931. GetVehiclePos(TrackCar[i], x, y, z);
  1932. SetPlayerCheckpoint(i, x, y, z, 3);
  1933. }
  1934. }
  1935. }
  1936. }
  1937. public SaveTimer()
  1938. {
  1939. SaveVehicleIndex++;
  1940. if(SaveVehicleIndex >= MAX_DVEHICLES) SaveVehicleIndex = 1;
  1941. if(IsValidVehicle(SaveVehicleIndex)) SaveVehicle(SaveVehicleIndex);
  1942. }
  1943.  
  1944. public StopAlarm(vehicleid)
  1945. {
  1946. ToggleAlarm(vehicleid, VEHICLE_PARAMS_OFF);
  1947. }
  1948. //====================================ENGINE====================================
  1949. public StartEngine(playerid)
  1950. {
  1951. new vehicleid = GetPlayerVehicleID(playerid);
  1952. new Float:health;
  1953. new rand = random(2);
  1954. GetVehicleHealth(vehicleid, health);
  1955. if(IsPlayerInAnyVehicle(playerid))
  1956. {
  1957. if(vehEngine[vehicleid] == 2)
  1958. {
  1959. if(health > 300)
  1960. {
  1961. if(rand == 0)
  1962. {
  1963. vehEngine[vehicleid] = 1;
  1964. TogglePlayerControllable(playerid, 1);
  1965. SetTimerEx("DamagedEngine", 1000, 1, "i", playerid);
  1966. SendClientMessage(playerid, COLOR_GREEN, "Vehicle engine started");
  1967. }
  1968. if(rand == 1)
  1969. {
  1970. vehEngine[vehicleid] = 0;
  1971. TogglePlayerControllable(playerid, 0);
  1972. SendClientMessage(playerid, COLOR_RED, "Vehicle engine failed to start");
  1973. }
  1974. }
  1975. else
  1976. {
  1977. vehEngine[vehicleid] = 0;
  1978. TogglePlayerControllable(playerid, 0);
  1979. SendClientMessage(playerid, COLOR_RED, "Vehicle engine failed to start due to damage");
  1980. }
  1981. }
  1982. }
  1983. return 1;
  1984. }
  1985.  
  1986. public DamagedEngine(playerid)
  1987. {
  1988. new vehicleid = GetPlayerVehicleID(playerid);
  1989. new Float:health;
  1990. GetVehicleHealth(vehicleid, health);
  1991. if(IsPlayerInAnyVehicle(playerid))
  1992. {
  1993. if(vehEngine[vehicleid] == 1)
  1994. {
  1995. if(health < 300)
  1996. {
  1997. vehEngine[vehicleid] = 0;
  1998. TogglePlayerControllable(playerid, 0);
  1999. SendClientMessage(playerid, COLOR_RED, "Vehicle engine stopped due to damage");
  2000. }
  2001. }
  2002. }
  2003. return 1;
  2004. }
  2005. public OnPlayerExitVehicle(playerid, vehicleid)
  2006. {
  2007. TogglePlayerControllable(playerid, 1);
  2008. return 1;
  2009. }
  2010. //==============================================================================
  2011. public FixHour(hour)
  2012. {
  2013. hour = timeshift+hour;
  2014. if (hour < 0)
  2015. {
  2016. hour = hour+24;
  2017. }
  2018. else if (hour > 23)
  2019. {
  2020. hour = hour-24;
  2021. }
  2022. shifthour = hour;
  2023. return 1;
  2024. }
  2025. public SetOriginalColor(playerid)
  2026. {
  2027. if(IsPlayerConnected(playerid))
  2028. {
  2029. SetPlayerColor(playerid, COLOR_WHITE);
  2030. }
  2031. }
  2032. public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
  2033. {
  2034. if(IsPlayerConnected(playerid))
  2035. {
  2036. new Float:oldposx, Float:oldposy, Float:oldposz;
  2037. new Float:tempposx, Float:tempposy, Float:tempposz;
  2038. GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  2039. tempposx = (oldposx -x);
  2040. tempposy = (oldposy -y);
  2041. tempposz = (oldposz -z);
  2042. //printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
  2043. if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  2044. {
  2045. return 1;
  2046. }
  2047. }
  2048. return 0;
  2049. }
  2050. public ShowStats(playerid,targetid)
  2051. {
  2052. if(IsPlayerConnected(playerid)&&IsPlayerConnected(targetid))
  2053. {
  2054. new cash = GetPlayerMoney(targetid);
  2055. new atext[20];
  2056. if(PlayerInfo[targetid][pSex] == 1)
  2057. { atext = "Male"; }
  2058. else if(PlayerInfo[targetid][pSex] == 2)
  2059. { atext = "Female"; }
  2060. new otext[20];
  2061. if(PlayerInfo[targetid][pPlace] == 1)
  2062. { otext = "Europe"; }
  2063. else if(PlayerInfo[targetid][pPlace] == 2)
  2064. { otext = "America"; }
  2065. new drank[20];
  2066. if(PlayerInfo[targetid][pVip] == 1)
  2067. { drank = "Gold Donator"; }
  2068. else if(PlayerInfo[targetid][pVip] == 2)
  2069. { drank = "Silver Donator"; }
  2070. else { drank = "None"; }
  2071. new age = PlayerInfo[targetid][pAge];
  2072. new warns = PlayerInfo[targetid][pWarns];
  2073. new level = PlayerInfo[targetid][pLevel];
  2074. new exp = PlayerInfo[targetid][pExp];
  2075. new nxtlevel = PlayerInfo[targetid][pLevel]+1;
  2076. new expamount = nxtlevel*levelexp;
  2077. new costlevel = nxtlevel*levelcost;
  2078. new name[MAX_PLAYER_NAME];
  2079. new pnumber = PlayerInfo[targetid][pNumber];
  2080. GetPlayerName(targetid, name, sizeof(name));
  2081. new Float:px,Float:py,Float:pz;
  2082. GetPlayerPos(targetid, px, py, pz);
  2083. new coordsstring[128];
  2084. SendClientMessage(playerid, COLOR_GREEN,"_____________________________________________________________________________________________");
  2085. format(coordsstring, sizeof(coordsstring),"*** %s ***",name);
  2086. SendClientMessage(playerid, COLOR_YELLOW,coordsstring);
  2087. format(coordsstring, sizeof(coordsstring), "Level:[%d] Sex:[%s] Age:[%d] Origin:[%s] Cash:[$%d] Phone:[%d] ", level,atext,age,otext, cash, pnumber);
  2088. SendClientMessage(playerid, COLOR_WHITE,coordsstring);
  2089. format(coordsstring, sizeof(coordsstring), "DonateRank:[%s] Warns:[%d/5] Faction: [%s] Rank: [%d] Division: [%s] ", drank, warns, RPFNEx(playerid), PlayerInfo[playerid][pFacRank], RPFDN(playerid));
  2090. SendClientMessage(playerid, COLOR_LIGHTBLUE,coordsstring);
  2091. format(coordsstring, sizeof(coordsstring), "NextLevel:[$%d] Respect:[%d/%d]",costlevel,exp,expamount);
  2092. SendClientMessage(playerid, COLOR_LIGHTBLUE,coordsstring);
  2093. SendClientMessage(playerid, COLOR_GREEN,"____________________________________________________________________________________________");
  2094. }
  2095. }
  2096.  
  2097. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  2098. {
  2099. if(dialogid == 1234)
  2100. {
  2101. if(!response) return Kick(playerid);
  2102. if(response)
  2103. {
  2104. if(fexist(UserPath(playerid)))
  2105. {
  2106. INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
  2107. ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_WHITE"Type your password below to login.","Login","Quit");
  2108. }
  2109. else
  2110. {
  2111. ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT,""COL_WHITE"Registering...",""COL_WHITE"Type your password below to register a new account.","Register","Quit");
  2112. }
  2113. }
  2114. }
  2115. if(dialogid == 1)
  2116. {
  2117. if (!response) return Kick(playerid);
  2118. if(response)
  2119. {
  2120. if(!strlen(inputtext)) return ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, ""COL_WHITE"Registering...",""COL_RED"You have entered an invalid password.\n"COL_WHITE"Type your password below to register a new account.","Register","Quit");
  2121. new INI:File = INI_Open(UserPath(playerid));
  2122. INI_SetTag(File,"data");
  2123. INI_WriteInt(File,"Password",udb_hash(inputtext));
  2124. INI_WriteInt(File, "Level",PlayerInfo[playerid][pLevel] = 1);
  2125. INI_WriteInt(File, "Money",PlayerInfo[playerid][pCash] = 0);
  2126. INI_WriteInt(File, "Admin",PlayerInfo[playerid][pAdmin] = 0);
  2127. INI_WriteInt(File, "Tester",PlayerInfo[playerid][pTester] = 0);
  2128. INI_WriteInt(File, "Vip", PlayerInfo[playerid][pVip] = 0);
  2129. INI_WriteInt(File, "Spawn", PlayerInfo[playerid][pSpawn] = 1);
  2130. INI_WriteInt(File, "Model", PlayerInfo[playerid][pModel] = 23);
  2131. INI_WriteInt(File, "Locked", PlayerInfo[playerid][pLocked] = 0);
  2132. INI_WriteInt(File, "FirstJoined", PlayerInfo[playerid][pFirstJoined] = 0);
  2133. INI_WriteInt(File, "Continent", PlayerInfo[playerid][pPlace] = 0);
  2134. INI_WriteInt(File, "Sex", PlayerInfo[playerid][pSex] = 0);
  2135. INI_WriteInt(File, "Selected", PlayerInfo[playerid][pSelected] = 1);
  2136. INI_WriteInt(File, "Age", PlayerInfo[playerid][pAge] = 0);
  2137. INI_WriteInt(File, "Origin", PlayerInfo[playerid][pOrigin] = 0);
  2138. INI_WriteInt(File, "Respect", PlayerInfo[playerid][pExp] = 0);
  2139. INI_WriteInt(File, "Warns", PlayerInfo[playerid][pWarns] = 0);
  2140. INI_WriteInt(File, "Muted", PlayerInfo[playerid][pMuted] = 0);
  2141. INI_WriteInt(File, "MuteTime", PlayerInfo[playerid][pMuteTime] = 0);
  2142. new rp = 100000 + random(899999);
  2143. INI_WriteInt(File, "Ph", PlayerInfo[playerid][pNumber] = rp);
  2144. INI_WriteInt(File, "DriveLic",PlayerInfo[playerid][pDriveLic] = 0);
  2145. INI_Close(File);
  2146. SpawnPlayer(playerid);
  2147. SetPlayerSkin(playerid, PlayerInfo[playerid][pModel]);
  2148. }
  2149. }
  2150. if(dialogid == 2)
  2151. {
  2152. if(!response ) return Kick (playerid);
  2153. if(response)
  2154. {
  2155. if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
  2156. {
  2157. INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
  2158. SpawnPlayer(playerid);
  2159. gPlayerLogged[playerid] = 1;
  2160. GivePlayerCash(playerid, PlayerInfo[playerid][pCash]);
  2161. }
  2162. else
  2163. {
  2164. ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_RED"You have entered an incorrect password.\n"COL_WHITE"Type your password below to login.","Login","Quit");
  2165. gPlayerLogTries[playerid] += 1;
  2166. if(gPlayerLogTries[playerid] == 3)
  2167. {
  2168. Kick(playerid);
  2169. }
  2170. }
  2171. }
  2172. }
  2173. if(dialogid == 155)
  2174. {
  2175. if(response)
  2176. {
  2177. if (listitem == 0)
  2178. {
  2179. PlayerInfo[playerid][pSex] = 1;
  2180. SendClientMessage(playerid, COLOR_YELLOW2,"So you are Male");
  2181. ShowPlayerDialog(playerid,156,DIALOG_STYLE_INPUT,"Age","How old are you?:((This information is IC.))","Next","Leave Game");
  2182. }
  2183. else if (listitem == 1)
  2184. {
  2185. PlayerInfo[playerid][pSex] = 2;
  2186. SendClientMessage(playerid, COLOR_YELLOW2,"So you are Female");
  2187. ShowPlayerDialog(playerid,156,DIALOG_STYLE_INPUT,"Age","How old are you?:((This information is IC.))","Next","Leave Game");
  2188. }
  2189. }
  2190. else
  2191. {
  2192. Kick(playerid);
  2193. }
  2194. }
  2195. if(dialogid == 156)
  2196. {
  2197. if(response)
  2198. {
  2199. PlayerInfo[playerid][pAge] = strval(inputtext);
  2200. new string[64];
  2201. format(string, sizeof(string),"So you are %s years old", inputtext);
  2202. SendClientMessage(playerid, COLOR_YELLOW2, string);
  2203. new sexthings[] = " Europe \n America \n Russia";
  2204. if(strval(inputtext) <= 15)
  2205. {
  2206. SendClientMessage(playerid, COLOR_WHITE, "SERVER: This is a 16+ Only Server, Grow up and Come Back.");
  2207. Kick(playerid);
  2208. return 1;
  2209.  
  2210.  
  2211. }
  2212. if(strval(inputtext) >= 60)
  2213. {
  2214. SendClientMessage(playerid, COLOR_WHITE, "SERVER: Incorrect Age, You need to enter a Real Age.");
  2215. ShowPlayerDialog(playerid,156,DIALOG_STYLE_INPUT,"Age","How old are you?:((This information is IC.))","Next","Leave Game");
  2216. return 1;
  2217.  
  2218.  
  2219. }
  2220. ShowPlayerDialog(playerid,157,DIALOG_STYLE_LIST,"Where are you from?:((This information is IC.))",sexthings,"Select","Leave Game");
  2221. }
  2222. else
  2223. {
  2224. Kick(playerid);
  2225. }
  2226. }
  2227. if(dialogid == 157)
  2228. {
  2229. if(response)
  2230. {
  2231. if (listitem == 0)
  2232. {
  2233. PlayerInfo[playerid][pPlace] = 1;
  2234. SendClientMessage(playerid, COLOR_YELLOW2, "So you are from the Europe.");
  2235. gPlayerRegStep[playerid] = 0;
  2236. PlayerInfo[playerid][pSelected] = 1;
  2237. }
  2238. else if (listitem == 1)
  2239. {
  2240. PlayerInfo[playerid][pPlace] = 2;
  2241. SendClientMessage(playerid, COLOR_YELLOW2, "So you are from United States.");
  2242. gPlayerRegStep[playerid] = 0;
  2243. PlayerInfo[playerid][pSelected] = 1;
  2244. }
  2245. else if (listitem == 2)
  2246. {
  2247. PlayerInfo[playerid][pPlace] = 3;
  2248. SendClientMessage(playerid, COLOR_YELLOW2, "So you are from Russia.");
  2249. gPlayerRegStep[playerid] = 0;
  2250. PlayerInfo[playerid][pSelected] = 1;
  2251. }
  2252. gPlayerLogged[playerid] = 1;
  2253. new packthings[] = " Package 1 \n Package 2";
  2254. ShowPlayerDialog(playerid,158,DIALOG_STYLE_LIST,"Please select a package that you want to start with",packthings,"Select","Leave Game");
  2255. }
  2256. else
  2257. {
  2258. Kick(playerid);
  2259. }
  2260. }
  2261. if(dialogid == 158)
  2262. {
  2263. if(response)
  2264. {
  2265. if (listitem == 0)
  2266. {
  2267. new DialogString[1024];
  2268. format(DialogString, sizeof DialogString, "Level 2 \n 4 Respect Points \n 1000$");
  2269. ShowPlayerDialog(playerid,159,DIALOG_STYLE_MSGBOX,"Package 1", DialogString,"Accept","Back");
  2270. }
  2271. else if (listitem == 1)
  2272. {
  2273. new DialogString[1024];
  2274. format(DialogString, sizeof DialogString, "Level 1 \n 4000$");
  2275. ShowPlayerDialog(playerid,160,DIALOG_STYLE_MSGBOX,"Package 1", DialogString,"Accept","Back");
  2276. }
  2277. }
  2278. else
  2279. {
  2280. Kick(playerid);
  2281. }
  2282. }
  2283. if(dialogid == 159)
  2284. {
  2285. if(response)
  2286. {
  2287. new playerexp = PlayerInfo[playerid][pExp];
  2288. PlayerInfo[playerid][pExp] = playerexp + 4;
  2289. new playerlvl = PlayerInfo[playerid][pLevel];
  2290. PlayerInfo[playerid][pLevel] = playerlvl + 1;
  2291. GivePlayerCash(playerid, 1000);
  2292. TogglePlayerControllable(playerid, 1);
  2293. SendClientMessage(playerid, COLOR_YELLOW2,"That's all, if you need help you can /helpme, have fun!");
  2294. SendClientMessage(playerid, COLOR_LIGHTBLUE,"A taxi has bringed you to the DMV so you can take your Drivers License");
  2295. SetPlayerPos(playerid, 1424.1869,-1696.1482,13.5469);
  2296. }
  2297. else
  2298. {
  2299. new packthings[] = "Package 1 \n Package 2";
  2300. ShowPlayerDialog(playerid,158,DIALOG_STYLE_LIST,"Please select a package that you want to start with",packthings,"Select","Leave Game");
  2301. }
  2302. }
  2303. if(dialogid == 160)
  2304. {
  2305. if(response)
  2306. {
  2307. GivePlayerCash(playerid, 4000);
  2308. TogglePlayerControllable(playerid, 1);
  2309. SendClientMessage(playerid, COLOR_YELLOW2,"That's all, if you need help you can /helpme, have fun!");
  2310. SendClientMessage(playerid, COLOR_LIGHTBLUE,"A taxi has bringed you to the DMV so you can take your Drivers License");
  2311. SetPlayerPos(playerid, 1424.1869,-1696.1482,13.5469);
  2312. }
  2313. else
  2314. {
  2315. new packthings[] = "Package 1 \n Package 2";
  2316. ShowPlayerDialog(playerid,158,DIALOG_STYLE_LIST,"Please select a package that you want to start with",packthings,"Select","Leave Game");
  2317. }
  2318. }
  2319. //==========================DEALERSHIP==========================================
  2320. if(dialogid == DIALOG_ERROR)
  2321. {
  2322. ShowDialog(playerid, GetPVarInt(playerid, "DialogReturn"));
  2323. return 1;
  2324. }
  2325. SetPVarInt(playerid, "DialogReturn", dialogid);
  2326. if(dialogid == DIALOG_VEHICLE)
  2327. {
  2328. if(response)
  2329. {
  2330. switch(listitem)
  2331. {
  2332. case 0:
  2333. {
  2334. new vehicleid = GetPlayerVehicleID(playerid);
  2335. new engine, lights, alarm, doors, bonnet, boot, objective;
  2336. GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
  2337. if(boot == 1) boot = 0; else boot = 1;
  2338. SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
  2339. }
  2340. case 1:
  2341. {
  2342. new vehicleid = GetPlayerVehicleID(playerid);
  2343. new engine, lights, alarm, doors, bonnet, boot, objective;
  2344. GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
  2345. if(engine == 0 && Fuel[vehicleid] <= 0)
  2346. {
  2347. ShowErrorDialog(playerid, "This vehicle is out of fuel!");
  2348. return 1;
  2349. }
  2350. if(engine == 1) { engine = 0; lights = 0; }
  2351. else { engine = 1; lights = 1; }
  2352. SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
  2353. }
  2354. case 2:
  2355. {
  2356. new id = GetPVarInt(playerid, "DialogValue1");
  2357. if(GetPlayerVehicleAccess(playerid, id) != 1)
  2358. {
  2359. ShowErrorDialog(playerid, "You are not the owner of this vehicle!");
  2360. return 1;
  2361. }
  2362. new msg[128];
  2363. VehicleCreated[id] = 0;
  2364. new money = VehicleValue[id]/2;
  2365. GivePlayerCash(playerid, money);
  2366. format(msg, sizeof(msg), "You have sold your vehicle for $%d", money);
  2367. SendClientMessage(playerid, COLOR_WHITE, msg);
  2368. RemovePlayerFromVehicle(playerid);
  2369. DestroyVehicle(VehicleID[id]);
  2370. SaveVehicle(id);
  2371. }
  2372. case 3:
  2373. {
  2374. new vehicleid = GetPVarInt(playerid, "DialogValue1");
  2375. if(GetPlayerVehicleAccess(playerid, vehicleid) != 1 && GetPlayerVehicleAccess(playerid, vehicleid) != 3)
  2376. {
  2377. ShowErrorDialog(playerid, "You are not the owner of this vehicle!");
  2378. return 1;
  2379. }
  2380. GetVehiclePos(VehicleID[vehicleid], VehiclePos[vehicleid][0], VehiclePos[vehicleid][1], VehiclePos[vehicleid][2]);
  2381. GetVehicleZAngle(VehicleID[vehicleid], VehiclePos[vehicleid][3]);
  2382. SendClientMessage(playerid, COLOR_WHITE, "You have parked this vehicle here");
  2383. UpdateVehicle(vehicleid, 1);
  2384. PutPlayerInVehicle(playerid, VehicleID[vehicleid], 0);
  2385. SaveVehicle(vehicleid);
  2386. }
  2387. case 4:
  2388. {
  2389. ShowDialog(playerid, DIALOG_VEHICLE_PLATE);
  2390. }
  2391. }
  2392. }
  2393. return 1;
  2394. }
  2395. if(dialogid == DIALOG_VEHICLE_BUY)
  2396. {
  2397. if(response)
  2398. {
  2399. if(GetPlayerVehicles(playerid) >= MAX_PLAYER_VEHICLES)
  2400. {
  2401. ShowErrorDialog(playerid, "You can't buy any more vehicles! Max: " #MAX_PLAYER_VEHICLES );
  2402. return 1;
  2403. }
  2404. new id = GetPVarInt(playerid, "DialogValue1");
  2405. if(GetPlayerMoney(playerid) < VehicleValue[id])
  2406. {
  2407. ShowErrorDialog(playerid, "You don't have enough money to buy this vehicle!");
  2408. return 1;
  2409. }
  2410. new freeid;
  2411. for(new i=1; i < MAX_DVEHICLES; i++)
  2412. {
  2413. if(!VehicleCreated[i])
  2414. {
  2415. freeid = i; break;
  2416. }
  2417. }
  2418. if(!freeid)
  2419. {
  2420. ShowErrorDialog(playerid, "Vehicle dealership is out of stock!");
  2421. return 1;
  2422. }
  2423. GivePlayerCash(playerid, -VehicleValue[id]);
  2424. new dealerid = strval(VehicleOwner[id]);
  2425. VehicleCreated[freeid] = VEHICLE_PLAYER;
  2426. VehicleModel[freeid] = VehicleModel[id];
  2427. VehiclePos[freeid][0] = DealershipPos[dealerid][0];
  2428. VehiclePos[freeid][1] = DealershipPos[dealerid][1];
  2429. VehiclePos[freeid][2] = DealershipPos[dealerid][2];
  2430. VehicleColor[freeid][0] = VehicleColor[id][0];
  2431. VehicleColor[freeid][1] = VehicleColor[id][0];
  2432. VehicleInterior[freeid] = VehicleInterior[id];
  2433. VehicleWorld[freeid] = VehicleWorld[id];
  2434. VehicleValue[freeid] = VehicleValue[id];
  2435. strcpy(VehicleOwner[freeid], sizeof(VehicleOwner[]), PlayerName(playerid));
  2436. VehicleNumberPlate[freeid] = DEFAULT_NUMBER_PLATE;
  2437. for(new d=0; d < sizeof(VehicleTrunk[]); d++)
  2438. {
  2439. VehicleTrunk[freeid][d][0] = 0;
  2440. VehicleTrunk[freeid][d][1] = 0;
  2441. }
  2442. for(new d=0; d < sizeof(VehicleMods[]); d++)
  2443. {
  2444. VehicleMods[freeid][d] = 0;
  2445. }
  2446. VehiclePaintjob[freeid] = 255;
  2447. UpdateVehicle(freeid, 0);
  2448. SaveVehicle(freeid);
  2449. new msg[128];
  2450. format(msg, sizeof(msg), "You have bought this vehicle for $%d", VehicleValue[id]);
  2451. SendClientMessage(playerid, COLOR_WHITE, msg);
  2452. RemovePlayerFromVehicle(playerid);
  2453. SetTimer("Unfreeze", 1000, 0);
  2454. }
  2455. else
  2456. {
  2457. new vehicleid = GetPVarInt(playerid, "DialogValue1");
  2458. if(GetPlayerVehicleAccess(playerid, vehicleid) != 3)
  2459. {
  2460. RemovePlayerFromVehicle(playerid);
  2461. }
  2462. RemovePlayerFromVehicle(playerid);
  2463. }
  2464. return 1;
  2465. }
  2466. if(dialogid == DIALOG_VEHICLE_SELL)
  2467. {
  2468. if(response)
  2469. {
  2470. if(GetPlayerVehicles(playerid) >= MAX_PLAYER_VEHICLES)
  2471. {
  2472. ShowErrorDialog(playerid, "You can't buy any more vehicles! Max: " #MAX_PLAYER_VEHICLES );
  2473. return 1;
  2474. }
  2475. new targetid = GetPVarInt(playerid, "DialogValue1");
  2476. new vehicleid = GetPVarInt(playerid, "DialogValue2");
  2477. new price = GetPVarInt(playerid, "DialogValue3");
  2478. if(GetPlayerMoney(playerid) < price)
  2479. {
  2480. ShowErrorDialog(playerid, "You don't have enough money to buy this vehicle!");
  2481. return 1;
  2482. }
  2483. new msg[128];
  2484. strcpy(VehicleOwner[vehicleid], sizeof(VehicleOwner[]), PlayerName(playerid));
  2485. GivePlayerCash(playerid, -price);
  2486. GivePlayerCash(targetid, price);
  2487. SaveVehicle(vehicleid);
  2488. format(msg, sizeof(msg), "You have bought this vehicle for $%d", price);
  2489. SendClientMessage(playerid, COLOR_WHITE, msg);
  2490. format(msg, sizeof(msg), "%s (%d) has accepted your offer and bought the vehicle", PlayerName(playerid), playerid);
  2491. SendClientMessage(targetid, COLOR_WHITE, msg);
  2492. }
  2493. else
  2494. {
  2495. new targetid = GetPVarInt(playerid, "DialogValue1");
  2496. new msg[128];
  2497. format(msg, sizeof(msg), "%s (%d) refused your offer", PlayerName(playerid), playerid);
  2498. SendClientMessage(targetid, COLOR_WHITE, msg);
  2499. }
  2500. return 1;
  2501. }
  2502. if(dialogid == DIALOG_FINDVEHICLE)
  2503. {
  2504. if(response)
  2505. {
  2506. new id;
  2507. sscanf(inputtext[4], "d", id);
  2508. if(IsValidVehicle(id))
  2509. {
  2510. TrackCar[playerid] = VehicleID[id];
  2511. SendClientMessage(playerid, COLOR_WHITE, "You vehicle's location is shown on your radar");
  2512. }
  2513. }
  2514. return 1;
  2515. }
  2516. if(dialogid == DIALOG_TRUNK)
  2517. {
  2518. if(response)
  2519. {
  2520. SetPVarInt(playerid, "DialogValue2", listitem);
  2521. ShowDialog(playerid, DIALOG_TRUNK_ACTION);
  2522. }
  2523. else
  2524. {
  2525. new vehicleid = GetPVarInt(playerid, "DialogValue1");
  2526. new engine, lights, alarm, doors, bonnet, boot, objective;
  2527. GetVehicleParamsEx(VehicleID[vehicleid], engine, lights, alarm, doors, bonnet, boot, objective);
  2528. SetVehicleParamsEx(VehicleID[vehicleid], engine, lights, alarm, doors, bonnet, 0, objective);
  2529. }
  2530. return 1;
  2531. }
  2532. if(dialogid == DIALOG_TRUNK_ACTION)
  2533. {
  2534. if(response)
  2535. {
  2536. new vehicleid = GetPVarInt(playerid, "DialogValue1");
  2537. new slot = GetPVarInt(playerid, "DialogValue2");
  2538. switch(listitem)
  2539. {
  2540. case 0:
  2541. {
  2542. new weaponid = GetPlayerWeapon(playerid);
  2543. if(weaponid == 0)
  2544. {
  2545. ShowPlayerDialog(playerid, DIALOG_ERROR, DIALOG_STYLE_MSGBOX, "ERROR", "You don't have a weapon in your hands!", "OK", "");
  2546. return 1;
  2547. }
  2548. VehicleTrunk[vehicleid][slot][0] = weaponid;
  2549. if(IsMeleeWeapon(weaponid)) VehicleTrunk[vehicleid][slot][1] = 1;
  2550. else VehicleTrunk[vehicleid][slot][1] = GetPlayerAmmo(playerid);
  2551. RemovePlayerWeapon(playerid, weaponid);
  2552. SaveVehicle(vehicleid);
  2553. }
  2554. case 1:
  2555. {
  2556. if(VehicleTrunk[vehicleid][slot][1] <= 0)
  2557. {
  2558. ShowPlayerDialog(playerid, DIALOG_ERROR, DIALOG_STYLE_MSGBOX, "ERROR", "This slot is empty!", "OK", "");
  2559. return 1;
  2560. }
  2561. GivePlayerWeapon(playerid, VehicleTrunk[vehicleid][slot][0], VehicleTrunk[vehicleid][slot][1]);
  2562. VehicleTrunk[vehicleid][slot][0] = 0;
  2563. VehicleTrunk[vehicleid][slot][1] = 0;
  2564. SaveVehicle(vehicleid);
  2565. }
  2566. }
  2567. }
  2568. ShowDialog(playerid, DIALOG_TRUNK);
  2569. return 1;
  2570. }
  2571. if(dialogid == DIALOG_VEHICLE_PLATE)
  2572. {
  2573. if(response)
  2574. {
  2575. if(strlen(inputtext) < 1 || strlen(inputtext) >= sizeof(VehicleNumberPlate[]))
  2576. {
  2577. ShowErrorDialog(playerid, "Invalid length!");
  2578. return 1;
  2579. }
  2580. new id = GetPVarInt(playerid, "DialogValue1");
  2581. new vehicleid = VehicleID[id];
  2582. strcpy(VehicleNumberPlate[id], sizeof(VehicleNumberPlate[]), inputtext);
  2583. SaveVehicle(id);
  2584. SetVehicleNumberPlate(vehicleid, inputtext);
  2585. SetVehicleToRespawn(vehicleid);
  2586. new msg[128];
  2587. format(msg, sizeof(msg), "You have changed vehicle number plate to %s", inputtext);
  2588. SendClientMessage(playerid, COLOR_WHITE, msg);
  2589. }
  2590. else ShowDialog(playerid, DIALOG_VEHICLE);
  2591. return 1;
  2592. }
  2593. if(dialogid == DIALOG_FUEL)
  2594. {
  2595. if(response)
  2596. {
  2597. switch(listitem)
  2598. {
  2599. case 0:
  2600. {
  2601. if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER)
  2602. {
  2603. ShowErrorDialog(playerid, "You are not driving a vehicle!");
  2604. return 1;
  2605. }
  2606. new vehicleid = GetPlayerVehicleID(playerid);
  2607. if(IsBicycle(vehicleid))
  2608. {
  2609. ShowErrorDialog(playerid, "Your vehicle doesn't have a fuel tank!");
  2610. return 1;
  2611. }
  2612. if(Fuel[vehicleid] >= 100.0)
  2613. {
  2614. ShowErrorDialog(playerid, "Your vehicle fuel tank is full!");
  2615. return 1;
  2616. }
  2617. if(GetPlayerMoney(playerid) < FUEL_PRICE)
  2618. {
  2619. ShowErrorDialog(playerid, "You don't have enough money!");
  2620. return 1;
  2621. }
  2622. RefuelTime[playerid] = 5;
  2623. SetPVarFloat(playerid, "Fuel", Fuel[vehicleid]);
  2624. GameTextForPlayer(playerid, "~w~refueling...", 2000, 3);
  2625. }
  2626. case 1:
  2627. {
  2628. if(GetPVarInt(playerid, "GasCan"))
  2629. {
  2630. ShowErrorDialog(playerid, "You already have a gas can!");
  2631. return 1;
  2632. }
  2633. if(GetPlayerMoney(playerid) < GAS_CAN_PRICE)
  2634. {
  2635. ShowErrorDialog(playerid, "You don't have enough money!");
  2636. return 1;
  2637. }
  2638. GivePlayerCash(playerid, -GAS_CAN_PRICE);
  2639. SetPVarInt(playerid, "GasCan", 1);
  2640. SendClientMessage(playerid, COLOR_WHITE, "You have bought a gas can for $" #GAS_CAN_PRICE );
  2641. }
  2642. }
  2643. }
  2644. return 1;
  2645. }
  2646. if(dialogid == DIALOG_EDITVEHICLE)
  2647. {
  2648. if(response)
  2649. {
  2650. new id = GetPVarInt(playerid, "DialogValue1");
  2651. new nr, params[128];
  2652. sscanf(inputtext, "ds", nr, params);
  2653. switch(nr)
  2654. {
  2655. case 1:
  2656. {
  2657. new value = strval(params);
  2658. if(value < 0) value = 0;
  2659. VehicleValue[id] = value;
  2660. UpdateVehicleLabel(id, 1);
  2661. SaveVehicle(id);
  2662. ShowDialog(playerid, DIALOG_EDITVEHICLE);
  2663. }
  2664. case 2:
  2665. {
  2666. new value;
  2667. if(IsNumeric(params)) value = strval(params);
  2668. else value = GetVehicleModelIDFromName(params);
  2669. if(value < 400 || value > 611)
  2670. {
  2671. ShowErrorDialog(playerid, "Invalid vehicle model!");
  2672. return 1;
  2673. }
  2674. VehicleModel[id] = value;
  2675. for(new i=0; i < sizeof(VehicleMods[]); i++)
  2676. {
  2677. VehicleMods[id][i] = 0;
  2678. }
  2679. VehiclePaintjob[id] = 255;
  2680. UpdateVehicle(id, 1);
  2681. SaveVehicle(id);
  2682. ShowDialog(playerid, DIALOG_EDITVEHICLE);
  2683. }
  2684. case 3:
  2685. {
  2686. new color1, color2;
  2687. sscanf(params, "dd", color1, color2);
  2688. VehicleColor[id][0] = color1;
  2689. VehicleColor[id][1] = color2;
  2690. SaveVehicle(id);
  2691. ChangeVehicleColor(VehicleID[id], color1, color2);
  2692. ShowDialog(playerid, DIALOG_EDITVEHICLE);
  2693. }
  2694. case 4:
  2695. {
  2696. if(strlen(params) < 1 || strlen(params) > 8)
  2697. {
  2698. ShowErrorDialog(playerid, "Invalid length!");
  2699. return 1;
  2700. }
  2701. strcpy(VehicleNumberPlate[id], sizeof(VehicleNumberPlate[]), params);
  2702. SaveVehicle(id);
  2703. SetVehicleNumberPlate(VehicleID[id], params);
  2704. SetVehicleToRespawn(VehicleID[id]);
  2705. ShowDialog(playerid, DIALOG_EDITVEHICLE);
  2706. }
  2707. case 5:
  2708. {
  2709. DestroyVehicle(VehicleID[id]);
  2710. if(VehicleCreated[id] == VEHICLE_DEALERSHIP)
  2711. {
  2712. Delete3DTextLabel(VehicleLabel[id]);
  2713. }
  2714. VehicleCreated[id] = 0;
  2715. SaveVehicle(id);
  2716. new msg[128];
  2717. format(msg, sizeof(msg), "You have deleted vehicle id %d", id);
  2718. SendClientMessage(playerid, COLOR_WHITE, msg);
  2719. }
  2720. case 6:
  2721. {
  2722. if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER)
  2723. {
  2724. ShowErrorDialog(playerid, "You are not driving the vehicle!");
  2725. return 1;
  2726. }
  2727. GetVehiclePos(VehicleID[id], VehiclePos[id][0], VehiclePos[id][1], VehiclePos[id][2]);
  2728. GetVehicleZAngle(VehicleID[id], VehiclePos[id][3]);
  2729. SendClientMessage(playerid, COLOR_WHITE, "You have parked this vehicle here");
  2730. UpdateVehicle(id, 1);
  2731. PutPlayerInVehicle(playerid, VehicleID[id], 0);
  2732. SaveVehicle(id);
  2733. ShowDialog(playerid, DIALOG_EDITVEHICLE);
  2734. }
  2735. case 7:
  2736. {
  2737. new Float:x, Float:y, Float:z;
  2738. GetVehiclePos(VehicleID[id], x, y, z);
  2739. SetPlayerPos(playerid, x, y, z+1);
  2740. new msg[128];
  2741. format(msg, sizeof(msg), "You have teleported to vehicle id %d", id);
  2742. SendClientMessage(playerid, COLOR_WHITE, msg);
  2743. }
  2744. }
  2745. }
  2746. }
  2747. return 1;
  2748. }
  2749. public ClearChatboxToAll(playerid, lines)
  2750. {
  2751. if (IsPlayerConnected(playerid))
  2752. {
  2753. for(new i=0; i<lines; i++)
  2754. {
  2755. SendClientMessageToAll(COLOR_GREY, " ");
  2756. }
  2757. }
  2758. return 1;
  2759. }
  2760. public OOCOff(color,const string[])
  2761. {
  2762. for(new i = 0; i < MAX_PLAYERS; i++)
  2763. {
  2764. if(IsPlayerConnected(i))
  2765. {
  2766. if(!gOoc[i])
  2767. {
  2768. SendClientMessage(i, color, string);
  2769. }
  2770. }
  2771. }
  2772. }
  2773. forward TazeTimer(playerid);
  2774. public TazeTimer(playerid)
  2775. {
  2776. if(IsPlayerConnected(playerid))
  2777. {
  2778. new string[128];
  2779. if (TazeTimeout[playerid] > 0)
  2780. {
  2781. format(string,sizeof(string),"~n~~n~~n~~n~~n~~n~~n~~n~~r~Tazer effect fading in ~w~%d ~r~seconds", TazeTimeout[playerid]);
  2782. GameTextForPlayer(playerid, string,1500, 3);
  2783. TazeTimeout[playerid] -= 1;
  2784. ApplyAnimation(playerid,"CRACK","crckdeth2",4.1,0,1,1,1,1,1);
  2785. }
  2786. if(TazeTimeout[playerid] <= 0)
  2787. {
  2788. KillTimer(TazeCountDown[playerid]);
  2789. TogglePlayerControllable(playerid, 1);
  2790. TogglePlayerTazed(playerid, 0);
  2791. ClearAnimations(playerid);
  2792. format(string, sizeof(string), "* %s recovers from the tazer effect and stands up.", RPN(playerid));
  2793. SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
  2794. }
  2795. }
  2796. return 1;
  2797. }
  2798.  
  2799.  
  2800. forward CuffTimer(playerid);
  2801. public CuffTimer(playerid)
  2802. {
  2803. if(IsPlayerConnected(playerid))
  2804. {
  2805. new string[128];
  2806. if (CuffTimeout[playerid] > 0)
  2807. {
  2808. //format(string,sizeof(string),"~n~~n~~n~~n~~n~~n~~n~~n~~r~Cuffs open in ~w~%d ~r~seconds", CuffTimeout[playerid]);
  2809. //GameTextForPlayer(playerid, string,1500, 3);
  2810. CuffTimeout[playerid] -= 1;
  2811. }
  2812. if(CuffTimeout[playerid] <= 0)
  2813. {
  2814. KillTimer(CuffCountDown[playerid]);
  2815. TogglePlayerControllable(playerid, 1);
  2816. TogglePlayerCuffed(playerid, 0);
  2817. TogglePlayerTazed(playerid, 0);
  2818. if(!Uncuffed[playerid])
  2819. {
  2820. format(string, sizeof(string), "* %s manages to get their hands out of the cuffs.", RPN(playerid));
  2821. SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
  2822. }
  2823. Uncuffed[playerid] = 0;
  2824. KillTimer(CuffCountDown[playerid]);
  2825. RemovePlayerAttachedObject(playerid, 0);
  2826. ClearAnimations(playerid);
  2827. SetPlayerSpecialAction(playerid,SPECIAL_ACTION_CUFFED);
  2828. }
  2829. }
  2830. return 1;
  2831. }
  2832. public ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
  2833. {
  2834. if(IsPlayerConnected(playerid))
  2835. {
  2836. new Float:posx, Float:posy, Float:posz;
  2837. new Float:oldposx, Float:oldposy, Float:oldposz;
  2838. new Float:tempposx, Float:tempposy, Float:tempposz;
  2839. GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  2840. //radi = 2.0; //Trigger Radius
  2841. for(new i = 0; i < MAX_PLAYERS; i++)
  2842. {
  2843. if(IsPlayerConnected(i) && (GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i)))
  2844. {
  2845. if(!BigEar[i])
  2846. {
  2847. GetPlayerPos(i, posx, posy, posz);
  2848. tempposx = (oldposx -posx);
  2849. tempposy = (oldposy -posy);
  2850. tempposz = (oldposz -posz);
  2851. //printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
  2852. if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
  2853. {
  2854. SendClientMessage(i, col1, string);
  2855. }
  2856. else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
  2857. {
  2858. SendClientMessage(i, col2, string);
  2859. }
  2860. else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
  2861. {
  2862. SendClientMessage(i, col3, string);
  2863. }
  2864. else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
  2865. {
  2866. SendClientMessage(i, col4, string);
  2867. }
  2868. else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  2869. {
  2870. SendClientMessage(i, col5, string);
  2871. }
  2872. }
  2873. else
  2874. {
  2875. SendClientMessage(i, col1, string);
  2876. }
  2877. }
  2878. }
  2879. }//not connected
  2880. return 1;
  2881. }
  2882. public ClearChatboxToAll2(playerid, lines)//newbie chat
  2883. {
  2884. for(new k=0; k<MAX_PLAYERS; k++)
  2885. {
  2886. if (IsPlayerConnected(k))
  2887. {
  2888. for(new i=0; i<lines; i++)
  2889. {
  2890. if (PlayerInfo[k][pLevel] < 4)
  2891. {
  2892. SendClientMessage(k, COLOR_GREY, " ");
  2893. }
  2894. }
  2895. }
  2896. }
  2897. return 1;
  2898. }
  2899. public split(const strsrc[], strdest[][], delimiter)
  2900. {
  2901. new i, li;
  2902. new aNum;
  2903. new len;
  2904. while(i <= strlen(strsrc)){
  2905. if(strsrc[i]==delimiter || i==strlen(strsrc)){
  2906. len = strmid(strdest[aNum], strsrc, li, i, 128);
  2907. strdest[aNum][len] = 0;
  2908. li = i+1;
  2909. aNum++;
  2910. }
  2911. i++;
  2912. }
  2913. return 1;
  2914. }
  2915. public SendAdminMessage(color, string[])
  2916. {
  2917. for(new i = 0; i < MAX_PLAYERS; i++)
  2918. {
  2919. if(IsPlayerConnected(i))
  2920. {
  2921. if(PlayerInfo[i][pAdmin] >= 1)
  2922. {
  2923. SendClientMessage(i, color, string);
  2924. }
  2925. }
  2926. }
  2927. }
  2928. public SendTesterMessage(color, string[])
  2929. {
  2930. for(new i = 0; i < MAX_PLAYERS; i++)
  2931. {
  2932. if(IsPlayerConnected(i))
  2933. {
  2934. if(PlayerInfo[i][pTester] >= 1)
  2935. {
  2936. SendClientMessage(i, color, string);
  2937. }
  2938. }
  2939. }
  2940. }
  2941. public ProxDetectorS(Float:radi, playerid, targetid)
  2942. {
  2943. if(IsPlayerConnected(playerid)&&IsPlayerConnected(targetid))
  2944. {
  2945. new Float:posx, Float:posy, Float:posz;
  2946. new Float:oldposx, Float:oldposy, Float:oldposz;
  2947. new Float:tempposx, Float:tempposy, Float:tempposz;
  2948. GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  2949. //radi = 2.0; //Trigger Radius
  2950. GetPlayerPos(targetid, posx, posy, posz);
  2951. tempposx = (oldposx -posx);
  2952. tempposy = (oldposy -posy);
  2953. tempposz = (oldposz -posz);
  2954. //printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
  2955. if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  2956. {
  2957. return 1;
  2958. }
  2959. }
  2960. return 0;
  2961. }
  2962. public OnPlayerText(playerid, text[])
  2963. {
  2964. if(PlayerInfo[playerid][pMuted] == 1)
  2965. {
  2966. SendClientMessage(playerid, COLOR_RED, "You cannot speak, you have been silenced");
  2967. return 0;
  2968. }
  2969. if(Mobile[playerid] != 255)
  2970. {
  2971. new string[128], sendername[MAX_PLAYER_NAME];
  2972. GetPlayerName(playerid, sendername, sizeof(sendername));
  2973. sendername[strfind(sendername,"_")] = ' ';
  2974. format(string, sizeof(string), "%s Says (cellphone): %s", sendername, text);
  2975. ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
  2976. }
  2977. if (realchat)
  2978. {
  2979. new sendername[MAX_PLAYER_NAME], string[128];
  2980. GetPlayerName(playerid, sendername, sizeof(sendername));
  2981. sendername[strfind(sendername,"_")] = ' ';
  2982. format(string, sizeof(string), "%s Says: %s", sendername, text);
  2983. ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
  2984. new lengthtime = strlen(text);
  2985. new time = lengthtime*50;
  2986. ApplyAnimation(playerid,"PED","IDLE_CHAT",4.0,0,0,0,0,time);
  2987. return 0;
  2988. }
  2989. return 1;
  2990. }
  2991. public newbietimer()
  2992. {
  2993. for(new i = 0; i < MAX_PLAYERS; i++)
  2994. {
  2995. ntimer[i] -= 10;
  2996. }
  2997. }
  2998. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  2999. {
  3000. if(!ispassenger)
  3001. {
  3002. new id = GetVehicleID(vehicleid);
  3003. if(IsValidVehicle(id) && VehicleCreated[id] == VEHICLE_PLAYER)
  3004. {
  3005. new msg[128];
  3006. format(msg, sizeof(msg), "This vehicle belongs to %s", VehicleOwner[id]);
  3007. SendClientMessage(playerid, COLOR_GREY, msg);
  3008. }
  3009. }
  3010. else if(IsLSPDVehicle(vehicleid) && PlayerInfo[playerid][pFac] != 1)
  3011. {
  3012. new Float:pos[3];
  3013. GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
  3014. SetPlayerPos(playerid, pos[0], pos[1], pos[2]);
  3015. SendClientMessage(playerid, COLOR_GREY, " This vehicle is restricted to the LSPD faction.");
  3016. }
  3017. else if(IsGovVehicle(vehicleid) && PlayerInfo[playerid][pFac] != 2)
  3018. {
  3019. new Float:pos[3];
  3020. GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
  3021. SetPlayerPos(playerid, pos[0], pos[1], pos[2]);
  3022. SendClientMessage(playerid, COLOR_GREY, " This vehicle is restricted to the GOV faction.");
  3023. }
  3024. else if(IsNewsVehicle(vehicleid) && PlayerInfo[playerid][pFac] != 4)
  3025. {
  3026. new Float:pos[3];
  3027. GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
  3028. SetPlayerPos(playerid, pos[0], pos[1], pos[2]);
  3029. SendClientMessage(playerid, COLOR_GREY, " This vehicle is restricted to the News Reporters faction.");
  3030. }
  3031. return 1;
  3032. }
  3033.  
  3034. public RACtime(playerid)
  3035. {
  3036. for(new player=0; player<MAX_PLAYERS; player++)
  3037. {
  3038. if(!IsVehicleOccupied(player)) SetVehicleToRespawn(player);
  3039. }
  3040. for(new car = 1; car <= 1000; car++)
  3041. {
  3042. if(!IsVehicleOccupied(car)) SetVehicleToRespawn(car);
  3043. }
  3044. return 1;
  3045. }
  3046. public ABroadCast(color,const string[],level)
  3047. {
  3048. for(new i = 0; i < MAX_PLAYERS; i++)
  3049. {
  3050. if(IsPlayerConnected(i))
  3051. {
  3052. if (PlayerInfo[i][pAdmin] >= level)
  3053. {
  3054. SendClientMessage(i, color, string);
  3055. }
  3056. }
  3057. }
  3058. return 1;
  3059. }
  3060. public TBroadCast(color,const string[],level)
  3061. {
  3062. for(new i = 0; i < MAX_PLAYERS; i++)
  3063. {
  3064. if(IsPlayerConnected(i))
  3065. {
  3066. if (PlayerInfo[i][pTester] >= level)
  3067. {
  3068. SendClientMessage(i, color, string);
  3069. }
  3070. }
  3071. }
  3072. return 1;
  3073. }
  3074. public OnPlayerShootPlayer(Shooter,Target,Float:HealthLost,Float:ArmourLost)
  3075. {
  3076. new string[128];
  3077.  
  3078. if(IsACop(Shooter))
  3079. {
  3080. if(Tazer[Shooter])
  3081. {
  3082. if(GetPlayerWeapon(Shooter) == 23)
  3083. {
  3084. if(!IsPlayerTazed(Target) && !IsPlayerCuffed(Target) && !IsPlayerTied(Target))
  3085. {
  3086. new Float:HP, Float:Armor;
  3087. GetPlayerHealth(Target, HP);
  3088. GetPlayerArmour(Target, Armor);
  3089. SetPlayerHealth(Target, HealthLost+HP);
  3090. SetPlayerArmour(Target, ArmourLost+Armor);
  3091. if(!IsPlayerNearPlayer(Shooter, Target, 8)) return SendClientMessage(Shooter, COLOR_GREY, "You are too far away from that player.");
  3092. if(IsHoldingFirearm(Target)) return SendClientMessage(Shooter, COLOR_GREY, "You can't taze someone with a gun in hand.");
  3093. // Got Tazed
  3094. format(string, sizeof(string), "* %s aims their tazer on %s and tazes them.", RPN(Shooter), RPN(Target));
  3095. SendNearbyMessage(Shooter, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
  3096. GameTextForPlayer(Target, "~r~Tazed", 3500, 3);
  3097. // Custom Freeze
  3098. ApplyAnimation(Target,"CRACK","crckdeth2",4.1,0,1,1,1,1,1);
  3099. TogglePlayerControllable(Target, 0);
  3100. // Tazed Detecting
  3101. TogglePlayerTazed(Target, 1);
  3102. // Tazer Timeout
  3103. TazeTimeout[Target] = 11;
  3104. TazeCountDown[Target] = SetTimerEx("TazeTimer", 1000, true, "d", Target);
  3105. }
  3106.  
  3107. }
  3108. }
  3109. }
  3110. return 1;
  3111. }
  3112. //================================[COMMANDS]====================================
  3113. CMD:veh(playerid, params[])
  3114. {
  3115. if(PlayerInfo[playerid][pAdmin] >= 4)
  3116. {
  3117. new veh,color1,color2;
  3118. if (!sscanf(params, "iii", veh, color1,color2))
  3119. {
  3120. new Float:x, Float:y, Float:z;
  3121. GetPlayerPos(playerid, x,y,z);
  3122. AddStaticVehicle(veh, x,y,z,0,color1, color2);
  3123. }
  3124. else SendClientMessage(playerid, 0xFFFFFFFF, "Usage: /veh [carid] [Color 1] [Color 2]");
  3125. }
  3126. else SendClientMessage(playerid, 0xFFFFFFFF, "You do not have the rights to use that command!");
  3127. return 1;
  3128. }
  3129.  
  3130. CMD:stats(playerid, params[])
  3131. {
  3132. if(gPlayerLogged[playerid] == 1)
  3133. {
  3134. ShowStats(playerid, playerid);
  3135. }
  3136. else
  3137. {
  3138. SCM(playerid, COLOR_GREY,"You are not logged in!");
  3139. }
  3140. return 1;
  3141. }
  3142. CMD:th(playerid, params[])
  3143. {
  3144. new string[128];
  3145. if(!(PlayerInfo[playerid][pTester] == 1)) return SCM(playerid, COLOR_GREY,"You are not authorized to use this command");
  3146. if(PlayerInfo[playerid][pTester] == 1)
  3147. {
  3148. format(string, sizeof(string),"***Testers Commands:{C3C3C3} /goto /gethere /respawn /cc /cnc /mute /unmute /tc [text] (tester/admin chat) /tod /sendtols");
  3149. SendClientMessage(playerid, COLOR_GRAD1, string);
  3150. }
  3151. return 1;
  3152. }
  3153. CMD:ah(playerid, params[])
  3154. {
  3155. if(!(PlayerInfo[playerid][pAdmin] >= 1)) return SCM(playerid, COLOR_GREY,"You are not authorized to use this command");
  3156. new string[128];
  3157. if(PlayerInfo[playerid][pAdmin] >= 1)
  3158. {
  3159. format(string, sizeof(string),"***Admin Level 1:{C3C3C3} /goto /gethere /respawn /healall /kick /ban /cc /cnc /a [text] (admin chat)");
  3160. SendClientMessage(playerid, COLOR_GRAD1, string);
  3161. format(string, sizeof(string),"***Admin Level 1:{C3C3C3} /warn /aod /unban /unbanip /freeze /unfreeze /check /mute /unmute /acceptreport /markfalse");
  3162. SendClientMessage(playerid, COLOR_GRAD1, string);
  3163. }
  3164. if(PlayerInfo[playerid][pAdmin] >= 2)
  3165. {
  3166. format(string, sizeof(string),"***Admin Level 2:{C3C3C3} /gotols /gotolv /gotosf /sendtols");
  3167. SendClientMessage(playerid, COLOR_GRAD1, string);
  3168. }
  3169. if(PlayerInfo[playerid][pAdmin] >= 4)
  3170. {
  3171. format(string, sizeof(string),"***Admin Level 4:{C3C3C3} /veh /setskin /sethp /givegun");
  3172. SendClientMessage(playerid, COLOR_GRAD1, string);
  3173. }
  3174. if(PlayerInfo[playerid][pAdmin] >= 1337)
  3175. {
  3176. format(string, sizeof(string),"***Admin Level 1337:{C3C3C3} /rac /setlevel /givemoney");
  3177. SendClientMessage(playerid, COLOR_GRAD1, string);
  3178. }
  3179. if(PlayerInfo[playerid][pAdmin] >= 1338)
  3180. {
  3181. format(string, sizeof(string),"***Admin Level 1338:{C3C3C3} /maketester /makeadmin /changename /addv /editv /setfuel");
  3182. SendClientMessage(playerid, COLOR_GRAD1, string);
  3183. format(string, sizeof(string),"***Admin Level 1338:{C3C3C3} /adddealership /deletedealership /movedealership /gotodealership");
  3184. SendClientMessage(playerid, COLOR_GRAD1, string);
  3185. format(string, sizeof(string),"***Admin Level 1338:{C3C3C3} /addfuelstation /deletefuelstation /movefuelstation /gotofuelstation");
  3186. SendClientMessage(playerid, COLOR_GRAD1, string);
  3187. }
  3188. return 1;
  3189. }
  3190.  
  3191. CMD:help(playerid, params[])
  3192. {
  3193. if(PlayerInfo[playerid][pAdmin] >= 1)
  3194. {
  3195. SendClientMessage(playerid, COLOR_GRAD2,"***Admin: /ah");
  3196. }
  3197. if(PlayerInfo[playerid][pTester] >= 1)
  3198. {
  3199. SendClientMessage(playerid, COLOR_GRAD2,"***Tester: /th");
  3200. }
  3201. SendClientMessage(playerid, COLOR_GRAD1,"{FFAF00}*** ACCOUNT *** {C3C3C3}/rules /forum /stats /buylevel");
  3202. SendClientMessage(playerid, COLOR_GRAD2,"{FFAF00}*** GENERAL *** {C3C3C3}/me /anims /do /time /helpme /report /(c)all /(h)angup /(p)ickup /number");
  3203. SendClientMessage(playerid, COLOR_GRAD2,"{FFAF00}*** GENERAL *** {C3C3C3}/admins /testers /id /pay /newspaper /stopanim /takeexam");
  3204. SendClientMessage(playerid, COLOR_GRAD2,"{FFAF00}*** CAR *** {C3C3C3}/v /tow /eject /ejectall /vlock /valarm /fuel /trunk");
  3205. SendClientMessage(playerid, COLOR_GRAD2,"{FFAF00}*** CAR *** {C3C3C3}/clearmods /sellv /givecarkeys /trackcar /engine");
  3206. SendClientMessage(playerid, COLOR_GRAD2,"{FFAF00}*** CHAT *** {C3C3C3}/b [local ooc chat] /s (shout) /low [low chat]");
  3207. SendClientMessage(playerid, COLOR_GRAD2,"{FFAF00}*** CHAT *** {C3C3C3}/n (newbie chat) /w (whisper) /pm (private message ooc)");
  3208. return 1;
  3209. }
  3210. CMD:setskin(playerid, params[])
  3211. {
  3212. new id, ammount, name[MAX_PLAYER_NAME], string[128];
  3213. if(!(PlayerInfo[playerid][pAdmin] >= 4)) return SCM(playerid, COLOR_GREY,"You are not authorized to use this command");
  3214. else if(sscanf(params,"ui", id, ammount)) return SCM(playerid, COLOR_GREY,"USAGE: /setskin [playerid/partofname] [skinmodel]");
  3215. else if(ammount > 299 || ammount < 1) return SCM(playerid, COLOR_GREY,"Wrong Skin ID! Available ID's: 1-299");
  3216. else if(!IsPlayerConnected(id)) return SCM(playerid, COLOR_GREY,"Invalid player id");
  3217. else
  3218. {
  3219. GetPlayerName(playerid, name, sizeof(name));
  3220. format(string, sizeof(string),"Your skin have been setted to %i by admin %s", ammount, name);
  3221. SendClientMessage(id, COLOR_GREEN, string);
  3222. PlayerInfo[id][pModel] = ammount;
  3223. SetPlayerSkin(id, PlayerInfo[id][pModel]);
  3224. }
  3225. return 1;
  3226. }
  3227. CMD:sendtols(playerid, params[])
  3228. {
  3229. new id, sendername[MAX_PLAYER_NAME], string[128];
  3230. if(PlayerInfo[playerid][pAdmin] < 2 && PlayerInfo[playerid][pTester] < 1) return SCM(playerid, COLOR_GREY,"You are not authorized to use this command");
  3231. else if(sscanf(params,"u", id)) return SCM(playerid, COLOR_GREY,"USAGE: /sendtols [playerid/partofname]");
  3232. else if(GetPlayerState(id) == 2)
  3233. {
  3234. new tmpcar = GetPlayerVehicleID(id);
  3235. SetVehiclePos(tmpcar,1529.6,-1691.2,13.3);
  3236. }
  3237. else
  3238. {
  3239. SetPlayerPos(id, 1529.6,-1691.2,13.3);
  3240. }
  3241. GetPlayerName(playerid, sendername, sizeof(sendername));
  3242. sendername[strfind(sendername,"_")] = ' ';
  3243. format(string, sizeof(string),"You have been teleported to Los Santos by admin %s !", sendername);
  3244. SendClientMessage(id, COLOR_GRAD1, string);
  3245. SetPlayerInterior(id,0);
  3246. SetPlayerVirtualWorld(id, 0);
  3247. return 1;
  3248. }
  3249. CMD:setlevel(playerid, params[])
  3250. {
  3251. new id, level, sendername[MAX_PLAYER_NAME], string[128];
  3252. if(!(PlayerInfo[playerid][pAdmin] >= 1337)) return SCM(playerid, COLOR_GREY,"You are not authorized to use this command");
  3253. else if(sscanf(params,"ui", id, level)) return SCM(playerid, COLOR_GREY,"USAGE: /setlevel [playerid/partofname] [level]");
  3254. else if(!IsPlayerConnected(id)) return SCM(playerid, COLOR_GREY,"Invalid player ID");
  3255. else
  3256. {
  3257. PlayerInfo[id][pLevel] = level;
  3258. GetPlayerName(playerid, sendername, sizeof(sendername));
  3259. sendername[strfind(sendername,"_")] = ' ';
  3260. format(string, sizeof(string),"Your level has been set to %i by admin %s", level, sendername);
  3261. SendClientMessage(id, COLOR_YELLOW, string);
  3262. }
  3263. return 1;
  3264. }
  3265. CMD:sethp(playerid, params[])
  3266. {
  3267. new id, hp, sendername[MAX_PLAYER_NAME], string[128];
  3268. if(!(PlayerInfo[playerid][pAdmin] >= 4)) return SCM(playerid, COLOR_GREY,"You are not authorized to use this command");
  3269. else if(sscanf(params,"ui", id, hp)) return SCM(playerid, COLOR_GREY,"USAGE: /sethp [playerid/partofname] [ammount]");
  3270. else if(!IsPlayerConnected(id)) return SCM(playerid, COLOR_GREY,"Invalid player ID");
  3271. else
  3272. {
  3273. SetPlayerHealth(id, hp);
  3274. GetPlayerName(playerid, sendername, sizeof(sendername));
  3275. sendername[strfind(sendername,"_")] = ' ';
  3276. format(string, sizeof(string),"Your health has been set to %i by admin %s", hp, sendername);
  3277. SendClientMessage(id, COLOR_YELLOW, string);
  3278. }
  3279. return 1;
  3280. }
  3281. CMD:givegun(playerid, params[])
  3282. {
  3283. new id, gun, ammo;
  3284. if(!(PlayerInfo[playerid][pAdmin] >= 4)) return SCM(playerid, COLOR_GREY,"You are not authorized to use this command");
  3285. else if(sscanf(params,"uii", id, gun, ammo)) return SCM(playerid, COLOR_GREY,"USAGE: /givegun [playerid/partofname] [gunid] [ammo]");
  3286. else if(gun > 47 || gun < 1) return SCM(playerid, COLOR_GREY,"GUN ID'S: 1-47");
  3287. else if(ammo > 999 || ammo < 1) return SCM(playerid, COLOR_GREY,"Ammo 1-999");
  3288. else
  3289. {
  3290. GivePlayerWeapon(id, gun, ammo);
  3291. }
  3292. return 1;
  3293. }
  3294. CMD:admins(playerid, params[])
  3295. {
  3296. if(IsPlayerConnected(playerid))
  3297. {
  3298. SendClientMessage(playerid, COLOR_GREY, " ");
  3299. SendClientMessage(playerid, COLOR_GREY, "-| Online Admins |-");
  3300. for(new i = 0; i < MAX_PLAYERS; i++)
  3301. {
  3302. if(IsPlayerConnected(i))
  3303. {
  3304. if(PlayerInfo[i][pAdmin] >= 1 && PlayerInfo[i][pAdmin] < 1339)
  3305. {
  3306. new admtext[64], sendername[MAX_PLAYER_NAME], string[128];
  3307. if(PlayerInfo[i][pAdmin] == 1338) { admtext = "Owner"; }
  3308. else if(PlayerInfo[i][pAdmin] == 1337) { admtext = "Admin Level 1337"; }
  3309. else if(PlayerInfo[i][pAdmin] == 4) { admtext = "Admin Level 4"; }
  3310. else if(PlayerInfo[i][pAdmin] == 3) { admtext = "Admin Level 3"; }
  3311. else if(PlayerInfo[i][pAdmin] == 2) { admtext = "Admin Level 2"; }
  3312. else if(PlayerInfo[i][pAdmin] == 1) { admtext = "Admin Level 1"; }
  3313. else { admtext = "Admin Level 1"; }
  3314. GetPlayerName(i, sendername, sizeof(sendername));
  3315. sendername[strfind(sendername,"_")] = ' ';
  3316. if(AdminDuty[i] == 0)
  3317. {
  3318. format(string, 128, "%s: %s (AdminDuty: No)", admtext, sendername);
  3319. SendClientMessage(playerid, random(0xFFFFFFFF), string);
  3320. }
  3321. else
  3322. {
  3323. format(string, 128, "%s: %s (AdminDuty: Yes)", admtext, sendername);
  3324. SendClientMessage(playerid, 0xFAAFBEFF, string);
  3325.  
  3326. }
  3327. }
  3328. }
  3329. }
  3330. }
  3331. return 1;
  3332. }
  3333. CMD:testers(playerid, params[])
  3334. {
  3335. if(IsPlayerConnected(playerid))
  3336. {
  3337. SendClientMessage(playerid, COLOR_WHITE, " ");
  3338. SendClientMessage(playerid, COLOR_WHITE, "-| Online Testers |-");
  3339. for(new i = 0; i < MAX_PLAYERS; i++)
  3340. {
  3341. if(IsPlayerConnected(i))
  3342. {
  3343. if(PlayerInfo[i][pTester] >= 1 && PlayerInfo[i][pTester] < 1339)
  3344. {
  3345. new admtext[64], sendername[MAX_PLAYER_NAME], string[128];
  3346. if(PlayerInfo[i][pTester] == 1) { admtext = "Tester"; }
  3347. else { admtext = "Tester"; }
  3348. GetPlayerName(i, sendername, sizeof(sendername));
  3349. sendername[strfind(sendername,"_")] = ' ';
  3350. if(TesterDuty[i] == 0)
  3351. {
  3352. format(string, 128, "%s: %s (TesterDuty: No)", admtext, sendername);
  3353. SendClientMessage(playerid, random(0xFFFFFFFF), string);
  3354. }
  3355. else
  3356. {
  3357. format(string, 128, "%s: %s (TesterDuty: Yes)", admtext, sendername);
  3358. SendClientMessage(playerid, COLOR_GREEN, string);
  3359.  
  3360. }
  3361. }
  3362. }
  3363. }
  3364. }
  3365. return 1;
  3366. }
  3367.  
  3368. CMD:gotols(playerid, params[])
  3369. {
  3370. if(!(PlayerInfo[playerid][pAdmin] >= 2)) return SCM(playerid, COLOR_GREY,"You are not authorized to use this command");
  3371. else if(GetPlayerState(playerid) == 2)
  3372. {
  3373. new tmpcar = GetPlayerVehicleID(playerid);
  3374. SetVehiclePos(tmpcar,1529.6,-1691.2,13.3);
  3375. }
  3376. else
  3377. {
  3378. SetPlayerPos(playerid, 1529.6,-1691.2,13.3);
  3379. }
  3380. SendClientMessage(playerid, COLOR_GRAD1, " You have been teleported !");
  3381. SetPlayerInterior(playerid,0);
  3382. SetPlayerVirtualWorld(playerid, 0);
  3383. return 1;
  3384. }
  3385. CMD:gotolv(playerid, params[])
  3386. {
  3387. if(!(PlayerInfo[playerid][pAdmin] >= 2)) return SCM(playerid, COLOR_GREY,"You are not authorized to use this command");
  3388. else if(GetPlayerState(playerid) == 2)
  3389. {
  3390. new tmpcar = GetPlayerVehicleID(playerid);
  3391. SetVehiclePos(tmpcar,1699.2, 1435.1, 10.7);
  3392. }
  3393. else
  3394. {
  3395. SetPlayerPos(playerid, 1699.2, 1435.1, 10.7);
  3396. }
  3397. SendClientMessage(playerid, COLOR_GRAD1, " You have been teleported !");
  3398. SetPlayerInterior(playerid,0);
  3399. SetPlayerVirtualWorld(playerid, 0);
  3400. return 1;
  3401. }
  3402. CMD:gotosf(playerid, params[])
  3403. {
  3404. if(!(PlayerInfo[playerid][pAdmin] >= 2)) return SCM(playerid, COLOR_GREY,"You are not authorized to use this command");
  3405. else if(GetPlayerState(playerid) == 2)
  3406. {
  3407. new tmpcar = GetPlayerVehicleID(playerid);
  3408. SetVehiclePos(tmpcar,-1417.0,-295.8,14.1);
  3409. }
  3410. else
  3411. {
  3412. SetPlayerPos(playerid, -1417.0,-295.8,14.1);
  3413. }
  3414. SendClientMessage(playerid, COLOR_GRAD1, " You have been teleported !");
  3415. SetPlayerInterior(playerid,0);
  3416. SetPlayerVirtualWorld(playerid, 0);
  3417. return 1;
  3418. }
  3419. CMD:gethere(playerid,params[])
  3420. {
  3421. new targetid, Float:x, Float:y, Float:z;
  3422. if(PlayerInfo[playerid][pAdmin] < 1 && PlayerInfo[playerid][pTester] < 1) return SCM(playerid, COLOR_GREY,"You are not authorized to use this command");
  3423. else if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /gethere [playerid/partofname]");
  3424. else if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "That player is not connected");
  3425. else
  3426. {
  3427. GetPlayerPos(playerid, x, y, z);
  3428. SetPlayerPos(targetid, x, y+0.5, z+0.5);
  3429. }
  3430. return 1;
  3431. }
  3432. CMD:goto(playerid, params[])
  3433. {
  3434. new ID;
  3435. if(PlayerInfo[playerid][pAdmin] < 1 && PlayerInfo[playerid][pTester] < 1) return SCM(playerid, COLOR_GREY,"You are not authorized to use this command");
  3436. else if(sscanf(params, "u", ID)) SendClientMessage(playerid, 0xF97804FF, "USAGE: /goto [partofname/playerid]");
  3437. else if(!IsPlayerConnected(ID)) SendClientMessage(playerid, 0xF97804FF, "Player is not connected!");
  3438. else
  3439. {
  3440. new Float:x, Float:y, Float:z;
  3441. GetPlayerPos(ID, x, y, z);
  3442. SetPlayerPos(playerid, x+1, y+1, z);
  3443. }
  3444. return 1;
  3445. }
  3446. CMD:respawn(playerid, params[])
  3447. {
  3448. new id, sendername[MAX_PLAYER_NAME], name[MAX_PLAYER_NAME], string[128];
  3449. if(PlayerInfo[playerid][pAdmin] < 1 && PlayerInfo[playerid][pTester] < 1) return SCM(playerid, COLOR_GREY,"You are not authorized to use this command");
  3450. else if(sscanf(params,"u", id)) return SCM(playerid, COLOR_GREY,"USAGE: /respawn [playerid/partofname]");
  3451. else if(!IsPlayerConnected(id)) return SCM(playerid, COLOR_GREY,"Invalid player ID");
  3452. else
  3453. {
  3454. GetPlayerName(playerid, sendername, sizeof(sendername));
  3455. sendername[strfind(sendername,"_")] = ' ';
  3456. GetPlayerName(id, name, sizeof(name));
  3457. SpawnPlayer(id);
  3458. format(string, sizeof(string), "*You have respawned player %s", name);
  3459. SendClientMessage(playerid, COLOR_YELLOW, string);
  3460. format(string, sizeof(string), "*You have been respawned by admin %s", sendername);
  3461. SendClientMessage(id, COLOR_YELLOW, string);
  3462. ABroadCast(COLOR_YELLOW,string,1);
  3463. TBroadCast(COLOR_YELLOW,string,1);
  3464. }
  3465. return 1;
  3466. }
  3467. CMD:healall(playerid, params[])
  3468. {
  3469. new sendername[MAX_PLAYER_NAME], string[128];
  3470. GetPlayerName(playerid, sendername, sizeof(sendername));
  3471. sendername[strfind(sendername,"_")] = ' ';
  3472. if(!(PlayerInfo[playerid][pAdmin] >= 4)) return SCM(playerid, COLOR_GREY,"you are not authorized to use this command");
  3473. else
  3474. {
  3475. format(string, sizeof(string), "Admin %s has healed everyone", sendername);
  3476. SendClientMessageToAll(COLOR_GREEN, string);
  3477. for(new i = 0; i < MAX_PLAYERS; i ++)
  3478. SetPlayerHealth(i,100);
  3479. }
  3480. return 1;
  3481. }
  3482. CMD:makeadmin(playerid, params[])
  3483. {
  3484. new pID, value;
  3485. if(PlayerInfo[playerid][pAdmin] < 1338 && !IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF0000AA, " you are not authorized to use this command!");
  3486. else if (sscanf(params, "ui", pID, value)) return SendClientMessage(playerid, 0xFF0000AA, "Usage: /makeadmin [playerid/partofname] [level 1-1338]");
  3487. else if (value < 0 || value > 1338) return SendClientMessage(playerid, 0xFF0000AA, "Unknown level! Only 0 to 1338");
  3488. else if(pID == INVALID_PLAYER_ID) return SCM(playerid, COLOR_GREY,"Invalid player id");
  3489. else
  3490. {
  3491. new pName[MAX_PLAYER_NAME], tName[MAX_PLAYER_NAME], string[128];
  3492. GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
  3493. GetPlayerName(pID, tName, MAX_PLAYER_NAME);
  3494. format(string, sizeof(string), "You have promoted %s to Admin level %i", tName, value);
  3495. SCM(playerid, COLOR_LIGHTBLUE, string);
  3496. format(string, sizeof(string), "You have been promoted to Admin level %i by %s", value, pName);
  3497. SCM(pID, COLOR_LIGHTBLUE, string);
  3498. PlayerInfo[pID][pAdmin] = value;
  3499. }
  3500. return 1;
  3501. }
  3502. CMD:maketester(playerid, params[])
  3503. {
  3504. new pID, value;
  3505. if(PlayerInfo[playerid][pAdmin] < 1338 && !IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF0000AA, " you are not authorized to use this command!");
  3506. else if (sscanf(params, "ui", pID, value)) return SendClientMessage(playerid, 0xFF0000AA, "Usage: /maketester [playerid/partofname] [1]");
  3507. else if (value < 0 || value > 1) return SendClientMessage(playerid, 0xFF0000AA, "Unknown level! Available level: 1");
  3508. else if(pID == INVALID_PLAYER_ID) return SCM(playerid, COLOR_GREY,"Invalid player id");
  3509. else
  3510. {
  3511. new pName[MAX_PLAYER_NAME], tName[MAX_PLAYER_NAME], string[128];
  3512. GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
  3513. GetPlayerName(pID, tName, MAX_PLAYER_NAME);
  3514. format(string, sizeof(string), "You have promoted %s to Tester", tName);
  3515. SCM(playerid, COLOR_LIGHTBLUE, string);
  3516. format(string, sizeof(string), "You have been promoted to Tester by %s", pName);
  3517. SCM(pID, COLOR_LIGHTBLUE, string);
  3518. PlayerInfo[pID][pTester] = value;
  3519. }
  3520. return 1;
  3521. }
  3522. CMD:warn(playerid, params[])
  3523. {
  3524. new id, sendername[MAX_PLAYER_NAME], name[MAX_PLAYER_NAME], reason[35], string[128];
  3525. if(PlayerInfo[playerid][pAdmin] < 1) return SCM(playerid, COLOR_GREY,"You are not authorized to use this command");
  3526. if(sscanf(params,"uz",id,reason)) return SCM(playerid, COLOR_WHITE,"USAGE: /warn [playerid/partofname] [reason]");
  3527. if(!IsPlayerConnected(id)) return SCM(playerid, COLOR_GREY,"Invalid player id");
  3528. else
  3529. {
  3530. if(PlayerInfo[id][pWarns] >= 5)
  3531. {
  3532. format(string, sizeof(string), "AdmCmd: %s was banned by %s (Had 5 Warnings) reason %s", name, sendername, reason);
  3533. SendClientMessageToAll(COLOR_LIGHTRED, string);
  3534. PlayerInfo[id][pLocked] = 1;
  3535. new plrIP[16];
  3536. GetPlayerIp(id,plrIP, sizeof(plrIP));
  3537. SendClientMessage(id,COLOR_DBLUE,"|___________[BAN INFO]___________|");
  3538. format(string, sizeof(string), "Your name: %s.",name);
  3539. SendClientMessage(id, COLOR_WHITE, string);
  3540. format(string, sizeof(string), "Your ip is: %s.",plrIP);
  3541. SendClientMessage(id, COLOR_WHITE, string);
  3542. format(string, sizeof(string), "You were banned by: %s.",sendername);
  3543. SendClientMessage(id, COLOR_WHITE, string);
  3544. format(string, sizeof(string), "You were banned for: %s.",reason);
  3545. SendClientMessage(id, COLOR_WHITE, string);
  3546. SendClientMessage(id,COLOR_DBLUE,"|___________[BAN INFO]___________|");
  3547. Ban(id);
  3548. }
  3549. PlayerInfo[id][pWarns] += 1;
  3550. GetPlayerName(playerid, sendername, sizeof(sendername));
  3551. sendername[strfind(sendername,"_")] = ' ';
  3552. GetPlayerName(id, name, sizeof(name));
  3553. format(string, sizeof(string), "You were warned by %s, reason: %s", sendername, reason);
  3554. SendClientMessage(id, COLOR_LIGHTRED, string);
  3555. format(string, sizeof(string), "AdmCmd: %s was warned by %s, reason %s", name, sendername, reason);
  3556. SendClientMessageToAll(COLOR_LIGHTRED,string);
  3557. }
  3558. return 1;
  3559. }
  3560. CMD:unmute(playerid,params[])
  3561. {
  3562. new id, name1[MAX_PLAYER_NAME], name2[MAX_PLAYER_NAME], string[128];
  3563. if(PlayerInfo[playerid][pAdmin] < 1 && PlayerInfo[playerid][pTester] < 1) return SCM(playerid, COLOR_GREY,"You are not authorized to use this command");
  3564. if(sscanf(params,"u", id)) return SCM(playerid, COLOR_GREY,"USAGE: /unmute [playerid/partofname]");
  3565. if(!IsPlayerConnected(id)) return SCM(playerid, COLOR_GREY,"Invalid player ID");
  3566. else
  3567. {
  3568. PlayerInfo[id][pMuted] = 0;
  3569. PlayerInfo[id][pMuteTime] = 0;
  3570. GetPlayerName(playerid,name1,sizeof(name1));
  3571. GetPlayerName(id,name2,sizeof(name2));
  3572. format(string, sizeof(string),"%s has been unsilenced by %s", name2, name1);
  3573. SendClientMessageToAll(COLOR_LIGHTRED,string);
  3574. }
  3575. return 1;
  3576. }
  3577. CMD:mute(playerid,params[])
  3578. {
  3579. new id,time,name1[MAX_PLAYER_NAME],reason[35],name2[MAX_PLAYER_NAME], string[128];
  3580. if(PlayerInfo[playerid][pAdmin] < 1 && PlayerInfo[playerid][pTester] < 1) return SCM(playerid, COLOR_GREY,"You are not authorized to use this command");
  3581. if(sscanf(params,"uiz", id, time, reason)) return SCM(playerid, COLOR_GREY,"USAGE: /mute [playerid/partofname] [minutes] [reason]");
  3582. if(!IsPlayerConnected(id)) return SCM(playerid, COLOR_GREY,"Invalid player id");
  3583. else
  3584. {
  3585. PlayerInfo[id][pMuted] = 1;
  3586. PlayerInfo[id][pMuteTime] = time*60;
  3587. GetPlayerName(playerid,name1,sizeof(name1));
  3588. GetPlayerName(id,name2,sizeof(name2));
  3589. format(string, sizeof(string), "AdmCmd: %s was silenced by %s for %d minute(s) reason: %s",name2 ,name1,time,reason);
  3590. SendClientMessageToAll(COLOR_LIGHTRED,string);
  3591. }
  3592. return 1;
  3593. }
  3594. CMD:report(playerid,params[])
  3595. {
  3596. new id, reason[35], string[128], sendername[MAX_PLAYER_NAME], name[MAX_PLAYER_NAME];
  3597. if(sscanf(params,"uz", id, reason)) return SCM(playerid, COLOR_GREY,"USAGE: /report [playerid/partofname] [reason]");
  3598. if(!IsPlayerConnected(id)) return SCM(playerid, COLOR_GREY,"Invalid player ID");
  3599. else
  3600. {
  3601. GetPlayerName(id, name,sizeof(name));
  3602. GetPlayerName(playerid, sendername, sizeof(sendername));
  3603. sendername[strfind(sendername,"_")] = ' ';
  3604. format(string, sizeof(string), "[ID:%d] %s has reported %s: %s.", playerid, sendername, name, reason);
  3605. ABroadCast(COLOR_LIGHTRED,string,1);
  3606. format(string, sizeof(string), "Use /markfalse [id] or /acceptreport [id]");
  3607. ABroadCast(COLOR_LIGHTBLUE,string,1);
  3608. format(string, sizeof(string), "Your report was just send to the online admins, please wait for a reply");
  3609. SendClientMessage(playerid,COLOR_LIGHTRED,string);
  3610. PlayerNeedsHelp[playerid] = 1;
  3611. return 1;
  3612. }
  3613. }
  3614. CMD:kick(playerid,params[])
  3615. {
  3616. new id,name1[MAX_PLAYER_NAME], reason[35],name2[MAX_PLAYER_NAME], string[128];
  3617. if(PlayerInfo[playerid][pAdmin] < 1) return SCM(playerid, COLOR_GREY,"You are not authorized to use this command");
  3618. if(sscanf(params,"uz",id,reason)) return SCM(playerid, COLOR_WHITE,"USAGE: /kick [playerid/partofname] [reason]");
  3619. if(!IsPlayerConnected(id)) return SCM(playerid, COLOR_GREY,"Invalid player id");
  3620. else
  3621. {
  3622. GetPlayerName(playerid,name1,sizeof(name1));
  3623. GetPlayerName(id,name2,sizeof(name2));
  3624. format(string, sizeof(string),"AdmCmd: %s was kicked by %s, reason: %s",name2,name1,reason);
  3625. SendClientMessageToAll(COLOR_LIGHTRED,string);
  3626. Kick(id);
  3627. }
  3628. return 1;
  3629. }
  3630. CMD:ban(playerid, params[])
  3631. {
  3632. new id, name[MAX_PLAYER_NAME], reason[35], name1[MAX_PLAYER_NAME], name2[MAX_PLAYER_NAME], string[128];
  3633. if(!(PlayerInfo[playerid][pAdmin] >= 1)) return SCM(playerid, COLOR_GREY,"You are not authorized to use this command");
  3634. if(sscanf(params,"uz", id, reason)) return SCM(playerid, COLOR_WHITE,"USAGE: /ban [playerid/partofname] [reason]");
  3635. if(id == INVALID_PLAYER_ID) return SCM(playerid, COLOR_GREY,"Invalid player id");
  3636. else
  3637. {
  3638. if(PlayerInfo[id][pAdmin] >= 1)
  3639. {
  3640. SendClientMessage(playerid,COLOR_GREY,"That player can not be banned");
  3641. GetPlayerName(playerid, name, sizeof(name));
  3642. format(string, 128, "AdmWarning: %s tryes banning an admin!", name);
  3643. ABroadCast(COLOR_YELLOW,string,1);
  3644. return 1;
  3645. }
  3646. GetPlayerName(playerid, name1, sizeof(name1));
  3647. GetPlayerName(id, name2, sizeof(name2));
  3648. format(string, sizeof(string), "AdmCmd: %s was banned by %s, reason: %s", name2, name1, reason);
  3649. SendClientMessageToAll(COLOR_LIGHTRED, string);
  3650. PlayerInfo[id][pLocked] = 1;
  3651. new plrIP[16];
  3652. GetPlayerIp(id,plrIP, sizeof(plrIP));
  3653. SendClientMessage(id,COLOR_DBLUE,"|___________[BAN INFO]___________|");
  3654. format(string, sizeof(string), "Your name: %s.",name2);
  3655. SendClientMessage(id, COLOR_WHITE, string);
  3656. format(string, sizeof(string), "Your ip is: %s.",plrIP);
  3657. SendClientMessage(id, COLOR_WHITE, string);
  3658. format(string, sizeof(string), "You were banned by: %s.",name1);
  3659. SendClientMessage(id, COLOR_WHITE, string);
  3660. format(string, sizeof(string), "You were banned for: %s.",reason);
  3661. SendClientMessage(id, COLOR_WHITE, string);
  3662. SendClientMessage(id,COLOR_DBLUE,"|___________[BAN INFO]___________|");
  3663. Ban(id);
  3664. }
  3665. return 1;
  3666. }
  3667. CMD:unbanip(playerid, params[])
  3668. {
  3669. new id, string[128], sendername[MAX_PLAYER_NAME];
  3670. if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_GRAD1, " you are not authorized to use that command!");
  3671. if(isnull(params)) return SCM(playerid,COLOR_WHITE,"USAGE: /unbanip [playerIP]");
  3672. format(string,sizeof(string),"unbanip %s",params);
  3673. SendRconCommand(string);
  3674. SendRconCommand("reloadbans");
  3675. PlayerInfo[id][pLocked] = 0;
  3676. GetPlayerName(playerid, sendername, sizeof(sendername));
  3677. format(string, 128, "[ADMIN]: %s has unbanned IP %s", sendername,params);
  3678. ABroadCast(COLOR_YELLOW,string,1);
  3679. return 1;
  3680. }
  3681. CMD:unban(playerid, params[])
  3682. {
  3683. new id, string[128], sendername[MAX_PLAYER_NAME], name[MAX_PLAYER_NAME];
  3684. if(PlayerInfo[playerid][pAdmin] < 1) return SCM(playerid, COLOR_GRAD1,"You are not authorized to use this command");
  3685. else if(sscanf(params,"u", id)) return SCM(playerid, COLOR_GREY,"USAGE: /unban [playername]");
  3686. else
  3687. {
  3688. PlayerInfo[id][pLocked] = 0;
  3689. GetPlayerName(playerid, sendername, sizeof(sendername));
  3690. GetPlayerName(id, name, sizeof(name));
  3691. format(string, sizeof(string),"%s has been unbanned by admin %s", name, sendername);
  3692. ABroadCast(COLOR_YELLOW,string,1);
  3693. TBroadCast(COLOR_YELLOW,string,1);
  3694. }
  3695. return 1;
  3696. }
  3697. CMD:a(playerid, params[])
  3698. {
  3699. new sendername[MAX_PLAYER_NAME], string[160];
  3700. if(!(PlayerInfo[playerid][pAdmin] >= 1)) return SCM(playerid, COLOR_GREY,"You are not authorized to use this command");
  3701. if(isnull(params)) return SCM(playerid,COLOR_GOLD,"USAGE: /a [chat]");
  3702. GetPlayerName(playerid,sendername,sizeof(sendername));
  3703. sendername[strfind(sendername,"_")] = ' ';
  3704. format(string,160,"*%d Admin %s: %s",PlayerInfo[playerid][pAdmin],sendername,params);
  3705. SendAdminMessage(COLOR_GOLD, string);
  3706. SendTesterMessage(COLOR_GOLD, string);
  3707. return 1;
  3708. }
  3709. CMD:tc(playerid, params[])
  3710. {
  3711. new sendername[MAX_PLAYER_NAME], string[160];
  3712. if(!(PlayerInfo[playerid][pTester] >= 1)) return SCM(playerid, COLOR_GREY,"You are not authorized to use this command");
  3713. if(isnull(params)) return SCM(playerid,COLOR_GOLD,"USAGE: /tc [chat]");
  3714. GetPlayerName(playerid,sendername,sizeof(sendername));
  3715. sendername[strfind(sendername,"_")] = ' ';
  3716. format(string,160,"*Tester %s: %s",sendername,params);
  3717. SendAdminMessage(COLOR_GOLD, string);
  3718. SendTesterMessage(COLOR_GOLD, string);
  3719. return 1;
  3720. }
  3721. CMD:n(playerid, params[])
  3722. {
  3723. new sendername[MAX_PLAYER_NAME], string[160];
  3724. if(isnull(params)) return SCM(playerid,COLOR_GREEN,"USAGE: /n [AskQustions/Help]");
  3725. GetPlayerName(playerid,sendername,sizeof(sendername));
  3726. sendername[strfind(sendername,"_")] = ' ';
  3727. if(PlayerInfo[playerid][pMuted] == 1)
  3728. {
  3729. SendClientMessage(playerid, COLOR_RED, " You can't speak, you have been silenced !");
  3730. return 1;
  3731. }
  3732. if (PlayerInfo[playerid][pAdmin] < 1)
  3733. {
  3734. format(string, sizeof(string), "* Newbie Level %d (%d)%s: %s", PlayerInfo[playerid][pLevel], playerid, sendername, params);
  3735. }
  3736. else
  3737. {
  3738. format(string, sizeof(string), "* %d Admin {FFAF00}%s: {C9FFAB}%s", PlayerInfo[playerid][pAdmin],sendername, params);
  3739. }
  3740. if(PlayerInfo[playerid][pTester] == 1)
  3741. {
  3742. format(string, sizeof(string), "* Tester {C9FFAB}%s: {FFAF00}%s", sendername, params);
  3743. }
  3744. if(ntimer[playerid] < 1 || PlayerInfo[playerid][pAdmin] >=1 || PlayerInfo[playerid][pTester] >= 1)
  3745. { }
  3746. else
  3747. {
  3748. SendClientMessage(playerid, COLOR_GREY, "You must wait 30 seconds for every message");
  3749. return 1;
  3750. }
  3751. for (new n=0; n<MAX_PLAYERS; n++)
  3752. {
  3753. if (IsPlayerConnected(n) && (PlayerInfo[n][pLevel] < 4 || PlayerInfo[n][pAdmin] > 0) || PlayerInfo[n][pTester] > 0)
  3754. {
  3755. SendClientMessage(n, COLOR_LIGHTGREEN, string);
  3756. ntimer[playerid] = 30;
  3757. }
  3758. }
  3759. return 1;
  3760. }
  3761. CMD:cc(playerid, params[])
  3762. {
  3763. if(PlayerInfo[playerid][pAdmin] < 1 && PlayerInfo[playerid][pTester] < 1) return SCM(playerid, COLOR_GREY,"You are not authorized to use this command");
  3764. else
  3765. {
  3766. new string[128], sendername[MAX_PLAYER_NAME];
  3767. ClearChatboxToAll(playerid,100);
  3768. GetPlayerName(playerid, sendername, sizeof(sendername));
  3769. sendername[strfind(sendername,"_")] = ' ';
  3770. format(string, sizeof(string),"AdmCmd: %s has cleared the chat", sendername);
  3771. SendClientMessageToAll(COLOR_LIGHTRED,string);
  3772. }
  3773. return 1;
  3774. }
  3775. CMD:o(playerid, params[])
  3776. {
  3777. new sendername[MAX_PLAYER_NAME], string[160];
  3778. if(!(PlayerInfo[playerid][pAdmin] >= 1)) return SCM(playerid, COLOR_GREY,"You are not authorized to use this command");
  3779. if(isnull(params)) return SCM(playerid, COLOR_GREY,"USAGE: /o [chat]");
  3780. if(gPlayerLogged[playerid] == 0)
  3781. {
  3782. SendClientMessage(playerid, COLOR_GREY, " You havent logged in yet !");
  3783. return 1;
  3784. }
  3785. if ((noooc) && PlayerInfo[playerid][pAdmin] < 1 && PlayerInfo[playerid][pTester] < 1)
  3786. {
  3787. SendClientMessage(playerid, COLOR_GRAD2, " The OOC channel has been disabled by an Admin !");
  3788. return 1;
  3789. }
  3790. GetPlayerName(playerid,sendername,sizeof(sendername));
  3791. sendername[strfind(sendername,"_")] = ' ';
  3792. format(string,160,"(( %s: %s ))", sendername, params);
  3793. printf("%s", string);
  3794. OOCOff(COLOR_OOC,string);
  3795. return 1;
  3796. }
  3797. CMD:noooc(playerid, params[])
  3798. {
  3799. if (PlayerInfo[playerid][pAdmin] >= 4 && (!noooc))
  3800. {
  3801. noooc = 1;
  3802. SendClientMessageToAll(COLOR_GRAD2, " OOC chat channel disabled by an Admin !");
  3803. }
  3804. else if (PlayerInfo[playerid][pAdmin] >= 3 && (noooc))
  3805. {
  3806. noooc = 0;
  3807. SendClientMessageToAll(COLOR_GRAD2, " OOC chat channel enabled by an Admin !");
  3808. }
  3809. else
  3810. {
  3811. SendClientMessage(playerid, COLOR_GRAD1, " you are not authorized to use that command!");
  3812. }
  3813. return 1;
  3814. }
  3815.  
  3816. CMD:me(playerid, params[])
  3817. {
  3818. new sendername[MAX_PLAYER_NAME], string[128];
  3819. GetPlayerName(playerid, sendername, sizeof(sendername));
  3820. sendername[strfind(sendername,"_")] = ' ';
  3821. if(isnull(params)) return SCM(playerid,COLOR_GREY,"USAGE: /me [action]");
  3822. format(string, sizeof(string), "*%s %s", sendername, params);
  3823. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  3824. return 1;
  3825. }
  3826. CMD:do(playerid, params[])
  3827. {
  3828. new sendername[MAX_PLAYER_NAME], string[128];
  3829. GetPlayerName(playerid, sendername, sizeof(sendername));
  3830. sendername[strfind(sendername,"_")] = ' ';
  3831. if(isnull(params)) return SCM(playerid,COLOR_GREY,"USAGE: /do [action]");
  3832. format(string, sizeof(string), "***%s (( %s ))", params, sendername);
  3833. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  3834. return 1;
  3835. }
  3836. CMD:cnc(playerid, params[])
  3837. {
  3838. if(PlayerInfo[playerid][pAdmin] < 1 && PlayerInfo[playerid][pTester] < 1) return SCM(playerid, COLOR_GREY,"You are not authorized to use this command");
  3839. else
  3840. {
  3841. new string[128], sendername[MAX_PLAYER_NAME];
  3842. ClearChatboxToAll2(playerid,100);
  3843. GetPlayerName(playerid, sendername, sizeof(sendername));
  3844. format(string, sizeof(string), "AdmCmd: %s has cleared the newbie chat", sendername);
  3845. SendClientMessageToAll(COLOR_LIGHTRED, string);
  3846. }
  3847. return 1;
  3848. }
  3849. CMD:rac(playerid, params[])
  3850. {
  3851. if(!(PlayerInfo[playerid][pAdmin] >= 1337)) return SCM(playerid, COLOR_GREY,"You are not authorized to use this command");
  3852. else
  3853. {
  3854. new string[128], sendername[MAX_PLAYER_NAME];
  3855. GetPlayerName(playerid, sendername, sizeof(sendername));
  3856. format(string, sizeof(string),"All unused cars will be respawned in 10 seconds by admin %s", sendername);
  3857. SendClientMessageToAll(COLOR_RED,string);
  3858. SetTimer("RACtime", 10000, 0);
  3859. }
  3860. return 1;
  3861. }
  3862. CMD:buylevel(playerid, params[])
  3863. {
  3864. if(IsPlayerConnected(playerid))
  3865. {
  3866. if (gPlayerLogged[playerid] != 0)
  3867. {
  3868. PlayerInfo[playerid][pCash] = GetPlayerMoney(playerid);
  3869. if(PlayerInfo[playerid][pLevel] >= 0)
  3870. {
  3871. new nxtlevel = PlayerInfo[playerid][pLevel]+1;
  3872. new costlevel = nxtlevel*levelcost;
  3873. new expamount = nxtlevel*levelexp;
  3874. new infostring[128];
  3875. if(GetPlayerMoney(playerid) < costlevel)
  3876. {
  3877. format(infostring, 128, " You do not have enough Cash ($%d) !",costlevel);
  3878. SendClientMessage(playerid, COLOR_GRAD1, infostring);
  3879. return 1;
  3880. }
  3881. else if (PlayerInfo[playerid][pExp] < expamount)
  3882. {
  3883. format(infostring, 128, " You need %d Respect Points, you curently have [%d] !",expamount,PlayerInfo[playerid][pExp]);
  3884. SendClientMessage(playerid, COLOR_GRAD1, infostring);
  3885. return 1;
  3886. }
  3887. else
  3888. {
  3889. new string[128];
  3890. format(string, sizeof(string), "~g~LEVEL UP~n~~w~You Are Now Level %d", PlayerInfo[playerid][pLevel]);
  3891. GivePlayerCash(playerid, (-costlevel));
  3892. PlayerInfo[playerid][pLevel]++;
  3893. if(PlayerInfo[playerid][pVip] > 0)
  3894. {
  3895. PlayerInfo[playerid][pExp] -= expamount;
  3896. new total = PlayerInfo[playerid][pExp];
  3897. if(total > 0)
  3898. {
  3899. PlayerInfo[playerid][pExp] = total;
  3900. }
  3901. else
  3902. {
  3903. PlayerInfo[playerid][pExp] -= expamount;
  3904. }
  3905. }
  3906. else
  3907. {
  3908. PlayerInfo[playerid][pExp] -= expamount;
  3909. }
  3910. GameTextForPlayer(playerid, string, 5000, 1);
  3911. }
  3912. }
  3913. return 1;
  3914. }
  3915. else
  3916. {
  3917. SendClientMessage(playerid, COLOR_GRAD1, " You are not Logged in !");
  3918. }
  3919. }
  3920. return 1;
  3921. }
  3922. CMD:aod(playerid, params[])
  3923. {
  3924. new sendername[MAX_PLAYER_NAME], string[128];
  3925. if(PlayerInfo[playerid][pAdmin] < 1) return SCM(playerid, COLOR_GREY,"You are not authorized to use this command");
  3926. else if(AdminDuty[playerid] == 1)
  3927. {
  3928. GetPlayerName(playerid, sendername, sizeof(sendername));
  3929. sendername[strfind(sendername,"_")] = ' ';
  3930. format(string, sizeof(string), "Admin %s is now off duty.", sendername,playerid);
  3931. SendClientMessageToAll(COLOR_DBLUE,string);
  3932. AdminDuty[playerid] = 0;
  3933. SetPlayerHealth(playerid,100);
  3934. SetPlayerArmour(playerid,0);
  3935. SetOriginalColor(playerid);
  3936. }
  3937. else
  3938. {
  3939. GetPlayerName(playerid, sendername, sizeof(sendername));
  3940. sendername[strfind(sendername,"_")] = ' ';
  3941. format(string, sizeof(string), "Admin %s is now on duty.",sendername,playerid);
  3942. SendClientMessageToAll(0xFAAFBEFF,string);
  3943. AdminDuty[playerid] = 1;
  3944. SetPlayerHealth(playerid,999);
  3945. SetPlayerArmour(playerid,999);
  3946. SetPlayerColor(playerid,0xFAAFBEFF);
  3947. }
  3948. return 1;
  3949. }
  3950. CMD:tod(playerid, params[])
  3951. {
  3952. new sendername[MAX_PLAYER_NAME], string[128];
  3953. if(PlayerInfo[playerid][pTester] < 1) return SCM(playerid, COLOR_GREY,"You are not authorized to use this command");
  3954. else if(TesterDuty[playerid] == 1)
  3955. {
  3956. GetPlayerName(playerid, sendername, sizeof(sendername));
  3957. sendername[strfind(sendername,"_")] = ' ';
  3958. format(string, sizeof(string), "Tester %s is now off duty.", sendername,playerid);
  3959. SendClientMessageToAll(COLOR_DBLUE,string);
  3960. TesterDuty[playerid] = 0;
  3961. SetPlayerHealth(playerid,100);
  3962. SetPlayerArmour(playerid,0);
  3963. SetOriginalColor(playerid);
  3964. }
  3965. else
  3966. {
  3967. GetPlayerName(playerid, sendername, sizeof(sendername));
  3968. sendername[strfind(sendername,"_")] = ' ';
  3969. format(string, sizeof(string), "Tester %s is now on duty.",sendername,playerid);
  3970. SendClientMessageToAll(0xFAAFBEFF,string);
  3971. TesterDuty[playerid] = 1;
  3972. SetPlayerHealth(playerid,999);
  3973. SetPlayerArmour(playerid,999);
  3974. SetPlayerColor(playerid,0xFAAFBEFF);
  3975. }
  3976. return 1;
  3977. }
  3978. CMD:time(playerid, params[])
  3979. {
  3980. if(IsPlayerConnected(playerid))
  3981. {
  3982. new mtext[20];
  3983. new year, month,day;
  3984. getdate(year, month, day);
  3985. if(month == 1) { mtext = "January"; }
  3986. else if(month == 2) { mtext = "February"; }
  3987. else if(month == 3) { mtext = "March"; }
  3988. else if(month == 4) { mtext = "April"; }
  3989. else if(month == 5) { mtext = "May"; }
  3990. else if(month == 6) { mtext = "June"; }
  3991. else if(month == 7) { mtext = "Juli"; }
  3992. else if(month == 8) { mtext = "August"; }
  3993. else if(month == 9) { mtext = "September"; }
  3994. else if(month == 10) { mtext = "October"; }
  3995. else if(month == 11) { mtext = "November"; }
  3996. else if(month == 12) { mtext = "December"; }
  3997. new hour,minuite,second;
  3998. gettime(hour,minuite,second);
  3999. FixHour(hour);
  4000. hour = shifthour;
  4001. new string[128];
  4002. format(string, sizeof(string), "~y~%d %s~n~~g~|~w~%d:%d~g~|", day, mtext, hour, minuite);
  4003. GameTextForPlayer(playerid, string, 5000, 1);
  4004. }
  4005. return 1;
  4006. }
  4007. CMD:rules(playerid, params[])
  4008. {
  4009. SendClientMessage(playerid, COLOR_GRAD1,"Read our /forum rules");
  4010. return 1;
  4011. }
  4012. CMD:forum(playerid, params[])
  4013. {
  4014. SCM(playerid, COLOR_GRAD1,"Forum not yet ^^ ");
  4015. return 1;
  4016. }
  4017. CMD:s(playerid,params[])
  4018. {
  4019. if(PlayerInfo[playerid][pMuted] == 1)
  4020. {
  4021. SendClientMessage(playerid, COLOR_RED,"You can't speak you have been silenced");
  4022. return 1;
  4023. }
  4024. if(isnull(params)) return SCM(playerid, COLOR_GREY,"/s [text]");
  4025. new sendername[MAX_PLAYER_NAME], string[128];
  4026. GetPlayerName(playerid, sendername, sizeof(sendername));
  4027. format(string, sizeof(string), "%s Shouts: %s!!", sendername, params);
  4028. ProxDetector(30.0, playerid, string,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_FADE1,COLOR_FADE2);
  4029. return 1;
  4030. }
  4031. CMD:shout(playerid, params[])
  4032. {
  4033. return cmd_s(playerid, params);
  4034. }
  4035. CMD:b(playerid,params[])
  4036. {
  4037. if(PlayerInfo[playerid][pMuted] == 1)
  4038. {
  4039. SCM(playerid, COLOR_RED,"You can't speak you have been silenced");
  4040. return 1;
  4041. }
  4042. if(isnull(params)) return SCM(playerid, COLOR_GREY,"/b [local ooc chat]");
  4043. new sendername[MAX_PLAYER_NAME], string[128];
  4044. GetPlayerName(playerid,sendername,sizeof(sendername));
  4045. sendername[strfind(sendername,"_")] = ' ';
  4046. format(string, sizeof(string), "%s Says: (( %s ))", sendername, params);
  4047. ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
  4048. return 1;
  4049. }
  4050. CMD:booc(playerid, params[])
  4051. {
  4052. return cmd_b(playerid, params);
  4053. }
  4054. CMD:low(playerid,params[])
  4055. {
  4056. if(PlayerInfo[playerid][pMuted] == 1)
  4057. {
  4058. SCM(playerid, COLOR_RED,"You can't speec you have been silenced");
  4059. return 1;
  4060. }
  4061. if(isnull(params)) return SCM(playerid, COLOR_GREY,"/low [low chat]");
  4062. new sendername[MAX_PLAYER_NAME], string[128];
  4063. GetPlayerName(playerid,sendername,sizeof(sendername));
  4064. sendername[strfind(sendername,"_")] = ' ';
  4065. format(string,sizeof(string), "%s Says [Low]: %s", sendername, params);
  4066. ProxDetector(3.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
  4067. return 1;
  4068. }
  4069. CMD:acceptreport(playerid, params[])
  4070. {
  4071. new id, sendername[MAX_PLAYER_NAME], name[MAX_PLAYER_NAME], string[128];
  4072. if(PlayerInfo[playerid][pAdmin] < 1) return SCM(playerid, COLOR_GREY,"You are not authorized to use this command");
  4073. if(sscanf(params,"u", id)) return SCM(playerid, COLOR_GREY," USAGE: /acceptreport [playerid]");
  4074. if(!IsPlayerConnected(id)) return SCM(playerid, COLOR_GREY,"Player not connected");
  4075. else
  4076. {
  4077. if(PlayerNeedsHelp[id] == 1)
  4078. {
  4079. PlayerNeedsHelp[id] = 0;
  4080. GetPlayerName(playerid, sendername, sizeof(sendername));
  4081. GetPlayerName(id, name, sizeof(name));
  4082. format(string, sizeof(string), "[AdminCMD]: %s has just accepted the report of [ID:%d]%s.", sendername, id, name);
  4083. ABroadCast(COLOR_YELLOW, string, 1);
  4084. format(string, sizeof(string), "**[ID:%d] %s has accepted your report and now ready to assist you! Please be patience.", playerid, sendername);
  4085. SendClientMessage(id, 0x4D903DAA, string);
  4086. }
  4087. else return SCM(playerid, COLOR_GREY,"Player don't need help!");
  4088. }
  4089. return 1;
  4090. }
  4091. CMD:markfalse(playerid, params[])
  4092. {
  4093. new id, sendername[MAX_PLAYER_NAME], name[MAX_PLAYER_NAME], string[128];
  4094. if(PlayerInfo[playerid][pAdmin] < 1) return SCM(playerid, COLOR_GREY,"You are not authorized to use this command");
  4095. if(sscanf(params,"u", id)) return SCM(playerid, COLOR_GREY," USAGE: /markfalse [playerid]");
  4096. if(!IsPlayerConnected(id)) return SCM(playerid, COLOR_GREY,"Player not connected");
  4097. else
  4098. {
  4099. if(PlayerNeedsHelp[id] == 1)
  4100. {
  4101. PlayerNeedsHelp[id] = 0;
  4102. GetPlayerName(playerid, sendername, sizeof(sendername));
  4103. GetPlayerName(id, name, sizeof(name));
  4104. format(string, sizeof(string), "[AdminCMD]: %s has just marked as fals the report of [ID:%d]%s.", sendername, id, name);
  4105. ABroadCast(COLOR_YELLOW, string, 1);
  4106. format(string, sizeof(string), "**[ID:%d] %s has denied your report, please next time make sure what you report.", playerid, sendername);
  4107. SendClientMessage(id, 0x4D903DAA, string);
  4108. }
  4109. else return SCM(playerid, COLOR_GREY,"Player don't need help!");
  4110. }
  4111. return 1;
  4112. }
  4113. CMD:id(playerid, params[])
  4114. {
  4115. new id, name[MAX_PLAYER_NAME], string[128];
  4116. if(sscanf(params,"u", id)) return SCM(playerid, COLOR_GREY,"USAGE: /id [playerid/partofname]");
  4117. if(!IsPlayerConnected(id)) return SCM(playerid, COLOR_GREY,"Player not connected");
  4118. else
  4119. {
  4120. GetPlayerName(id, name, sizeof(name));
  4121. format(string,sizeof(string), "ID: (%d) %s", id, name);
  4122. SendClientMessage(playerid, COLOR_GRAD1, string);
  4123. }
  4124. return 1;
  4125. }
  4126.  
  4127. CMD:pm(playerid, params[])
  4128. {
  4129. new PID, reason[35], pName[MAX_PLAYER_NAME], Sender[MAX_PLAYER_NAME];
  4130. if(sscanf(params, "uz", PID, reason)) return SendClientMessage(playerid, 0xFF0000FF, "Usage: /PM < PlayerID > < Message >");
  4131. if(!IsPlayerConnected(PID)) return SendClientMessage(playerid, 0xFF0000FF, "That user is not connected!");
  4132. else
  4133. {
  4134. new Str[128];
  4135. GetPlayerName(PID, pName, sizeof(pName));
  4136. GetPlayerName(playerid, Sender, sizeof(Sender));
  4137. format(Str, sizeof(Str), "(( PM From: %s(%d): %s ))", Sender, playerid, reason);
  4138. SendClientMessage(PID, COLOR_GOLD, Str);
  4139. format(Str, sizeof(Str), "(( PM Sent To: %s(%d): %s ))", pName, PID, reason);
  4140. SendClientMessage(playerid, COLOR_GOLD, Str);
  4141. }
  4142. return 1;
  4143. }
  4144. CMD:whisper(playerid, params[])
  4145. {
  4146. new id, text[35], sendername[MAX_PLAYER_NAME], name[MAX_PLAYER_NAME], string[128];
  4147. if(sscanf(params,"uz", id, text)) return SCM(playerid, COLOR_GREY,"USAGE: /(w)hisper [playerid/partofname] [text]");
  4148. if(!IsPlayerConnected(id)) return SCM(playerid, COLOR_GREY,"Invalid player ID");
  4149. else
  4150. {
  4151. new Float:x, Float:y, Float:z;
  4152. GetPlayerPos(id,x,y,z);
  4153. if(PlayerToPoint(5, playerid, x,y,z))
  4154. {
  4155. GetPlayerName(playerid, sendername,sizeof(sendername));
  4156. GetPlayerName(id, name, sizeof(name));
  4157. if(id == playerid)
  4158. {
  4159. format(string,sizeof(string),"%s mutters something", sendername);
  4160. ProxDetector(5.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  4161. }
  4162. else
  4163. {
  4164. format(string,sizeof(string),"%s whispers something to %s", sendername, name);
  4165. ProxDetector(15.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  4166. }
  4167. format(string, sizeof(string), "%s whispers: %s", sendername, text);
  4168. SendClientMessage(id, COLOR_YELLOW3, string);
  4169. format(string, sizeof(string), "%s whispers: %s", sendername, text);
  4170. SendClientMessage(playerid, COLOR_YELLOW3, string);
  4171. }
  4172. else return SCM(playerid, COLOR_GREY,"That player is not near you");
  4173. }
  4174. return 1;
  4175. }
  4176. CMD:w(playerid, params[])
  4177. {
  4178. return cmd_whisper(playerid, params);
  4179. }
  4180. CMD:helpme(playerid, params[])
  4181. {
  4182. new string[128], sendername[MAX_PLAYER_NAME], name[MAX_PLAYER_NAME], id;
  4183. if(isnull(params)) return SCM(playerid, COLOR_GREY,"USAGE:/helpme [description]");
  4184. GetPlayerName(playerid,sendername,sizeof(sendername));
  4185. GetPlayerName(id,name,sizeof(name));
  4186. format(string,sizeof(string),"TesterCmd: %s has requested for help: %s", sendername, params);
  4187. TBroadCast(COLOR_LIGHTBLUE,string,1);
  4188. SendClientMessage(playerid, COLOR_LIGHTBLUE,"You have requested for help, please wait for a reply");
  4189. return 1;
  4190. }
  4191. CMD:ad(playerid, params[])
  4192. {
  4193. new string[128], sendername[MAX_PLAYER_NAME];
  4194. if(isnull(params)) return SCM(playerid, COLOR_GREY,"USAGE:/ad [advertisement]");
  4195. if(PlayerInfo[playerid][pMuted] == 1) return SendClientMessage(playerid, COLOR_RED, "You can't speak, you have been silenced");
  4196. if(!IsPlayerInRangeOfPoint(playerid, 5.0, 1738.7830, -1269.8062, 13.5433)) return SendClientMessage(playerid,COLOR_RED,"Your far than 50 metters from the Advertisment Building!");
  4197. GetPlayerName(playerid, sendername, sizeof(sendername));
  4198. format(string, sizeof(string), "[Advertisment]: %s, Contact %s ,Phone: %d", params, sendername ,PlayerInfo[playerid][pNumber]);
  4199. SendClientMessageToAll(COLOR_GREEN,string);
  4200. GivePlayerCash(playerid, -50);
  4201. SendClientMessage(playerid,COLOR_WHITE,"The advertisment costs 50$!");
  4202. return 1;
  4203. }
  4204. CMD:pay(playerid, params[])
  4205. {
  4206. new id, money, sendername[MAX_PLAYER_NAME], name[MAX_PLAYER_NAME], string[128];
  4207. if(sscanf(params,"ui", id, money)) return SCM(playerid, COLOR_GREY,"USAGE:/pay [playerid/partofname] [ammount]");
  4208. if(money < 1 || money > 100000) return SendClientMessage(playerid, COLOR_GRAD1, "You can't pay less than 1$ or more than 100k $.");
  4209. if(!ProxDetectorS(5.0, playerid, id)) return SCM(playerid, COLOR_GRAD1,"You are too far away from that player");
  4210. else
  4211. {
  4212. GetPlayerName(id, name, sizeof(name));
  4213. GetPlayerName(playerid, sendername, sizeof(sendername));
  4214. new pmoney = GetPlayerMoney(playerid);
  4215. if (money > 0 && pmoney >= money)
  4216. {
  4217. GivePlayerCash(playerid, (0 - money));
  4218. GivePlayerCash(id, money);
  4219. format(string, sizeof(string), "You payed %s(ID: %d) $%d.", name,id, money);
  4220. SendClientMessage(playerid, COLOR_GREEN, string);
  4221. format(string, sizeof(string), "You recieved $%d from %s(ID: %d).", money, sendername, playerid);
  4222. SendClientMessage(id, COLOR_GREEN, string);
  4223. format(string, sizeof(string), "[AdminCMD]: %s payed $%d to %s.", sendername, money, name);
  4224. if(money >= 70000)
  4225. {
  4226. ABroadCast(COLOR_RED,string,1);
  4227. }
  4228. format(string, sizeof(string), "* %s takes out %d$ from his pocket and hands it to %s.", sendername , money ,name);
  4229. ProxDetector(30.0, playerid, string, COLOR_RED,COLOR_RED,COLOR_RED,COLOR_RED,COLOR_RED);
  4230. ApplyAnimation(playerid,"DEALER","shop_pay",4.1,0,0,0,0,0);
  4231. }
  4232. }
  4233. return 1;
  4234. }
  4235. CMD:givemoney(playerid, params[])
  4236. {
  4237. new id, cash, sendername[MAX_PLAYER_NAME], name[MAX_PLAYER_NAME], string[128];
  4238. if(PlayerInfo[playerid][pAdmin] < 1337) return SCM(playerid, COLOR_GREY,"You are not authorized to use this command");
  4239. if(sscanf(params,"ui", id, cash)) return SCM(playerid, COLOR_GREY,"USAGE: /givemoney [playerid/partofname] [ammount]");
  4240. if(!IsPlayerConnected(id)) return SCM(playerid, COLOR_GREY,"Invalid player ID");
  4241. else
  4242. {
  4243. GivePlayerCash(id, cash);
  4244. GetPlayerName(playerid,sendername,sizeof(sendername));
  4245. GetPlayerName(id,name,sizeof(name));
  4246. format(string,sizeof(string),"%s has given %s money to %d", sendername, name, cash);
  4247. ABroadCast(COLOR_YELLOW,string,1);
  4248. format(string,sizeof(string),"You have recieved %d money from admin %s", cash, sendername);
  4249. SendClientMessage(id, COLOR_YELLOW, string);
  4250. }
  4251. return 1;
  4252. }
  4253. CMD:call(playerid, params[])
  4254. {
  4255. new number, sendername[MAX_PLAYER_NAME], string[128];
  4256. if(sscanf(params,"i", number))
  4257. {
  4258. SendClientMessage(playerid, COLOR_GREEN, "____________Services number list____________");
  4259. SendClientMessage(playerid, COLOR_GREEN, "/call [number]");
  4260. SendClientMessage(playerid, COLOR_WHITE, "[Emergency]911 - Emergency Line || 103 - L.S-E.M.S");
  4261. SendClientMessage(playerid, COLOR_WHITE, "[Services]445 - Taxi Company || 235 - Mechanic");
  4262. SendClientMessage(playerid, COLOR_GREEN, "____________________________________________");
  4263. return 1;
  4264. }
  4265. if(number == PlayerInfo[playerid][pNumber]) return SCM(playerid, COLOR_GREY,"Can't call yourself");
  4266. if(Mobile[playerid] != 255) return SCM(playerid, COLOR_GREY,"Already in a call");
  4267. GetPlayerName(playerid,sendername,sizeof(sendername));
  4268. format(string, sizeof(string), "* %s takes his cellphone out.", sendername);
  4269. SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USECELLPHONE);
  4270. ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
  4271. for(new i = 0; i < MAX_PLAYERS; i++)
  4272. {
  4273. if(IsPlayerConnected(i))
  4274. {
  4275. if(PlayerInfo[i][pNumber] == number && number != 0)
  4276. {
  4277. new giveplayerid;
  4278. giveplayerid = i;
  4279. Mobile[playerid] = giveplayerid;
  4280. if(IsPlayerConnected(giveplayerid))
  4281. {
  4282. if(giveplayerid != INVALID_PLAYER_ID)
  4283. {
  4284. if (Mobile[giveplayerid] == 255)
  4285. {
  4286. format(string, sizeof(string), "[Mobile] Your mobile phone is ringing (/pickup) Caller: %d", PlayerInfo[playerid][pNumber]);
  4287. SendClientMessage(giveplayerid, COLOR_YELLOW, string);
  4288. GetPlayerName(giveplayerid, sendername, sizeof(sendername));
  4289. RingTone[giveplayerid] = 10;
  4290. format(string, sizeof(string), "* %s's phone is ringing.", sendername);
  4291. ProxDetector(30.0, i, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
  4292. CellTime[playerid] = 1;
  4293. return 1;
  4294. }
  4295. }
  4296. }
  4297. }
  4298. }
  4299. }
  4300. return 1;
  4301.  
  4302. }
  4303. CMD:c(playerid, params[])
  4304. {
  4305. return cmd_call(playerid, params);
  4306. }
  4307. CMD:pickup(playerid, params[])
  4308. {
  4309. if(IsPlayerConnected(playerid))
  4310. {
  4311. if(Mobile[playerid] != 255)
  4312. {
  4313. SendClientMessage(playerid, COLOR_GREY, "You are already on a call...");
  4314. return 1;
  4315. }
  4316. for(new i = 0; i < MAX_PLAYERS; i++)
  4317. {
  4318. if(IsPlayerConnected(i))
  4319. {
  4320. if(Mobile[i] == playerid)
  4321. {
  4322. Mobile[playerid] = i;
  4323. new string[128], sendername[MAX_PLAYER_NAME];
  4324. GetPlayerName(playerid,sendername,sizeof(sendername));
  4325. SendClientMessage(i, COLOR_YELLOW2, "They Picked up the call...");
  4326. format(string, sizeof(string), "* %s answers his cellphone.", sendername);
  4327. SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USECELLPHONE);
  4328. ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
  4329. RingTone[playerid] = 0;
  4330. }
  4331.  
  4332. }
  4333. }
  4334. }
  4335. return 1;
  4336. }
  4337. CMD:p(playerid, params[])
  4338. {
  4339. return cmd_pickup(playerid, params);
  4340. }
  4341. CMD:hangup(playerid, params[])
  4342. {
  4343. if(IsPlayerConnected(playerid))
  4344. {
  4345. new caller = Mobile[playerid];
  4346. if(IsPlayerConnected(caller))
  4347. {
  4348. if(caller != INVALID_PLAYER_ID)
  4349. {
  4350. if(caller != 255)
  4351. {
  4352. if(caller < 255)
  4353. {
  4354. SendClientMessage(caller, COLOR_GREY, "They hung up...");
  4355. CellTime[caller] = 0;
  4356. CellTime[playerid] = 0;
  4357. SendClientMessage(playerid, COLOR_GREY, "You hung up....");
  4358. Mobile[caller] = 255;
  4359. }
  4360. }
  4361. }
  4362. }
  4363. new string[128];
  4364. GivePlayerCash(playerid,-CellTime[playerid]);
  4365. format(string,sizeof(string),"You have paid %d $ for your conversation!",CellTime[playerid]);
  4366. GameTextForPlayer(playerid,string,5000,1);
  4367. Mobile[playerid] = 255;
  4368. CellTime[playerid] = 0;
  4369. RingTone[playerid] = 0;
  4370. SetPlayerSpecialAction(playerid, SPECIAL_ACTION_STOPUSECELLPHONE);
  4371. }
  4372. return 1;
  4373. }
  4374. CMD:h(playerid, params[])
  4375. {
  4376. return cmd_hangup(playerid, params);
  4377. }
  4378. CMD:number(playerid, params[])
  4379. {
  4380. new id, sendername[MAX_PLAYER_NAME], string[128];
  4381. if(sscanf(params,"u", id)) return SCM(playerid, COLOR_GREY,"USAGE: /number [playerid/partofname]");
  4382. if(!IsPlayerConnected(id)) return SCM(playerid, COLOR_GREY,"Invalid player ID");
  4383. else
  4384. {
  4385. GetPlayerName(id, sendername, sizeof(sendername));
  4386. format(string, 256, "Name: %s, Ph: %d",sendername,PlayerInfo[id][pNumber]);
  4387. SendClientMessage(playerid, COLOR_GRAD1, string);
  4388. }
  4389. return 1;
  4390. }
  4391. CMD:stopanim(playerid, params[])
  4392. {
  4393. ClearAnimations(playerid);
  4394. ApplyAnimation(playerid, "CARRY", "crry_prtial", 1.0, 0, 0, 0, 0, 0);
  4395. TogglePlayerControllable(playerid, 1);
  4396. return 1;
  4397. }
  4398. CMD:newspaper(playerid, params[])
  4399. {
  4400. if(!IsPlayerInRangeOfPoint(playerid, 4,1707.8434,-2331.6506,-2.6797)) return SCM(playerid, COLOR_GREY,"You are not near the news paper");
  4401. else
  4402. {
  4403. SetPlayerPos(playerid,1708.1606,-2333.2563,-2.3670);
  4404. SetPlayerFacingAngle(playerid, 353.5373);
  4405. TogglePlayerControllable(playerid, 0);
  4406. LoopingAnim(playerid,"BEACH", "bather", 4.0, 1, 0, 0, 0, 0); // Lay down
  4407. ShowMenuForPlayer(Paper, playerid);
  4408. }
  4409. return 1;
  4410. }
  4411. CMD:exitcar(playerid, params[])
  4412. {
  4413. if(IsPlayerInVehicle(playerid, dmvc) || IsPlayerInVehicle(playerid, dmvc1) || IsPlayerInVehicle(playerid,dmvc2))
  4414. {
  4415. RemovePlayerFromVehicle(playerid);
  4416. TogglePlayerControllable(playerid, 1);
  4417. SetTimer("Unfreeze", 1000, 1);
  4418. }
  4419. return 1;
  4420. }
  4421. CMD:takeexam(playerid, params[])
  4422. {
  4423. if(PlayerInfo[playerid][pDriveLic] == 1) return SCM(playerid, COLOR_GREY,"You already have Driving License!");
  4424. if(IsPlayerInVehicle(playerid, dmvc) || IsPlayerInVehicle(playerid, dmvc1) || IsPlayerInVehicle(playerid,dmvc2))
  4425. {
  4426. TogglePlayerControllable(playerid, 1);
  4427. CP[playerid] = 200;
  4428. SetPlayerCheckpoint(playerid, 1421.1475,-1699.3237,13.2888, 4.0);
  4429. TakingLesson[playerid] = 1;
  4430. SendClientMessage(playerid, COLOR_LIGHTBLUE, "DMV: Please follow the checkpoints and drive safety!");
  4431. }
  4432. else return SCM(playerid, COLOR_GREY,"You are not in a DMV car");
  4433. return 1;
  4434. }
  4435. CMD:freeze(playerid, params[])
  4436. {
  4437. new id, sendername[MAX_PLAYER_NAME], name[MAX_PLAYER_NAME], string[128];
  4438. if(PlayerInfo[playerid][pAdmin] < 1) return SCM(playerid,COLOR_GREY,"You are not authorized to use this command");
  4439. if(sscanf(params,"u", id)) return SCM(playerid, COLOR_GREY,"USAGE: /freeze [playerid/partofname]");
  4440. if(!IsPlayerConnected(id)) return SCM(playerid, COLOR_GREY,"Invalid player ID");
  4441. else
  4442. {
  4443. GetPlayerName(playerid,sendername,sizeof(sendername));
  4444. GetPlayerName(id,name,sizeof(name));
  4445. TogglePlayerControllable(id, 0);
  4446. format(string, sizeof(string), "AdmCmd: %s has freezed %s", sendername, name);
  4447. ABroadCast(COLOR_YELLOW,string,1);
  4448. format(string, sizeof(string),"You have been frozen by admin %s", sendername);
  4449. SendClientMessage(id, COLOR_LIGHTRED, string);
  4450. }
  4451. return 1;
  4452. }
  4453. CMD:unfreeze(playerid, params[])
  4454. {
  4455. new id, sendername[MAX_PLAYER_NAME], name[MAX_PLAYER_NAME], string[128];
  4456. if(PlayerInfo[playerid][pAdmin] < 1) return SCM(playerid,COLOR_GREY,"You are not authorized to use this command");
  4457. if(sscanf(params,"u", id)) return SCM(playerid, COLOR_GREY,"USAGE: /unfreeze [playerid/partofname]");
  4458. if(!IsPlayerConnected(id)) return SCM(playerid, COLOR_GREY,"Invalid player ID");
  4459. else
  4460. {
  4461. GetPlayerName(playerid,sendername,sizeof(sendername));
  4462. GetPlayerName(id,name,sizeof(name));
  4463. TogglePlayerControllable(id, 1);
  4464. format(string, sizeof(string), "AdmCmd: %s has unfreezed %s", sendername, name);
  4465. ABroadCast(COLOR_YELLOW,string,1);
  4466. format(string, sizeof(string),"You have been unfreezed by admin %s", sendername);
  4467. SendClientMessage(id, COLOR_LIGHTRED, string);
  4468. }
  4469. return 1;
  4470. }
  4471. CMD:check(playerid, params[])
  4472. {
  4473. new id;
  4474. if(PlayerInfo[playerid][pAdmin] < 1) return SCM(playerid,COLOR_GREY,"You are not authorized to use this command");
  4475. if(sscanf(params,"u", id)) return SCM(playerid, COLOR_GREY,"USAGE: /check [playerid/partofname]");
  4476. if(!IsPlayerConnected(id)) return SCM(playerid, COLOR_GREY,"Invalid player ID");
  4477. else
  4478. {
  4479. ShowStats(playerid, id);
  4480. }
  4481. return 1;
  4482. }
  4483. //===================================================DEALERSHIP=============================================================
  4484. CMD:tow(playerid, params[])
  4485. {
  4486. if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, COLOR_RED, "You are not driving a vehicle!");
  4487. new vehicleid = GetPlayerVehicleID(playerid);
  4488. if(IsTrailerAttachedToVehicle(vehicleid))
  4489. {
  4490. DetachTrailerFromVehicle(vehicleid);
  4491. SendClientMessage(playerid, COLOR_WHITE, "You are not towing anymore");
  4492. return 1;
  4493. }
  4494. new Float:x, Float:y, Float:z;
  4495. new Float:dist, Float:closedist=8, closeveh;
  4496. for(new i=1; i < MAX_VEHICLES; i++)
  4497. {
  4498. if(i != vehicleid && GetVehiclePos(i, x, y, z))
  4499. {
  4500. dist = GetPlayerDistanceFromPoint(playerid, x, y, z);
  4501. if(dist < closedist)
  4502. {
  4503. closedist = dist;
  4504. closeveh = i;
  4505. }
  4506. }
  4507. }
  4508. if(!closeveh) return SendClientMessage(playerid, COLOR_RED, "You are not close to a vehicle!");
  4509. AttachTrailerToVehicle(closeveh, vehicleid);
  4510. SendClientMessage(playerid, COLOR_WHITE, "You are now towing a vehicle");
  4511. return 1;
  4512. }
  4513.  
  4514. CMD:eject(playerid, params[])
  4515. {
  4516. if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, COLOR_RED, "You are not driving a vehicle!");
  4517. new pid, msg[128];
  4518. if(sscanf(params, "u", pid)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /eject [player]");
  4519. if(!IsPlayerConnected(pid)) return SendClientMessage(playerid, COLOR_RED, "Invalid player!");
  4520. new vehicleid = GetPlayerVehicleID(playerid);
  4521. if(!IsPlayerInVehicle(pid, vehicleid)) return SendClientMessage(playerid, COLOR_RED, "Player is not in your vehicle!");
  4522. RemovePlayerFromVehicle(pid);
  4523. format(msg, sizeof(msg), "Vehicle driver %s (%d) has ejected you", PlayerName(playerid), playerid);
  4524. SendClientMessage(pid, COLOR_WHITE, msg);
  4525. format(msg, sizeof(msg), "You have ejected %s (%d) from your vehicle", PlayerName(pid), pid);
  4526. SendClientMessage(playerid, COLOR_WHITE, msg);
  4527. return 1;
  4528. }
  4529.  
  4530. CMD:ejectall(playerid, params[])
  4531. {
  4532. if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, COLOR_RED, "You are not driving a vehicle!");
  4533. new vehicleid = GetPlayerVehicleID(playerid);
  4534. new msg[128];
  4535. format(msg, sizeof(msg), "Vehicle driver %s (%d) has ejected you", PlayerName(playerid), playerid);
  4536. for(new i=0; i < MAX_PLAYERS; i++)
  4537. {
  4538. if(IsPlayerConnected(i) && i != playerid && IsPlayerInVehicle(i, vehicleid))
  4539. {
  4540. RemovePlayerFromVehicle(i);
  4541. SendClientMessage(i, COLOR_WHITE, msg);
  4542. }
  4543. }
  4544. SendClientMessage(playerid, COLOR_WHITE, "You have ejected all passengers");
  4545. return 1;
  4546. }
  4547.  
  4548. CMD:clearmods(playerid, params[])
  4549. {
  4550. if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, COLOR_RED, "You are not driving a vehicle!");
  4551. new vehicleid = GetPlayerVehicleID(playerid);
  4552. new id = GetVehicleID(vehicleid);
  4553. if(GetPlayerVehicleAccess(playerid, id) != 1)
  4554. return SendClientMessage(playerid, COLOR_RED, "This is not your vehicle vehicle!");
  4555. for(new i=0; i < sizeof(VehicleMods[]); i++)
  4556. {
  4557. RemoveVehicleComponent(VehicleID[id], GetVehicleComponentInSlot(VehicleID[id], i));
  4558. VehicleMods[id][i] = 0;
  4559. }
  4560. VehiclePaintjob[id] = 255;
  4561. ChangeVehiclePaintjob(VehicleID[id], 255);
  4562. SaveVehicle(id);
  4563. SendClientMessage(playerid, COLOR_WHITE, "You have removed all modifications from your vehicle");
  4564. return 1;
  4565. }
  4566.  
  4567. CMD:trackcar(playerid, params[])
  4568. {
  4569. if(TrackCar[playerid])
  4570. {
  4571. TrackCar[playerid] = 0;
  4572. DisablePlayerCheckpoint(playerid);
  4573. SendClientMessage(playerid, COLOR_WHITE, "You are not tracking your vehicle anymore");
  4574. return 1;
  4575. }
  4576. new info[256], bool:found;
  4577. for(new i=1; i < MAX_DVEHICLES; i++)
  4578. {
  4579. if(VehicleCreated[i] == VEHICLE_PLAYER && strcmp(VehicleOwner[i], PlayerName(playerid)) == 0)
  4580. {
  4581. found = true;
  4582. format(info, sizeof(info), "%sID: %d Name: %s\n", info, i, VehicleNames[VehicleModel[i]-400]);
  4583. }
  4584. }
  4585. if(!found) return SendClientMessage(playerid, COLOR_RED, "You don't have any vehicles!");
  4586. ShowPlayerDialog(playerid, DIALOG_FINDVEHICLE, DIALOG_STYLE_LIST, "Find Your Vehicle", info, "Find", "Cancel");
  4587. return 1;
  4588. }
  4589.  
  4590. CMD:v(playerid, params[])
  4591. {
  4592. if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, COLOR_RED, "You are not driving a vehicle!");
  4593. new vehicleid = GetPlayerVehicleID(playerid);
  4594. if(IsBicycle(vehicleid)) return SendClientMessage(playerid, COLOR_RED, "You are not driving a vehicle!");
  4595. new id = GetVehicleID(vehicleid);
  4596. if(!GetPlayerVehicleAccess(playerid, id))
  4597. return SendClientMessage(playerid, COLOR_RED, "You don't have the keys for this vehicle!");
  4598. SetPVarInt(playerid, "DialogValue1", id);
  4599. ShowDialog(playerid, DIALOG_VEHICLE);
  4600. return 1;
  4601. }
  4602.  
  4603. CMD:sellv(playerid, params[])
  4604. {
  4605. new pid, id, price, msg[128];
  4606. if(sscanf(params, "udd", pid, id, price)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /sellv [player] [vehicleid] [price]");
  4607. if(!IsPlayerConnected(pid)) return SendClientMessage(playerid, COLOR_RED, "Invalid player!");
  4608. if(GetPlayerVehicleAccess(playerid, id) != 1)
  4609. return SendClientMessage(playerid, COLOR_RED, "You are not the owner of this vehicle!");
  4610. if(price < 1) return SendClientMessage(playerid, COLOR_RED, "Invalid price!");
  4611. if(!PlayerToPlayer(playerid, pid, 10.0)) return SendClientMessage(playerid, COLOR_RED, "Player is too far!");
  4612. SetPVarInt(pid, "DialogValue1", playerid);
  4613. SetPVarInt(pid, "DialogValue2", id);
  4614. SetPVarInt(pid, "DialogValue3", price);
  4615. ShowDialog(pid, DIALOG_VEHICLE_SELL);
  4616. format(msg, sizeof(msg), "You have offered %s (%d) to buy your vehicle for $%d", PlayerName(pid), pid, price);
  4617. SendClientMessage(playerid, COLOR_WHITE, msg);
  4618. return 1;
  4619. }
  4620.  
  4621. CMD:givecarkeys(playerid, params[])
  4622. {
  4623. new pid, id, msg[128];
  4624. if(sscanf(params, "ud", pid, id)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /givecarkeys [player] [vehicleid]");
  4625. if(!IsPlayerConnected(pid)) return SendClientMessage(playerid, COLOR_RED, "Invalid player!");
  4626. if(!IsValidVehicle(id)) return SendClientMessage(playerid, COLOR_RED, "Invalid vehicleid!");
  4627. if(GetPlayerVehicleAccess(playerid, id) != 1)
  4628. return SendClientMessage(playerid, COLOR_RED, "You are not the owner of this vehicle!");
  4629. if(!PlayerToPlayer(playerid, pid, 10.0)) return SendClientMessage(playerid, COLOR_RED, "Player is too far!");
  4630. SetPVarInt(pid, "CarKeys", id);
  4631. format(msg, sizeof(msg), "You have given your car keys to %s (%d)", PlayerName(pid), pid);
  4632. SendClientMessage(playerid, COLOR_WHITE, msg);
  4633. format(msg, sizeof(msg), "%s (%d) has given you car keys", PlayerName(playerid), playerid);
  4634. SendClientMessage(pid, COLOR_WHITE, msg);
  4635. return 1;
  4636. }
  4637.  
  4638. CMD:vlock(playerid, params[])
  4639. {
  4640. new vehicleid;
  4641. if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
  4642. {
  4643. vehicleid = GetPlayerVehicleID(playerid);
  4644. }
  4645. else
  4646. {
  4647. vehicleid = GetClosestVehicle(playerid);
  4648. if(!PlayerToVehicle(playerid, vehicleid, 5.0)) vehicleid = 0;
  4649. }
  4650. if(!vehicleid) return SendClientMessage(playerid, COLOR_RED, "You are not close to a vehicle!");
  4651. new id = GetVehicleID(vehicleid);
  4652. if(!IsValidVehicle(id)) return SendClientMessage(playerid, COLOR_RED, "You don't have the keys for this vehicle!");
  4653. if(!GetPlayerVehicleAccess(playerid, id))
  4654. return SendClientMessage(playerid, COLOR_RED, "You don't have the keys for this vehicle!");
  4655. new engine, lights, alarm, doors, bonnet, boot, objective;
  4656. GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
  4657. if(doors == 1)
  4658. {
  4659. doors = 0;
  4660. GameTextForPlayer(playerid, "~g~doors unlocked", 3000, 6);
  4661. }
  4662. else
  4663. {
  4664. doors = 1;
  4665. GameTextForPlayer(playerid, "~r~doors locked", 3000, 6);
  4666. }
  4667. SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
  4668. return 1;
  4669. }
  4670.  
  4671. CMD:valarm(playerid, params[])
  4672. {
  4673. new vehicleid;
  4674. if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
  4675. {
  4676. vehicleid = GetPlayerVehicleID(playerid);
  4677. }
  4678. else
  4679. {
  4680. vehicleid = GetClosestVehicle(playerid);
  4681. if(!PlayerToVehicle(playerid, vehicleid, 5.0)) vehicleid = 0;
  4682. }
  4683. if(!vehicleid) return SendClientMessage(playerid, COLOR_RED, "You are not close to a vehicle!");
  4684. new id = GetVehicleID(vehicleid);
  4685. if(!IsValidVehicle(id)) return SendClientMessage(playerid, COLOR_RED, "You don't have the keys for this vehicle!");
  4686. if(GetPlayerVehicleAccess(playerid, id) != 1)
  4687. return SendClientMessage(playerid, COLOR_RED, "You don't have the keys for this vehicle!");
  4688. if(VehicleSecurity[vehicleid] == 0)
  4689. {
  4690. VehicleSecurity[vehicleid] = 1;
  4691. GameTextForPlayer(playerid, "~g~alarm on", 3000, 6);
  4692. }
  4693. else
  4694. {
  4695. ToggleAlarm(vehicleid, VEHICLE_PARAMS_OFF);
  4696. VehicleSecurity[vehicleid] = 0;
  4697. GameTextForPlayer(playerid, "~r~alarm off", 3000, 6);
  4698. }
  4699. return 1;
  4700. }
  4701.  
  4702. CMD:trunk(playerid, params[])
  4703. {
  4704. new vehicleid;
  4705. if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
  4706. {
  4707. vehicleid = GetPlayerVehicleID(playerid);
  4708. }
  4709. else
  4710. {
  4711. vehicleid = GetClosestVehicle(playerid);
  4712. if(!PlayerToVehicle(playerid, vehicleid, 5.0)) vehicleid = 0;
  4713. }
  4714. if(!vehicleid)
  4715. return SendClientMessage(playerid, COLOR_RED, "You are not close to a vehicle!");
  4716. new id = GetVehicleID(vehicleid);
  4717. if(!IsValidVehicle(id)) return SendClientMessage(playerid, COLOR_RED, "You don't have the keys for this vehicle!");
  4718. if(!GetPlayerVehicleAccess(playerid, id))
  4719. return SendClientMessage(playerid, COLOR_RED, "You don't have the keys for this vehicle!");
  4720. new engine, lights, alarm, doors, bonnet, boot, objective;
  4721. GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
  4722. SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, 1, objective);
  4723. SetPVarInt(playerid, "DialogValue1", id);
  4724. ShowDialog(playerid, DIALOG_TRUNK);
  4725. return 1;
  4726. }
  4727.  
  4728. CMD:fuel(playerid, params[])
  4729. {
  4730. for(new i=1; i < MAX_FUEL_STATIONS; i++)
  4731. {
  4732. if(FuelStationCreated[i])
  4733. {
  4734. if(IsPlayerInRangeOfPoint(playerid, 15.0, FuelStationPos[i][0], FuelStationPos[i][1], FuelStationPos[i][2]))
  4735. {
  4736. SetPVarInt(playerid, "FuelStation", i);
  4737. ShowDialog(playerid, DIALOG_FUEL);
  4738. return 1;
  4739. }
  4740. }
  4741. }
  4742. SendClientMessage(playerid, COLOR_RED, "You are not in a fuel station!");
  4743. return 1;
  4744. }
  4745.  
  4746. CMD:setfuel(playerid, params[])
  4747. {
  4748. if(PlayerInfo[playerid][pAdmin] < 1338) return SendClientMessage(playerid, COLOR_RED, "You are not admin!");
  4749. if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, "You are not in a vehicle!");
  4750. new amount, msg[128];
  4751. if(sscanf(params, "d", amount)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /setfuel [amount]");
  4752. if(amount < 0 || amount > 100) return SendClientMessage(playerid, COLOR_RED, "Invalid amount! (0-100)");
  4753. Fuel[GetPlayerVehicleID(playerid)] = amount;
  4754. format(msg, sizeof(msg), "You have set your vehicle fuel to %d", amount);
  4755. SendClientMessage(playerid, COLOR_WHITE, msg);
  4756. return 1;
  4757. }
  4758.  
  4759. CMD:addv(playerid, params[])
  4760. {
  4761. if(PlayerInfo[playerid][pAdmin] < 1338) return SendClientMessage(playerid, COLOR_RED, "You are not admin!");
  4762. if(!IsPlayerSpawned(playerid)) return SendClientMessage(playerid, COLOR_RED, "You can't use this command now!");
  4763. new model[32], modelid, dealerid, color1, color2, price;
  4764. if(sscanf(params, "dsddd", dealerid, model, color1, color2, price))
  4765. return SendClientMessage(playerid, COLOR_GREY, "USAGE: /addv [dealerid] [model] [color1] [color2] [price]");
  4766. if(!IsValidDealership(dealerid)) return SendClientMessage(playerid, COLOR_RED, "Invalid dealerid!");
  4767. if(IsNumeric(model)) modelid = strval(model);
  4768. else modelid = GetVehicleModelIDFromName(model);
  4769. if(modelid < 400 || modelid > 611) return SendClientMessage(playerid, COLOR_RED, "Invalid model ID!");
  4770. if(color1 < 0 || color2 < 0) return SendClientMessage(playerid, COLOR_RED, "Invalid color!");
  4771. if(price < 0) return SendClientMessage(playerid, COLOR_RED, "Invalid price!");
  4772. new Float:X, Float:Y, Float:Z, Float:angle;
  4773. GetPlayerPos(playerid, X, Y, Z);
  4774. GetPlayerFacingAngle(playerid, angle);
  4775. X += floatmul(floatsin(-angle, degrees), 4.0);
  4776. Y += floatmul(floatcos(-angle, degrees), 4.0);
  4777. for(new i=1; i < MAX_DVEHICLES; i++)
  4778. {
  4779. if(!VehicleCreated[i])
  4780. {
  4781. new msg[128];
  4782. VehicleCreated[i] = VEHICLE_DEALERSHIP;
  4783. VehicleModel[i] = modelid;
  4784. VehiclePos[i][0] = X;
  4785. VehiclePos[i][1] = Y;
  4786. VehiclePos[i][2] = Z;
  4787. VehiclePos[i][3] = angle+90.0;
  4788. VehicleColor[i][0] = color1;
  4789. VehicleColor[i][1] = color2;
  4790. VehicleInterior[i] = GetPlayerInterior(playerid);
  4791. VehicleWorld[i] = GetPlayerVirtualWorld(playerid);
  4792. VehicleValue[i] = price;
  4793. valstr(VehicleOwner[i], dealerid);
  4794. VehicleNumberPlate[i] = DEFAULT_NUMBER_PLATE;
  4795. for(new d=0; d < sizeof(VehicleTrunk[]); d++)
  4796. {
  4797. VehicleTrunk[i][d][0] = 0;
  4798. VehicleTrunk[i][d][1] = 0;
  4799. }
  4800. for(new d=0; d < sizeof(VehicleMods[]); d++)
  4801. {
  4802. VehicleMods[i][d] = 0;
  4803. }
  4804. VehiclePaintjob[i] = 255;
  4805. UpdateVehicle(i, 0);
  4806. SaveVehicle(i);
  4807. format(msg, sizeof(msg), "Added vehicle id %d to dealerid %d", i, dealerid);
  4808. SendClientMessage(playerid, COLOR_WHITE, msg);
  4809. return 1;
  4810. }
  4811. }
  4812. SendClientMessage(playerid, COLOR_RED, "Can't add any more vehicles!");
  4813. return 1;
  4814. }
  4815.  
  4816. CMD:editv(playerid, params[])
  4817. {
  4818. if(PlayerInfo[playerid][pAdmin] < 1338) return SendClientMessage(playerid, COLOR_RED, "You are not admin!");
  4819. if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
  4820. {
  4821. new id = GetVehicleID(GetPlayerVehicleID(playerid));
  4822. if(!IsValidVehicle(id)) return SendClientMessage(playerid, COLOR_RED, "This is not a dynamic vehicle!");
  4823. SetPVarInt(playerid, "DialogValue1", id);
  4824. ShowDialog(playerid, DIALOG_EDITVEHICLE);
  4825. return 1;
  4826. }
  4827. new vehicleid;
  4828. if(sscanf(params, "d", vehicleid)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /editv [vehicleid]");
  4829. if(!IsValidVehicle(vehicleid)) return SendClientMessage(playerid, COLOR_RED, "Invalid vehicleid!");
  4830. SetPVarInt(playerid, "DialogValue1", vehicleid);
  4831. ShowDialog(playerid, DIALOG_EDITVEHICLE);
  4832. return 1;
  4833. }
  4834.  
  4835. CMD:adddealership(playerid, params[])
  4836. {
  4837. if(PlayerInfo[playerid][pAdmin] < 1338) return SendClientMessage(playerid, COLOR_RED, "You are not admin!");
  4838. if(!IsPlayerSpawned(playerid)) return SendClientMessage(playerid, COLOR_RED, "You can't use this command now!");
  4839. for(new i=1; i < MAX_DEALERSHIPS; i++)
  4840. {
  4841. if(!DealershipCreated[i])
  4842. {
  4843. new msg[128];
  4844. DealershipCreated[i] = 1;
  4845. GetPlayerPos(playerid, DealershipPos[i][0], DealershipPos[i][1], DealershipPos[i][2]);
  4846. UpdateDealership(i, 0);
  4847. SaveDealership(i);
  4848. format(msg, sizeof(msg), "Added dealership id %d", i);
  4849. SendClientMessage(playerid, COLOR_WHITE, msg);
  4850. return 1;
  4851. }
  4852. }
  4853. SendClientMessage(playerid, COLOR_RED, "Can't add any more dealerships!");
  4854. return 1;
  4855. }
  4856.  
  4857. CMD:deletedealership(playerid, params[])
  4858. {
  4859. if(PlayerInfo[playerid][pAdmin] < 1338) return SendClientMessage(playerid, COLOR_RED, "You are not admin!");
  4860. new dealerid, msg[128];
  4861. if(sscanf(params, "d", dealerid)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /deletedealership [dealerid]");
  4862. if(!IsValidDealership(dealerid)) return SendClientMessage(playerid, COLOR_RED, "Invalid dealerid!");
  4863. for(new i=1; i < MAX_DVEHICLES; i++)
  4864. {
  4865. if(VehicleCreated[i] == VEHICLE_DEALERSHIP && strval(VehicleOwner[i]) == dealerid)
  4866. {
  4867. DestroyVehicle(VehicleID[i]);
  4868. Delete3DTextLabel(VehicleLabel[i]);
  4869. VehicleCreated[i] = 0;
  4870. }
  4871. }
  4872. DealershipCreated[dealerid] = 0;
  4873. Delete3DTextLabel(DealershipLabel[dealerid]);
  4874. SaveDealership(dealerid);
  4875. format(msg, sizeof(msg), "Deleted dealership id %d", dealerid);
  4876. SendClientMessage(playerid, COLOR_WHITE, msg);
  4877. return 1;
  4878. }
  4879.  
  4880. CMD:movedealership(playerid, params[])
  4881. {
  4882. if(PlayerInfo[playerid][pAdmin] < 1338) return SendClientMessage(playerid, COLOR_RED, "You are not admin!");
  4883. new dealerid, msg[128];
  4884. if(sscanf(params, "d", dealerid)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /movedealership [dealerid]");
  4885. if(!IsValidDealership(dealerid)) return SendClientMessage(playerid, COLOR_RED, "Invalid dealerid!");
  4886. GetPlayerPos(playerid, DealershipPos[dealerid][0], DealershipPos[dealerid][1], DealershipPos[dealerid][2]);
  4887. UpdateDealership(dealerid, 1);
  4888. SaveDealership(dealerid);
  4889. format(msg, sizeof(msg), "Moved dealership id %d here", dealerid);
  4890. SendClientMessage(playerid, COLOR_WHITE, msg);
  4891. return 1;
  4892. }
  4893.  
  4894. CMD:gotodealership(playerid, params[])
  4895. {
  4896. if(PlayerInfo[playerid][pAdmin] < 1338) return SendClientMessage(playerid, COLOR_RED, "You are not admin!");
  4897. new dealerid, msg[128];
  4898. if(sscanf(params, "d", dealerid)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /gotodealership [dealerid]");
  4899. if(!IsValidDealership(dealerid)) return SendClientMessage(playerid, COLOR_RED, "Invalid dealerid!");
  4900. SetPlayerPos(playerid, DealershipPos[dealerid][0], DealershipPos[dealerid][1], DealershipPos[dealerid][2]);
  4901. format(msg, sizeof(msg), "Teleported to dealership id %d", dealerid);
  4902. SendClientMessage(playerid, COLOR_WHITE, msg);
  4903. return 1;
  4904. }
  4905.  
  4906. CMD:addfuelstation(playerid, params[])
  4907. {
  4908. if(PlayerInfo[playerid][pAdmin] < 1338) return SendClientMessage(playerid, COLOR_RED, "You are not admin!");
  4909. if(!IsPlayerSpawned(playerid)) return SendClientMessage(playerid, COLOR_RED, "You can't use this command now!");
  4910. for(new i=1; i < MAX_FUEL_STATIONS; i++)
  4911. {
  4912. if(!FuelStationCreated[i])
  4913. {
  4914. new msg[128];
  4915. FuelStationCreated[i] = 1;
  4916. GetPlayerPos(playerid, FuelStationPos[i][0], FuelStationPos[i][1], FuelStationPos[i][2]);
  4917. UpdateFuelStation(i, 0);
  4918. SaveFuelStation(i);
  4919. format(msg, sizeof(msg), "Added fuel station id %d", i);
  4920. SendClientMessage(playerid, COLOR_WHITE, msg);
  4921. return 1;
  4922. }
  4923. }
  4924. SendClientMessage(playerid, COLOR_RED, "Can't add any more fuel stations!");
  4925. return 1;
  4926. }
  4927.  
  4928. CMD:deletefuelstation(playerid, params[])
  4929. {
  4930. if(PlayerInfo[playerid][pAdmin] < 1338) return SendClientMessage(playerid, COLOR_RED, "You are not admin!");
  4931. new stationid, msg[128];
  4932. if(sscanf(params, "d", stationid)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /deletefuelstation [stationid]");
  4933. if(!IsValidFuelStation(stationid)) return SendClientMessage(playerid, COLOR_RED, "Invalid stationid!");
  4934. FuelStationCreated[stationid] = 0;
  4935. Delete3DTextLabel(FuelStationLabel[stationid]);
  4936. SaveFuelStation(stationid);
  4937. format(msg, sizeof(msg), "Deleted fuel station id %d", stationid);
  4938. SendClientMessage(playerid, COLOR_WHITE, msg);
  4939. return 1;
  4940. }
  4941.  
  4942. CMD:movefuelstation(playerid, params[])
  4943. {
  4944. if(PlayerInfo[playerid][pAdmin] < 1338) return SendClientMessage(playerid, COLOR_RED, "You are not admin!");
  4945. new stationid, msg[128];
  4946. if(sscanf(params, "d", stationid)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /movefuelstation [stationid]");
  4947. if(!IsValidFuelStation(stationid)) return SendClientMessage(playerid, COLOR_RED, "Invalid stationid!");
  4948. GetPlayerPos(playerid, FuelStationPos[stationid][0], FuelStationPos[stationid][1], FuelStationPos[stationid][2]);
  4949. UpdateFuelStation(stationid, 1);
  4950. SaveFuelStation(stationid);
  4951. format(msg, sizeof(msg), "Moved fuel station id %d here", stationid);
  4952. SendClientMessage(playerid, COLOR_WHITE, msg);
  4953. return 1;
  4954. }
  4955.  
  4956. CMD:gotofuelstation(playerid, params[])
  4957. {
  4958. if(PlayerInfo[playerid][pAdmin] < 1338) return SendClientMessage(playerid, COLOR_RED, "You are not admin!");
  4959. new stationid, msg[128];
  4960. if(sscanf(params, "d", stationid)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /gotofuelstation [stationid]");
  4961. if(!IsValidFuelStation(stationid)) return SendClientMessage(playerid, COLOR_RED, "Invalid stationid!");
  4962. SetPlayerPos(playerid, FuelStationPos[stationid][0], FuelStationPos[stationid][1], FuelStationPos[stationid][2]);
  4963. format(msg, sizeof(msg), "Teleported to fuel station id %d", stationid);
  4964. SendClientMessage(playerid, COLOR_WHITE, msg);
  4965. return 1;
  4966. }
  4967. CMD:anims(playerid, params[])
  4968. {
  4969. SendClientMessage(playerid,COLOR_GRAD2," ____________Character Animations____________");
  4970. SendClientMessage(playerid,COLOR_GRAD2,"[Sit/Lay] /sit /seat /lay /sleep /lean /lean2");
  4971. SendClientMessage(playerid,COLOR_GRAD2,"[Signs] /gsign1 /gsign2 /gsign4 /gsign5 /gsign7");
  4972. SendClientMessage(playerid,COLOR_GRAD2,"[Communication] /greet1 /greet2 /greet3 ");
  4973. SendClientMessage(playerid,COLOR_GRAD2,"[Communication] /fuckyou /wave /argue /kiss");
  4974. SendClientMessage(playerid,COLOR_GRAD2,"[Physical Actions] /bat /bat2 /punch /aim /slapass");
  4975. SendClientMessage(playerid,COLOR_GRAD2,"[Physical Actions] /taxiL /flip /crack");
  4976. SendClientMessage(playerid,COLOR_GRAD2,"[Emotions] /injured");
  4977. SendClientMessage(playerid,COLOR_GRAD2,"_____________________________________________");
  4978. return true;
  4979. }
  4980. //================================ANIMATIONS====================================
  4981. CMD:taxiL(playerid, params[])
  4982. {
  4983. LoopingAnim(playerid,"PED","IDLE_taxi",4.0,0,1,1,1,0);
  4984. return 1;
  4985. }
  4986. CMD:punch(playerid, params[])
  4987. {
  4988. LoopingAnim(playerid,"MD_CHASE","MD_BIKE_Punch",4.0,0,1,1,1,0);
  4989. return 1;
  4990. }
  4991. CMD:greet1(playerid, params[])
  4992. {
  4993. LoopingAnim(playerid,"WUZI","Wuzi_Greet_Plyr",4.0,0,1,1,1,0);
  4994. return 1;
  4995. }
  4996. CMD:greet2(playerid, params[])
  4997. {
  4998. LoopingAnim(playerid,"WUZI","Wuzi_Greet_Wuzi",4.0,0,1,1,1,0);
  4999. return 1;
  5000. }
  5001. CMD:wave(playerid, params[])
  5002. {
  5003. LoopingAnim(playerid,"BD_FIRE ","BD_GF_Wave",4.0,0,1,1,1,0);
  5004. return 1;
  5005. }
  5006. CMD:argue(playerid, params[])
  5007. {
  5008. LoopingAnim(playerid,"PAULNMAC","PnM_Argue1_A",4.0,0,1,1,1,0);
  5009. return 1;
  5010. }
  5011. CMD:sleep(playerid, params[])
  5012. {
  5013. LoopingAnim(playerid,"INT_HOUSE","BED_In_L",4.0,0,1,1,1,0);
  5014. return 1;
  5015. }
  5016. CMD:lean2(playerid, params[])
  5017. {
  5018. LoopingAnim(playerid,"RYDER","Van_Lean_L",4.0,0,1,1,1,0);
  5019. return 1;
  5020. }
  5021.  
  5022. CMD:gsign1(playerid, params[])
  5023. {
  5024. LoopingAnim(playerid,"GHANDS","gsign1",4.0,0,1,1,1,0);
  5025. return 1;
  5026. }
  5027. CMD:gsign2(playerid, params[])
  5028. {
  5029. LoopingAnim(playerid,"GHANDS","gsign1LH",4.0,0,1,1,1,0);
  5030. return 1;
  5031. }
  5032. CMD:gsign3(playerid, params[])
  5033. {
  5034. LoopingAnim(playerid,"GHANDS","gsign2",4.0,0,1,1,1,0);
  5035. return 1;
  5036. }
  5037. CMD:gsign4(playerid, params[])
  5038. {
  5039. LoopingAnim(playerid,"GHANDS","gsign2LH",4.0,0,1,1,1,0);
  5040. return 1;
  5041. }
  5042. CMD:gsign5(playerid, params[])
  5043. {
  5044. LoopingAnim(playerid,"GHANDS","gsign3",4.0,0,1,1,1,0);
  5045. return 1;
  5046. }
  5047. CMD:gsign6(playerid, params[])
  5048. {
  5049. LoopingAnim(playerid,"GHANDS","gsign3LH",4.0,0,1,1,1,0);
  5050. return 1;
  5051. }
  5052. CMD:gsign7(playerid, params[])
  5053. {
  5054. LoopingAnim(playerid,"GHANDS","gsign4",4.0,0,1,1,1,0);
  5055. return 1;
  5056. }
  5057.  
  5058.  
  5059.  
  5060. CMD:carjacked1(playerid, params[])
  5061. {
  5062. LoopingAnim(playerid,"PED","CAR_jackedLHS",4.0,0,1,1,1,0);
  5063. return 1;
  5064. }
  5065.  
  5066.  
  5067.  
  5068. CMD:carjacked2(playerid, params[])
  5069. {
  5070. LoopingAnim(playerid,"PED","CAR_jackedRHS",4.0,0,1,1,1,0);
  5071. return 1;
  5072. }
  5073.  
  5074.  
  5075.  
  5076. CMD:handsup(playerid, params[])
  5077. {
  5078. LoopingAnim(playerid, "ROB_BANK","SHP_HandsUp_Scr", 4.0, 0, 1, 1, 1, 0);
  5079. return 1;
  5080. }
  5081.  
  5082.  
  5083.  
  5084. CMD:cellin(playerid, params[])
  5085. {
  5086. SetPlayerSpecialAction(playerid,SPECIAL_ACTION_USECELLPHONE);
  5087. return 1;
  5088. }
  5089.  
  5090.  
  5091.  
  5092. CMD:cellout(playerid, params[])
  5093. {
  5094. SetPlayerSpecialAction(playerid,SPECIAL_ACTION_STOPUSECELLPHONE);
  5095. return 1;
  5096. }
  5097.  
  5098.  
  5099.  
  5100. CMD:drunk(playerid, params[])
  5101. {
  5102. LoopingAnim(playerid,"PED","WALK_DRUNK",4.1,1,1,1,1,1);
  5103. return 1;
  5104. }
  5105.  
  5106.  
  5107.  
  5108. CMD:bomb(playerid, params[])
  5109. {
  5110. ClearAnimations(playerid);
  5111. LoopingAnim(playerid, "BOMBER","BOM_Plant_Loop",4.0,1,0,0,1,0); // Place Bomb
  5112. return 1;
  5113. }
  5114.  
  5115.  
  5116. CMD:getarrested(playerid, params[])
  5117. {
  5118. LoopingAnim(playerid,"ped", "ARRESTgun", 4.0, 0, 1, 1, 1, -1); // Gun Arrest
  5119. return 1;
  5120. }
  5121.  
  5122.  
  5123. CMD:laugh(playerid, params[])
  5124. {
  5125. OnePlayAnim(playerid, "RAPPING", "Laugh_01", 4.0, 0, 0, 0, 0, 0); // Laugh
  5126. return 1;
  5127. }
  5128.  
  5129.  
  5130. CMD:lookout(playerid, params[])
  5131. {
  5132. OnePlayAnim(playerid, "SHOP", "ROB_Shifty", 4.0, 0, 0, 0, 0, 0); // Rob Lookout
  5133. return 1;
  5134. }
  5135.  
  5136.  
  5137. CMD:robman(playerid, params[])
  5138. {
  5139. LoopingAnim(playerid, "SHOP", "ROB_Loop_Threat", 4.0, 1, 0, 0, 0, 0); // Rob
  5140. return 1;
  5141. }
  5142.  
  5143.  
  5144. CMD:crossarms(playerid, params[])
  5145. {
  5146. LoopingAnim(playerid, "COP_AMBIENT", "Coplook_loop", 4.0, 0, 1, 1, 1, -1); // Arms crossed
  5147. return 1;
  5148. }
  5149.  
  5150.  
  5151. CMD:lay(playerid, params[])
  5152. {
  5153. LoopingAnim(playerid,"BEACH", "bather", 4.0, 1, 0, 0, 0, 0); // Lay down
  5154. return 1;
  5155. }
  5156.  
  5157.  
  5158. CMD:hide(playerid, params[])
  5159. {
  5160. LoopingAnim(playerid, "ped", "cower", 3.0, 1, 0, 0, 0, 0); // Taking Cover
  5161. return 1;
  5162. }
  5163.  
  5164.  
  5165. CMD:vomit(playerid, params[])
  5166. {
  5167. OnePlayAnim(playerid, "FOOD", "EAT_Vomit_P", 3.0, 0, 0, 0, 0, 0); // Vomit BAH!
  5168. return 1;
  5169. }
  5170.  
  5171.  
  5172. CMD:eat(playerid, params[])
  5173. {
  5174. OnePlayAnim(playerid, "FOOD", "EAT_Burger", 3.0, 0, 0, 0, 0, 0); // Eat Burger
  5175. return 1;
  5176. }
  5177. // Wave
  5178.  
  5179.  
  5180.  
  5181. CMD:slapass(playerid, params[])
  5182. {
  5183. OnePlayAnim(playerid, "SWEET", "sweet_ass_slap", 4.0, 0, 0, 0, 0, 0); // Ass Slapping
  5184. return 1;
  5185. }
  5186.  
  5187.  
  5188. CMD:deal(playerid, params[])
  5189. {
  5190. OnePlayAnim(playerid, "DEALER", "DEALER_DEAL", 4.0, 0, 0, 0, 0, 0); // Deal Drugs
  5191. return 1;
  5192. }
  5193.  
  5194.  
  5195.  
  5196. CMD:crack(playerid, params[])
  5197. {
  5198. LoopingAnim(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0); // Dieing of Crack
  5199. return 1;
  5200. }
  5201.  
  5202. // Sit
  5203. CMD:sit(playerid, params[])
  5204. {
  5205. LoopingAnim(playerid,"BEACH", "ParkSit_M_loop", 4.0, 1, 0, 0, 0, 0); // Sit
  5206. return 1;
  5207. }
  5208. // Idle Chat
  5209. CMD:chat(playerid, params[])
  5210. {
  5211. LoopingAnim(playerid,"PED","IDLE_CHAT",4.0,1,0,0,1,1);
  5212. return 1;
  5213. }
  5214. // Idle Chat2
  5215. CMD:chat2(playerid, params[])
  5216. {
  5217. LoopingAnim(playerid,"MISC","Idle_Chat_02",4.0,1,0,0,1,1);
  5218. return 1;
  5219. }
  5220. // Fucku
  5221. CMD:fuckyou(playerid, params[])
  5222. {
  5223. OnePlayAnim(playerid,"PED","fucku",4.0,0,0,0,0,0);
  5224. return 1;
  5225. }
  5226. // TaiChi
  5227. CMD:taichi(playerid, params[])
  5228. {
  5229. LoopingAnim(playerid,"PARK","Tai_Chi_Loop",4.0,1,0,0,0,0);
  5230. return 1;
  5231. }
  5232.  
  5233. // ChairSit
  5234.  
  5235. // Fall on the ground
  5236. CMD:flip(playerid, params[])
  5237. {
  5238. LoopingAnim(playerid,"PED","KO_skid_front",4.1,0,1,1,1,0);
  5239. return 1;
  5240. }
  5241.  
  5242. // Fall
  5243. CMD:backflip(playerid, params[])
  5244. {
  5245. LoopingAnim(playerid, "PED","FLOOR_hit_f", 4.0, 1, 0, 0, 0, 0);
  5246. return 1;
  5247. }
  5248.  
  5249. // kiss
  5250. CMD:kiss(playerid, params[])
  5251. {
  5252. LoopingAnim(playerid, "KISSING", "Playa_Kiss_02", 3.0, 1, 1, 1, 1, 0);
  5253. return 1;
  5254. }
  5255.  
  5256. // Injujred
  5257. CMD:injured(playerid, params[])
  5258. {
  5259. LoopingAnim(playerid, "SWEET", "Sweet_injuredloop", 4.0, 1, 0, 0, 0, 0);
  5260. return 1;
  5261. }
  5262.  
  5263.  
  5264. // Violence animations
  5265. CMD:push(playerid, params[])
  5266. {
  5267. OnePlayAnim(playerid,"GANGS","shake_cara",4.0,0,0,0,0,0);
  5268. return 1;
  5269. }
  5270.  
  5271. CMD:akick(playerid, params[])
  5272. {
  5273. OnePlayAnim(playerid,"POLICE","Door_Kick",4.0,0,0,0,0,0);
  5274. return 1;
  5275. }
  5276.  
  5277. CMD:lowbodypush(playerid, params[])
  5278. {
  5279. OnePlayAnim(playerid,"GANGS","shake_carSH",4.0,0,0,0,0,0);
  5280. return 1;
  5281. }
  5282.  
  5283. // Spray
  5284. CMD:spray(playerid, params[])
  5285. {
  5286. OnePlayAnim(playerid,"SPRAYCAN","spraycan_full",4.0,0,0,0,0,0);
  5287. return 1;
  5288. }
  5289.  
  5290. // Headbutt
  5291. CMD:headbutt(playerid, params[])
  5292. {
  5293. OnePlayAnim(playerid,"WAYFARER","WF_Fwd",4.0,0,0,0,0,0);
  5294. return 1;
  5295. }
  5296.  
  5297. // Medic
  5298. CMD:medic(playerid, params[])
  5299. {
  5300. OnePlayAnim(playerid,"MEDIC","CPR",4.0,0,0,0,0,0);
  5301. return 1;
  5302. }
  5303.  
  5304. // KO Face
  5305. CMD:koface(playerid, params[])
  5306. {
  5307. LoopingAnim(playerid,"PED","KO_shot_face",4.0,0,1,1,1,0);
  5308. return 1;
  5309. }
  5310.  
  5311. // KO Stomach
  5312. CMD:kostomach(playerid, params[])
  5313. {
  5314. LoopingAnim(playerid,"PED","KO_shot_stom",4.0,0,1,1,1,0);
  5315. return 1;
  5316. }
  5317.  
  5318. // Jump for your life!
  5319. CMD:lifejump(playerid, params[])
  5320. {
  5321. LoopingAnim(playerid,"PED","EV_dive",4.0,0,1,1,1,0);
  5322. return 1;
  5323. }
  5324.  
  5325. // Exhausted
  5326. CMD:exhaust(playerid, params[])
  5327. {
  5328. LoopingAnim(playerid,"PED","IDLE_tired",3.0,1,0,0,0,0);
  5329. return 1;
  5330. }
  5331.  
  5332. // Left big slap
  5333. CMD:leftslap(playerid, params[])
  5334. {
  5335. OnePlayAnim(playerid,"PED","BIKE_elbowL",4.0,0,0,0,0,0);
  5336. return 1;
  5337. }
  5338.  
  5339. // Big fall
  5340. CMD:rollfall(playerid, params[])
  5341. {
  5342. LoopingAnim(playerid,"PED","BIKE_fallR",4.0,0,1,1,1,0);
  5343. return 1;
  5344. }
  5345.  
  5346. // Locked
  5347. CMD:carlock(playerid, params[])
  5348. {
  5349. OnePlayAnim(playerid,"PED","CAR_doorlocked_LHS",4.0,0,0,0,0,0);
  5350. return 1;
  5351. }
  5352.  
  5353. // carjack
  5354. CMD:rcarjack1(playerid, params[])
  5355. {
  5356. OnePlayAnim(playerid,"PED","CAR_pulloutL_LHS",4.0,0,0,0,0,0);
  5357. return 1;
  5358. }
  5359.  
  5360. // carjack
  5361. CMD:lcarjack1(playerid, params[])
  5362. {
  5363. OnePlayAnim(playerid,"PED","CAR_pulloutL_RHS",4.0,0,0,0,0,0);
  5364. return 1;
  5365. }
  5366.  
  5367. // carjack
  5368. CMD:rcarjack2(playerid, params[])
  5369. {
  5370. OnePlayAnim(playerid,"PED","CAR_pullout_LHS",4.0,0,0,0,0,0);
  5371. return 1;
  5372. }
  5373.  
  5374. // carjack
  5375. CMD:lcarjack2(playerid, params[])
  5376. {
  5377. OnePlayAnim(playerid,"PED","CAR_pullout_RHS",4.0,0,0,0,0,0);
  5378. return 1;
  5379. }
  5380.  
  5381. // Hood frisked
  5382. CMD:hoodfrisked(playerid, params[])
  5383. {
  5384. LoopingAnim(playerid,"POLICE","crm_drgbst_01",4.0,0,1,1,1,0);
  5385. return 1;
  5386. }
  5387.  
  5388. // Lighting cigarette
  5389. CMD:lightcig(playerid, params[])
  5390. {
  5391. OnePlayAnim(playerid,"SMOKING","M_smk_in",3.0,0,0,0,0,0);
  5392. return 1;
  5393. }
  5394.  
  5395. // Tap cigarette
  5396. CMD:tapcig(playerid, params[])
  5397. {
  5398. OnePlayAnim(playerid,"SMOKING","M_smk_tap",3.0,0,0,0,0,0);
  5399. return 1;
  5400. }
  5401.  
  5402. // Bat stance
  5403. CMD:bat(playerid, params[])
  5404. {
  5405. LoopingAnim(playerid,"BASEBALL","Bat_IDLE",4.0,1,1,1,1,0);
  5406. return 1;
  5407. }
  5408.  
  5409. // Boxing
  5410. CMD:box(playerid, params[])
  5411. {
  5412. LoopingAnim(playerid,"GYMNASIUM","GYMshadowbox",4.0,1,1,1,1,0);
  5413. return 1;
  5414. }
  5415.  
  5416. // Lay 2
  5417. CMD:lay2(playerid, params[])
  5418. {
  5419. LoopingAnim(playerid,"SUNBATHE","Lay_Bac_in",3.0,0,1,1,1,0);
  5420. return 1;
  5421. }
  5422.  
  5423.  
  5424.  
  5425. CMD:chant(playerid, params[])
  5426. {
  5427. LoopingAnim(playerid,"RIOT","RIOT_CHANT",4.0,1,1,1,1,0);
  5428. return 1;
  5429. }
  5430.  
  5431.  
  5432.  
  5433. CMD:fucku(playerid, params[])
  5434. {
  5435. OnePlayAnim(playerid,"RIOT","RIOT_FUKU",2.0,0,0,0,0,0);
  5436. return 1;
  5437. }
  5438.  
  5439.  
  5440.  
  5441. CMD:shouting(playerid, params[])
  5442. {
  5443. LoopingAnim(playerid,"RIOT","RIOT_shout",4.0,1,0,0,0,0);
  5444. return 1;
  5445. }
  5446.  
  5447.  
  5448.  
  5449. CMD:cop(playerid, params[])
  5450. {
  5451. OnePlayAnim(playerid,"SWORD","sword_block",50.0,0,1,1,1,1);
  5452. return 1;
  5453. }
  5454.  
  5455.  
  5456.  
  5457. CMD:elbow(playerid, params[])
  5458. {
  5459. OnePlayAnim(playerid,"FIGHT_D","FightD_3",4.0,0,1,1,0,0);
  5460. return 1;
  5461. }
  5462.  
  5463.  
  5464.  
  5465. CMD:kneekick(playerid, params[])
  5466. {
  5467. OnePlayAnim(playerid,"FIGHT_D","FightD_2",4.0,0,1,1,0,0);
  5468. return 1;
  5469. }
  5470.  
  5471.  
  5472.  
  5473. CMD:fstance(playerid, params[])
  5474. {
  5475. LoopingAnim(playerid,"FIGHT_D","FightD_IDLE",4.0,1,1,1,1,0);
  5476. return 1;
  5477. }
  5478. //==============================================================================
  5479. CMD:engine(playerid, params[])
  5480. {
  5481. new vehicleid = GetPlayerVehicleID(playerid);
  5482. if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, "You need to be in a vehicle to use this command");
  5483. if(vehEngine[vehicleid] == 0)
  5484. {
  5485. vehEngine[vehicleid] = 2;
  5486. SetTimerEx("StartEngine", 3000, 0, "i", playerid);
  5487. SendClientMessage(playerid, COLOR_GREEN, "Vehicle engine starting");
  5488. }
  5489. else if(vehEngine[vehicleid] == 1)
  5490. {
  5491. vehEngine[vehicleid] = 0;
  5492. TogglePlayerControllable(playerid, 0);
  5493. SendClientMessage(playerid, COLOR_GOLD, "Vehicle engine stopped");
  5494. SendClientMessage(playerid, COLOR_GOLD, "To re-start the vehicle's engine press \"Shift\" or type \"/engine\"");
  5495. }
  5496. return 1;
  5497. }
  5498. //==============================================================================
  5499. CMD:makeleader(playerid, params[])
  5500. {
  5501. new playerb, faction, string[128];
  5502. if(PlayerInfo[playerid][pAdmin] < 5 && !PlayerInfo[playerid][pFacMod]) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
  5503. if(sscanf(params, "ui", playerb, faction))
  5504. {
  5505. SendClientMessage(playerid, COLOR_WHITE, "USAGE: /makeleader [playerid] [factionid]");
  5506. SendClientMessage(playerid, COLOR_GREY, "FACTIONS: 0) Civilian | 1) LSPD | 2) FBI | 3) GOV | 4) Hitman Agency | 5) News Reporters | 6) LSMD | 7) SS");
  5507. return 1;
  5508. }
  5509. if(faction < 0 || faction > 7) return SendClientMessage(playerid, COLOR_GREY, "Factions are between 0 and 4");
  5510. // Setting Player's Stats
  5511. if(faction == 0)
  5512. {
  5513. PlayerInfo[playerb][pFac] = 0;
  5514. PlayerInfo[playerb][pFacRank] = 0;
  5515. PlayerInfo[playerb][pFacLeader] = 0;
  5516. }
  5517. else
  5518. {
  5519. PlayerInfo[playerb][pFac] = faction;
  5520. PlayerInfo[playerb][pFacRank] = 6;
  5521. PlayerInfo[playerb][pFacLeader] = 1;
  5522. PlayerInfo[playerb][pFacDiv] = 0;
  5523. PlayerInfo[playerb][pFacDivLeader] = 0;
  5524. }
  5525. // Admin & Player messages
  5526. format(string, sizeof(string), "AdmWarn: %s has given %s the {33AA33}%s {AA3333}faction leadership.", RPN(playerid), RPN(playerb), RPFNEx(playerb));
  5527. SendAdminMessage(COLOR_YELLOW, string);
  5528. format(string, sizeof(string), " %s has given you the {33AA33}%s {33CCFF}faction leadership.", RPN(playerid), RPFNEx(playerb));
  5529. SendClientMessage(playerb, COLOR_LIGHTBLUE, string);
  5530. format(string, sizeof(string), "AdmWarn: %s has given %s the %s faction leadership.", RPN(playerid), RPN(playerb), RPFNEx(playerb));
  5531. Log("logs/factions.log", string);
  5532. return 1;
  5533. }
  5534. CMD:adjustrankname(playerid, params[])
  5535. {
  5536. new rank, name[32], string[128];
  5537. if(!PlayerInfo[playerid][pFacLeader]) return SendClientMessage(playerid, COLOR_GREY, "You are not a faction leader.");
  5538. if(sscanf(params, "is[32]", rank, name)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /adjustrankname [rank] [name]");
  5539. switch(rank)
  5540. {
  5541. case 0:
  5542. {
  5543. format(FacInfo[PlayerInfo[playerid][pFac]][fRank0], 32, "%s", name);
  5544. format(string, sizeof(string), "You have set rank 0's name to %s", name);
  5545. SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
  5546. }
  5547. case 1:
  5548. {
  5549. format(FacInfo[PlayerInfo[playerid][pFac]][fRank1], 32, "%s", name);
  5550. format(string, sizeof(string), "You have set rank 1's name to %s", name);
  5551. SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
  5552. }
  5553. case 2:
  5554. {
  5555. format(FacInfo[PlayerInfo[playerid][pFac]][fRank2], 32, "%s", name);
  5556. format(string, sizeof(string), "You have set rank 2's name to %s", name);
  5557. SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
  5558. }
  5559. case 3:
  5560. {
  5561. format(FacInfo[PlayerInfo[playerid][pFac]][fRank3], 32, "%s", name);
  5562. format(string, sizeof(string), "You have set rank 3's name to %s", name);
  5563. SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
  5564. }
  5565. case 4:
  5566. {
  5567. format(FacInfo[PlayerInfo[playerid][pFac]][fRank4], 32, "%s", name);
  5568. format(string, sizeof(string), "You have set rank 4's name to %s", name);
  5569. SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
  5570. }
  5571. case 5:
  5572. {
  5573. format(FacInfo[PlayerInfo[playerid][pFac]][fRank5], 32, "%s", name);
  5574. format(string, sizeof(string), "You have set rank 5's name to %s", name);
  5575. SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
  5576. }
  5577. case 6:
  5578. {
  5579. format(FacInfo[PlayerInfo[playerid][pFac]][fRank6], 32, "%s", name);
  5580. format(string, sizeof(string), "You have set rank 6's name to %s", name);
  5581. SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
  5582. }
  5583. }
  5584. return 1;
  5585. }
  5586.  
  5587. CMD:dinvite(playerid, params[])
  5588. {
  5589. new playerb, string[128];
  5590. if(!PlayerInfo[playerid][pFacDivLeader]) return SendClientMessage(playerid, COLOR_GREY, "You are not a division leader.");
  5591. if(sscanf(params, "u", playerb)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /dinvite");
  5592. if(PlayerInfo[playerb][pFac] != PlayerInfo[playerid][pFac]) return SendClientMessage(playerid, COLOR_GREY, "Player is not in your faction.");
  5593. if(PlayerInfo[playerb][pFacDiv]) return SendClientMessage(playerid, COLOR_GREY, "Player is already in a division.");
  5594. PlayerInfo[playerb][pFacDiv] = PlayerInfo[playerid][pFacDiv];
  5595. PlayerInfo[playerb][pFacDivLeader] = 0;
  5596. format(string, sizeof(string), "You have assigned %s to the {33AA33}%s {33CCFF}division.", RPN(playerb), RPFDN(playerb));
  5597. SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
  5598. format(string, sizeof(string), "%s has assigned you to the {33AA33}%s {33CCFF}division.", RPN(playerid), RPFDN(playerb));
  5599. SendClientMessage(playerb, COLOR_LIGHTBLUE, string);
  5600. return 1;
  5601. }
  5602.  
  5603. CMD:duninvite(playerid, params[])
  5604. {
  5605. new playerb, string[128];
  5606. if(!PlayerInfo[playerid][pFacDivLeader]) return SendClientMessage(playerid, COLOR_GREY, "You are not a division leader.");
  5607. if(sscanf(params, "u", playerb)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /dinvite");
  5608. if(PlayerInfo[playerb][pFac] != PlayerInfo[playerid][pFac]) return SendClientMessage(playerid, COLOR_GREY, "Player is not in your faction.");
  5609. if(PlayerInfo[playerb][pFacDiv] != PlayerInfo[playerid][pFacDiv]) return SendClientMessage(playerid, COLOR_GREY, "Player is not in in your division.");
  5610. PlayerInfo[playerb][pFacDiv] = 0;
  5611. PlayerInfo[playerb][pFacDivLeader] = 0;
  5612. format(string, sizeof(string), "You have removed %s from the {33AA33}%s {33CCFF}division.", RPN(playerb), RPFDN(playerb));
  5613. SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
  5614. format(string, sizeof(string), "%s has removed you from to the {33AA33}%s {33CCFF}division.", RPN(playerid), RPFDN(playerb));
  5615. SendClientMessage(playerb, COLOR_LIGHTBLUE, string);
  5616. return 1;
  5617. }
  5618.  
  5619. CMD:setdivision(playerid, params[])
  5620. {
  5621. new playerb, division, string[128];
  5622. if(!IsACop(playerid) || !PlayerInfo[playerid][pFacLeader]) return SendClientMessage(playerid, COLOR_GREY, "You are not an LSPD faction leader.");
  5623. if(sscanf(params, "ui", playerb, division))
  5624. {
  5625. SendClientMessage(playerid, COLOR_WHITE, "USAGE: setdivision [playerid] [division]");
  5626. format(string, sizeof(string), "DIVISIONS: 1) %s | 2) %s | 3) %s | 4) %s", FacInfo[1][fDiv1], FacInfo[1][fDiv2], FacInfo[1][fDiv3], FacInfo[1][fDiv4]);
  5627. SendClientMessage(playerid, COLOR_GREY, string);
  5628. return 1;
  5629. }
  5630. if(PlayerInfo[playerb][pFac] != PlayerInfo[playerid][pFac]) return SendClientMessage(playerid, COLOR_GREY, "Player is not in your faction.");
  5631. if(division < 0 || division > 4) return SendClientMessage(playerid, COLOR_GREY, "Divisions are between 1 and 4.");
  5632. if(PlayerInfo[playerb][pFacDiv] == division) return SendClientMessage(playerid, COLOR_GREY, "Player is already in a division.");
  5633. PlayerInfo[playerb][pFacDiv] = division;
  5634. PlayerInfo[playerb][pFacDivLeader] = division;
  5635. format(string, sizeof(string), "You have assigned %s to lead the {33AA33}%s {33CCFF}division.", RPN(playerb), RPFDN(playerb));
  5636. SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
  5637. format(string, sizeof(string), "%s has assigned you to lead the {33AA33}%s {33CCFF}division.", RPN(playerid), RPFDN(playerb));
  5638. SendClientMessage(playerb, COLOR_LIGHTBLUE, string);
  5639. return 1;
  5640. }
  5641.  
  5642. CMD:adjustdivisionname(playerid, params[])
  5643. {
  5644. new division, name[8], string[128];
  5645. if(!IsACop(playerid) || !PlayerInfo[playerid][pFacLeader]) return SendClientMessage(playerid, COLOR_GREY, "You are not an LSPD faction leader.");
  5646. if(sscanf(params, "is[32]", division, name)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /adjustdivisionname [division] [name]");
  5647. switch(division)
  5648. {
  5649. case 1:
  5650. {
  5651. FacInfo[1][fDiv1] = name;
  5652. format(string, sizeof(string), "You have set division 1's name to %s", name);
  5653. SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
  5654. }
  5655. case 2:
  5656. {
  5657. FacInfo[1][fDiv2] = name;
  5658. format(string, sizeof(string), "You have set division 2's name to %s", name);
  5659. SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
  5660. }
  5661. case 3:
  5662. {
  5663. FacInfo[1][fDiv3] = name;
  5664. format(string, sizeof(string), "You have set division 3's name to %s", name);
  5665. SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
  5666. }
  5667. case 4:
  5668. {
  5669. FacInfo[1][fDiv4] = name;
  5670. format(string, sizeof(string), "You have set division 3's name to %s", name);
  5671. SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
  5672. }
  5673. }
  5674. return 1;
  5675. }
  5676. CMD:makefacmod(playerid, params[])
  5677. {
  5678. new string[128], playerb, log[256];
  5679. if(PlayerInfo[playerid][pAdmin] < 6) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
  5680. if(sscanf(params, "ui", playerb)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /makefacmod [playerid]");
  5681. if(!PlayerInfo[playerb][pAdmin]) return SendClientMessage(playerid, COLOR_GREY, "Player is not an administrator.");
  5682. if(!PlayerInfo[playerb][pFacMod])
  5683. {
  5684. PlayerInfo[playerb][pFacMod] = 1;
  5685. format(string, sizeof(string), "AdmWarn: %s has {33AA33}assigned {AA3333}%s as a {33AA33}Faction Moderator{AA3333}.", RPN(playerid), RPN(playerb));
  5686. format(log, sizeof(log), "AdmWarn: %s has assigned %s as a Faction Moderator.", RPN(playerid), RPN(playerb));
  5687. }
  5688. else
  5689. {
  5690. PlayerInfo[playerb][pFacMod] = 0;
  5691. format(string, sizeof(string), "AdmWarn: %s has {FF9900}removed {AA3333}%s's {FF9900}Faction Moderator{AA3333} powers.", RPN(playerid), RPN(playerb));
  5692. format(log, sizeof(log), "AdmWarn: %s has removed %s's Faction Moderator powers.", RPN(playerid), RPN(playerb));
  5693. }
  5694. new file[32];
  5695. format(file, sizeof(file), "users/%s.ini", RPNU(playerb));
  5696. format(file, sizeof(file), "users/%s.ini", dini_Get(file, "AdminName"));
  5697. if(dini_Exists(file))
  5698. {
  5699. dini_IntSet(file, "FacMod", PlayerInfo[playerb][pFacMod]);
  5700. }
  5701. format(file, sizeof(file), "users/%s.ini", RPNU(playerb));
  5702. if(dini_Int(file, "AdminAccount") == 1)
  5703. {
  5704. format(file, sizeof(file), "users/%s.ini", dini_Get(file, "OldName"));
  5705. dini_IntSet(file, "FacMod", PlayerInfo[playerb][pFacMod]);
  5706. }
  5707. Log("logs/makeadmin.log", log);
  5708. SendAdminMessage(COLOR_YELLOW, string);
  5709. return 1;
  5710. }
  5711. CMD:tazer(playerid, params[])
  5712. {
  5713. new string[128];
  5714. if(!IsACop(playerid) && !IsAFBI(playerid) && !IsASS(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not a Member of LSPD/FBI/SS.");
  5715. if(!PlayerInfo[playerid][pFacDuty]) return SendClientMessage(playerid, COLOR_GREY, "You are not on duty.");
  5716. if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You can't use this command while being in a vehicle.");
  5717. if(!Tazer[playerid])
  5718. {
  5719. Tazer[playerid] = 1;
  5720. format(string, sizeof(string), "* %s takes out their tazer from their holster and loads it.", RPN(playerid));
  5721. SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
  5722. if(PlayerInfo[playerid][pWeapon][2] == 24)
  5723. {
  5724. ReplaceTazer[playerid] = 1;
  5725. GetPlayerWeaponData(playerid, 2, OldGun[playerid], OldAmmo[playerid]);
  5726. SendClientMessage(playerid, COLOR_WHITE, "Your desert eagle will be given back when you holster your tazer.");
  5727. }
  5728. GunsBeingRemoved[playerid] = 1;
  5729. RemoveMenqWeapon(playerid, 24);
  5730. GunsBeingRemoved[playerid] = 1;
  5731. GiveMenqWeapon(playerid, 23, 500);
  5732. GunsBeingRemoved[playerid] = 1;
  5733. }
  5734. else
  5735. {
  5736. Tazer[playerid] = 0;
  5737. RemoveMenqWeapon(playerid, 23);
  5738. format(string, sizeof(string), "* %s unloads their tazer and puts it back to their holster.", RPN(playerid));
  5739. SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
  5740. if(ReplaceTazer[playerid])
  5741. {
  5742.  
  5743. ReplaceTazer[playerid] = 0;
  5744. GunsBeingRemoved[playerid] = 1;
  5745. GiveMenqWeapon(playerid, OldGun[playerid], OldAmmo[playerid]);
  5746. GunsBeingRemoved[playerid] = 1;
  5747. OldGun[playerid] = 0;
  5748. OldAmmo[playerid] = 0;
  5749. SendClientMessage(playerid, COLOR_WHITE, "You have recieved your desert eagle back as you've holstered your tazer.");
  5750. }
  5751. }
  5752. return 1;
  5753. }
  5754. CMD:cuff(playerid, params[])
  5755. {
  5756. new playerb, string[128];
  5757. if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
  5758. if(!IsACop(playerid) && !IsAFBI(playerid) && !IsASS(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not a Member of LSPD/FBI/SS.");
  5759. if(!PlayerInfo[playerid][pFacDuty]) return SendClientMessage(playerid, COLOR_GREY, "You are not on duty.");
  5760. if(sscanf(params, "u", playerb)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /cuff [playerid]");
  5761. if(!IsPlayerConnected(playerb)) return SendClientMessage(playerid, COLOR_GREY, "Invalid player id.");
  5762. if(!IsPlayerNearPlayer(playerid, playerb, 2)) return SendClientMessage(playerid, COLOR_GREY, "You are too far away from that player.");
  5763. if(!IsPlayerTazed(playerb) && GetPlayerSpecialAction(playerb) != SPECIAL_ACTION_HANDSUP) return SendClientMessage(playerid, COLOR_GREY, "Player is not tazed nor has their hands up.");
  5764. // /me Message & Animation
  5765. GameTextForPlayer(playerb, "~r~Cuffed", 3500, 3);
  5766. format(string, sizeof(string), "* %s pulls a pair of steel cuffs from their belt and puts %s's hands inside them.", RPN(playerid), RPN(playerb));
  5767. SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
  5768. ClearAnimations(playerb);
  5769. //ApplyAnimation(playerb,"ped","cower",1,1,0,0,0,0,1);
  5770. // Custom Freeze
  5771. TogglePlayerControllable(playerb, 0);
  5772. //ApplyAnimation(playerb,"ped","cower",1,1,0,0,0,0,1);
  5773. SetPlayerAttachedObject(playerb, 0, 19418, 6, -0.011000, 0.028000, -0.022000, -15.600012, -33.699977, -81.700035, 0.891999, 1.000000, 1.168000);
  5774. SetPlayerSpecialAction(playerb,SPECIAL_ACTION_CUFFED);
  5775. // Tazed Setting
  5776. TogglePlayerTazed(playerb, 0);
  5777. TogglePlayerCuffed(playerb, 1);
  5778. // Cuff Timeout
  5779. CuffTimeout[playerb] = 300;
  5780. KillTimer(TazeCountDown[playerb]);
  5781. CuffCountDown[playerb] = SetTimerEx("CuffTimer", 1000, true, "d", playerb);
  5782. return 1;
  5783. }
  5784.  
  5785.  
  5786. CMD:uncuff(playerid, params[])
  5787. {
  5788. new playerb, string[128];
  5789. if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
  5790. if(!IsACop(playerid) && !IsAFBI(playerid) && !IsASS(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not a Member of LSPD/FBI/SS.");
  5791. if(sscanf(params, "u", playerb)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /uncuff [playerid]");
  5792. if(playerid == playerb) return SendClientMessage(playerid, COLOR_GREY, "You can't uncuff yourself.");
  5793. if(!IsPlayerConnected(playerb)) return SendClientMessage(playerid, COLOR_GREY, "Invalid player id.");
  5794. if(!IsPlayerNearPlayer(playerid, playerb, 2)) return SendClientMessage(playerid, COLOR_GREY, "You are too far away from that player.");
  5795. if(!IsPlayerCuffed(playerb)) return SendClientMessage(playerid, COLOR_GREY, "Player is not cuffed");
  5796. if(IsPlayerTied(playerb)) return SendClientMessage(playerid, COLOR_GREY, "Player is tied.");
  5797. CuffTimeout[playerb] = 0;
  5798. format(string, sizeof(string), "* %s reaches to %s and uncuffs them.", RPN(playerid), RPN(playerb));
  5799. SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
  5800. TogglePlayerTazed(playerb, 0);
  5801. TogglePlayerCuffed(playerb, 0);
  5802. Uncuffed[playerb] = 1;
  5803. KillTimer(CuffCountDown[playerid]);
  5804. RemovePlayerAttachedObject(playerb, 0);
  5805. SetPlayerSpecialAction(playerb, SPECIAL_ACTION_NONE);
  5806. TogglePlayerControllable(playerb, 1);
  5807. return 1;
  5808. }
  5809. CMD:gov(playerid, params[])
  5810. {
  5811. new string[128];
  5812. if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
  5813. if(!IsACop(playerid) && !IsAFBI(playerid) && !IsASS(playerid) && !IsAGov(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not a Member of LSPD/FBI/SS/Gov.");
  5814. if(!PlayerInfo[playerid][pFacLeader]) return SendClientMessage(playerid, COLOR_GREY, "You are not a faction leader.");
  5815. if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: (/gov)ernment announcement [text]");
  5816. SendClientMessageToAll(COLOR_WHITE, "|___________ Government News Announcement ___________|");
  5817. format(string, sizeof(string), "** [%s] %s %s: %s **", RPFN(playerid), RPFRN(playerid), RPN(playerid), params);
  5818. SendClientMessageToAll(COLOR_BLUE, string);
  5819. return 1;
  5820. }
  5821. CMD:news(playerid, params[])
  5822. {
  5823. new string[128];
  5824. if(!IsAReporter(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not a news reporter.");
  5825. if(!IsNewsVehicle(GetPlayerVehicleID(playerid))) return SendClientMessage(playerid, COLOR_GREY, "You are not in a news vehicle.");
  5826. if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /news [text]");
  5827. format(string, sizeof(string), "** [News] %s: %s", RPN(playerid), params);
  5828. SendClientMessageToAll(COLOR_NEWS, string);
  5829. Log("logs/news.log", string);
  5830. return 1;
  5831. }
  5832. CMD:heal(playerid, params[])
  5833. {
  5834. new giveplayerid, price, playerb;
  5835.  
  5836. if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
  5837. if(!IsAMedic(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not a Member of LSMD.");
  5838. if(!IsPlayerNearPlayer(playerid, playerb, 2)) return SendClientMessage(playerid, COLOR_GREY, "You are too far away from that player.");
  5839. if(sscanf(params, "u", playerb)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /uncuff [playerid]");
  5840. if(!(100 <= price <= 1000))
  5841. {
  5842. SendClientMessage(playerid, COLOR_GREY, "Healing price can't below $100 or above $1,000.");
  5843. return 1;
  5844. }
  5845. if (giveplayerid == playerid)
  5846. {
  5847. SendClientMessage(playerid, COLOR_GRAD1, "You can't heal yourself.");
  5848. return 1;
  5849. }
  5850. if (IsPlayerConnected(giveplayerid))
  5851. {
  5852. new Float:tempheal;
  5853. GetPlayerHealth(giveplayerid,tempheal);
  5854. if(tempheal >= 100.0)
  5855. {
  5856. SendClientMessage(playerid, TEAM_GREEN_COLOR,"That person is fully healed.");
  5857. return 1;
  5858. }
  5859. new string[64];
  5860. format(string, sizeof(string), "You healed %s for $%d.", RPN(giveplayerid),price);
  5861. SendClientMessage(playerid, COLOR_PINK, string);
  5862. GivePlayerCash(playerid, price / 2);
  5863. Tax += price / 2;
  5864. GivePlayerCash(giveplayerid, -price);
  5865. SetPlayerHealth(giveplayerid, 100);
  5866. PlayerPlaySound(playerid, 1150, 0.0, 0.0, 0.0);
  5867. PlayerPlaySound(giveplayerid, 1150, 0.0, 0.0, 0.0);
  5868. format(string, sizeof(string), "You have been healed to 100 health for $%d by %s.",price, RPN(playerid));
  5869. SendClientMessage(giveplayerid, TEAM_GREEN_COLOR,string);
  5870. }
  5871. return 1;
  5872. }
  5873. CMD:invite(playerid, params[])
  5874. {
  5875. new playerb, string[128];
  5876. if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
  5877. if(!PlayerInfo[playerid][pFacLeader]) return SendClientMessage(playerid, COLOR_GREY, "You are not a faction leader.");
  5878. if(sscanf(params, "u", playerb)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /invite [playerid]");
  5879. if(!IsPlayerConnected(playerb)) return SendClientMessage(playerid, COLOR_GREY, "Invalid player id.");
  5880. if(PlayerInfo[playerb][pFac]) return SendClientMessage(playerid, COLOR_GREY, "Player is already in a faction.");
  5881. if(playerid == playerb) return SendClientMessage(playerid, COLOR_GREY, "You can't invite yourself.");
  5882. // Inviting
  5883. Invited[playerb] = 1;
  5884. Inviter[playerb] = playerid;
  5885. Faction[playerb] = PlayerInfo[playerid][pFac];
  5886. format(string, sizeof(string), " You have invited %s to join the {33AA33}%s {33CCFF}faction.", RPN(playerb), RPFNEx(playerid));
  5887. SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
  5888. format(string, sizeof(string), " %s has invited you to join the {33AA33}%s {33CCFF}faction. (/accept faction) (/cancel faction)", RPN(playerid), RPFNEx(playerid));
  5889. SendClientMessage(playerb, COLOR_LIGHTBLUE, string);
  5890. return 1;
  5891. }
  5892.  
  5893. CMD:uninvite(playerid, params[])
  5894. {
  5895. new playerb, string[128];
  5896. if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
  5897. if(!PlayerInfo[playerid][pFacLeader]) return SendClientMessage(playerid, COLOR_GREY, "You are not a faction leader.");
  5898. if(sscanf(params, "u", playerb)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /invite [playerid]");
  5899. if(!IsPlayerConnected(playerb)) return SendClientMessage(playerid, COLOR_GREY, "Invalid player id.");
  5900. if(PlayerInfo[playerb][pFac] != PlayerInfo[playerid][pFac]) return SendClientMessage(playerid, COLOR_GREY, "Player is not in your faction.");
  5901. if(playerid == playerb) return SendClientMessage(playerid, COLOR_GREY, "You can't uninvite yourself.");
  5902. PlayerInfo[playerb][pFac] = 0;
  5903. PlayerInfo[playerb][pFacRank] = 0;
  5904. PlayerInfo[playerb][pFacLeader] = 0;
  5905. PlayerInfo[playerb][pFacDuty] = 0;
  5906. SetPlayerColor(playerb, COLOR_WHITE);
  5907. format(string, sizeof(string), " You have kicked %s out of the {33AA33}%s {33CCFF}faction.", RPN(playerb), RPFNEx(playerid));
  5908. SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
  5909. format(string, sizeof(string), " %s has kicked you out of the {33AA33}%s {33CCFF}faction, you are now a civilian.", RPN(playerid), RPFNEx(playerid));
  5910. SendClientMessage(playerb, COLOR_LIGHTBLUE, string);
  5911. return 1;
  5912. }
  5913.  
  5914. CMD:setrank(playerid, params[])
  5915. {
  5916. new playerb, rank, string[128];
  5917. if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
  5918. if(!PlayerInfo[playerid][pFacLeader]) return SendClientMessage(playerid, COLOR_GREY, "You are not a faction leader.");
  5919. if(sscanf(params, "ui", playerb, rank)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setrank [playerid] [rank]");
  5920. if(playerid == playerb) return SendClientMessage(playerid, COLOR_GREY, "You can't change your rank.");
  5921. if(!IsPlayerConnected(playerb)) return SendClientMessage(playerid, COLOR_GREY, "Invalid player id.");
  5922. if(PlayerInfo[playerb][pFac] != PlayerInfo[playerid][pFac]) return SendClientMessage(playerid, COLOR_GREY, "Player is not in your faction.");
  5923. if(rank < 0 || rank > 6) return SendClientMessage(playerid, COLOR_GREY, "Ranks are between 0 and 6.");
  5924. if(PlayerInfo[playerb][pFacRank] == rank) return SendClientMessage(playerid, COLOR_GREY, "Player already has that rank.");
  5925. if(PlayerInfo[playerb][pFacRank] < rank)
  5926. {
  5927. PlayerInfo[playerb][pFacRank] = rank;
  5928. format(string, sizeof(string), "You have {33AA33}promoted {33CCFF}%s to {33AA33}%s (%d){33CCFF}.", RPN(playerb), RPFRN(playerb), rank);
  5929. SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
  5930. format(string, sizeof(string), "%s has {33AA33}promoted {33CCFF}you to {33AA33}%s (%d){33CCFF}.", RPN(playerid), RPFRN(playerb), rank);
  5931. SendClientMessage(playerb, COLOR_LIGHTBLUE, string);
  5932. }
  5933. else if(PlayerInfo[playerb][pFacRank] > rank)
  5934. {
  5935. PlayerInfo[playerb][pFacRank] = rank;
  5936. format(string, sizeof(string), "You have {FF9900}demoted {33CCFF}%s to {FF9900}%s (%d){33CCFF}.", RPN(playerb), RPFRN(playerb), rank);
  5937. SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
  5938. format(string, sizeof(string), "%s has {FF9900}demoted {33CCFF}you to {FF9900}%s (%d){33CCFF}.", RPN(playerid), RPFRN(playerb), rank);
  5939. SendClientMessage(playerb, COLOR_LIGHTBLUE, string);
  5940. }
  5941. return 1;
  5942. }
  5943. CMD:accept(playerid, params[])
  5944. {
  5945. new string[128];
  5946. if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
  5947. if(sscanf(params, "s[128]", params))
  5948. {
  5949. SendClientMessage(playerid, COLOR_WHITE, "USAGE: /accept [option]");
  5950. SendClientMessage(playerid, COLOR_GREY, "OPTIONS: faction");
  5951. return 1;
  5952. }
  5953. if(!strcmp(params, "faction", true))
  5954. {
  5955. if(!Invited[playerid]) return SendClientMessage(playerid, COLOR_GREY, "You haven't been invited to a faction.");
  5956. {
  5957. PlayerInfo[playerid][pFac] = Faction[playerid];
  5958. PlayerInfo[playerid][pFacRank] = 0;
  5959. PlayerInfo[playerid][pFacLeader] = 0;
  5960. PlayerInfo[playerid][pFacDiv] = 0;
  5961. PlayerInfo[playerid][pFacDivLeader] = 0;
  5962. Invited[playerid] = 0;
  5963. Faction[playerid] = 0;
  5964. format(string, sizeof(string), " You have accepted %s's invitation to join the {33AA33}%s {33CCFF}faction.", RPN(Inviter[playerid]), RPFNEx(playerid));
  5965. SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
  5966. format(string, sizeof(string), " %s has accepted your faction invitation.", RPN(playerid));
  5967. SendClientMessage(Inviter[playerid], COLOR_LIGHTBLUE, string);
  5968. return 1;
  5969. }
  5970. }
  5971. return 1;
  5972. }
  5973. CMD:cancel(playerid, params[])
  5974. {
  5975. new string[128];
  5976. if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
  5977. if(sscanf(params, "s[128]", params))
  5978. {
  5979. SendClientMessage(playerid, COLOR_WHITE, "USAGE: /cancel [option]");
  5980. SendClientMessage(playerid, COLOR_GREY, "OPTIONS: faction");
  5981. return 1;
  5982. }
  5983. if(!strcmp(params, "faction", true))
  5984. {
  5985. if(!Invited[playerid]) return SendClientMessage(playerid, COLOR_GREY, "You haven't been invited to a faction.");
  5986. {
  5987. PlayerInfo[playerid][pFac] = 0;
  5988. PlayerInfo[playerid][pFacRank] = 0;
  5989. PlayerInfo[playerid][pFacLeader] = 0;
  5990. PlayerInfo[playerid][pFacDiv] = 0;
  5991. PlayerInfo[playerid][pFacDivLeader] = 0;
  5992. Invited[playerid] = 0;
  5993. Faction[playerid] = 0;
  5994. format(string, sizeof(string), " You have cancelled %s's faction invitation.", RPN(Inviter[playerid]));
  5995. SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
  5996. format(string, sizeof(string), " %s has cancelled your faction invitation.", RPN(playerid));
  5997. SendClientMessage(Inviter[playerid], COLOR_LIGHTBLUE, string);
  5998. }
  5999. }
  6000. return 1;
  6001. }
  6002. CMD:factionhelp(playerid, params[])
  6003. {
  6004. if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
  6005. if(!PlayerInfo[playerid][pFac]) return SendClientMessage(playerid, COLOR_GREY, "You are not in a faction.");
  6006.  
  6007. // LSPD
  6008. if(!IsACop(playerid)) SendClientMessage(playerid, COLOR_YELLOW, "LSPD: /setrank, /invite, /uninvite, /gov, /cuff, /uncuff, /tazer");
  6009.  
  6010. // FBI
  6011. if(!IsAFBI(playerid)) SendClientMessage(playerid, COLOR_YELLOW, "FBI: /setrank, /invite, /uninvite, /gov, /cuff, /uncuff, /tazer");
  6012.  
  6013. // Gov
  6014. if(!IsAGov(playerid)) SendClientMessage(playerid, COLOR_YELLOW, "Gov: /setrank, /invite, /uninvite, /gov, /cuff, /uncuff, /tazer");
  6015.  
  6016. // LSMD
  6017. if(!IsAMedic(playerid)) SendClientMessage(playerid, COLOR_YELLOW, "LSMD: /setrank, /invite, /uninvite, /heal");
  6018.  
  6019. // NR
  6020. if(!IsAReporter(playerid)) SendClientMessage(playerid, COLOR_YELLOW, "Reporters: /setrank, /invite, /uninvite, /news");
  6021. return 1;
  6022. }
  6023. //======================================================[STOCKS]========================================================================
  6024. stock IsVehicleOccupied(vehicleid)
  6025. {
  6026. for(new i=0;i<MAX_PLAYERS;i++)
  6027. {
  6028. if(IsPlayerInVehicle(i,vehicleid)) return 1;
  6029. }
  6030. return 0;
  6031. }
  6032. stock RemoveMenqWeapon(playerid, weaponid)
  6033. {
  6034. GunsBeingRemoved[playerid] = 1;
  6035. ResetPlayerWeapons(playerid);
  6036. GunsBeingRemoved[playerid] = 1;
  6037. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  6038. for(new w = 0; w < 13; w++)
  6039. {
  6040. GetPlayerWeaponData(playerid, w, TempGuns[w], TempGunsAmmo[w]);
  6041. if(PlayerInfo[playerid][pWeapon][w] == weaponid)
  6042. {
  6043. PlayerInfo[playerid][pWeapon][w] = 0;
  6044. TempGuns[w] = 0;
  6045. TempGunsAmmo[w] = 0;
  6046. }
  6047. PlayerInfo[playerid][pWeapon][w] = 0;
  6048. }
  6049. for(new w = 0; w < 13; w++)
  6050. {
  6051. GiveMenqWeapon(playerid, TempGuns[w], TempGunsAmmo[w]);
  6052. }
  6053. return 1;
  6054. }
  6055.  
  6056. stock SaveMenqAmmo(playerid)
  6057. {
  6058. for(new i = 0; i < 13; i++)
  6059. {
  6060. new Guns[2][13];
  6061. GetPlayerWeaponData(playerid, i, Guns[0][i], Guns[1][i]);
  6062. if(PlayerInfo[playerid][pWeapon][i] == Guns[0][i])
  6063. {
  6064. PlayerInfo[playerid][pWeaponAmmo][i] = Guns[1][i];
  6065. }
  6066. }
  6067. return 1;
  6068. }
  6069.  
  6070. stock ResetMenqWeapons(playerid)
  6071. {
  6072. GunsBeingRemoved[playerid] = 1;
  6073. ResetPlayerWeapons(playerid);
  6074. GunsBeingRemoved[playerid] = 1;
  6075. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  6076. for(new i = 0; i < 13; i++)
  6077. {
  6078. GunsBeingRemoved[playerid] = 1;
  6079. PlayerInfo[playerid][pWeapon][i] = 0;
  6080. GunsBeingRemoved[playerid] = 1;
  6081. PlayerInfo[playerid][pWeaponAmmo][i] = 0;
  6082. GunsBeingRemoved[playerid] = 1;
  6083. }
  6084. GunsBeingRemoved[playerid] = 1;
  6085. return 1;
  6086. }
  6087.  
  6088. stock GiveMenqWeapon(playerid, weaponid, ammo)
  6089. {
  6090. GunsBeingRemoved[playerid] = 1;
  6091. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  6092. if(weaponid == 0 || weaponid == 1)
  6093. { // Slot 0
  6094. GunsBeingRemoved[playerid] = 1;
  6095. PlayerInfo[playerid][pWeapon][0] = weaponid;
  6096. GunsBeingRemoved[playerid] = 1;
  6097. }
  6098. else if(weaponid == 2 || weaponid == 3 || weaponid == 4 || weaponid == 5 || weaponid == 6 || weaponid == 7 || weaponid == 8 || weaponid == 9)
  6099. { // Slot 1
  6100. GunsBeingRemoved[playerid] = 1;
  6101. PlayerInfo[playerid][pWeapon][1] = weaponid;
  6102. GunsBeingRemoved[playerid] = 1;
  6103. }
  6104. else if(weaponid == 22 || weaponid == 23 || weaponid == 24)
  6105. { // Slot 2
  6106. GunsBeingRemoved[playerid] = 1;
  6107. PlayerInfo[playerid][pWeapon][2] = weaponid;
  6108. GunsBeingRemoved[playerid] = 1;
  6109. }
  6110. else if(weaponid == 25 || weaponid == 26 || weaponid == 27)
  6111. { // Slot 3
  6112. GunsBeingRemoved[playerid] = 1;
  6113. PlayerInfo[playerid][pWeapon][3] = weaponid;
  6114. GunsBeingRemoved[playerid] = 1;
  6115. }
  6116. else if(weaponid == 28 || weaponid == 29 || weaponid == 32)
  6117. { // Slot 4
  6118. GunsBeingRemoved[playerid] = 1;
  6119. PlayerInfo[playerid][pWeapon][4] = weaponid;
  6120. GunsBeingRemoved[playerid] = 1;
  6121. }
  6122. else if(weaponid == 30 || weaponid == 31)
  6123. { // Slot 5
  6124. GunsBeingRemoved[playerid] = 1;
  6125. PlayerInfo[playerid][pWeapon][5] = weaponid;
  6126. GunsBeingRemoved[playerid] = 1;
  6127. }
  6128. else if(weaponid == 33 || weaponid == 34)
  6129. { // Slot 6
  6130. GunsBeingRemoved[playerid] = 1;
  6131. PlayerInfo[playerid][pWeapon][6] = weaponid;
  6132. GunsBeingRemoved[playerid] = 1;
  6133. }
  6134. else if(weaponid == 35 || weaponid == 36 || weaponid == 37 || weaponid == 38)
  6135. { // Slot 7
  6136. GunsBeingRemoved[playerid] = 1;
  6137. PlayerInfo[playerid][pWeapon][7] = weaponid;
  6138. GunsBeingRemoved[playerid] = 1;
  6139. }
  6140. else if(weaponid == 16 || weaponid == 17 || weaponid == 18 || weaponid == 39)
  6141. { // Slot 8
  6142. GunsBeingRemoved[playerid] = 1;
  6143. PlayerInfo[playerid][pWeapon][8] = weaponid;
  6144. GunsBeingRemoved[playerid] = 1;
  6145. }
  6146. else if(weaponid == 41 || weaponid == 42 || weaponid == 43)
  6147. { // Slot 9
  6148. GunsBeingRemoved[playerid] = 1;
  6149. PlayerInfo[playerid][pWeapon][9] = weaponid;
  6150. GunsBeingRemoved[playerid] = 1;
  6151. }
  6152. else if(weaponid == 10 || weaponid == 11 || weaponid == 12 || weaponid == 13 || weaponid == 14 || weaponid == 15)
  6153. { // Slot 10
  6154. GunsBeingRemoved[playerid] = 1;
  6155. PlayerInfo[playerid][pWeapon][10] = weaponid;
  6156. GunsBeingRemoved[playerid] = 1;
  6157. }
  6158. else if(weaponid == 44 || weaponid == 45 || weaponid == 46)
  6159. { // Slot 11
  6160. GunsBeingRemoved[playerid] = 1;
  6161. PlayerInfo[playerid][pWeapon][11] = weaponid;
  6162. GunsBeingRemoved[playerid] = 1;
  6163. }
  6164. else if(weaponid == 40)
  6165. { // Slot 12
  6166. GunsBeingRemoved[playerid] = 1;
  6167. PlayerInfo[playerid][pWeapon][12] = weaponid;
  6168. GunsBeingRemoved[playerid] = 1;
  6169. }
  6170. GivePlayerWeapon(playerid, weaponid, ammo);
  6171. return 1;
  6172. }
  6173. //=====================================================[SERVERSIDE CASH FUNCTIONS=============================================
  6174. stock GivePlayerCash(playerid, money)
  6175. {
  6176. PlayerInfo[playerid][pCash] += money;
  6177. ResetMoneyBar(playerid);//Resets the money in the original moneybar, Do not remove!
  6178. UpdateMoneyBar(playerid,PlayerInfo[playerid][pCash]);//Sets the money in the moneybar to the serverside cash, Do not remove!
  6179. return PlayerInfo[playerid][pCash];
  6180. }
  6181. stock SetPlayerCash(playerid, money)
  6182. {
  6183. PlayerInfo[playerid][pCash] = money;
  6184. ResetMoneyBar(playerid);//Resets the money in the original moneybar, Do not remove!
  6185. UpdateMoneyBar(playerid,PlayerInfo[playerid][pCash]);//Sets the money in the moneybar to the serverside cash, Do not remove!
  6186. return PlayerInfo[playerid][pCash];
  6187. }
  6188. stock ResetPlayerCash(playerid)
  6189. {
  6190. PlayerInfo[playerid][pCash] = 0;
  6191. ResetMoneyBar(playerid);//Resets the money in the original moneybar, Do not remove!
  6192. UpdateMoneyBar(playerid,PlayerInfo[playerid][pCash]);//Sets the money in the moneybar to the serverside cash, Do not remove!
  6193. return PlayerInfo[playerid][pCash];
  6194. }
  6195. stock GetPlayerCash(playerid)
  6196. {
  6197. return PlayerInfo[playerid][pCash];
  6198. }
  6199. //===============================================================================================================================
  6200.  
  6201. stock sscanf(string[], format[], {Float,_}:...)
  6202. {
  6203. #if defined isnull
  6204. if (isnull(string))
  6205. #else
  6206. if (string[0] == 0 || (string[0] == 1 && string[1] == 0))
  6207. #endif
  6208. {
  6209. return format[0];
  6210. }
  6211. #pragma tabsize 4
  6212. new
  6213. formatPos = 0,
  6214. stringPos = 0,
  6215. paramPos = 2,
  6216. paramCount = numargs(),
  6217. delim = ' ';
  6218. while (string[stringPos] && string[stringPos] <= ' ')
  6219. {
  6220. stringPos++;
  6221. }
  6222. while (paramPos < paramCount && string[stringPos])
  6223. {
  6224. switch (format[formatPos++])
  6225. {
  6226. case '\0':
  6227. {
  6228. return 0;
  6229. }
  6230. case 'i', 'd':
  6231. {
  6232. new
  6233. neg = 1,
  6234. num = 0,
  6235. ch = string[stringPos];
  6236. if (ch == '-')
  6237. {
  6238. neg = -1;
  6239. ch = string[++stringPos];
  6240. }
  6241. do
  6242. {
  6243. stringPos++;
  6244. if ('0' <= ch <= '9')
  6245. {
  6246. num = (num * 10) + (ch - '0');
  6247. }
  6248. else
  6249. {
  6250. return -1;
  6251. }
  6252. }
  6253. while ((ch = string[stringPos]) > ' ' && ch != delim);
  6254. setarg(paramPos, 0, num * neg);
  6255. }
  6256. case 'h', 'x':
  6257. {
  6258. new
  6259. num = 0,
  6260. ch = string[stringPos];
  6261. do
  6262. {
  6263. stringPos++;
  6264. switch (ch)
  6265. {
  6266. case 'x', 'X':
  6267. {
  6268. num = 0;
  6269. continue;
  6270. }
  6271. case '0' .. '9':
  6272. {
  6273. num = (num << 4) | (ch - '0');
  6274. }
  6275. case 'a' .. 'f':
  6276. {
  6277. num = (num << 4) | (ch - ('a' - 10));
  6278. }
  6279. case 'A' .. 'F':
  6280. {
  6281. num = (num << 4) | (ch - ('A' - 10));
  6282. }
  6283. default:
  6284. {
  6285. return -1;
  6286. }
  6287. }
  6288. }
  6289. while ((ch = string[stringPos]) > ' ' && ch != delim);
  6290. setarg(paramPos, 0, num);
  6291. }
  6292. case 'c':
  6293. {
  6294. setarg(paramPos, 0, string[stringPos++]);
  6295. }
  6296. case 'f':
  6297. {
  6298.  
  6299. new changestr[16], changepos = 0, strpos = stringPos;
  6300. while(changepos < 16 && string[strpos] && string[strpos] != delim)
  6301. {
  6302. changestr[changepos++] = string[strpos++];
  6303. }
  6304. changestr[changepos] = '\0';
  6305. setarg(paramPos,0,_:floatstr(changestr));
  6306. }
  6307. case 'p':
  6308. {
  6309. delim = format[formatPos++];
  6310. continue;
  6311. }
  6312. case '\'':
  6313. {
  6314. new
  6315. end = formatPos - 1,
  6316. ch;
  6317. while ((ch = format[++end]) && ch != '\'') {}
  6318. if (!ch)
  6319. {
  6320. return -1;
  6321. }
  6322. format[end] = '\0';
  6323. if ((ch = strfind(string, format[formatPos], false, stringPos)) == -1)
  6324. {
  6325. if (format[end + 1])
  6326. {
  6327. return -1;
  6328. }
  6329. return 0;
  6330. }
  6331. format[end] = '\'';
  6332. stringPos = ch + (end - formatPos);
  6333. formatPos = end + 1;
  6334. }
  6335. case 'u':
  6336. {
  6337. new
  6338. end = stringPos - 1,
  6339. id = 0,
  6340. bool:num = true,
  6341. ch;
  6342. while ((ch = string[++end]) && ch != delim)
  6343. {
  6344. if (num)
  6345. {
  6346. if ('0' <= ch <= '9')
  6347. {
  6348. id = (id * 10) + (ch - '0');
  6349. }
  6350. else
  6351. {
  6352. num = false;
  6353. }
  6354. }
  6355. }
  6356. if (num && IsPlayerConnected(id))
  6357. {
  6358. setarg(paramPos, 0, id);
  6359. }
  6360. else
  6361. {
  6362. #if !defined foreach
  6363. #define foreach(%1,%2) for (new %2 = 0; %2 < MAX_PLAYERS; %2++) if (IsPlayerConnected(%2))
  6364. #define __SSCANF_FOREACH__
  6365. #endif
  6366. string[end] = '\0';
  6367. num = false;
  6368. new
  6369. name[MAX_PLAYER_NAME];
  6370. id = end - stringPos;
  6371. foreach (Player, playerid)
  6372. {
  6373. GetPlayerName(playerid, name, sizeof (name));
  6374. if (!strcmp(name, string[stringPos], true, id))
  6375. {
  6376. setarg(paramPos, 0, playerid);
  6377. num = true;
  6378. break;
  6379. }
  6380. }
  6381. if (!num)
  6382. {
  6383. setarg(paramPos, 0, INVALID_PLAYER_ID);
  6384. }
  6385. string[end] = ch;
  6386. #if defined __SSCANF_FOREACH__
  6387. #undef foreach
  6388. #undef __SSCANF_FOREACH__
  6389. #endif
  6390. }
  6391. stringPos = end;
  6392. }
  6393. case 's', 'z':
  6394. {
  6395. new
  6396. i = 0,
  6397. ch;
  6398. if (format[formatPos])
  6399. {
  6400. while ((ch = string[stringPos++]) && ch != delim)
  6401. {
  6402. setarg(paramPos, i++, ch);
  6403. }
  6404. if (!i)
  6405. {
  6406. return -1;
  6407. }
  6408. }
  6409. else
  6410. {
  6411. while ((ch = string[stringPos++]))
  6412. {
  6413. setarg(paramPos, i++, ch);
  6414. }
  6415. }
  6416. stringPos--;
  6417. setarg(paramPos, i, '\0');
  6418. }
  6419. default:
  6420. {
  6421. continue;
  6422. }
  6423. }
  6424. while (string[stringPos] && string[stringPos] != delim && string[stringPos] > ' ')
  6425. {
  6426. stringPos++;
  6427. }
  6428. while (string[stringPos] && (string[stringPos] == delim || string[stringPos] <= ' '))
  6429. {
  6430. stringPos++;
  6431. }
  6432. paramPos++;
  6433. }
  6434. do
  6435. {
  6436. if ((delim = format[formatPos++]) > ' ')
  6437. {
  6438. if (delim == '\'')
  6439. {
  6440. while ((delim = format[formatPos++]) && delim != '\'') {}
  6441. }
  6442. else if (delim != 'z')
  6443. {
  6444. return delim;
  6445. }
  6446. }
  6447. }
  6448. while (delim > ' ');
  6449. return 0;
  6450. }
  6451.  
  6452. stock strvalEx( const string[] ) // fix for strval-bug with > 50 letters.
  6453. {
  6454. // written by mabako in less than a minute :X
  6455. if( strlen( string ) >= 50 ) return 0; // It will just return 0 if the string is too long
  6456. return strval(string);
  6457. }
  6458. stock IsValidName(playerid)
  6459. {
  6460. if (IsPlayerConnected(playerid))
  6461. {
  6462. new player[24];
  6463. GetPlayerName(playerid,player,24);
  6464. for(new n = 0; n < strlen(player); n++)
  6465. {
  6466. if (player[n] == '_' && player[n+1] >= 'A' && player[n+1] <= 'Z') return 1;
  6467. if (player[n] == ']' || player[n] == '[') return 0;
  6468. }
  6469. }
  6470. return 0;
  6471. }
  6472. //=============================DEALERSHIP=======================================
  6473. stock PlayerName(playerid)
  6474. {
  6475. new pName[MAX_PLAYER_NAME];
  6476. GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
  6477. return pName;
  6478. }
  6479.  
  6480. stock IsPlayerSpawned(playerid)
  6481. {
  6482. switch(GetPlayerState(playerid))
  6483. {
  6484. case 1,2,3: return 1;
  6485. }
  6486. return 0;
  6487. }
  6488.  
  6489. stock IsMeleeWeapon(weaponid)
  6490. {
  6491. switch(weaponid)
  6492. {
  6493. case 2 .. 15, 41 .. 42: return 1;
  6494. }
  6495. return 0;
  6496. }
  6497.  
  6498. stock RemovePlayerWeapon(playerid, weaponid)
  6499. {
  6500. new WeaponData[12][2];
  6501. for(new i=1; i < sizeof(WeaponData); i++)
  6502. {
  6503. GetPlayerWeaponData(playerid, i, WeaponData[i][0], WeaponData[i][1]);
  6504. }
  6505. ResetPlayerWeapons(playerid);
  6506. for(new i=1; i < sizeof(WeaponData); i++)
  6507. {
  6508. if(WeaponData[i][0] != weaponid)
  6509. {
  6510. GivePlayerWeapon(playerid, WeaponData[i][0], WeaponData[i][1]);
  6511. }
  6512. }
  6513. }
  6514.  
  6515. stock IsBicycle(vehicleid)
  6516. {
  6517. switch(GetVehicleModel(vehicleid))
  6518. {
  6519. case 481,509,510: return 1;
  6520. }
  6521. return 0;
  6522. }
  6523.  
  6524. stock PlayerToPlayer(playerid, targetid, Float:dist)
  6525. {
  6526. new Float:pos[3];
  6527. GetPlayerPos(targetid, pos[0], pos[1], pos[2]);
  6528. return IsPlayerInRangeOfPoint(playerid, dist, pos[0], pos[1], pos[2]);
  6529. }
  6530.  
  6531. stock SendNearbyMessage(playerid, Float:radius, string[], col1, col2, col3, col4, col5)
  6532. {
  6533. new Float:x, Float:y, Float:z;
  6534. GetPlayerPos(playerid, x, y, z);
  6535. new Float:ix, Float:iy, Float:iz;
  6536. new Float:cx, Float:cy, Float:cz;
  6537. foreach(Player, i)
  6538. {
  6539. if(IsPlayerConnected(i))
  6540. {
  6541. if(GetPlayerInterior(playerid) == GetPlayerInterior(i) && GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i))
  6542. {
  6543. GetPlayerPos(i, ix, iy, iz);
  6544. cx = (x - ix);
  6545. cy = (y - iy);
  6546. cz = (z - iz);
  6547. if(((cx < radius/16) && (cx > -radius/16)) && ((cy < radius/16) && (cy > -radius/16)) && ((cz < radius/16) && (cz > -radius/16)))
  6548. {
  6549. SendClientMessage(i, col1, string);
  6550. }
  6551. else if(((cx < radius/8) && (cx > -radius/8)) && ((cy < radius/8) && (cy > -radius/8)) && ((cz < radius/8) && (cz > -radius/8)))
  6552. {
  6553. SendClientMessage(i, col2, string);
  6554. }
  6555. else if(((cx < radius/4) && (cx > -radius/4)) && ((cy < radius/4) && (cy > -radius/4)) && ((cz < radius/4) && (cz > -radius/4)))
  6556. {
  6557. SendClientMessage(i, col3, string);
  6558. }
  6559. else if(((cx < radius/2) && (cx > -radius/2)) && ((cy < radius/2) && (cy > -radius/2)) && ((cz < radius/2) && (cz > -radius/2)))
  6560. {
  6561. SendClientMessage(i, col4, string);
  6562. }
  6563. else if(((cx < radius) && (cx > -radius)) && ((cy < radius) && (cy > -radius)) && ((cz < radius) && (cz > -radius)))
  6564. {
  6565. SendClientMessage(i, col5, string);
  6566. }
  6567. }
  6568. }
  6569. }
  6570. return 1;
  6571. }
  6572.  
  6573. stock PlayerToVehicle(playerid, vehicleid, Float:dist)
  6574. {
  6575. new Float:pos[3];
  6576. GetVehiclePos(vehicleid, pos[0], pos[1], pos[2]);
  6577. return IsPlayerInRangeOfPoint(playerid, dist, pos[0], pos[1], pos[2]);
  6578. }
  6579.  
  6580. stock GetClosestVehicle(playerid)
  6581. {
  6582. new Float:x, Float:y, Float:z;
  6583. new Float:dist, Float:closedist=9999, closeveh;
  6584. for(new i=1; i < MAX_VEHICLES; i++)
  6585. {
  6586. if(GetVehiclePos(i, x, y, z))
  6587. {
  6588. dist = GetPlayerDistanceFromPoint(playerid, x, y, z);
  6589. if(dist < closedist)
  6590. {
  6591. closedist = dist;
  6592. closeveh = i;
  6593. }
  6594. }
  6595. }
  6596. return closeveh;
  6597. }
  6598.  
  6599. stock ToggleEngine(vehicleid, toggle)
  6600. {
  6601. new engine, lights, alarm, doors, bonnet, boot, objective;
  6602. GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
  6603. SetVehicleParamsEx(vehicleid, toggle, lights, alarm, doors, bonnet, boot, objective);
  6604. }
  6605.  
  6606. stock ToggleAlarm(vehicleid, toggle)
  6607. {
  6608. new engine, lights, alarm, doors, bonnet, boot, objective;
  6609. GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
  6610. SetVehicleParamsEx(vehicleid, engine, lights, toggle, doors, bonnet, boot, objective);
  6611. }
  6612.  
  6613. stock IsHoldingFirearm(playerid)
  6614. {
  6615. if(GetPlayerWeapon(playerid) < 16) return 0;
  6616. if(GetPlayerWeapon(playerid) > 40) return 0;
  6617. return 1;
  6618. }
  6619. stock IsPlayerNearPlayer(playerid, targetid, Float:radius)
  6620. {
  6621. new Float:x, Float:y, Float:z;
  6622. GetPlayerPos(targetid, x, y, z);
  6623. if(IsPlayerInRangeOfPoint(playerid, radius ,x, y, z))
  6624. {
  6625. return 1;
  6626. }
  6627. return 0;
  6628. }
  6629.  
  6630. stock IsNumeric(const string[])
  6631. {
  6632. for(new i=0; string[i]; i++)
  6633. {
  6634. if(string[i] < '0' || string[i] > '9') return 0;
  6635. }
  6636. return 1;
  6637. }
  6638.  
  6639. stock GetVehicleModelIDFromName(const vname[])
  6640. {
  6641. for(new i=0; i < sizeof(VehicleNames); i++)
  6642. {
  6643. if(strfind(VehicleNames[i], vname, true) != -1) return i + 400;
  6644. }
  6645. return -1;
  6646. }
  6647.  
  6648. stock GetPlayer2DZone(playerid)
  6649. {
  6650. new zone[32] = "San Andreas";
  6651. new Float:x, Float:y, Float:z;
  6652. GetPlayerPos(playerid, x, y, z);
  6653. for(new i = 0; i < sizeof(SanAndreasZones); i++)
  6654. {
  6655. if(x >= SanAndreasZones[i][Zone_Area][0] && x <= SanAndreasZones[i][Zone_Area][3]
  6656. && y >= SanAndreasZones[i][Zone_Area][1] && y <= SanAndreasZones[i][Zone_Area][4])
  6657. {
  6658. strcpy(zone, sizeof(zone), SanAndreasZones[i][Zone_Name]);
  6659. return zone;
  6660. }
  6661. }
  6662. return zone;
  6663. }
  6664. stock GetPlayer3DZone(playerid)
  6665. {
  6666. new zone[32] = "San Andreas";
  6667. new Float:x, Float:y, Float:z;
  6668. GetPlayerPos(playerid, x, y, z);
  6669. for(new i = 0; i < sizeof(SanAndreasZones); i++)
  6670. {
  6671. if(x >= SanAndreasZones[i][Zone_Area][0] && x <= SanAndreasZones[i][Zone_Area][3]
  6672. && y >= SanAndreasZones[i][Zone_Area][1] && y <= SanAndreasZones[i][Zone_Area][4]
  6673. && z >= SanAndreasZones[i][Zone_Area][2] && z <= SanAndreasZones[i][Zone_Area][5])
  6674. {
  6675. strcpy(zone, sizeof(zone), SanAndreasZones[i][Zone_Name]);
  6676. return zone;
  6677. }
  6678. }
  6679. return zone;
  6680. }
  6681.  
  6682. LoadVehicles()
  6683. {
  6684. new File:handle, count;
  6685. new Filename[64], line[256];
  6686. for(new i=1; i < MAX_DVEHICLES; i++)
  6687. {
  6688. format(Filename, sizeof(Filename), VEHICLE_File_PATH "v%d.ini", i);
  6689. if(!fexist(Filename)) continue;
  6690. handle = fopen(Filename, io_read);
  6691. while(fread(handle, line))
  6692. {
  6693. StripNL(line);
  6694. if(!line[0]) continue;
  6695. if(strcmp(line, "Created=", false, 8) == 0) VehicleCreated[i] = strval(line[8]);
  6696. else if(strcmp(line, "Model=", false, 6) == 0) VehicleModel[i] = strval(line[6]);
  6697. else if(strcmp(line, "Pos=", false, 4) == 0) sscanf(line[4], "p,ffff", VehiclePos[i][0], VehiclePos[i][1],
  6698. VehiclePos[i][2], VehiclePos[i][3]);
  6699. else if(strcmp(line, "Colors=", false, 7) == 0) sscanf(line[7], "p,dd", VehicleColor[i][0], VehicleColor[i][1]);
  6700. else if(strcmp(line, "Interior=", false, 9) == 0) VehicleInterior[i] = strval(line[9]);
  6701. else if(strcmp(line, "VirtualWorld=", false, 13) == 0) VehicleWorld[i] = strval(line[13]);
  6702. else if(strcmp(line, "Owner=", false, 6) == 0) strcpy(VehicleOwner[i], sizeof(VehicleOwner[]), line[6]);
  6703. else if(strcmp(line, "NumberPlate=", false, 12) == 0) strcpy(VehicleNumberPlate[i], sizeof(VehicleNumberPlate[]), line[12]);
  6704. else if(strcmp(line, "Value=", false, 6) == 0) VehicleValue[i] = strval(line[6]);
  6705. else if(strcmp(line, "Trunk1=", false, 7) == 0) sscanf(line[7], "p,dd", VehicleTrunk[i][0][0], VehicleTrunk[i][0][1]);
  6706. else if(strcmp(line, "Trunk2=", false, 7) == 0) sscanf(line[7], "p,dd", VehicleTrunk[i][1][0], VehicleTrunk[i][1][1]);
  6707. else if(strcmp(line, "Trunk3=", false, 7) == 0) sscanf(line[7], "p,dd", VehicleTrunk[i][2][0], VehicleTrunk[i][2][1]);
  6708. else if(strcmp(line, "Trunk4=", false, 7) == 0) sscanf(line[7], "p,dd", VehicleTrunk[i][3][0], VehicleTrunk[i][3][1]);
  6709. else if(strcmp(line, "Trunk5=", false, 7) == 0) sscanf(line[7], "p,dd", VehicleTrunk[i][4][0], VehicleTrunk[i][4][1]);
  6710. else if(strcmp(line, "Mod0=", false, 5) == 0) VehicleMods[i][0] = strval(line[5]);
  6711. else if(strcmp(line, "Mod1=", false, 5) == 0) VehicleMods[i][1] = strval(line[5]);
  6712. else if(strcmp(line, "Mod2=", false, 5) == 0) VehicleMods[i][2] = strval(line[5]);
  6713. else if(strcmp(line, "Mod3=", false, 5) == 0) VehicleMods[i][3] = strval(line[5]);
  6714. else if(strcmp(line, "Mod4=", false, 5) == 0) VehicleMods[i][4] = strval(line[5]);
  6715. else if(strcmp(line, "Mod5=", false, 5) == 0) VehicleMods[i][5] = strval(line[5]);
  6716. else if(strcmp(line, "Mod6=", false, 5) == 0) VehicleMods[i][6] = strval(line[5]);
  6717. else if(strcmp(line, "Mod7=", false, 5) == 0) VehicleMods[i][7] = strval(line[5]);
  6718. else if(strcmp(line, "Mod8=", false, 5) == 0) VehicleMods[i][8] = strval(line[5]);
  6719. else if(strcmp(line, "Mod9=", false, 5) == 0) VehicleMods[i][9] = strval(line[5]);
  6720. else if(strcmp(line, "Mod10=", false, 6) == 0) VehicleMods[i][10] = strval(line[6]);
  6721. else if(strcmp(line, "Mod11=", false, 6) == 0) VehicleMods[i][11] = strval(line[6]);
  6722. else if(strcmp(line, "Mod12=", false, 6) == 0) VehicleMods[i][12] = strval(line[6]);
  6723. else if(strcmp(line, "Mod13=", false, 6) == 0) VehicleMods[i][13] = strval(line[6]);
  6724. else if(strcmp(line, "Paintjob=", false, 9) == 0) VehiclePaintjob[i] = strval(line[9]);
  6725. }
  6726. fclose(handle);
  6727. if(VehicleCreated[i]) count++;
  6728. }
  6729. printf("------ Dealerships System Started------ ");
  6730. printf(" Loaded %d vehicles", count);
  6731. }
  6732.  
  6733. SaveVehicle(vehicleid)
  6734. {
  6735. new Filename[64], line[256];
  6736. format(Filename, sizeof(Filename), VEHICLE_File_PATH "v%d.ini", vehicleid);
  6737. new File:handle = fopen(Filename, io_write);
  6738. format(line, sizeof(line), "Created=%d\r\n", VehicleCreated[vehicleid]); fwrite(handle, line);
  6739. format(line, sizeof(line), "Model=%d\r\n", VehicleModel[vehicleid]); fwrite(handle, line);
  6740. format(line, sizeof(line), "Pos=%.3f,%.3f,%.3f,%.3f\r\n", VehiclePos[vehicleid][0], VehiclePos[vehicleid][1],
  6741. VehiclePos[vehicleid][2], VehiclePos[vehicleid][3]);
  6742. fwrite(handle, line);
  6743. format(line, sizeof(line), "Colors=%d,%d\r\n", VehicleColor[vehicleid][0], VehicleColor[vehicleid][1]); fwrite(handle, line);
  6744. format(line, sizeof(line), "Interior=%d\r\n", VehicleInterior[vehicleid]); fwrite(handle, line);
  6745. format(line, sizeof(line), "VirtualWorld=%d\r\n", VehicleWorld[vehicleid]); fwrite(handle, line);
  6746. format(line, sizeof(line), "Owner=%s\r\n", VehicleOwner[vehicleid]); fwrite(handle, line);
  6747. format(line, sizeof(line), "NumberPlate=%s\r\n", VehicleNumberPlate[vehicleid]); fwrite(handle, line);
  6748. format(line, sizeof(line), "Value=%d\r\n", VehicleValue[vehicleid]); fwrite(handle, line);
  6749. format(line, sizeof(line), "Trunk1=%d,%d\r\n", VehicleTrunk[vehicleid][0][0], VehicleTrunk[vehicleid][0][1]); fwrite(handle, line);
  6750. format(line, sizeof(line), "Trunk2=%d,%d\r\n", VehicleTrunk[vehicleid][1][0], VehicleTrunk[vehicleid][1][1]); fwrite(handle, line);
  6751. format(line, sizeof(line), "Trunk3=%d,%d\r\n", VehicleTrunk[vehicleid][2][0], VehicleTrunk[vehicleid][2][1]); fwrite(handle, line);
  6752. format(line, sizeof(line), "Trunk4=%d,%d\r\n", VehicleTrunk[vehicleid][3][0], VehicleTrunk[vehicleid][3][1]); fwrite(handle, line);
  6753. format(line, sizeof(line), "Trunk5=%d,%d\r\n", VehicleTrunk[vehicleid][4][0], VehicleTrunk[vehicleid][4][1]); fwrite(handle, line);
  6754. format(line, sizeof(line), "Mod0=%d\r\n", VehicleMods[vehicleid][0]); fwrite(handle, line);
  6755. format(line, sizeof(line), "Mod1=%d\r\n", VehicleMods[vehicleid][1]); fwrite(handle, line);
  6756. format(line, sizeof(line), "Mod2=%d\r\n", VehicleMods[vehicleid][2]); fwrite(handle, line);
  6757. format(line, sizeof(line), "Mod3=%d\r\n", VehicleMods[vehicleid][3]); fwrite(handle, line);
  6758. format(line, sizeof(line), "Mod4=%d\r\n", VehicleMods[vehicleid][4]); fwrite(handle, line);
  6759. format(line, sizeof(line), "Mod5=%d\r\n", VehicleMods[vehicleid][5]); fwrite(handle, line);
  6760. format(line, sizeof(line), "Mod6=%d\r\n", VehicleMods[vehicleid][6]); fwrite(handle, line);
  6761. format(line, sizeof(line), "Mod7=%d\r\n", VehicleMods[vehicleid][7]); fwrite(handle, line);
  6762. format(line, sizeof(line), "Mod8=%d\r\n", VehicleMods[vehicleid][8]); fwrite(handle, line);
  6763. format(line, sizeof(line), "Mod9=%d\r\n", VehicleMods[vehicleid][9]); fwrite(handle, line);
  6764. format(line, sizeof(line), "Mod10=%d\r\n", VehicleMods[vehicleid][10]); fwrite(handle, line);
  6765. format(line, sizeof(line), "Mod11=%d\r\n", VehicleMods[vehicleid][11]); fwrite(handle, line);
  6766. format(line, sizeof(line), "Mod12=%d\r\n", VehicleMods[vehicleid][12]); fwrite(handle, line);
  6767. format(line, sizeof(line), "Mod13=%d\r\n", VehicleMods[vehicleid][13]); fwrite(handle, line);
  6768. format(line, sizeof(line), "Paintjob=%d\r\n", VehiclePaintjob[vehicleid]); fwrite(handle, line);
  6769. fclose(handle);
  6770. }
  6771.  
  6772. UpdateVehicle(vehicleid, removeold)
  6773. {
  6774. if(VehicleCreated[vehicleid])
  6775. {
  6776. if(removeold)
  6777. {
  6778. new Float:health;
  6779. GetVehicleHealth(VehicleID[vehicleid], health);
  6780. new engine, lights, alarm, doors, bonnet, boot, objective;
  6781. GetVehicleParamsEx(VehicleID[vehicleid], engine, lights, alarm, doors, bonnet, boot, objective);
  6782. //new panels, doorsd, lightsd, tires;
  6783. //GetVehicleDamageStatus(VehicleID[vehicleid], panels, doorsd, lightsd, tires);
  6784. DestroyVehicle(VehicleID[vehicleid]);
  6785. VehicleID[vehicleid] = CreateVehicle(VehicleModel[vehicleid], VehiclePos[vehicleid][0], VehiclePos[vehicleid][1],
  6786. VehiclePos[vehicleid][2], VehiclePos[vehicleid][3], VehicleColor[vehicleid][0], VehicleColor[vehicleid][1], 3600);
  6787. SetVehicleHealth(VehicleID[vehicleid], health);
  6788. SetVehicleParamsEx(VehicleID[vehicleid], engine, lights, alarm, doors, bonnet, boot, objective);
  6789. //UpdateVehicleDamageStatus(VehicleID[vehicleid], panels, doorsd, lightsd, tires);
  6790. }
  6791. else
  6792. {
  6793. VehicleID[vehicleid] = CreateVehicle(VehicleModel[vehicleid], VehiclePos[vehicleid][0], VehiclePos[vehicleid][1],
  6794. VehiclePos[vehicleid][2], VehiclePos[vehicleid][3], VehicleColor[vehicleid][0], VehicleColor[vehicleid][1], 3600);
  6795. }
  6796. LinkVehicleToInterior(VehicleID[vehicleid], VehicleInterior[vehicleid]);
  6797. SetVehicleVirtualWorld(VehicleID[vehicleid], VehicleWorld[vehicleid]);
  6798. SetVehicleNumberPlate(VehicleID[vehicleid], VehicleNumberPlate[vehicleid]);
  6799. for(new i=0; i < sizeof(VehicleMods[]); i++)
  6800. {
  6801. AddVehicleComponent(VehicleID[vehicleid], VehicleMods[vehicleid][i]);
  6802. }
  6803. ChangeVehiclePaintjob(VehicleID[vehicleid], VehiclePaintjob[vehicleid]);
  6804. UpdateVehicleLabel(vehicleid, removeold);
  6805. }
  6806. }
  6807.  
  6808. UpdateVehicleLabel(vehicleid, removeold)
  6809. {
  6810. if(VehicleCreated[vehicleid] == VEHICLE_DEALERSHIP)
  6811. {
  6812. if(removeold)
  6813. {
  6814. Delete3DTextLabel(VehicleLabel[vehicleid]);
  6815. }
  6816. new labeltext[128];
  6817. format(labeltext, sizeof(labeltext), "%s\nID: %d\nDealership: %s\nPrice: $%d", VehicleNames[VehicleModel[vehicleid]-400],
  6818. vehicleid, VehicleOwner[vehicleid], VehicleValue[vehicleid]);
  6819. VehicleLabel[vehicleid] = Create3DTextLabel(labeltext, 0xBB7700DD, 0, 0, 0, 10.0, 0);
  6820. Attach3DTextLabelToVehicle(VehicleLabel[vehicleid], VehicleID[vehicleid], 0, 0, 0);
  6821. }
  6822. }
  6823.  
  6824. IsValidVehicle(vehicleid)
  6825. {
  6826. if(vehicleid < 1 || vehicleid >= MAX_DVEHICLES) return 0;
  6827. if(VehicleCreated[vehicleid]) return 1;
  6828. return 0;
  6829. }
  6830.  
  6831. GetVehicleID(vehicleid)
  6832. {
  6833. for(new i=1; i < MAX_DVEHICLES; i++)
  6834. {
  6835. if(VehicleCreated[i] && VehicleID[i] == vehicleid) return i;
  6836. }
  6837. return 0;
  6838. }
  6839.  
  6840. GetPlayerVehicles(playerid)
  6841. {
  6842. new count;
  6843. for(new i=1; i < MAX_DVEHICLES; i++)
  6844. {
  6845. if(VehicleCreated[i] == VEHICLE_PLAYER && strcmp(VehicleOwner[i], PlayerName(playerid)) == 0)
  6846. {
  6847. count++;
  6848. }
  6849. }
  6850. return count;
  6851. }
  6852.  
  6853. GetPlayerVehicleAccess(playerid, vehicleid)
  6854. {
  6855. if(IsValidVehicle(vehicleid))
  6856. {
  6857. if(VehicleCreated[vehicleid] == VEHICLE_DEALERSHIP)
  6858. {
  6859. if(PlayerInfo[playerid][pAdmin] < 1338)
  6860. {
  6861. return 3;
  6862. }
  6863. }
  6864. else if(VehicleCreated[vehicleid] == VEHICLE_PLAYER)
  6865. {
  6866. if(strcmp(VehicleOwner[vehicleid], PlayerName(playerid)) == 0)
  6867. {
  6868. return 1;
  6869. }
  6870. else if(GetPVarInt(playerid, "CarKeys") == vehicleid)
  6871. {
  6872. return 2;
  6873. }
  6874. }
  6875. }
  6876. else
  6877. {
  6878. return 2;
  6879. }
  6880. return 0;
  6881. }
  6882.  
  6883. LoadDealerships()
  6884. {
  6885. new File:handle, count;
  6886. new Filename[64], line[256];
  6887. for(new i=1; i < MAX_DEALERSHIPS; i++)
  6888. {
  6889. format(Filename, sizeof(Filename), DEALERSHIP_File_PATH "d%d.ini", i);
  6890. if(!fexist(Filename)) continue;
  6891. handle = fopen(Filename, io_read);
  6892. while(fread(handle, line))
  6893. {
  6894. StripNL(line);
  6895. if(!line[0]) continue;
  6896. if(strcmp(line, "Created=", false, 8) == 0) DealershipCreated[i] = strval(line[8]);
  6897. else if(strcmp(line, "Pos=", false, 4) == 0) sscanf(line[4], "p,fff", DealershipPos[i][0],
  6898. DealershipPos[i][1], DealershipPos[i][2]);
  6899. }
  6900. fclose(handle);
  6901. if(DealershipCreated[i]) count++;
  6902. }
  6903. printf(" Loaded %d dealerships", count);
  6904. }
  6905.  
  6906. SaveDealership(dealerid)
  6907. {
  6908. new Filename[64], line[256];
  6909. format(Filename, sizeof(Filename), DEALERSHIP_File_PATH "d%d.ini", dealerid);
  6910. new File:handle = fopen(Filename, io_write);
  6911. format(line, sizeof(line), "Created=%d\r\n", DealershipCreated[dealerid]); fwrite(handle, line);
  6912. format(line, sizeof(line), "Pos=%.3f,%.3f,%.3f\r\n", DealershipPos[dealerid][0],
  6913. DealershipPos[dealerid][1], DealershipPos[dealerid][2]);
  6914. fwrite(handle, line);
  6915. fclose(handle);
  6916. }
  6917.  
  6918. UpdateDealership(dealerid, removeold)
  6919. {
  6920. if(DealershipCreated[dealerid])
  6921. {
  6922. if(removeold)
  6923. {
  6924. Delete3DTextLabel(DealershipLabel[dealerid]);
  6925. }
  6926. new labeltext[32];
  6927. format(labeltext, sizeof(labeltext), "Vehicle Dealership\nID: %d", dealerid);
  6928. DealershipLabel[dealerid] = Create3DTextLabel(labeltext, 0x00BB00DD, DealershipPos[dealerid][0],
  6929. DealershipPos[dealerid][1], DealershipPos[dealerid][2]+0.5, 20.0, 0);
  6930. }
  6931. }
  6932.  
  6933. IsValidDealership(dealerid)
  6934. {
  6935. if(dealerid < 1 || dealerid >= MAX_DEALERSHIPS) return 0;
  6936. if(DealershipCreated[dealerid]) return 1;
  6937. return 0;
  6938. }
  6939.  
  6940. LoadFuelStations()
  6941. {
  6942. new File:handle, count;
  6943. new Filename[64], line[256];
  6944. for(new i=1; i < MAX_FUEL_STATIONS; i++)
  6945. {
  6946. format(Filename, sizeof(Filename), FUEL_STATION_File_PATH "f%d.ini", i);
  6947. if(!fexist(Filename)) continue;
  6948. handle = fopen(Filename, io_read);
  6949. while(fread(handle, line))
  6950. {
  6951. StripNL(line);
  6952. if(!line[0]) continue;
  6953. if(strcmp(line, "Created=", false, 8) == 0) FuelStationCreated[i] = strval(line[8]);
  6954. else if(strcmp(line, "Pos=", false, 4) == 0) sscanf(line[4], "p,fff", FuelStationPos[i][0],
  6955. FuelStationPos[i][1], FuelStationPos[i][2]);
  6956. }
  6957. fclose(handle);
  6958. if(FuelStationCreated[i]) count++;
  6959. }
  6960. printf(" Loaded %d fuel stations", count);
  6961. }
  6962.  
  6963. SaveFuelStation(stationid)
  6964. {
  6965. new Filename[64], line[256];
  6966. format(Filename, sizeof(Filename), FUEL_STATION_File_PATH "f%d.ini", stationid);
  6967. new File:handle = fopen(Filename, io_write);
  6968. format(line, sizeof(line), "Created=%d\r\n", FuelStationCreated[stationid]); fwrite(handle, line);
  6969. format(line, sizeof(line), "Pos=%.3f,%.3f,%.3f\r\n", FuelStationPos[stationid][0],
  6970. FuelStationPos[stationid][1], FuelStationPos[stationid][2]);
  6971. fwrite(handle, line);
  6972. fclose(handle);
  6973. }
  6974.  
  6975. UpdateFuelStation(stationid, removeold)
  6976. {
  6977. if(FuelStationCreated[stationid])
  6978. {
  6979. if(removeold)
  6980. {
  6981. Delete3DTextLabel(FuelStationLabel[stationid]);
  6982. }
  6983. new labeltext[32];
  6984. format(labeltext, sizeof(labeltext), "Fuel Station\nID: %d\n/fuel", stationid);
  6985. FuelStationLabel[stationid] = Create3DTextLabel(labeltext, 0x00BBFFDD, FuelStationPos[stationid][0],
  6986. FuelStationPos[stationid][1], FuelStationPos[stationid][2]+0.5, 20.0, 0);
  6987. }
  6988. }
  6989.  
  6990. IsValidFuelStation(stationid)
  6991. {
  6992. if(stationid < 1 || stationid >= MAX_FUEL_STATIONS) return 0;
  6993. if(FuelStationCreated[stationid]) return 1;
  6994. return 0;
  6995. }
  6996. stock GetVehicleName(vehicleid, model[], len)
  6997. {
  6998. new vid = GetVehicleModel(vehicleid);
  6999. if(vid == 400) return format(model, len, "Landstalker", 0);
  7000. else if(vid == 401) return format(model, len, "Bravura", 0);
  7001. else if(vid == 402) return format(model, len, "Buffalo", 0);
  7002. else if(vid == 403) return format(model, len, "Linerunner", 0);
  7003. else if(vid == 404) return format(model, len, "Perenail", 0);
  7004. else if(vid == 405) return format(model, len, "Sentinel", 0);
  7005. else if(vid == 406) return format(model, len, "Dumper", 0);
  7006. else if(vid == 407) return format(model, len, "Firetruck", 0);
  7007. else if(vid == 408) return format(model, len, "Trashmaster", 0);
  7008. else if(vid == 409) return format(model, len, "Stretch", 0);
  7009. else if(vid == 410) return format(model, len, "Manana", 0);
  7010. else if(vid == 411) return format(model, len, "Infernus", 0);
  7011. else if(vid == 412) return format(model, len, "Vodooo", 0);
  7012. else if(vid == 413) return format(model, len, "Pony", 0);
  7013. else if(vid == 414) return format(model, len, "Mule", 0);
  7014. else if(vid == 415) return format(model, len, "Cheetah", 0);
  7015. else if(vid == 416) return format(model, len, "Ambulance", 0);
  7016. else if(vid == 417) return format(model, len, "Leviathan", 0);
  7017. else if(vid == 418) return format(model, len, "Moonbeam", 0);
  7018. else if(vid == 419) return format(model, len, "Esperanto", 0);
  7019. else if(vid == 420) return format(model, len, "Taxi", 0);
  7020. else if(vid == 421) return format(model, len, "Washington", 0);
  7021. else if(vid == 422) return format(model, len, "Bobcat", 0);
  7022. else if(vid == 423) return format(model, len, "Mr Whoopee", 0);
  7023. else if(vid == 424) return format(model, len, "BF Injection", 0);
  7024. else if(vid == 425) return format(model, len, "Hunter", 0);
  7025. else if(vid == 426) return format(model, len, "Premier", 0);
  7026. else if(vid == 427) return format(model, len, "S.W.A.T Truck", 0);
  7027. else if(vid == 428) return format(model, len, "Securicar", 0);
  7028. else if(vid == 429) return format(model, len, "Banshee", 0);
  7029. else if(vid == 430) return format(model, len, "Predator", 0);
  7030. else if(vid == 431) return format(model, len, "Bus", 0);
  7031. else if(vid == 432) return format(model, len, "Rhino", 0);
  7032. else if(vid == 433) return format(model, len, "Barracks", 0);
  7033. else if(vid == 434) return format(model, len, "Hotknife", 0);
  7034. else if(vid == 435) return format(model, len, "Trailer", 0);
  7035. else if(vid == 436) return format(model, len, "Previon", 0);
  7036. else if(vid == 437) return format(model, len, "Coach", 0);
  7037. else if(vid == 438) return format(model, len, "Cabbie", 0);
  7038. else if(vid == 439) return format(model, len, "Stallion", 0);
  7039. else if(vid == 440) return format(model, len, "Rumpo", 0);
  7040. else if(vid == 441) return format(model, len, "RC Bandit", 0);
  7041. else if(vid == 442) return format(model, len, "Romero", 0);
  7042. else if(vid == 443) return format(model, len, "Packer", 0);
  7043. else if(vid == 444) return format(model, len, "Monster", 0);
  7044. else if(vid == 445) return format(model, len, "Admiral", 0);
  7045. else if(vid == 446) return format(model, len, "Squalo", 0);
  7046. else if(vid == 447) return format(model, len, "Seasparrow", 0);
  7047. else if(vid == 448) return format(model, len, "Pizza Boy", 0);
  7048. else if(vid == 449) return format(model, len, "Tram", 0);
  7049. else if(vid == 450) return format(model, len, "Trailer 2", 0);
  7050. else if(vid == 451) return format(model, len, "Turismo", 0);
  7051. else if(vid == 452) return format(model, len, "Speeder", 0);
  7052. else if(vid == 453) return format(model, len, "Refeer", 0);
  7053. else if(vid == 454) return format(model, len, "Tropic", 0);
  7054. else if(vid == 455) return format(model, len, "Flatbed", 0);
  7055. else if(vid == 456) return format(model, len, "Yankee", 0);
  7056. else if(vid == 457) return format(model, len, "Caddy", 0);
  7057. else if(vid == 458) return format(model, len, "Solair", 0);
  7058. else if(vid == 459) return format(model, len, "Top Fun", 0);
  7059. else if(vid == 460) return format(model, len, "Skimmer", 0);
  7060. else if(vid == 461) return format(model, len, "PCJ-600", 0);
  7061. else if(vid == 462) return format(model, len, "Faggio", 0);
  7062. else if(vid == 463) return format(model, len, "Freeway", 0);
  7063. else if(vid == 464) return format(model, len, "RC Baron", 0);
  7064. else if(vid == 465) return format(model, len, "RC Raider", 0);
  7065. else if(vid == 466) return format(model, len, "Glendade", 0);
  7066. else if(vid == 467) return format(model, len, "Oceanic", 0);
  7067. else if(vid == 468) return format(model, len, "Sanchez", 0);
  7068. else if(vid == 469) return format(model, len, "Sparrow", 0);
  7069. else if(vid == 470) return format(model, len, "Patriot", 0);
  7070. else if(vid == 471) return format(model, len, "Quad", 0);
  7071. else if(vid == 472) return format(model, len, "Coastguard", 0);
  7072. else if(vid == 473) return format(model, len, "Dinghy", 0);
  7073. else if(vid == 474) return format(model, len, "Hermes", 0);
  7074. else if(vid == 475) return format(model, len, "Sabre", 0);
  7075. else if(vid == 476) return format(model, len, "Rustler", 0);
  7076. else if(vid == 477) return format(model, len, "ZR-350", 0);
  7077. else if(vid == 478) return format(model, len, "Walton", 0);
  7078. else if(vid == 479) return format(model, len, "Regina", 0);
  7079. else if(vid == 480) return format(model, len, "Comet", 0);
  7080. else if(vid == 481) return format(model, len, "BMX", 0);
  7081. else if(vid == 482) return format(model, len, "Burrito", 0);
  7082. else if(vid == 483) return format(model, len, "Camper", 0);
  7083. else if(vid == 484) return format(model, len, "Marquis", 0);
  7084. else if(vid == 485) return format(model, len, "Baggage", 0);
  7085. else if(vid == 486) return format(model, len, "Dozer", 0);
  7086. else if(vid == 487) return format(model, len, "Maverick", 0);
  7087. else if(vid == 488) return format(model, len, "News Maverick", 0);
  7088. else if(vid == 489) return format(model, len, "Rancher", 0);
  7089. else if(vid == 490) return format(model, len, "Federal Rancher", 0);
  7090. else if(vid == 491) return format(model, len, "Virgo", 0);
  7091. else if(vid == 492) return format(model, len, "Greenwood", 0);
  7092. else if(vid == 493) return format(model, len, "Jetmax", 0);
  7093. else if(vid == 494) return format(model, len, "Hotring", 0);
  7094. else if(vid == 495) return format(model, len, "Sandking", 0);
  7095. else if(vid == 496) return format(model, len, "Blista Compact", 0);
  7096. else if(vid == 497) return format(model, len, "Police Maverick", 0);
  7097. else if(vid == 498) return format(model, len, "Boxville", 0);
  7098. else if(vid == 499) return format(model, len, "Benson", 0);
  7099. else if(vid == 500) return format(model, len, "Mesa", 0);
  7100. else if(vid == 501) return format(model, len, "RC Goblin", 0);
  7101. else if(vid == 502) return format(model, len, "Hotring A", 0);
  7102. else if(vid == 503) return format(model, len, "Hotring B", 0);
  7103. else if(vid == 504) return format(model, len, "Blooding Banger", 0);
  7104. else if(vid == 505) return format(model, len, "Rancher", 0);
  7105. else if(vid == 506) return format(model, len, "Super GT", 0);
  7106. else if(vid == 507) return format(model, len, "Elegant", 0);
  7107. else if(vid == 508) return format(model, len, "Journey", 0);
  7108. else if(vid == 509) return format(model, len, "Bike", 0);
  7109. else if(vid == 510) return format(model, len, "Mountain Bike", 0);
  7110. else if(vid == 511) return format(model, len, "Beagle", 0);
  7111. else if(vid == 512) return format(model, len, "Cropduster", 0);
  7112. else if(vid == 513) return format(model, len, "Stuntplane", 0);
  7113. else if(vid == 514) return format(model, len, "Petrol", 0);
  7114. else if(vid == 515) return format(model, len, "Roadtrain", 0);
  7115. else if(vid == 516) return format(model, len, "Nebula", 0);
  7116. else if(vid == 517) return format(model, len, "Majestic", 0);
  7117. else if(vid == 518) return format(model, len, "Buccaneer", 0);
  7118. else if(vid == 519) return format(model, len, "Shamal", 0);
  7119. else if(vid == 520) return format(model, len, "Hydra", 0);
  7120. else if(vid == 521) return format(model, len, "FCR-300", 0);
  7121. else if(vid == 522) return format(model, len, "NRG-500", 0);
  7122. else if(vid == 523) return format(model, len, "HPV-1000", 0);
  7123. else if(vid == 524) return format(model, len, "Cement Truck", 0);
  7124. else if(vid == 525) return format(model, len, "Towtruck", 0);
  7125. else if(vid == 526) return format(model, len, "Fortune", 0);
  7126. else if(vid == 527) return format(model, len, "Cadrona", 0);
  7127. else if(vid == 528) return format(model, len, "Federal Truck", 0);
  7128. else if(vid == 529) return format(model, len, "Williard", 0);
  7129. else if(vid == 530) return format(model, len, "Fork Lift", 0);
  7130. else if(vid == 531) return format(model, len, "Tractor", 0);
  7131. else if(vid == 532) return format(model, len, "Combine", 0);
  7132. else if(vid == 533) return format(model, len, "Feltzer", 0);
  7133. else if(vid == 534) return format(model, len, "Remington", 0);
  7134. else if(vid == 535) return format(model, len, "Slamvan", 0);
  7135. else if(vid == 536) return format(model, len, "Blade", 0);
  7136. else if(vid == 537) return format(model, len, "Freight", 0);
  7137. else if(vid == 538) return format(model, len, "Streak", 0);
  7138. else if(vid == 539) return format(model, len, "Vortex", 0);
  7139. else if(vid == 540) return format(model, len, "Vincent", 0);
  7140. else if(vid == 541) return format(model, len, "Bullet", 0);
  7141. else if(vid == 542) return format(model, len, "Clover", 0);
  7142. else if(vid == 543) return format(model, len, "Sadler", 0);
  7143. else if(vid == 544) return format(model, len, "Stairs Firetruck", 0);
  7144. else if(vid == 545) return format(model, len, "Hustler", 0);
  7145. else if(vid == 546) return format(model, len, "Intruder", 0);
  7146. else if(vid == 547) return format(model, len, "Primo", 0);
  7147. else if(vid == 548) return format(model, len, "Cargobob", 0);
  7148. else if(vid == 549) return format(model, len, "Tampa", 0);
  7149. else if(vid == 550) return format(model, len, "Sunrise", 0);
  7150. else if(vid == 551) return format(model, len, "Merit", 0);
  7151. else if(vid == 552) return format(model, len, "Utility Van", 0);
  7152. else if(vid == 553) return format(model, len, "Nevada", 0);
  7153. else if(vid == 554) return format(model, len, "Yosemite", 0);
  7154. else if(vid == 555) return format(model, len, "Windsor", 0);
  7155. else if(vid == 556) return format(model, len, "Monster A", 0);
  7156. else if(vid == 557) return format(model, len, "Monster B", 0);
  7157. else if(vid == 558) return format(model, len, "Uranus", 0);
  7158. else if(vid == 559) return format(model, len, "Jester", 0);
  7159. else if(vid == 560) return format(model, len, "Sultan", 0);
  7160. else if(vid == 561) return format(model, len, "Stratum", 0);
  7161. else if(vid == 562) return format(model, len, "Elegy", 0);
  7162. else if(vid == 563) return format(model, len, "Raindance", 0);
  7163. else if(vid == 564) return format(model, len, "RC Tiger", 0);
  7164. else if(vid == 565) return format(model, len, "Flash", 0);
  7165. else if(vid == 566) return format(model, len, "Tahoma", 0);
  7166. else if(vid == 567) return format(model, len, "Savanna", 0);
  7167. else if(vid == 568) return format(model, len, "Bandito", 0);
  7168. else if(vid == 569) return format(model, len, "Freight Flat", 0);
  7169. else if(vid == 570) return format(model, len, "Streak", 0);
  7170. else if(vid == 571) return format(model, len, "Kart", 0);
  7171. else if(vid == 572) return format(model, len, "Mower", 0);
  7172. else if(vid == 573) return format(model, len, "Duneride", 0);
  7173. else if(vid == 574) return format(model, len, "Sweeper", 0);
  7174. else if(vid == 575) return format(model, len, "Broadway", 0);
  7175. else if(vid == 576) return format(model, len, "Tornado", 0);
  7176. else if(vid == 577) return format(model, len, "AT-400", 0);
  7177. else if(vid == 578) return format(model, len, "DFT-30", 0);
  7178. else if(vid == 579) return format(model, len, "Huntley", 0);
  7179. else if(vid == 580) return format(model, len, "Stafford", 0);
  7180. else if(vid == 581) return format(model, len, "BF-400", 0);
  7181. else if(vid == 582) return format(model, len, "Raindance", 0);
  7182. else if(vid == 583) return format(model, len, "News Van", 0);
  7183. else if(vid == 584) return format(model, len, "Tug", 0);
  7184. else if(vid == 585) return format(model, len, "Petrol Tanker", 0);
  7185. else if(vid == 586) return format(model, len, "Wayfarer", 0);
  7186. else if(vid == 587) return format(model, len, "Euros", 0);
  7187. else if(vid == 588) return format(model, len, "Hotdog", 0);
  7188. else if(vid == 589) return format(model, len, "Club", 0);
  7189. else if(vid == 590) return format(model, len, "Freight Box", 0);
  7190. else if(vid == 591) return format(model, len, "Trailer 3", 0);
  7191. else if(vid == 592) return format(model, len, "Andromada", 0);
  7192. else if(vid == 593) return format(model, len, "Dodo", 0);
  7193. else if(vid == 594) return format(model, len, "RC Cam", 0);
  7194. else if(vid == 595) return format(model, len, "Launch", 0);
  7195. else if(vid == 596) return format(model, len, "LSPD Patrol Car", 0);
  7196. else if(vid == 597) return format(model, len, "FBI Patrol Car", 0);
  7197. else if(vid == 598) return format(model, len, "NG Patrol Car", 0);
  7198. else if(vid == 599) return format(model, len, "LSPD Patrol Ranger", 0);
  7199. else if(vid == 600) return format(model, len, "Picador", 0);
  7200. else if(vid == 601) return format(model, len, "S.W.A.T Tank", 0);
  7201. else if(vid == 602) return format(model, len, "Alpha", 0);
  7202. else if(vid == 603) return format(model, len, "Phoenix", 0);
  7203. else if(vid == 609) return format(model, len, "Boxville", 0);
  7204. return 0;
  7205. }
  7206.  
  7207. /*================================{FACTIONS SETTINGS}==================================*/
  7208.  
  7209. stock SaveFactions()
  7210. {
  7211. // LSPD
  7212. new file[64];
  7213. format(file, sizeof(file), "factions/LSPD.ini");
  7214. if(!dini_Exists(file)) dini_Create(file);
  7215. dini_Set(file, "Rank0", FacInfo[1][fRank0]);
  7216. dini_Set(file, "Rank1", FacInfo[1][fRank1]);
  7217. dini_Set(file, "Rank2", FacInfo[1][fRank2]);
  7218. dini_Set(file, "Rank3", FacInfo[1][fRank3]);
  7219. dini_Set(file, "Rank4", FacInfo[1][fRank4]);
  7220. dini_Set(file, "Rank5", FacInfo[1][fRank5]);
  7221. dini_Set(file, "Rank6", FacInfo[1][fRank6]);
  7222. dini_Set(file, "Div1", FacInfo[1][fDiv1]);
  7223. dini_Set(file, "Div2", FacInfo[1][fDiv2]);
  7224. dini_Set(file, "Div3", FacInfo[1][fDiv3]);
  7225. dini_Set(file, "Div4", FacInfo[1][fDiv4]);
  7226. print("LSPD files saved successfully.");
  7227. // FBI
  7228. format(file, sizeof(file), "factions/FBI.ini");
  7229. if(!dini_Exists(file)) dini_Create(file);
  7230. dini_Set(file, "Rank0", FacInfo[3][fRank0]);
  7231. dini_Set(file, "Rank1", FacInfo[3][fRank1]);
  7232. dini_Set(file, "Rank2", FacInfo[3][fRank2]);
  7233. dini_Set(file, "Rank3", FacInfo[3][fRank3]);
  7234. dini_Set(file, "Rank4", FacInfo[3][fRank4]);
  7235. dini_Set(file, "Rank5", FacInfo[3][fRank5]);
  7236. dini_Set(file, "Rank6", FacInfo[3][fRank6]);
  7237. print("FBI files saved successfully.");
  7238. // Government
  7239. format(file, sizeof(file), "factions/Government.ini");
  7240. if(!dini_Exists(file)) dini_Create(file);
  7241. dini_Set(file, "Rank0", FacInfo[2][fRank0]);
  7242. dini_Set(file, "Rank1", FacInfo[2][fRank1]);
  7243. dini_Set(file, "Rank2", FacInfo[2][fRank2]);
  7244. dini_Set(file, "Rank3", FacInfo[2][fRank3]);
  7245. dini_Set(file, "Rank4", FacInfo[2][fRank4]);
  7246. dini_Set(file, "Rank5", FacInfo[2][fRank5]);
  7247. dini_Set(file, "Rank6", FacInfo[2][fRank6]);
  7248. dini_IntSet(file, "TaxPercent", TaxPercent);
  7249. dini_IntSet(file, "TaxVault", TaxMoney);
  7250. print("Government files saved successfully.");
  7251. // Hitman Agency
  7252. format(file, sizeof(file), "factions/HA.ini");
  7253. if(!dini_Exists(file)) dini_Create(file);
  7254. dini_Set(file, "Rank0", FacInfo[3][fRank0]);
  7255. dini_Set(file, "Rank1", FacInfo[3][fRank1]);
  7256. dini_Set(file, "Rank2", FacInfo[3][fRank2]);
  7257. dini_Set(file, "Rank3", FacInfo[3][fRank3]);
  7258. dini_Set(file, "Rank4", FacInfo[3][fRank4]);
  7259. dini_Set(file, "Rank5", FacInfo[3][fRank5]);
  7260. dini_Set(file, "Rank6", FacInfo[3][fRank6]);
  7261. print("Hitman Agency files saved successfully.");
  7262. // News Agency
  7263. format(file, sizeof(file), "factions/NA.ini");
  7264. if(!dini_Exists(file)) dini_Create(file);
  7265. dini_Set(file, "Rank0", FacInfo[4][fRank0]);
  7266. dini_Set(file, "Rank1", FacInfo[4][fRank1]);
  7267. dini_Set(file, "Rank2", FacInfo[4][fRank2]);
  7268. dini_Set(file, "Rank3", FacInfo[4][fRank3]);
  7269. dini_Set(file, "Rank4", FacInfo[4][fRank4]);
  7270. dini_Set(file, "Rank5", FacInfo[4][fRank5]);
  7271. dini_Set(file, "Rank6", FacInfo[4][fRank6]);
  7272. dini_IntSet(file, "Vault", NewsMoney);
  7273. print("News Agency files saved successfully.");
  7274. // Los Santos Medic Departmant
  7275. format(file, sizeof(file), "factions/LSMD.ini");
  7276. if(!dini_Exists(file)) dini_Create(file);
  7277. dini_Set(file, "Rank0", FacInfo[3][fRank0]);
  7278. dini_Set(file, "Rank1", FacInfo[3][fRank1]);
  7279. dini_Set(file, "Rank2", FacInfo[3][fRank2]);
  7280. dini_Set(file, "Rank3", FacInfo[3][fRank3]);
  7281. dini_Set(file, "Rank4", FacInfo[3][fRank4]);
  7282. dini_Set(file, "Rank5", FacInfo[3][fRank5]);
  7283. dini_Set(file, "Rank6", FacInfo[3][fRank6]);
  7284. print("LSMD files saved successfully.");
  7285. // Secret Service
  7286. format(file, sizeof(file), "factions/SS.ini");
  7287. if(!dini_Exists(file)) dini_Create(file);
  7288. dini_Set(file, "Rank0", FacInfo[3][fRank0]);
  7289. dini_Set(file, "Rank1", FacInfo[3][fRank1]);
  7290. dini_Set(file, "Rank2", FacInfo[3][fRank2]);
  7291. dini_Set(file, "Rank3", FacInfo[3][fRank3]);
  7292. dini_Set(file, "Rank4", FacInfo[3][fRank4]);
  7293. dini_Set(file, "Rank5", FacInfo[3][fRank5]);
  7294. dini_Set(file, "Rank6", FacInfo[3][fRank6]);
  7295. print("SS files saved successfully.");
  7296. return 1;
  7297. }
  7298.  
  7299. stock LoadFactions()
  7300. {
  7301. // LSPD
  7302. new file[64];
  7303. format(file, sizeof(file), "factions/LSPD.ini");
  7304. format(FacInfo[1][fRank0], 32, "%s", dini_Get(file, "Rank0"));
  7305. format(FacInfo[1][fRank1], 32, "%s", dini_Get(file, "Rank1"));
  7306. format(FacInfo[1][fRank2], 32, "%s", dini_Get(file, "Rank2"));
  7307. format(FacInfo[1][fRank3], 32, "%s", dini_Get(file, "Rank3"));
  7308. format(FacInfo[1][fRank4], 32, "%s", dini_Get(file, "Rank4"));
  7309. format(FacInfo[1][fRank5], 32, "%s", dini_Get(file, "Rank5"));
  7310. format(FacInfo[1][fRank6], 32, "%s", dini_Get(file, "Rank6"));
  7311. format(FacInfo[1][fDiv1], 8, "%s", dini_Get(file, "Div1"));
  7312. format(FacInfo[1][fDiv2], 8, "%s", dini_Get(file, "Div2"));
  7313. format(FacInfo[1][fDiv3], 8, "%s", dini_Get(file, "Div3"));
  7314. format(FacInfo[1][fDiv4], 8, "%s", dini_Get(file, "Div4"));
  7315. print("LSPD files loaded successfully.");
  7316. // FBI
  7317. format(file, sizeof(file), "factions/FBI.ini");
  7318. format(FacInfo[3][fRank0], 32, "%s", dini_Get(file, "Rank0"));
  7319. format(FacInfo[3][fRank1], 32, "%s", dini_Get(file, "Rank1"));
  7320. format(FacInfo[3][fRank2], 32, "%s", dini_Get(file, "Rank2"));
  7321. format(FacInfo[3][fRank3], 32, "%s", dini_Get(file, "Rank3"));
  7322. format(FacInfo[3][fRank4], 32, "%s", dini_Get(file, "Rank4"));
  7323. format(FacInfo[3][fRank5], 32, "%s", dini_Get(file, "Rank5"));
  7324. format(FacInfo[3][fRank6], 32, "%s", dini_Get(file, "Rank6"));
  7325. print("FBI files loaded successfully.");
  7326. // Government
  7327. format(file, sizeof(file), "factions/GOV.ini");
  7328. format(FacInfo[2][fRank0], 32, "%s", dini_Get(file, "Rank0"));
  7329. format(FacInfo[2][fRank1], 32, "%s", dini_Get(file, "Rank1"));
  7330. format(FacInfo[2][fRank2], 32, "%s", dini_Get(file, "Rank2"));
  7331. format(FacInfo[2][fRank3], 32, "%s", dini_Get(file, "Rank3"));
  7332. format(FacInfo[2][fRank4], 32, "%s", dini_Get(file, "Rank4"));
  7333. format(FacInfo[2][fRank5], 32, "%s", dini_Get(file, "Rank5"));
  7334. format(FacInfo[2][fRank6], 32, "%s", dini_Get(file, "Rank6"));
  7335. TaxPercent = dini_Int(file, "TaxPercent");
  7336. TaxMoney = dini_Int(file, "TaxVault");
  7337. print("Government files loaded successfully.");
  7338. // Hitman Agency
  7339. format(file, sizeof(file), "factions/HA.ini");
  7340. format(FacInfo[3][fRank0], 32, "%s", dini_Get(file, "Rank0"));
  7341. format(FacInfo[3][fRank1], 32, "%s", dini_Get(file, "Rank1"));
  7342. format(FacInfo[3][fRank2], 32, "%s", dini_Get(file, "Rank2"));
  7343. format(FacInfo[3][fRank3], 32, "%s", dini_Get(file, "Rank3"));
  7344. format(FacInfo[3][fRank4], 32, "%s", dini_Get(file, "Rank4"));
  7345. format(FacInfo[3][fRank5], 32, "%s", dini_Get(file, "Rank5"));
  7346. format(FacInfo[3][fRank6], 32, "%s", dini_Get(file, "Rank6"));
  7347. print("Hitman Agency files loaded successfully.");
  7348. // News Reporters
  7349. format(file, sizeof(file), "factions/NR.ini");
  7350. format(FacInfo[4][fRank0], 32, "%s", dini_Get(file, "Rank0"));
  7351. format(FacInfo[4][fRank1], 32, "%s", dini_Get(file, "Rank1"));
  7352. format(FacInfo[4][fRank2], 32, "%s", dini_Get(file, "Rank2"));
  7353. format(FacInfo[4][fRank3], 32, "%s", dini_Get(file, "Rank3"));
  7354. format(FacInfo[4][fRank4], 32, "%s", dini_Get(file, "Rank4"));
  7355. format(FacInfo[4][fRank5], 32, "%s", dini_Get(file, "Rank5"));
  7356. format(FacInfo[4][fRank6], 32, "%s", dini_Get(file, "Rank6"));
  7357. NewsMoney = dini_Int(file, "Vault");
  7358. print("News Reporters files loaded successfully.");
  7359. // LSMD
  7360. format(file, sizeof(file), "factions/LSMD.ini");
  7361. format(FacInfo[3][fRank0], 32, "%s", dini_Get(file, "Rank0"));
  7362. format(FacInfo[3][fRank1], 32, "%s", dini_Get(file, "Rank1"));
  7363. format(FacInfo[3][fRank2], 32, "%s", dini_Get(file, "Rank2"));
  7364. format(FacInfo[3][fRank3], 32, "%s", dini_Get(file, "Rank3"));
  7365. format(FacInfo[3][fRank4], 32, "%s", dini_Get(file, "Rank4"));
  7366. format(FacInfo[3][fRank5], 32, "%s", dini_Get(file, "Rank5"));
  7367. format(FacInfo[3][fRank6], 32, "%s", dini_Get(file, "Rank6"));
  7368. print("LSMD files loaded successfully.");
  7369. // Secret Service
  7370. format(file, sizeof(file), "factions/SS.ini");
  7371. format(FacInfo[3][fRank0], 32, "%s", dini_Get(file, "Rank0"));
  7372. format(FacInfo[3][fRank1], 32, "%s", dini_Get(file, "Rank1"));
  7373. format(FacInfo[3][fRank2], 32, "%s", dini_Get(file, "Rank2"));
  7374. format(FacInfo[3][fRank3], 32, "%s", dini_Get(file, "Rank3"));
  7375. format(FacInfo[3][fRank4], 32, "%s", dini_Get(file, "Rank4"));
  7376. format(FacInfo[3][fRank5], 32, "%s", dini_Get(file, "Rank5"));
  7377. format(FacInfo[3][fRank6], 32, "%s", dini_Get(file, "Rank6"));
  7378. print("SS files loaded successfully.");
  7379. return 1;
  7380. }
  7381. stock RPN(playerid)
  7382. {
  7383. new name[MAX_PLAYER_NAME];
  7384. GetPlayerName(playerid,name,sizeof(name));
  7385. for(new i = 0; i < MAX_PLAYER_NAME; i++)
  7386. {
  7387. if(name[i] == '_') name[i] = ' ';
  7388. }
  7389. return name;
  7390. }
  7391. stock RPNU(playerid)
  7392. {
  7393. new name[MAX_PLAYER_NAME];
  7394. GetPlayerName(playerid, name, sizeof(name));
  7395. return name;
  7396. }
  7397. stock RPFDN(playerid)
  7398. {
  7399. new divname[8];
  7400. if(PlayerInfo[playerid][pFac] == 1)
  7401. {
  7402. if(PlayerInfo[playerid][pFacDiv] == 1) format(divname, sizeof(divname), "%s", FacInfo[1][fDiv1]);
  7403. else if(PlayerInfo[playerid][pFacDiv] == 2) format(divname, sizeof(divname), "%s", FacInfo[1][fDiv2]);
  7404. else if(PlayerInfo[playerid][pFacDiv] == 3) format(divname, sizeof(divname), "%s", FacInfo[1][fDiv3]);
  7405. else if(PlayerInfo[playerid][pFacDiv] == 4) format(divname, sizeof(divname), "%s", FacInfo[1][fDiv4]);
  7406. }
  7407. if(PlayerInfo[playerid][pFacDiv] == 0) format(divname, sizeof(divname), "None");
  7408. return divname;
  7409. }
  7410. stock RPFRN(playerid)
  7411. {
  7412. new rankname[32];
  7413. if(PlayerInfo[playerid][pFacRank] == 0 && PlayerInfo[playerid][pFac] == 0) format(rankname, sizeof(rankname), "Civilian");
  7414. else if(PlayerInfo[playerid][pFac])
  7415. {
  7416. if(PlayerInfo[playerid][pFacRank] == 0) format(rankname, sizeof(rankname), "%s", FacInfo[PlayerInfo[playerid][pFac]][fRank0]);
  7417. else if(PlayerInfo[playerid][pFacRank] == 1) format(rankname, sizeof(rankname), "%s", FacInfo[PlayerInfo[playerid][pFac]][fRank1]);
  7418. else if(PlayerInfo[playerid][pFacRank] == 2) format(rankname, sizeof(rankname), "%s", FacInfo[PlayerInfo[playerid][pFac]][fRank2]);
  7419. else if(PlayerInfo[playerid][pFacRank] == 3) format(rankname, sizeof(rankname), "%s", FacInfo[PlayerInfo[playerid][pFac]][fRank3]);
  7420. else if(PlayerInfo[playerid][pFacRank] == 4) format(rankname, sizeof(rankname), "%s", FacInfo[PlayerInfo[playerid][pFac]][fRank4]);
  7421. else if(PlayerInfo[playerid][pFacRank] == 5) format(rankname, sizeof(rankname), "%s", FacInfo[PlayerInfo[playerid][pFac]][fRank5]);
  7422. else if(PlayerInfo[playerid][pFacRank] == 6) format(rankname, sizeof(rankname), "%s", FacInfo[PlayerInfo[playerid][pFac]][fRank6]);
  7423. }
  7424. return rankname;
  7425. }
  7426. stock RPFN(playerid)
  7427. {
  7428. new facname[32];
  7429. if(PlayerInfo[playerid][pFac] == 0) format(facname, sizeof(facname), "CIV");
  7430. else if(PlayerInfo[playerid][pFac] == 1) format(facname, sizeof(facname), "LSPD Chief");
  7431. else if(PlayerInfo[playerid][pFac] == 2) format(facname, sizeof(facname), "FBI Chief");
  7432. else if(PlayerInfo[playerid][pFac] == 3) format(facname, sizeof(facname), "GOV Chief");
  7433. else if(PlayerInfo[playerid][pFac] == 4) format(facname, sizeof(facname), "Hitman Director");
  7434. else if(PlayerInfo[playerid][pFac] == 5) format(facname, sizeof(facname), "News Chief");
  7435. else if(PlayerInfo[playerid][pFac] == 6) format(facname, sizeof(facname), "LSMD Chief");
  7436. else if(PlayerInfo[playerid][pFac] == 7) format(facname, sizeof(facname), "SS Chief");
  7437. return facname;
  7438. }
  7439.  
  7440. stock RPFNEx(playerid)
  7441. {
  7442. new facname[32];
  7443. if(PlayerInfo[playerid][pFac] == 0) format(facname, sizeof(facname), "Civilian");
  7444. else if(PlayerInfo[playerid][pFac] == 1) format(facname, sizeof(facname), "Los Santos Police Department");
  7445. else if(PlayerInfo[playerid][pFac] == 2) format(facname, sizeof(facname), "FBI");
  7446. else if(PlayerInfo[playerid][pFac] == 3) format(facname, sizeof(facname), "Government");
  7447. else if(PlayerInfo[playerid][pFac] == 4) format(facname, sizeof(facname), "Hitman Agency");
  7448. else if(PlayerInfo[playerid][pFac] == 5) format(facname, sizeof(facname), "News Reporters");
  7449. else if(PlayerInfo[playerid][pFac] == 6) format(facname, sizeof(facname), "Los Santos Medic Department");
  7450. else if(PlayerInfo[playerid][pFac] == 7) format(facname, sizeof(facname), "Secret Service");
  7451. return facname;
  7452. }
  7453. stock IsACop(playerid)
  7454. {
  7455. if(PlayerInfo[playerid][pFac] == 1) return 1;
  7456. return 0;
  7457. }
  7458. stock IsAFBI(playerid)
  7459. {
  7460. if(PlayerInfo[playerid][pFac] == 2) return 1;
  7461. return 0;
  7462. }
  7463. stock IsASS(playerid)
  7464. {
  7465. if(PlayerInfo[playerid][pFac] == 7) return 1;
  7466. return 0;
  7467. }
  7468. stock IsAGov(playerid)
  7469. {
  7470. if(PlayerInfo[playerid][pFac] == 3) return 1;
  7471. return 0;
  7472. }
  7473. stock IsAReporter(playerid)
  7474. {
  7475. if(PlayerInfo[playerid][pFac] == 5) return 1;
  7476. return 0;
  7477. }
  7478. stock IsAMedic(playerid)
  7479. {
  7480. if(PlayerInfo[playerid][pFac] == 6) return 1;
  7481. return 0;
  7482. }
  7483. stock Log(sz_fileName[], sz_input[]) {
  7484.  
  7485. new sz_logEntry[156], i_dateTime[2][3], File: fileHandle = fopen(sz_fileName, io_append);
  7486. gettime(i_dateTime[0][0], i_dateTime[0][1], i_dateTime[0][2]);
  7487. getdate(i_dateTime[1][0], i_dateTime[1][1], i_dateTime[1][2]);
  7488. format(sz_logEntry, sizeof(sz_logEntry), "[%i/%i/%i - %i:%i:%i] %s\r\n", i_dateTime[1][0], i_dateTime[1][1], i_dateTime[1][2], i_dateTime[0][0], i_dateTime[0][1], i_dateTime[0][2], sz_input);
  7489. fwrite(fileHandle, sz_logEntry);
  7490. return fclose(fileHandle);
  7491. }
  7492. /*========================================[TAZER]=============================*/
  7493. stock TogglePlayerTazed(playerid, status)
  7494. {
  7495. Tazed[playerid] = status;
  7496. return 1;
  7497. }
  7498. stock IsPlayerTazed(playerid)
  7499. {
  7500. if(!Tazed[playerid]) return 0;
  7501. if(Tazed[playerid]) return 1;
  7502. return 1;
  7503. }
  7504. /*==================================[CUFFED]==================================*/
  7505. stock TogglePlayerCuffed(playerid, status)
  7506. {
  7507. Cuffed[playerid] = status;
  7508. return 1;
  7509. }
  7510. stock IsPlayerCuffed(playerid)
  7511. {
  7512. if(!Cuffed[playerid]) return 0;
  7513. if(Cuffed[playerid]) return 1;
  7514. return 1;
  7515. }
  7516. /*==================================[TIED]====================================*/
  7517. stock TogglePlayerTied(playerid, status)
  7518. {
  7519. Tied[playerid] = status;
  7520. return 1;
  7521. }
  7522. stock IsPlayerTied(playerid)
  7523. {
  7524. if(!Tied[playerid]) return 0;
  7525. if(Tied[playerid]) return 1;
  7526. return 1;
  7527. }
  7528. /*==============================[LEO Vehicles]================================*/
  7529. stock IsGovVehicle(vehicleid)
  7530. {
  7531. for(new i=0; i<2; i++)
  7532. {
  7533. if(vehicleid == FacInfo[2][fCars][i]) return 1;
  7534. }
  7535. return 0;
  7536. }
  7537. stock IsNewsVehicle(vehicleid)
  7538. {
  7539. for(new i=0; i<8; i++)
  7540. {
  7541. if(vehicleid == FacInfo[4][fCars][i]) return 1;
  7542. }
  7543. return 0;
  7544. }
  7545.  
  7546. stock IsLSPDVehicle(vehicleid)
  7547. {
  7548. for(new i=0; i<26; i++)
  7549. {
  7550. if(vehicleid == FacInfo[1][fCars][i]) return 1;
  7551. }
  7552. return 0;
  7553. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement