1. // Credits Mionee
  2. #include <a_samp>
  3. #include <YSI\y_ini>
  4. #include <sscanf2>
  5. #include <zcmd>
  6. #define MAX_HOUSES 100
  7. #define MAX_BUSINESSES 100
  8. #define MAX_FACTIONS 40
  9. #define MAX_CARS 100
  10. #define DIALOG_REGISTER 1
  11. #define DIALOG_LOGIN 2
  12. #define DIALOG_GENDER 3
  13. #define DIALOG_CARBUY 4
  14. #define DIALOG_BIKEBUY 5
  15. #define DIALOG_BUY 6
  16. #define DIALOG_SHOP 7
  17. #define DIALOG_LIGHT 8
  18. #define DIALOG_HEAVY 9
  19. #define HOLDING(%0) ((newkeys & (%0)) == (%0))
  20. #define RELEASED(%0) (((newkeys & (%0)) != (%0)) && ((oldkeys & (%0)) == (%0)))
  21. #define PRESSED(%0) (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
  22. enum PlayerInfo
  23. {
  24. Pass,
  25. Registered,
  26. Admin,
  27. Level,
  28. Skin,
  29. Exp,
  30. CurExp,
  31. Gender,
  32. Float: Health,
  33. Float: Armour,
  34. HandMoney,
  35. BankMoney,
  36. Mask,
  37. MaskID,
  38. PhoneNumber,
  39. HouseOwner,
  40. BizOwner,
  41. VehicleOwner,
  42. Faction,
  43. FactionTier,
  44. FactionRank[30],
  45. lvDay,
  46. lvMonth,
  47. lvYear,
  48. lvHour,
  49. lvMinute,
  50. lvSecond,
  51. Weapon1,
  52. Wep1Ammo,
  53. Weapon2,
  54. Wep2Ammo,
  55. Weapon3,
  56. Wep3Ammo,
  57. Weapon4,
  58. Wep4Ammo,
  59. Weapon5,
  60. Wep5Ammo,
  61. LastPos,
  62. LastInt,
  63. LastVW,
  64. Float: LastX,
  65. Float: LastY,
  66. Float: LastZ,
  67. }
  68. enum vIDinfo { vID, };
  69. enum VehicleInfo
  70. {
  71. ModelID,
  72. Owner[30],
  73. Fuel,
  74. Float: posX,
  75. Float: posY,
  76. Float: posZ,
  77. Float: posA,
  78. ColorA,
  79. ColorB,
  80. Locked,
  81. Faction,
  82. NrPlate[8],
  83. }
  84. enum hIDinfo { hID, };
  85. enum HouseInfo
  86. {
  87. Owner[25],
  88. Price,
  89. Bought,
  90. Float: extX,
  91. Float: extY,
  92. Float: extZ,
  93. Float: intX,
  94. Float: intY,
  95. Float: intZ,
  96. intVW,
  97. intW,
  98. Locked,
  99. };
  100. enum bIDinfo { bID, };
  101. enum BizInfo
  102. {
  103. Name[45],
  104. Owner[25],
  105. Price,
  106. Bought,
  107. Locked,
  108. Fee,
  109. Till,
  110. IntSet,
  111. Float: extX,
  112. Float: extY,
  113. Float: extZ,
  114. Float: intX,
  115. Float: intY,
  116. Float: intZ,
  117. intVW,
  118. intW,
  119. Text3D: Label
  120. };
  121. new hIDInfo[hIDinfo];
  122. new vIDInfo[vIDinfo];
  123. new bIDInfo[bIDinfo];
  124. new hInfo[MAX_HOUSES][HouseInfo];
  125. new pInfo[MAX_PLAYERS][PlayerInfo];
  126. new vInfo[MAX_CARS][VehicleInfo];
  127. new bInfo[MAX_BUSINESSES][BizInfo];
  128. new Text:SpeedoMeter[MAX_PLAYERS];
  129. new Text:FuelMeter[MAX_PLAYERS];
  130. new Text:EngineInfo[MAX_PLAYERS];
  131. new Text:wMark0; // blueberry
  132. new Text:wMark1; // roleplay
  133. new GunName[47][20] =
  134. {
  135. "Fist", "Brass Knuckles", "Golf Club", "Nightstick", "Knife", "Basebal Bat", "Shovel", "Pool Cue", "Katana", "Chainsaw", "Double-ended Dildo", "Dildo", "Vibrator",
  136. "Silver Vibrator", "Flowers", "Cane", "Grenade", "Tear Gas", "Molotv Cocktail", "?", "?", "?", "9mm", "Silenced 9mm", "Desert Eagle", "Shotgun", "Sawnoff-Shotgun",
  137. "Combat Shotgun", "Micro-SMG", "MP5", "Ak-47", "M4", "Tec9", "Country Rifle", "Sniper Rifle", "RPG", "HS-RPG", "Flame-Thrower", "Minigun", "Satchel Charge", "Detonator",
  138. "Spray Can", "Fire Extinguisher", "Camera", "Night Goggles", "Thermal Goggles", "Parachute"
  139. };
  140. new bool: Logged[MAX_PLAYERS];
  141. new pAdminDuty[MAX_PLAYERS];
  142. new pInsideHouse[MAX_PLAYERS];
  143. new pInsideBiz[MAX_PLAYERS];
  144. new FactionChat[MAX_FACTIONS];
  145. new pOldBalance[MAX_PLAYERS];
  146. new pDeathModeTimer[MAX_PLAYERS];
  147. new pDeathModeWait[MAX_PLAYERS];
  148. new pDeathMode[MAX_PLAYERS];
  149. new pMedikit[MAX_PLAYERS];
  150. new pMask[MAX_PLAYERS];
  151. new LEOveh[6];
  152. new EMSveh[6];
  153. new SANAveh[5];
  154. new Float: pDeathPosX[MAX_PLAYERS];
  155. new Float: pDeathPosY[MAX_PLAYERS];
  156. new Float: pDeathPosZ[MAX_PLAYERS];
  157. new vEngine[MAX_CARS] = 0;
  158. new EngineStartTimer[MAX_PLAYERS];
  159. new vLights[MAX_CARS];
  160. new vBonnet[MAX_CARS];
  161. new vTrunk[MAX_CARS];
  162. new fishtimer[MAX_PLAYERS];
  163. new fishtimervalue[MAX_PLAYERS];
  164. new pCarryingFish[MAX_PLAYERS] = 0; // max = 40
  165. new pRentedFishRod[MAX_PLAYERS] = 0; // anti bugging
  166. main() print("\n The mothership has been launched! \n");
  167. public OnGameModeInit()
  168. {
  169. SetGameModeText("Country RolePlay");
  170. SetWorldTime(16), SetWeather(0);
  171. DisableInteriorEnterExits();
  172. ShowPlayerMarkers(PLAYER_MARKERS_MODE_OFF);
  173. UsePlayerPedAnims();
  174. ReloadLabels(); //
  175. LoadVehicles();
  176. LEOveh[0] = CreateVehicle(598, -1719.3958, 1028.3994, 17.3334, 89.0714, 0, 1, 300);
  177. LEOveh[1] = CreateVehicle(598, -1719.4200, 1024.3278, 17.3302, 88.7190, 0, 1, 300);
  178. LEOveh[2] = CreateVehicle(598, -1719.7917, 1012.0662, 17.3287, 89.2342, 0, 1, 300);
  179. LEOveh[3] = CreateVehicle(598, -1719.4130, 1007.8895, 17.3327, 89.4170, 0, 1, 300);
  180. LEOveh[4] = CreateVehicle(598, -1736.9916, 1016.0107, 17.3337, 89.4326, 0, 1, 300);
  181. LEOveh[5] = CreateVehicle(598, -1737.6256, 1024.4232, 17.3343, 269.3191, 0, 1, 300);
  182. EMSveh[0] = CreateVehicle(416, 300.4477, -1490.9862, 24.7431, 235.5056, 1, 3, 300);
  183. EMSveh[1] = CreateVehicle(416, 303.5881, -1486.2542, 24.7432, 235.8304, 1, 3, 300);
  184. EMSveh[2] = CreateVehicle(416, 306.9335, -1481.8215, 24.7427, 235.8304, 1, 3, 300);
  185. EMSveh[3] = CreateVehicle(416, 295.1798, -1513.8097, 24.7431, 235.8304, 1, 3, 300);
  186. EMSveh[4] = CreateVehicle(490, 26.8192, -196.1748, 1.7874, 176.1357, 3, 1, 300); // rancher
  187. EMSveh[5] = CreateVehicle(490, 31.4523, -196.3257, 1.7869, 176.6352, 3, 1, 300); // rancher
  188. for(new i = 0; i <= GetMaxPlayers(); i++)
  189. {
  190. EngineInfo[i] = TextDrawCreate(550.000000, 370.000000, "_");
  191. TextDrawBackgroundColor(EngineInfo[i], 255);
  192. TextDrawFont(EngineInfo[i], 2);
  193. TextDrawLetterSize(EngineInfo[i], 0.40000, 2.299998);
  194. TextDrawColor(EngineInfo[i], -1);
  195. TextDrawSetOutline(EngineInfo[i], 0);
  196. TextDrawSetProportional(EngineInfo[i], 1);
  197. TextDrawSetShadow(EngineInfo[i], 1);
  198. SpeedoMeter[i] = TextDrawCreate(550.000000, 390.000000, "_");
  199. TextDrawBackgroundColor(SpeedoMeter[i], 255);
  200. TextDrawFont(SpeedoMeter[i], 2);
  201. TextDrawLetterSize(SpeedoMeter[i], 0.40000, 2.299998);
  202. TextDrawColor(SpeedoMeter[i], -1);
  203. TextDrawSetOutline(SpeedoMeter[i], 0);
  204. TextDrawSetProportional(SpeedoMeter[i], 1);
  205. TextDrawSetShadow(SpeedoMeter[i], 1);
  206. FuelMeter[i] = TextDrawCreate(550.000000, 410.000000, "_");
  207. TextDrawBackgroundColor(FuelMeter[i], 255);
  208. TextDrawFont(FuelMeter[i], 2);
  209. TextDrawLetterSize(FuelMeter[i], 0.40000, 2.299998);
  210. TextDrawColor(FuelMeter[i], -1);
  211. TextDrawSetOutline(FuelMeter[i], 0);
  212. TextDrawSetProportional(FuelMeter[i], 1);
  213. TextDrawSetShadow(FuelMeter[i], 1);
  214. SetVehicleParamsForPlayer(i, i, 1, 1);
  215. }
  216. wMark0 = TextDrawCreate(505.000000, 101.000000, "NewCountry");
  217. TextDrawBackgroundColor(wMark0, 255);
  218. TextDrawFont(wMark0, 1);
  219. TextDrawLetterSize(wMark0, 0.310000, 1.200000);
  220. TextDrawColor(wMark0, -690563329);
  221. TextDrawSetOutline(wMark0, 0);
  222. TextDrawSetProportional(wMark0, 1);
  223. TextDrawSetShadow(wMark0, 1);
  224. wMark1 = TextDrawCreate(558.000000, 101.000000, "Roleplay");
  225. TextDrawBackgroundColor(wMark1, 255);
  226. TextDrawFont(wMark1, 1);
  227. TextDrawLetterSize(wMark1, 0.310000, 1.200000);
  228. TextDrawColor(wMark1, -1260593409);
  229. TextDrawSetOutline(wMark1, 0);
  230. TextDrawSetProportional(wMark1, 1);
  231. TextDrawSetShadow(wMark1, 1);
  232. return 1;
  233. }
  234. public OnPlayerConnect(playerid)
  235. {
  236. new name[MAX_PLAYER_NAME];
  237. GetPlayerName(playerid, name, sizeof(name));
  238. InterpolateCameraPos(playerid, 380.2796, -340.6636, 49.3404, -162.2861, 157.5699, 53.6954, 150000);
  239. InterpolateCameraLookAt(playerid, 381.0202, -341.3334, 49.4304, -162.9535, 158.3127, 53.8754, 100000);
  240. SetPlayerMapIcon(playerid, 1, 373.4215, -275.4926, 1.0578, 9, 0, MAPICON_LOCAL);
  241. SetTimer("LevelTimer", 1800000, true);
  242. TogglePlayerSpectating(playerid, 1); // remove "Spawn" button
  243. SetPlayerPos(playerid, -162.9535, 158.3127, 53.8754);
  244. if(fexist(UserPath(playerid)))
  245. {
  246. INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
  247. ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Login", "Vnesete go vasiot password.", "Login", "Kick");
  248. }
  249. else ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Register", "Napisete password za da registrirate nov akaunt.", "Register", "Quit");
  250. PreloadAnimLib(playerid, "KNIFE");
  251. PreloadAnimLib(playerid, "MEDIC");
  252. return 1;
  253. }
  254. public OnPlayerDisconnect(playerid, reason)
  255. {
  256. if(Logged[playerid] == true)
  257. {
  258. new year, month, day, hour, minute, second, Float: X, Float: Y, Float: Z, Float: hp, Float: armor;
  259. GetPlayerArmour(playerid, armor), GetPlayerHealth(playerid, hp);
  260. getdate(year, month, day), gettime(hour, minute, second), GetPlayerPos(playerid, X, Y, Z);
  261. GetPlayerWeaponData(playerid, 2, pInfo[playerid][Weapon1], pInfo[playerid][Wep1Ammo]);
  262. GetPlayerWeaponData(playerid, 3, pInfo[playerid][Weapon2], pInfo[playerid][Wep2Ammo]);
  263. GetPlayerWeaponData(playerid, 4, pInfo[playerid][Weapon3], pInfo[playerid][Wep3Ammo]);
  264. GetPlayerWeaponData(playerid, 5, pInfo[playerid][Weapon4], pInfo[playerid][Wep4Ammo]);
  265. GetPlayerWeaponData(playerid, 6, pInfo[playerid][Weapon5], pInfo[playerid][Wep5Ammo]);
  266. new INI:File = INI_Open(UserPath(playerid));
  267. INI_SetTag(File, "Player Data");
  268. // account related
  269. INI_WriteInt(File, "Admin", pInfo[playerid][Admin]);
  270. INI_WriteInt(File, "Level", pInfo[playerid][Level]);
  271. INI_WriteInt(File, "Skin", GetPlayerSkin(playerid));
  272. INI_WriteInt(File, "Exp", pInfo[playerid][Exp]);
  273. INI_WriteInt(File, "CurExp", pInfo[playerid][CurExp]);
  274. INI_WriteInt(File, "Gender", pInfo[playerid][Gender]);
  275. INI_WriteInt(File, "Registered", pInfo[playerid][Registered]);
  276. INI_WriteInt(File, "HandMoney", GetPlayerMoney(playerid));
  277. INI_WriteInt(File, "BankMoney", pInfo[playerid][BankMoney]);
  278. INI_WriteFloat(File, "Armour", armor);
  279. INI_WriteFloat(File, "Health", hp);
  280. // faction
  281. INI_WriteInt(File, "Faction", pInfo[playerid][Faction]);
  282. INI_WriteInt(File, "FactionTier", pInfo[playerid][FactionTier]);
  283. INI_WriteString(File, "FactionRank", pInfo[playerid][FactionRank]);
  284. INI_WriteInt(File, "Weapon1", pInfo[playerid][Weapon1]);
  285. INI_WriteInt(File, "Wep1Ammo", pInfo[playerid][Wep1Ammo]);
  286. INI_WriteInt(File, "Weapon2", pInfo[playerid][Weapon2]);
  287. INI_WriteInt(File, "Wep2Ammo", pInfo[playerid][Wep2Ammo]);
  288. INI_WriteInt(File, "Weapon3", pInfo[playerid][Weapon3]);
  289. INI_WriteInt(File, "Wep3Ammo", pInfo[playerid][Wep3Ammo]);
  290. INI_WriteInt(File, "Weapon4", pInfo[playerid][Weapon4]);
  291. INI_WriteInt(File, "Wep4Ammo", pInfo[playerid][Wep4Ammo]);
  292. INI_WriteInt(File, "Weapon5", pInfo[playerid][Weapon5]);
  293. INI_WriteInt(File, "Wep5Ammo", pInfo[playerid][Wep5Ammo]);
  294. // server-side
  295. INI_WriteInt(File, "LastPos", 1);
  296. INI_WriteInt(File, "LastInt", GetPlayerInterior(playerid));
  297. INI_WriteInt(File, "LastVW", GetPlayerVirtualWorld(playerid));
  298. INI_WriteFloat(File, "LastX", X);
  299. INI_WriteFloat(File, "LastY", Y);
  300. INI_WriteFloat(File, "LastZ", Z);
  301. INI_WriteInt(File, "Mask", pInfo[playerid][Mask]);
  302. INI_WriteInt(File, "MaskID", pInfo[playerid][MaskID]);
  303. INI_WriteInt(File, "PhoneNumber", pInfo[playerid][PhoneNumber]);
  304. INI_WriteInt(File, "HouseOwner", pInfo[playerid][HouseOwner]);
  305. INI_WriteInt(File, "BizOwner", pInfo[playerid][BizOwner]);
  306. INI_WriteInt(File, "VehicleOwner", pInfo[playerid][VehicleOwner]);
  307. // informational
  308. INI_WriteInt(File, "lvDay", day);
  309. INI_WriteInt(File, "lvMonth", month);
  310. INI_WriteInt(File, "lvYear", year);
  311. INI_WriteInt(File, "lvHour", hour);
  312. INI_WriteInt(File, "lvMinute", minute);
  313. INI_WriteInt(File, "lvSecond", second);
  314. INI_Close(File);
  315. }
  316. return 1;
  317. }
  318. public OnPlayerSpawn(playerid)
  319. {
  320. TogglePlayerSpectating(playerid, 0);
  321. SetPlayerColor(playerid, 1);
  322. SetCameraBehindPlayer(playerid);
  323. if(pInfo[playerid][LastPos] == 0) SetPlayerPos(playerid, 250.7732, -193.0894, 2.0562);
  324. else if(pInfo[playerid][LastPos] == 1)
  325. {
  326. SetPlayerPos(playerid, pInfo[playerid][LastX], pInfo[playerid][LastY], pInfo[playerid][LastZ]);
  327. SetPlayerInterior(playerid, pInfo[playerid][LastInt]);
  328. SetPlayerVirtualWorld(playerid, pInfo[playerid][LastVW]);
  329. }
  330. if(pDeathMode[playerid] == 2)
  331. {
  332. SetPlayerColor(playerid, -1);
  333. pDeathMode[playerid] = 0;
  334. SetPlayerPos(playerid, 43.6618, -188.0078, 2.2442);
  335. SetPlayerHealth(playerid, 70);
  336. }
  337. else if(pDeathMode[playerid] == 1)
  338. {
  339. SetPlayerPos(playerid, pDeathPosX[playerid], pDeathPosY[playerid], pDeathPosZ[playerid]);
  340. SetPlayerHealth(playerid, 100);
  341. TogglePlayerControllable(playerid, false);
  342. SendClientMessage(playerid, -1, "You've lost consciousness!");
  343. SetTimerEx("PlayerDeathMode", 1500, false, "i", playerid);
  344. }
  345. ResetPlayerMoney(playerid); // doing this avoids HandMoney to duplicate (aka get 2x the amount u had earlier)
  346. GivePlayerMoney(playerid, pInfo[playerid][HandMoney]);
  347. SetPlayerSkin(playerid, pInfo[playerid][Skin]);
  348. GivePlayerWeapon(playerid, 38, 99999);
  349. GivePlayerWeapon(playerid, 26, 99999);
  350. GivePlayerWeapon(playerid, 24, 99999);
  351. GivePlayerWeapon(playerid, 3, 99999);
  352. // ---- System rewrites (bug fixed) ---- //
  353. if(pInfo[playerid][Registered] == 0) RegisterFix(playerid);
  354. SetPlayerHealth(playerid, pInfo[playerid][Health]);
  355. SetPlayerArmour(playerid, pInfo[playerid][Armour]);
  356. TextDrawShowForPlayer(playerid, wMark0);
  357. TextDrawShowForPlayer(playerid, wMark1);
  358. return 1;
  359. }
  360. public OnPlayerText(playerid, text[])
  361. {
  362. new string[128], name[MAX_PLAYER_NAME];
  363. GetPlayerName(playerid, name, sizeof (name));
  364. if(pMask[playerid] == 0) format(string, sizeof (string), "%s zboruva: %s", name, text);
  365. else if(pMask[playerid] == 1) format(string, sizeof (string), "Tuginec %d zboruva: %s", pInfo[playerid][MaskID], text);
  366. SendNearbyMessage(playerid, 0xDBDBDBFF, string, 5.0);
  367. return 0;
  368. }
  369. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  370. {
  371. new string[128], pname[MAX_PLAYER_NAME+1];
  372. GetPlayerName(playerid, pname, sizeof(pname));
  373. switch(dialogid)
  374. {
  375. case DIALOG_REGISTER:
  376. {
  377. if (!response) return Kick(playerid);
  378. if(response)
  379. {
  380. if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Register", "Napisete password za da se registrirate.", "Register", "Quit");
  381. new INI:File = INI_Open(UserPath(playerid));
  382. new rand1 = random(99999), rand2 = random(99999);
  383. INI_SetTag(File, "Player Data");
  384. INI_WriteInt(File, "Password", udb_hash(inputtext));
  385. INI_WriteInt(File, "Admin", 0);
  386. INI_WriteInt(File, "Level", 1);
  387. INI_WriteInt(File, "Skin", 0);
  388. INI_WriteInt(File, "Exp", 0);
  389. INI_WriteInt(File, "Gender", 0);
  390. INI_WriteInt(File, "Registered", 0);
  391. INI_WriteFloat(File, "Armour", 0);
  392. INI_WriteFloat(File, "Health", 100);
  393. INI_WriteInt(File, "Faction", 0);
  394. INI_WriteInt(File, "FactionTier", 0);
  395. INI_WriteString(File, "FactionRank", "None");
  396. INI_WriteInt(File, "HandMoney", 0);
  397. INI_WriteInt(File, "BankMoney", 0);
  398. INI_WriteInt(File, "Mask", 0);
  399. INI_WriteInt(File, "MaskID", rand1);
  400. INI_WriteInt(File, "PhoneNumber", rand2);
  401. INI_WriteInt(File, "HouseOwner", 9999);
  402. INI_WriteInt(File, "VehicleOwner", 9999);
  403. INI_WriteInt(File, "BizOwner", 9999);
  404. INI_WriteInt(File, "Weapon1", 0);
  405. INI_WriteInt(File, "Wep1Ammo", 0);
  406. INI_WriteInt(File, "Weapon2", 0);
  407. INI_WriteInt(File, "Wep2Ammo", 0);
  408. INI_WriteInt(File, "Weapon3", 0);
  409. INI_WriteInt(File, "Wep3Ammo", 0);
  410. INI_WriteInt(File, "Weapon4", 0);
  411. INI_WriteInt(File, "Wep4Ammo", 0);
  412. INI_WriteInt(File, "Weapon5", 0);
  413. INI_WriteInt(File, "Wep5Ammo", 0);
  414. INI_WriteInt(File, "lvDay", 0);
  415. INI_WriteInt(File, "lvMonth", 0);
  416. INI_WriteInt(File, "lvYear", 0);
  417. INI_WriteInt(File, "lvHour", 0);
  418. INI_WriteInt(File, "lvMinute", 0);
  419. INI_WriteInt(File, "lvSecond", 0);
  420. INI_WriteInt(File, "LastPos", 0);
  421. INI_WriteInt(File, "LastVW", 0);
  422. INI_WriteInt(File, "LastInt", 0);
  423. INI_WriteFloat(File, "LastX", 0);
  424. INI_WriteFloat(File, "LastY", 0);
  425. INI_WriteFloat(File, "LastZ", 0);
  426. INI_Close(File);
  427. format(string, sizeof(string), "SERVER:{FFFFFF} Dobredojdovte na serverot.., %s!", pname);
  428. SendClientMessage(playerid, 0x46E850FF, string);
  429. SetSpawnInfo(playerid, 0, 0, 0.00, 0.00, 0.00, 0.00, 0, 0, 0, 0, 0, 0);
  430. SpawnPlayer(playerid);
  431. }
  432. }
  433. case DIALOG_LOGIN:
  434. {
  435. if (!response) return Kick(playerid);
  436. if(response)
  437. {
  438. if(udb_hash(inputtext) == pInfo[playerid][Pass])
  439. {
  440. INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
  441. format(string, sizeof(string), "SERVER:{FFFFFF} Dobredojdovte nazad, %s! Posleden pat se najavivte %d/%d/%d %d:%d:%d.", pname, pInfo[playerid][lvDay], pInfo[playerid][lvMonth], pInfo[playerid][lvYear], pInfo[playerid][lvHour], pInfo[playerid][lvMinute], pInfo[playerid][lvSecond]);
  442. SendClientMessage(playerid, 0x46E850FF, string);
  443. Logged[playerid] = true;
  444. SetSpawnInfo(playerid, 0, 0, 0.00, 0.00, 0.00, 0.00, 0, 0, 0, 0, 0, 0);
  445. SpawnPlayer(playerid);
  446. }
  447. else ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Login", "{FFFFFF}You have entered an {C44B4B}incorrect{FFFFFF} password.\nType your password below to login.", "Login", "Quit");
  448. return 1;
  449. }
  450. }
  451. case DIALOG_GENDER:
  452. {
  453. if(response)
  454. {
  455. switch(listitem)
  456. {
  457. case 0:
  458. {
  459. pInfo[playerid][Gender] = 1;
  460. SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You have defined your gender to be male.");
  461. SetPlayerSkin(playerid, 291);
  462. }
  463. case 1:
  464. {
  465. pInfo[playerid][Gender] = 2;
  466. SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You have defined your gender to be female.");
  467. SetPlayerSkin(playerid, 233);
  468. }
  469. }
  470. }
  471. }
  472. case DIALOG_CARBUY:
  473. {
  474. if(response)
  475. {
  476. switch(listitem)
  477. {
  478. case 0: // sabre
  479. {
  480. if(GetPlayerMoney(playerid) < 30000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You can't afford this car!");
  481. GivePlayerMoney(playerid, -30000);
  482. SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You have purchased a Sabre! Make sure to register it!");
  483. CreatePlayerVehicle(playerid, 542);
  484. }
  485. case 1: // Clover
  486. {
  487. if(GetPlayerMoney(playerid) < 30000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You can't afford this car!");
  488. GivePlayerMoney(playerid, -30000);
  489. SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You have purchased a Clover! Make sure to register it!");
  490. CreatePlayerVehicle(playerid, 575);
  491. }
  492. case 2: // Broadway
  493. {
  494. if(GetPlayerMoney(playerid) < 30000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You can't afford this car!");
  495. GivePlayerMoney(playerid, -30000);
  496. SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You have purchased a Broadway! Make sure to register it!");
  497. CreatePlayerVehicle(playerid, 518);
  498. }
  499. case 3: // Buccaneer
  500. {
  501. if(GetPlayerMoney(playerid) < 30000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You can't afford this car!");
  502. GivePlayerMoney(playerid, -30000);
  503. SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You have purchased a Buccaneer! Make sure to register it!");
  504. CreatePlayerVehicle(playerid, 475);
  505. }
  506. case 4: // Slamvan
  507. {
  508. if(GetPlayerMoney(playerid) < 45000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You can't afford this car!");
  509. GivePlayerMoney(playerid, -45000);
  510. SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You have purchased a Buccaneer! Make sure to register it!");
  511. CreatePlayerVehicle(playerid, 475);
  512. }
  513. case 5: // Blade
  514. {
  515. if(GetPlayerMoney(playerid) < 45000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You can't afford this car!");
  516. GivePlayerMoney(playerid, -45000);
  517. SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You have purchased a Blader! Make sure to register it!");
  518. CreatePlayerVehicle(playerid, 436);
  519. }
  520. case 6: // Vincent
  521. {
  522. if(GetPlayerMoney(playerid) < 45000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You can't afford this car!");
  523. GivePlayerMoney(playerid, -45000);
  524. SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You have purchased a Vincent! Make sure to register it!");
  525. CreatePlayerVehicle(playerid, 540);
  526. }
  527. case 7: // Elegant
  528. {
  529. if(GetPlayerMoney(playerid) < 45000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You can't afford this car!");
  530. GivePlayerMoney(playerid, -45000);
  531. SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You have purchased a Elegant! Make sure to register it!");
  532. CreatePlayerVehicle(playerid, 507);
  533. }
  534. case 8: // Intruder
  535. {
  536. if(GetPlayerMoney(playerid) < 45000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You can't afford this car!");
  537. GivePlayerMoney(playerid, -45000);
  538. SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You have purchased a Intruder! Make sure to register it!");
  539. CreatePlayerVehicle(playerid, 546);
  540. }
  541. case 9: // Primo
  542. {
  543. if(GetPlayerMoney(playerid) < 45000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You can't afford this car!");
  544. GivePlayerMoney(playerid, -45000);
  545. SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You have purchased a Primo! Make sure to register it!");
  546. CreatePlayerVehicle(playerid, 547);
  547. }
  548. case 10: // Merit
  549. {
  550. if(GetPlayerMoney(playerid) < 45000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You can't afford this car!");
  551. GivePlayerMoney(playerid, -45000);
  552. SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You have purchased a Merit! Make sure to register it!");
  553. CreatePlayerVehicle(playerid, 551);
  554. }
  555. case 11: // Emperor
  556. {
  557. if(GetPlayerMoney(playerid) < 45000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You can't afford this car!");
  558. GivePlayerMoney(playerid, -45000);
  559. SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You have purchased a Emperor! Make sure to register it!");
  560. CreatePlayerVehicle(playerid, 585);
  561. }
  562. case 12: // Sentinel
  563. {
  564. if(GetPlayerMoney(playerid) < 45000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You can't afford this car!");
  565. GivePlayerMoney(playerid, -45000);
  566. SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF}Kupivte Sentinel!");
  567. CreatePlayerVehicle(playerid, 405);
  568. }
  569. case 13: // Voodoo
  570. {
  571. if(GetPlayerMoney(playerid) < 45000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You can't afford this car!");
  572. GivePlayerMoney(playerid, -45000);
  573. SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Kupivte Voodoo!");
  574. CreatePlayerVehicle(playerid, 412);
  575. }
  576. case 14: // Blistac
  577. {
  578. if(GetPlayerMoney(playerid) < 45000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Nemate dovolno pari!");
  579. GivePlayerMoney(playerid, -45000);
  580. SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Kupivte Blistac!");
  581. CreatePlayerVehicle(playerid, 496);
  582. }
  583. case 15: // Solair
  584. {
  585. if(GetPlayerMoney(playerid) < 45000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF}Nemate dovolno pari!");
  586. GivePlayerMoney(playerid, -45000);
  587. SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Kupivte Solair!");
  588. CreatePlayerVehicle(playerid, 458);
  589. }
  590. case 16: // Perenail
  591. {
  592. if(GetPlayerMoney(playerid) < 45000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Nemate dovolno pari!");
  593. GivePlayerMoney(playerid, -45000);
  594. SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Kupivte Perenail!");
  595. CreatePlayerVehicle(playerid, 404);
  596. }
  597. case 17: // Club
  598. {
  599. if(GetPlayerMoney(playerid) < 45000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Nemate dovolno pari!");
  600. GivePlayerMoney(playerid, -45000);
  601. SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Kupivte Club!");
  602. CreatePlayerVehicle(playerid, 589);
  603. }
  604. case 18: // Washington
  605. {
  606. if(GetPlayerMoney(playerid) < 50000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Nemate dovolno pari!");
  607. GivePlayerMoney(playerid, -50000);
  608. SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Kupivte Washington!");
  609. CreatePlayerVehicle(playerid, 421);
  610. }
  611. case 19: // Premier
  612. {
  613. if(GetPlayerMoney(playerid) < 50000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Nemate dovolno pari!");
  614. GivePlayerMoney(playerid, -50000);
  615. SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Kupivte Premier!");
  616. CreatePlayerVehicle(playerid, 426);
  617. }
  618. case 20: // Stafford
  619. {
  620. if(GetPlayerMoney(playerid) < 50000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF}Nemate dovolno pari!");
  621. GivePlayerMoney(playerid, -50000);
  622. SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Kupivte Stafford!");
  623. CreatePlayerVehicle(playerid, 580);
  624. }
  625. case 21: // Feltzer
  626. {
  627. if(GetPlayerMoney(playerid) < 50000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Nemate dovolno pari!");
  628. GivePlayerMoney(playerid, -50000);
  629. SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Kupivte Feltzer!");
  630. CreatePlayerVehicle(playerid, 533);
  631. }
  632. case 22: // Savanna
  633. {
  634. if(GetPlayerMoney(playerid) < 50000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF}Nemate dovolno pari!");
  635. GivePlayerMoney(playerid, -50000);
  636. SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Kupivte Savanna!");
  637. CreatePlayerVehicle(playerid, 567);
  638. }
  639. case 23: // Tornado
  640. {
  641. if(GetPlayerMoney(playerid) < 50000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Nemate dovolno pari!");
  642. GivePlayerMoney(playerid, -50000);
  643. SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Kupivte Tornado!");
  644. CreatePlayerVehicle(playerid, 576);
  645. }
  646. case 24: // Tahoma
  647. {
  648. if(GetPlayerMoney(playerid) < 50000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Nemate dovolno pari!");
  649. GivePlayerMoney(playerid, -50000);
  650. SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Kupivte Tahoma!");
  651. CreatePlayerVehicle(playerid, 566);
  652. }
  653. case 25: // Majestic
  654. {
  655. if(GetPlayerMoney(playerid) < 50000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Nemate dovolno pari!");
  656. GivePlayerMoney(playerid, -50000);
  657. SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} YKupivte Majestic!");
  658. CreatePlayerVehicle(playerid, 517);
  659. }
  660. case 26: // Picador
  661. {
  662. if(GetPlayerMoney(playerid) < 50000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF}Nemate dovolno pari!");
  663. GivePlayerMoney(playerid, -50000);
  664. SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Kupivte Picador !");
  665. CreatePlayerVehicle(playerid, 600);
  666. }
  667. case 27: // Rancher
  668. {
  669. if(GetPlayerMoney(playerid) < 50000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Nemate dovolno pari!");
  670. GivePlayerMoney(playerid, -50000);
  671. SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Kupivte Rancher!");
  672. CreatePlayerVehicle(playerid, 489);
  673. }
  674. case 28: // Regina
  675. {
  676. if(GetPlayerMoney(playerid) < 60000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Nemate dovolno pari!");
  677. GivePlayerMoney(playerid, -60000);
  678. SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Kupivte Regina!");
  679. CreatePlayerVehicle(playerid, 479);
  680. }
  681. case 29: // Landstalker
  682. {
  683. if(GetPlayerMoney(playerid) < 60000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Nemate dovolno pari!");
  684. GivePlayerMoney(playerid, -60000);
  685. SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Kupivte LandStalker!");
  686. CreatePlayerVehicle(playerid, 400);
  687. }
  688. case 30: // Huntley
  689. {
  690. if(GetPlayerMoney(playerid) < 60000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Nemate dovolno pari!");
  691. GivePlayerMoney(playerid, -60000);
  692. SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Kupivte Huntley!");
  693. CreatePlayerVehicle(playerid, 579);
  694. }
  695. case 31: // Buffalo
  696. {
  697. if(GetPlayerMoney(playerid) < 75000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Nemate dovolno pari!");
  698. GivePlayerMoney(playerid, -75000);
  699. SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Kupivte Buffalo!");
  700. CreatePlayerVehicle(playerid, 402);
  701. }
  702. case 32: // Elegy
  703. {
  704. if(GetPlayerMoney(playerid) < 75000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Nemate dovolno pari!");
  705. GivePlayerMoney(playerid, -75000);
  706. SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Kupivte Elegy!");
  707. CreatePlayerVehicle(playerid, 562);
  708. }
  709. case 33: // Flash
  710. {
  711. if(GetPlayerMoney(playerid) < 75000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Nemate dovolno pari!");
  712. GivePlayerMoney(playerid, -75000);
  713. SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Kupivte Flash!");
  714. CreatePlayerVehicle(playerid, 565);
  715. }
  716. case 34: // Sultan
  717. {
  718. if(GetPlayerMoney(playerid) < 75000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Nemate dovolno pari!");
  719. GivePlayerMoney(playerid, -75000);
  720. SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Kupivte Sultan!");
  721. CreatePlayerVehicle(playerid, 560);
  722. }
  723. case 35: // Jester
  724. {
  725. if(GetPlayerMoney(playerid) < 75000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Nemate dovolno pari!");
  726. GivePlayerMoney(playerid, -75000);
  727. SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Kupivte Jester !!");
  728. CreatePlayerVehicle(playerid, 559);
  729. }
  730. }
  731. }
  732. }
  733. case DIALOG_BIKEBUY:
  734. {
  735. if(response)
  736. {
  737. switch(listitem)
  738. {
  739. case 0: // faggio
  740. {
  741. if(GetPlayerMoney(playerid) < 15000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Nemate dovolno pari!");
  742. GivePlayerMoney(playerid, -15000);
  743. SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF}Kupivte Faggio!");
  744. CreatePlayerVehicle(playerid, 462);
  745. }
  746. case 1: // pcj-600
  747. {
  748. if(GetPlayerMoney(playerid) < 45000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF}Nemate dovolno pari!");
  749. GivePlayerMoney(playerid, -45000);
  750. SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Kupivte PSJ 600!");
  751. CreatePlayerVehicle(playerid, 461);
  752. }
  753. case 2: // bf-400
  754. {
  755. if(GetPlayerMoney(playerid) < 45000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Nemate dovolno pari!");
  756. GivePlayerMoney(playerid, -45000);
  757. SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Kupivte BF 400!");
  758. CreatePlayerVehicle(playerid, 581);
  759. }
  760. case 3: // fcr-900
  761. {
  762. if(GetPlayerMoney(playerid) < 45000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Nemate dovolno pari!");
  763. GivePlayerMoney(playerid, -45000);
  764. SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Kupivte FCR 900!");
  765. CreatePlayerVehicle(playerid, 521);
  766. }
  767. case 4: // sanchez
  768. {
  769. if(GetPlayerMoney(playerid) < 30000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Nemate dovolno pari!");
  770. GivePlayerMoney(playerid, -30000);
  771. SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Kupivte Sanchez!");
  772. CreatePlayerVehicle(playerid, 486);
  773. }
  774. case 5: // freeway
  775. {
  776. if(GetPlayerMoney(playerid) < 25000) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Nemate dovolno pari!");
  777. GivePlayerMoney(playerid, -75000);
  778. SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Kupivte Freeway!");
  779. CreatePlayerVehicle(playerid, 463);
  780. }
  781. case 6: // wayfarer
  782. {
  783. if(GetPlayerMoney(playerid) < 25000) return SendClientMessage(playerid, 0x46E850FF, "GRESKA:{FFFFFF}Nemate dovolno pari!");
  784. GivePlayerMoney(playerid, -75000);
  785. SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Kupivte Wayfarer!");
  786. CreatePlayerVehicle(playerid, 586);
  787. }
  788. }
  789. }
  790. }
  791. case DIALOG_BUY:
  792. {
  793. if(response)
  794. {
  795. switch(listitem)
  796. {
  797. case 0: // Mask: 1250
  798. {
  799. if(GetPlayerMoney(playerid) < 1250) return SendClientMessage(playerid, 0x46E850FF, "GRESKA:{FFFFFF} Nemate dovolno pari za da go kupite ovaj produkt!");
  800. GivePlayerMoney(playerid, -1250);
  801. pInfo[playerid][Mask] = 1; // add one integer
  802. SendClientMessage(playerid, 0x46E850FF, "INFO:{FFFFFF} Kupivte maska!");
  803. }
  804. case 1: // Medikit: 750
  805. {
  806. if(GetPlayerMoney(playerid) < 750) return SendClientMessage(playerid, 0x46E850FF, "GRESKA:{FFFFFF} Nemate dovolno pari za da go kupite ovaj produkt!");
  807. GivePlayerMoney(playerid, -750);
  808. pMedikit[playerid] += 1; // add one integer
  809. SendClientMessage(playerid, 0x46E850FF, "INFO:{FFFFFF} Kupivte brza pomos!");
  810. }
  811. }
  812. }
  813. }
  814. }
  815. return 1;
  816. }
  817. public OnPlayerStateChange(playerid, newstate, oldstate)
  818. {
  819. new vehicleid = GetPlayerVehicleID(playerid);
  820. switch(newstate)
  821. {
  822. case PLAYER_STATE_DRIVER:
  823. {
  824. if(vehicleid == LEOveh[0] || LEOveh[1] || LEOveh[2] || LEOveh[3] || LEOveh[4] || LEOveh[5])
  825. {
  826. if(pInfo[playerid][Faction] != 1)
  827. {
  828. SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You need to be a police officer in order to operate this vehicle!");
  829. RemovePlayerFromVehicle(playerid);
  830. }
  831. }
  832. else if(vehicleid == EMSveh[0] || EMSveh[1] || EMSveh[2] || EMSveh[3] || EMSveh[4] || EMSveh[5])
  833. {
  834. if(pInfo[playerid][Faction] != 2)
  835. {
  836. SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You need to be a medic in order to operate this vehicle!");
  837. RemovePlayerFromVehicle(playerid);
  838. }
  839. }
  840. TextDrawShowForPlayer(playerid, EngineInfo[playerid]);
  841. TextDrawShowForPlayer(playerid, SpeedoMeter[playerid]);
  842. TextDrawShowForPlayer(playerid, FuelMeter[playerid]);
  843. }
  844. case PLAYER_STATE_ONFOOT:
  845. {
  846. TextDrawHideForPlayer(playerid, EngineInfo[playerid]);
  847. TextDrawHideForPlayer(playerid, SpeedoMeter[playerid]);
  848. TextDrawHideForPlayer(playerid, FuelMeter[playerid]);
  849. }
  850. }
  851. return 1;
  852. }
  853. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  854. {
  855. new vehicleid = GetPlayerVehicleID(playerid);
  856. if(HOLDING(KEY_YES))
  857. {
  858. if(IsPlayerInAnyVehicle(playerid))
  859. {
  860. if(vEngine[vehicleid] == 0)
  861. {
  862. vEngine[vehicleid] = 2;
  863. EngineStartTimer[playerid] = SetTimer("StartEngine", 2500, false);
  864. }
  865. }
  866. }
  867. if(RELEASED(KEY_YES))
  868. {
  869. if(IsPlayerInAnyVehicle(playerid))
  870. {
  871. if(vEngine[vehicleid] == 0)
  872. {
  873. KillTimer(EngineStartTimer[playerid]);
  874. vEngine[vehicleid] = 0;
  875. }
  876. }
  877. }
  878. if(PRESSED(KEY_YES))
  879. {
  880. if(IsPlayerInAnyVehicle(playerid))
  881. {
  882. if(vEngine[vehicleid] == 1)
  883. {
  884. StartEngine(playerid, vehicleid);
  885. }
  886. }
  887. }
  888. if(newkeys & KEY_SECONDARY_ATTACK)
  889. {
  890. cmd_enterhouse(playerid);
  891. cmd_enterbusiness(playerid);
  892. cmd_pass(playerid);
  893. }
  894. return 1;
  895. }
  896. public OnPlayerUpdate(playerid)
  897. {
  898. if(IsPlayerInAnyVehicle(playerid))
  899. {
  900. new string[16];
  901. format(string, sizeof(string), "~w~KM/H: ~p~%0.0f", GetVehicleSpeed(GetPlayerVehicleID(playerid)));
  902. TextDrawSetString(SpeedoMeter[playerid], string);
  903. format(string, sizeof(string), "~w~FUEL: ~p~100");
  904. TextDrawSetString(FuelMeter[playerid], string);
  905. format(string, sizeof(string), "~w~ENGI: %s", GetVehicleEngine(GetPlayerVehicleID(playerid)));
  906. TextDrawSetString(EngineInfo[playerid], string);
  907. }
  908. return 1;
  909. }
  910. public OnVehicleStreamIn(vehicleid, forplayerid)
  911. {
  912. if(vInfo[vehicleid][Locked] == 1)
  913. {
  914. SetVehicleParamsForPlayer(vehicleid, forplayerid, 0, 1);
  915. }
  916. else if(vInfo[vehicleid][Locked] == 0)
  917. {
  918. SetVehicleParamsForPlayer(vehicleid, forplayerid, 0, 0);
  919. }
  920. return 1;
  921. }
  922. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  923. {
  924. new engine, lights, alarm, doors, bonnet, boot, objective;
  925. GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
  926. if(vEngine[vehicleid] == 0)
  927. {
  928. SetVehicleParamsEx(vehicleid, 0, lights, alarm, doors, bonnet, boot, objective);
  929. SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Hold ~k~~CONVERSATION_YES~ to start vehicle engine!");
  930. }
  931. else if(vEngine[vehicleid] == 1) SetVehicleParamsEx(vehicleid, 1, lights, alarm, doors, bonnet, boot, objective);
  932. return 1;
  933. }
  934. public OnPlayerCommandPerformed(playerid, cmdtext[], success)
  935. {
  936. new string[128];
  937. if(!success)
  938. {
  939. format(string, sizeof(string), "GRESKA:{FFFFFF} Komandata {46E850}%s{FFFFFF} nepostoi! Pisete {46E850}/help{FFFFFF} da gi vidte site komandi.", cmdtext);
  940. SendClientMessage(playerid, 0x46E850FF, string);
  941. }
  942. return 1;
  943. }
  944. public OnPlayerRequestClass(playerid, classid)
  945. {
  946. SetSpawnInfo(playerid, 0, 0, 0.00, 0.00, 0.00, 0.00, 0, 0, 0, 0, 0, 0);
  947. return 1;
  948. }
  949. public OnPlayerDeath(playerid, killerid, reason)
  950. {
  951. new pname[MAX_PLAYER_NAME], kname[MAX_PLAYER_NAME], string[128], Float: X, Float: Y, Float: Z;
  952. GetPlayerName(playerid, pname, sizeof(pname)), GetPlayerName(killerid, kname, sizeof(kname));
  953. GetPlayerPos(playerid, X, Y, Z);
  954. pDeathPosX[playerid] = X;
  955. pDeathPosY[playerid] = Y;
  956. pDeathPosZ[playerid] = Z;
  957. pInfo[playerid][Mask] = 0;
  958. pDeathMode[playerid] = 1;
  959. if(killerid != INVALID_PLAYER_ID)
  960. {
  961. format(string, sizeof(string), "(%d) %s has just killed (%d) %s using a %s (%d)", killerid, kname, playerid, pname, GunName[reason], reason);
  962. SendClientMessageToAll(-1, string);
  963. }
  964. return 1;
  965. }
  966. // =-=-=-=-=-=-=-=-= PLAYER COMMANDS =-=-=-=-=-=-=-=-= //
  967. // General
  968. CMD:mask(playerid, params[])
  969. {
  970. if(pInfo[playerid][Mask] == 0) return SendClientMessage(playerid, 0x46E850FF, "GRESKA:{FFFFFF}Nemate maska!");
  971. if(pMask[playerid] == 0)
  972. {
  973. pMask[playerid] = 1;
  974. SendClientMessage(playerid, 0x46E850FF, "INFO:{FFFFFF} Stavivte maska!");
  975. for(new i; i < MAX_PLAYERS; i++)
  976. {
  977. if(!IsPlayerConnected(playerid)) continue;
  978. ShowPlayerNameTagForPlayer(i, playerid, false);
  979. }
  980. }
  981. else if(pMask[playerid] == 1)
  982. {
  983. pMask[playerid] = 0;
  984. SendClientMessage(playerid, 0x46E850FF, "INFO:{FFFFFF}Ja trgnavte maskata!");
  985. for(new i; i < MAX_PLAYERS; i++)
  986. {
  987. if(!IsPlayerConnected(playerid)) continue;
  988. ShowPlayerNameTagForPlayer(i, playerid, true);
  989. }
  990. }
  991. return 1;
  992. }
  993. CMD:buy(playerid, params[])
  994. {
  995. if(IsPlayerInRangeOfPoint(playerid, 3.0, 252.0834,-56.3722,1.5703))
  996. {
  997. ShowPlayerDialog(playerid, DIALOG_BUY, DIALOG_STYLE_LIST, "24/7", "Maska {$1250}\nLek {$750}\n", "Kupi", "Cancel");
  998. }
  999. else SendClientMessage(playerid, 0x46E850FF, "Ne ste na mestoto kade sto se kupuva.!");
  1000. return 1;
  1001. }
  1002. CMD:help(playerid, params[])
  1003. {
  1004. SendClientMessage(playerid, 0x46E850FF, "Komandi koi mozete da gi koristite");
  1005. SendClientMessage(playerid, 0x46E850FF, "[GENERAL]:{FFFFFF} /id, /admins, /help, /report, /stats, /withdraw, /deposit, nocp");
  1006. SendClientMessage(playerid, 0x46E850FF, "[GENERAL]:{FFFFFF} /fish, /rentrod, /returnrod, /checkfish, /sellfish, /pay, /revive");
  1007. SendClientMessage(playerid, 0x46E850FF, "[GENERAL]:{FFFFFF} /transfer, /me, /mes, /do, /low, /b, /o, /s, /p(riv)m(sg), /mask");
  1008. SendClientMessage(playerid, 0x46E850FF, "[VEHICLE]:{FFFFFF} /carbuy, /bikebuy, /carregister, /carlock, /cartow, /cargive");
  1009. SendClientMessage(playerid, 0x46E850FF, "[VEHICLE]:{FFFFFF} /carpark, /carhood, /carlights, /cartrunk, /carlocate");
  1010. SendClientMessage(playerid, 0x46E850FF, "[PROPRTY]:{FFFFFF} /housebuy, /housesell, /housenear, /houselock, /houselocate");
  1011. SendClientMessage(playerid, 0x46E850FF, "[PROPRTY]:{FFFFFF} /bizbuy, /bizsell, /bizlock, /biznear, /bizfee, /bizname");
  1012. SendClientMessage(playerid, 0x46E850FF, "[PROPRTY]:{FFFFFF} /bizlocate, /biztillinfo, /biztwithdraw, /biztdeposit, /buy");
  1013. SendClientMessage(playerid, 0x46E850FF, "[FACTION]:{FFFFFF} /f, /fnochat, /ftowcars, /fset(rank/tier), /f(un/in)vite");
  1014. return 1;
  1015. }
  1016. CMD:enterhouse(playerid)
  1017. {
  1018. // PARAMS ARE REMOVED FOR A REASON, SEE ONPLAYERSTATEKEYCHANGE
  1019. new pNearHouse[MAX_PLAYERS], s[128], vw = GetPlayerVirtualWorld(playerid), w = GetPlayerInterior(playerid);
  1020. // Houses
  1021. if(pInsideHouse[playerid] == 0)
  1022. {
  1023. for(new i = 0; i < MAX_HOUSES; i++)
  1024. {
  1025. if(IsPlayerInRangeOfPoint(playerid, 2.0, hInfo[i][extX], hInfo[i][extY], hInfo[i][extZ]))
  1026. {
  1027. pNearHouse[playerid] = i;
  1028. }
  1029. }
  1030. if(pNearHouse[playerid] == 0) return 1;
  1031. new nearhouse = pNearHouse[playerid];
  1032. if(hInfo[nearhouse][Locked] == 0)
  1033. {
  1034. SetPlayerPos(playerid, hInfo[nearhouse][intX], hInfo[nearhouse][intY], hInfo[nearhouse][intZ]);
  1035. SetPlayerVirtualWorld(playerid, hInfo[nearhouse][intVW]);
  1036. SetPlayerInterior(playerid, hInfo[nearhouse][intW]);
  1037. pInsideHouse[playerid] = 1;
  1038. }
  1039. else if(hInfo[nearhouse][Locked] == 1) SendClientMessage(playerid, 0x46E850FF, "GRESKA:{FFFFFF} Kukjata e zaklucena i nemozete da vlezete!");
  1040. if(pInfo[playerid][Admin] > 1)
  1041. {
  1042. format(s, 128, "INFO:{FFFFFF} Vlegovte vo kukja so ID: %d, VW: %d, W: %d", nearhouse, hInfo[nearhouse][intVW], hInfo[nearhouse][intW]);
  1043. SendClientMessage(playerid, 0x46E850FF, s);
  1044. }
  1045. return 1;
  1046. }
  1047. else if(pInsideHouse[playerid] == 1)
  1048. {
  1049. for(new i = 0; i < MAX_HOUSES; i++)
  1050. {
  1051. if(IsPlayerInRangeOfPoint(playerid, 2.0, hInfo[i][intX], hInfo[i][intY], hInfo[i][intZ]))
  1052. {
  1053. if(vw == hInfo[i][intVW] && w == hInfo[i][intW])
  1054. {
  1055. pNearHouse[playerid] = i;
  1056. }
  1057. }
  1058. }
  1059. if(pNearHouse[playerid] == 0) return 1;
  1060. new nearhouse = pNearHouse[playerid];
  1061. pInsideHouse[playerid] = 0;
  1062. SetPlayerPos(playerid, hInfo[nearhouse][extX], hInfo[nearhouse][extY], hInfo[nearhouse][extZ]);
  1063. SetPlayerVirtualWorld(playerid, 0);
  1064. SetPlayerInterior(playerid, 0);
  1065. }
  1066. return 1;
  1067. }
  1068. CMD:enterbusiness(playerid)
  1069. {
  1070. // PARAMS ARE REMOVED FOR A REASON, SEE ONPLAYERSTATEKEYCHANGE
  1071. new pNearBiz[MAX_PLAYERS], s[128], vw = GetPlayerVirtualWorld(playerid), w = GetPlayerInterior(playerid);
  1072. // Businesses
  1073. if(pInsideBiz[playerid] == 0)
  1074. {
  1075. for(new i = 0; i < MAX_BUSINESSES; i++)
  1076. {
  1077. if(IsPlayerInRangeOfPoint(playerid, 2.0, bInfo[i][extX], bInfo[i][extY], bInfo[i][extZ]))
  1078. {
  1079. pNearBiz[playerid] = i;
  1080. }
  1081. }
  1082. if(pNearBiz[playerid] == 0) return 1;
  1083. new nearbiz = pNearBiz[playerid], money = bInfo[nearbiz][Fee];
  1084. if(bInfo[nearbiz][Locked] == 0)
  1085. {
  1086. pInsideBiz[playerid] = 1;
  1087. if(bInfo[nearbiz][IntSet] == 0) SendClientMessage(playerid, 0x46E850FF, "GRESKA:{FFFFFF}Seuste nemate interrior namesteno , kontaktirajte admin!");
  1088. GivePlayerMoney(playerid, -bInfo[nearbiz][Fee]);
  1089. bInfo[nearbiz][Till] += money;
  1090. SaveBizzes();
  1091. SetPlayerPos(playerid, bInfo[nearbiz][intX], bInfo[nearbiz][intY], bInfo[nearbiz][intZ]);
  1092. SetPlayerVirtualWorld(playerid, bInfo[nearbiz][intVW]);
  1093. SetPlayerInterior(playerid, bInfo[nearbiz][intW]);
  1094. if(pInfo[playerid][Admin] > 1)
  1095. {
  1096. format(s, 128, "INFO:{FFFFFF} Vlegovte vo biznis so ID: %d, VW: %d, W: %d", nearbiz, bInfo[nearbiz][intVW], bInfo[nearbiz][intW]);
  1097. SendClientMessage(playerid, 0x46E850FF, s);
  1098. }
  1099. }
  1100. else if(bInfo[nearbiz][Locked] == 1) SendClientMessage(playerid, 0x46E850FF, "GRESKA:{FFFFFF} Biznisot e zaklucen!");
  1101. }
  1102. else if(pInsideBiz[playerid] == 1)
  1103. {
  1104. for(new i = 0; i < MAX_BUSINESSES; i++)
  1105. {
  1106. if(IsPlayerInRangeOfPoint(playerid, 2.0, bInfo[i][intX], bInfo[i][intY], bInfo[i][intZ]))
  1107. {
  1108. if(vw == bInfo[i][intVW] && w == bInfo[i][intW])
  1109. {
  1110. pNearBiz[playerid] = i;
  1111. }
  1112. }
  1113. }
  1114. if(pNearBiz[playerid] == 0) return 1;
  1115. new nearbiz = pNearBiz[playerid];
  1116. pInsideBiz[playerid] = 0;
  1117. SetPlayerPos(playerid, bInfo[nearbiz][extX], bInfo[nearbiz][extY], bInfo[nearbiz][extZ]);
  1118. SetPlayerVirtualWorld(playerid, 0);
  1119. SetPlayerInterior(playerid, 0);
  1120. }
  1121. return 1;
  1122. }
  1123. CMD:admins(playerid, params[])
  1124. {
  1125. SendClientMessage(playerid, 0x46E850FF, "Online Administrators");
  1126. for(new i = 0; i < MAX_PLAYERS; i++)
  1127. {
  1128. if(IsPlayerConnected(i))
  1129. {
  1130. if(pInfo[i][Admin] > 0)
  1131. {
  1132. new string[128], sendername[MAX_PLAYER_NAME];
  1133. GetPlayerName(i, sendername, sizeof(sendername));
  1134. if(pAdminDuty[i] == 1)
  1135. {
  1136. format(string, sizeof(string), "{389C35}ON DUTY{A3A3A3}: [%d] %s (%d)", pInfo[i][Admin], sendername, i);
  1137. SendClientMessage(playerid, 0xABABABFF, string);
  1138. }
  1139. else if(pAdminDuty[i] == 0)
  1140. {
  1141. format(string, sizeof(string), "OFF DUTY: [%d] %s (%d)", pInfo[i][Admin], sendername, i);
  1142. SendClientMessage(playerid, 0xABABABFF, string);
  1143. }
  1144. }
  1145. }
  1146. }
  1147. return 1;
  1148. }
  1149. CMD:id(playerid, params[])
  1150. {
  1151. new id, targetname[MAX_PLAYER_NAME+1], string[128];
  1152. if(sscanf(params, "i", id)) return SendClientMessage(playerid, 0x46E850FF, "INFO:{FFFFFF} /id [id/ime]");
  1153. for(new i = 0; i < MAX_PLAYERS; i++)
  1154. {
  1155. if(id == i) GetPlayerName(i, targetname, sizeof(targetname));
  1156. }
  1157. format(string, sizeof(string), "INFO:{FFFFFF} ID %d e %s", id, targetname);
  1158. SendClientMessage(playerid, 0x46E850FF, string);
  1159. return 1;
  1160. }
  1161. CMD:report(playerid, params[])
  1162. {
  1163. new reason[128], string[128], pname[MAX_PLAYER_NAME+1];
  1164. if(sscanf(params, "s[128]", reason)) return SendClientMessage(playerid, 0x46E850FF, "INFO:{FFFFFF} /report [text]");
  1165. GetPlayerName(playerid, pname, sizeof(pname));
  1166. format(string, sizeof(string), "[REPORT] %s (%d) reported: %s", pname, playerid, reason);
  1167. SendAdminMessage(0xFFFF00FF, string);
  1168. return 1;
  1169. }
  1170. CMD:pay(playerid, params[])
  1171. {
  1172. new string[128], targetid, input, Float: pos[3], name[MAX_PLAYER_NAME+1], tname[MAX_PLAYER_NAME+1];
  1173. if(sscanf(params, "ui", targetid, input)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /pay [player] [pari]");
  1174. if(GetPlayerMoney(playerid) < input) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You don't have that much money!");
  1175. GetPlayerPos(targetid, pos[0], pos[1], pos[2]), GetPlayerName(playerid, name, sizeof(name));
  1176. GetPlayerName(targetid, tname, sizeof(tname));
  1177. if(IsPlayerInRangeOfPoint(playerid, 3.0, pos[0], pos[1], pos[2]))
  1178. {
  1179. GivePlayerMoney(targetid, input);
  1180. GivePlayerMoney(playerid, -input);
  1181. format(string, 128, "(%d) %s has just given you %d.", playerid, name, input);
  1182. SendClientMessage(targetid, -1, string);
  1183. format(string, 128, "You have just given (%d) %s %d.", targetid, tname, input);
  1184. SendClientMessage(playerid, -1, string);
  1185. format(string, 128, "%s takes out some money and gives it to %s.", name, tname);
  1186. SendNearbyMessage(playerid, 0xC2A2DAAA, string, 6.0);
  1187. }
  1188. return 1;
  1189. }
  1190. CMD:deposit(playerid, params[])
  1191. {
  1192. new string[128], input;
  1193. if(sscanf(params, "i", input)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /deposit [amount]");
  1194. if(GetPlayerMoney(playerid) < input) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You don't have that much money!");
  1195. if(IsPlayerInRangeOfPoint(playerid, 3.0, 2316.5581, -11.3381, 26.7422))
  1196. {
  1197. pOldBalance[playerid] = pInfo[playerid][BankMoney]; // save old var
  1198. pInfo[playerid][BankMoney] += input, GivePlayerMoney(playerid, -input);
  1199. format(string, sizeof(string), "SERVER:{FFFFFF} You have deposited $%d into your bank account.", input);
  1200. SendClientMessage(playerid, 0x46E850FF, string);
  1201. format(string, sizeof(string), "SERVER:{FFFFFF} Old balance: $%d | New balance: $%d", pOldBalance[playerid], pInfo[playerid][BankMoney]);
  1202. SendClientMessage(playerid, 0x46E850FF, string);
  1203. }
  1204. else SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not near the bank!");
  1205. return 1;
  1206. }
  1207. CMD:withdraw(playerid, params[])
  1208. {
  1209. new string[128], input;
  1210. if(sscanf(params, "i", input)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /withdraw [amount]");
  1211. if(pInfo[playerid][BankMoney] < input) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Your bank account doesn't hold that much money!");
  1212. if(IsPlayerInRangeOfPoint(playerid, 3.0, 2316.5581, -11.3381, 26.7422))
  1213. {
  1214. pOldBalance[playerid] = pInfo[playerid][BankMoney]; // save old var
  1215. pInfo[playerid][BankMoney] -= input, GivePlayerMoney(playerid, input);
  1216. format(string, sizeof(string), "SERVER:{FFFFFF} You have withdrawn $%d from your bank account.", input);
  1217. SendClientMessage(playerid, 0x46E850FF, string);
  1218. format(string, sizeof(string), "SERVER:{FFFFFF} Old balance: $%d | New balance: $%d", pOldBalance[playerid], pInfo[playerid][BankMoney]);
  1219. SendClientMessage(playerid, 0x46E850FF, string);
  1220. }
  1221. else SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not near the bank!");
  1222. return 1;
  1223. }
  1224. CMD:transfer(playerid, params[])
  1225. {
  1226. new string[128], targetid, input;
  1227. if(sscanf(params, "ui", targetid, input)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /transfer [player] [amount]");
  1228. if(pInfo[playerid][BankMoney] < input) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Your bank account doesn't hold that much money!");
  1229. if(IsPlayerInRangeOfPoint(playerid, 3.0, 2316.5581, -11.3381, 26.7422))
  1230. {
  1231. pOldBalance[playerid] = pInfo[playerid][BankMoney]; // save old var
  1232. pInfo[playerid][BankMoney] -= input, pInfo[targetid][BankMoney] += input;
  1233. format(string, sizeof(string), "SERVER:{FFFFFF} You have withdrawn $%d from your bank account.", input);
  1234. SendClientMessage(playerid, 0x46E850FF, string);
  1235. format(string, sizeof(string), "SERVER:{FFFFFF} Old balance: $%d | New balance: $%d", pOldBalance[playerid], pInfo[playerid][BankMoney]);
  1236. SendClientMessage(playerid, 0x46E850FF, string);
  1237. format(string, sizeof(string), "SERVER:{FFFFFF} $%d has been deposited into your account.", input);
  1238. SendClientMessage(targetid, 0x46E850FF, string);
  1239. }
  1240. else SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not near the bank!");
  1241. return 1;
  1242. }
  1243. CMD:revive(playerid, params[])
  1244. {
  1245. new targetid, targetname[MAX_PLAYER_NAME], playername[MAX_PLAYER_NAME], string[128], Float: X, Float: Y, Float: Z;
  1246. if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, -1, "/revive [target]");
  1247. if(pMedikit[playerid] == 0) return SendClientMessage(playerid, -1, "You need a medikit in order to revive someone!");
  1248. GetPlayerName(playerid, playername, sizeof(playername)), GetPlayerName(targetid, targetname, sizeof(targetname));
  1249. GetPlayerPos(targetid, X, Y, Z);
  1250. if(IsPlayerInRangeOfPoint(playerid, 3.0, X, Y, Z))
  1251. {
  1252. if(pDeathMode[targetid] == 1)
  1253. {
  1254. KillTimer(pDeathModeTimer[targetid]);
  1255. TogglePlayerControllable(targetid, true);
  1256. SetPlayerColor(targetid, -1);
  1257. pDeathMode[targetid] = 0;
  1258. ApplyAnimation(playerid, "MEDIC", "CPR", 4.1, 0, 0, 0, 1, 0, 1);
  1259. ApplyAnimation(targetid, "ped", "CAR_crawloutRHS", 4.1, 0, 0, 0, 1, 0, 1);
  1260. format(string, sizeof(string), "%s has just revived you!", playername);
  1261. SendClientMessage(targetid, -1, string);
  1262. format(string, sizeof(string), "You have just revived %s!", targetname);
  1263. SendClientMessage(playerid, -1, string);
  1264. }
  1265. else SendClientMessage(playerid, -1, "You can't revive that player because they're not in death mode!");
  1266. }
  1267. else SendClientMessage(playerid, -1, "You're not near the player you want to revive!");
  1268. return 1;
  1269. }
  1270. CMD:stats(playerid, params[])
  1271. {
  1272. new string[128], maskholder[5], genderholder[8], weaponholder[32], pname[MAX_PLAYER_NAME +1], Float: health, Float: kev;
  1273. GetWeaponName(playerid, weaponholder, sizeof(weaponholder)), GetPlayerName(playerid, pname, sizeof(pname));
  1274. GetPlayerHealth(playerid, health), GetPlayerArmour(playerid, kev);
  1275. if(GetPlayerWeapon(playerid) == 0) weaponholder = "Fists"; // fix
  1276. else if(GetPlayerWeapon(playerid) > 0) weaponholder = GunName[GetPlayerWeapon(playerid)];
  1277. if(pInfo[playerid][Mask] == 0) maskholder = "No";
  1278. else if(pInfo[playerid][Mask] == 1) maskholder = "Yes";
  1279. if(pInfo[playerid][Gender] == 1) genderholder = "Male";
  1280. else if(pInfo[playerid][Gender] == 2) genderholder = "Female";
  1281. format(string, sizeof(string), "|_______________________| Ingame statistics of %s |_______________________|", pname);
  1282. SendClientMessage(playerid, 0x46E850FF, string);
  1283. format(string, sizeof(string), "[Gender: %s] [Level: %d] [Experience: %d/8] [Money: %d] [Bank: %d] [Phone Number: %d]", genderholder, pInfo[playerid][Level], pInfo[playerid][Exp], GetPlayerMoney(playerid), pInfo[playerid][BankMoney], pInfo[playerid][PhoneNumber]);
  1284. SendClientMessage(playerid, 0xCCCCCCFF, string);
  1285. format(string, sizeof(string), "[Mask: %s] [Mask ID: %d] [Primary Weapon: %s] [Ammo: %d] [Health: %d] [Armour: %d]", maskholder, pInfo[playerid][MaskID], weaponholder, GetPlayerAmmo(playerid), floatround(health), floatround(kev));
  1286. SendClientMessage(playerid, 0xFFFFFFFF, string);
  1287. format(string, sizeof(string), "[Faction: %s] [Faction Tier: %d] [Faction Rank: %s] [Medikits: %d]", GetFactionName(playerid), pInfo[playerid][FactionTier], pInfo[playerid][FactionRank], pMedikit[playerid]);
  1288. SendClientMessage(playerid, 0xCCCCCCFF, string);
  1289. format(string, sizeof(string), "[House Owner: %d] [Vehicle Owner: %d] [Business Owner: %d]", pInfo[playerid][HouseOwner], pInfo[playerid][VehicleOwner], pInfo[playerid][BizOwner]);
  1290. SendClientMessage(playerid, 0xFFFFFFFF, string);
  1291. return 1;
  1292. }
  1293. CMD:pass(playerid)
  1294. {
  1295. if(IsPlayerInRangeOfPoint(playerid, 3.0, -1716.2312, 1018.1048, 17.5859))
  1296. {
  1297. SetPlayerPos(playerid, 322.1928, 317.6448, 999.1484);
  1298. SetPlayerInterior(playerid, 5);
  1299. }
  1300. else if(IsPlayerInRangeOfPoint(playerid, 3.0, 207.8708, -61.6880, 1.9766))
  1301. {
  1302. SetPlayerPos(playerid, 322.197998, 302.497985, 999.148437);
  1303. SetPlayerInterior(playerid, 5);
  1304. }
  1305. else if(IsPlayerInRangeOfPoint(playerid, 3.0, 322.197998, 302.497985, 999.148437))
  1306. {
  1307. SetPlayerPos(playerid, 207.8708, -61.6880, 1.9766);
  1308. SetPlayerInterior(playerid, 0);
  1309. }
  1310. else if(IsPlayerInRangeOfPoint(playerid, 3.0, 322.3381, 317.8130, 999.1484))
  1311. {
  1312. SetPlayerPos(playerid, -1716.2312, 1018.1048, 17.5859);
  1313. SetPlayerInterior(playerid, 0);
  1314. }
  1315. // hospital
  1316. else if(IsPlayerInRangeOfPoint(playerid, 3.0, 43.6618, -188.0078, 2.2442)) // hospital entrance
  1317. {
  1318. SetPlayerPos(playerid,-204.5060, -1736.0486, 675.7687);
  1319. SetPlayerInterior(playerid, 3);
  1320. }
  1321. else if(IsPlayerInRangeOfPoint(playerid, 3.0, -204.5060, -1736.0486, 675.7687)) // hospital entrance
  1322. {
  1323. SetPlayerPos(playerid, 43.6618, -188.0078, 2.2442);
  1324. SetPlayerInterior(playerid, 0);
  1325. }
  1326. // Garage pass
  1327. else if(IsPlayerInRangeOfPoint(playerid, 3.0, 326.4513, -1492.8029, 24.9219)) // hospital entrance
  1328. {
  1329. SetPlayerPos(playerid, 54.2550, -190.9127, 1.6579);
  1330. }
  1331. else if(IsPlayerInRangeOfPoint(playerid, 3.0, 54.2550, -190.9127, 1.6579)) // hospital entrance
  1332. {
  1333. SetPlayerPos(playerid, 326.4513, -1492.8029, 24.9219);
  1334. SetPlayerInterior(playerid, 0);
  1335. }
  1336. // Police
  1337. else if(IsPlayerInRangeOfPoint(playerid, 6.0, 211.0195, -35.2429, 0.7898))
  1338. {
  1339. if(IsPlayerInAnyVehicle(playerid))
  1340. {
  1341. new vehicleid = GetPlayerVehicleID(playerid);
  1342. SetVehiclePos(vehicleid, -1775.2841, 985.0253, 23.2914);
  1343. SetVehicleZAngle(vehicleid, 269.8678);
  1344. }
  1345. else SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You need to be in a vehicle in order to pass through this!");
  1346. }
  1347. else if(IsPlayerInRangeOfPoint(playerid, 3.0, -1777.8029, 996.6982, 24.3305) || IsPlayerInRangeOfPoint(playerid, 3.0, -1777.5427, 967.4189, 24.3657))
  1348. {
  1349. if(IsPlayerInAnyVehicle(playerid))
  1350. {
  1351. new vehicleid = GetPlayerVehicleID(playerid);
  1352. SetVehiclePos(vehicleid, 211.3989, -28.5980, 1.5781);
  1353. SetVehicleZAngle(vehicleid, 2.4807);
  1354. }
  1355. else SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You need to be in a vehicle in order to pass through this!");
  1356. }
  1357. // Hospital
  1358. else if(IsPlayerInRangeOfPoint(playerid, 3.0, 58.8201, -195.7375, 1.6446))
  1359. {
  1360. if(IsPlayerInAnyVehicle(playerid))
  1361. {
  1362. new vehicleid = GetPlayerVehicleID(playerid);
  1363. SetVehiclePos(vehicleid, 318.6588, -1491.4716, 24.5918);
  1364. SetVehicleZAngle(vehicleid, 147.7229);
  1365. }
  1366. else SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You need to be in a vehicle in order to pass through this!");
  1367. }
  1368. else if(IsPlayerInRangeOfPoint(playerid, 3.0, 318.6588, -1491.4716, 24.5918))
  1369. {
  1370. if(IsPlayerInAnyVehicle(playerid))
  1371. {
  1372. new vehicleid = GetPlayerVehicleID(playerid);
  1373. SetVehiclePos(vehicleid, 58.8245, -192.3390, 1.7719);
  1374. SetVehicleZAngle(vehicleid, 211.9615);
  1375. }
  1376. else SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You need to be in a vehicle in order to pass through this!");
  1377. }
  1378. // Bank
  1379. else if(IsPlayerInRangeOfPoint(playerid, 3.0, 2305.1602, -16.2648, 26.2677))
  1380. {
  1381. SetPlayerPos(playerid, 273.0509, -195.4212, 1.1390);
  1382. SetPlayerInterior(playerid, 0);
  1383. }
  1384. else if(IsPlayerInRangeOfPoint(playerid, 3.0, 273.0509, -195.4212, 1.1390))
  1385. {
  1386. SetPlayerPos(playerid, 2305.1602, -16.2648, 26.2677);
  1387. SetPlayerInterior(playerid, 0);
  1388. }
  1389. return 1;
  1390. }
  1391. // Jobs
  1392. CMD:fish(playerid, params[])
  1393. {
  1394. new str[80], pname[MAX_PLAYER_NAME +1];
  1395. GetPlayerName(playerid, pname, sizeof(pname));
  1396. if(IsPlayerInRangeOfPoint(playerid, 6.0, 373.4215, -275.4926, 1.0578) || IsPlayerInRangeOfPoint(playerid, 6.0, 386.2177, -267.5155, 1.0633) || IsPlayerInRangeOfPoint(playerid, 6.0, 356.2553, -286.0096, 1.4032))
  1397. {
  1398. if(pCarryingFish[playerid] < 40)
  1399. {
  1400. if(pRentedFishRod[playerid] == 1)
  1401. {
  1402. format(str, sizeof(str), "%s has just cast out their rod!", pname);
  1403. SendNearbyMessage(playerid, 0xC2A2DAAA, str, 6.0);
  1404. fishtimer[playerid] = SetTimer("FishingCooldown", 1000, true);
  1405. fishtimervalue[playerid] = 15;
  1406. TogglePlayerControllable(playerid, false);
  1407. ApplyAnimation(playerid, "SWORD", "sword_4", 4.1, false, 0, 0, 1, 1, 1);
  1408. }
  1409. else SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You need a fishing rod in order to fish! Hire one at the fishing booth!");
  1410. }
  1411. else SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You are already carrying too many fish! Type {FFBB00}/sellfish{FFFFFF} at the fishing booth!");
  1412. }
  1413. else SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} There's no fish around here! Please proceed to the fishing docks and try again!");
  1414. return 1;
  1415. }
  1416. CMD:nocp(playerid, params[])
  1417. {
  1418. DisablePlayerCheckpoint(playerid);
  1419. SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You have disabled all active checkpoints!");
  1420. return 1;
  1421. }
  1422. CMD:rentrod(playerid, params[])
  1423. {
  1424. if(GetPlayerMoney(playerid) < 150) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You need atleast {FFBB00}$150{FFFFFF} to rent a fishing rod!");
  1425. if(pRentedFishRod[playerid] == 1) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're already renting a fishing rod! Return it using {FFBB00}/returnrod{FFFFFF}!");
  1426. if(IsPlayerInRangeOfPoint(playerid, 3.0, 382.7930, -260.5501, 1.6535))
  1427. {
  1428. SetPlayerAttachedObject(playerid, 8,18632, 6, 0.059999, 0.012000, 0.000000, -154.700012, 33.999992, -4.600000, 1.000000, 1.000000, 1.000000);
  1429. SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You've hired a fishing rod for {FFBB00}$150{FFFFFF}! Make sure to return it later using {FFBB00}/returnrod{FFFFFF}!");
  1430. GivePlayerMoney(playerid, -150);
  1431. pRentedFishRod[playerid] = 1;
  1432. }
  1433. else SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not near the fishing booth! Please proceed to the fishing docks and try again!");
  1434. return 1;
  1435. }
  1436. CMD:returnrod(playerid, params[])
  1437. {
  1438. if(pRentedFishRod[playerid] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You haven't rented a fishing rod yet! Hire one using {FFBB00}/rentrod{FFFFFF}!");
  1439. if(IsPlayerInRangeOfPoint(playerid, 3.0, 382.7930, -260.5501, 1.6535))
  1440. {
  1441. RemovePlayerAttachedObject(playerid, 8);
  1442. SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You've returned your fishing rod! Your {FFBB00}$150{FFFFFF} has been returned!");
  1443. GivePlayerMoney(playerid, 150);
  1444. pRentedFishRod[playerid] = 0;
  1445. }
  1446. else SendClientMessage(playerid ,0x46E850FF, "SERVER:{FFFFFF} You're not near the fishing booth! Please proceed to the fishing docks and try again!");
  1447. return 1;
  1448. }
  1449. CMD:sellfish(playerid, params[])
  1450. {
  1451. new reward, str[80];
  1452. if(pRentedFishRod[playerid] == 1) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Return your fishing rod first using {FFBB00}/returnrod{FFFFFF}!");
  1453. if(IsPlayerInRangeOfPoint(playerid, 3.0, 382.7930, -260.5501, 1.6535))
  1454. {
  1455. reward += pCarryingFish[playerid] *3;
  1456. format(str, sizeof(str), "SERVER:{FFFFFF} You've sold your current fish (%d lbs) for {FFBB00}$%d{FFFFFF}!", pCarryingFish[playerid], reward);
  1457. SendClientMessage(playerid, 0x46E850FF, str);
  1458. GivePlayerMoney(playerid, reward);
  1459. pCarryingFish[playerid] = 0;
  1460. }
  1461. else SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not near the fishing booth! Please proceed to the fishing docks and try again!");
  1462. return 1;
  1463. }
  1464. CMD:checkfish(playerid, params[])
  1465. {
  1466. new str[80];
  1467. if(pCarryingFish[playerid] > 150) pCarryingFish[playerid] = 150; // bug fix
  1468. format(str, sizeof(str), "SERVER:{FFFFFF} Carrying {3FA152}%d{FFFFFF}/{C42D2D}150{FFFFFF} lbs of fish!", pCarryingFish[playerid]);
  1469. SendClientMessage(playerid, 0x46E850FF, str);
  1470. return 1;
  1471. }
  1472. // Businesses
  1473. CMD:biztillinfo(playerid, params[])
  1474. {
  1475. new string[128], bizid = pInfo[playerid][BizOwner];
  1476. if(pInfo[playerid][BizOwner] == 9999) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You don't own a business!");
  1477. format(string, sizeof(string), "SERVER:{FFFFFF} Business ID: %d Till", bizid);
  1478. SendClientMessage(playerid, 0x46E850FF, string);
  1479. format(string, sizeof(string), "SERVER:{FFFFFF} Current Amount: %d", bInfo[bizid][Till]);
  1480. SendClientMessage(playerid, 0x46E850FF, string);
  1481. return 1;
  1482. }
  1483. CMD:biztwithdraw(playerid, params[])
  1484. {
  1485. new string[128], amount, bizid = pInfo[playerid][BizOwner], oldamount;
  1486. if(pInfo[playerid][BizOwner] == 9999) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You don't own a business!");
  1487. if(sscanf(params, "i", amount)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /biztwithdraw [amount]");
  1488. if(amount > bInfo[bizid][Till]) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Your business till doesn't hold that much money!");
  1489. oldamount = bInfo[bizid][Till];
  1490. bInfo[bizid][Till] -= amount;
  1491. GivePlayerMoney(playerid, amount);
  1492. SaveBizzes();
  1493. format(string, sizeof(string), "SERVER:{FFFFFF} Business ID: %d Till Information", bizid);
  1494. SendClientMessage(playerid, 0x46E850FF, string);
  1495. format(string, sizeof(string), "SERVER:{FFFFFF} Current Amount: %d || Old Amount: %d", bInfo[bizid][Till], oldamount);
  1496. SendClientMessage(playerid, 0x46E850FF, string);
  1497. return 1;
  1498. }
  1499. CMD:biztdeposit(playerid, params[])
  1500. {
  1501. new string[128], amount, bizid = pInfo[playerid][BizOwner], oldamount;
  1502. if(pInfo[playerid][BizOwner] == 9999) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You don't own a business!");
  1503. if(sscanf(params, "i", amount)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /biztdeposit [amount]");
  1504. if(amount > GetPlayerMoney(playerid)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You don't have that much money!");
  1505. oldamount = bInfo[bizid][Till];
  1506. GivePlayerMoney(playerid, -amount);
  1507. bInfo[bizid][Till] += amount;
  1508. SaveBizzes();
  1509. format(string, sizeof(string), "SERVER:{FFFFFF} Business ID: %d Till Information", bizid);
  1510. SendClientMessage(playerid, 0x46E850FF, string);
  1511. format(string, sizeof(string), "SERVER:{FFFFFF} Current Amount: %d || Old Amount: %d", bInfo[bizid][Till], oldamount);
  1512. SendClientMessage(playerid, 0x46E850FF, string);
  1513. return 1;
  1514. }
  1515. CMD:bizlocate(playerid, params[])
  1516. {
  1517. new bid;
  1518. if(sscanf(params, "i", bid)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /bizlocate [business id]");
  1519. SetPlayerCheckpoint(playerid, bInfo[bid][extX], bInfo[bid][extY], bInfo[bid][extZ], 3.0);
  1520. SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} The location of the business has been {DE3535}marked{FFFFFF} on your map! Use /nocp to hide the checkpoint!");
  1521. return 1;
  1522. }
  1523. CMD:bizsell(playerid, params[])
  1524. {
  1525. new name[25], str1[128], pNearBiz[MAX_PLAYERS] = 0, newname[25], fee = 0;
  1526. GetPlayerName(playerid, name, 25);
  1527. if(pInfo[playerid][BizOwner] == 9999) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You don't own a business!");
  1528. for(new i = 0; i < MAX_BUSINESSES; i++)
  1529. {
  1530. if(IsPlayerInRangeOfPoint(playerid, 2.0, bInfo[i][extX], bInfo[i][extY], bInfo[i][extZ]))
  1531. {
  1532. if(pInfo[playerid][BizOwner] == i)
  1533. {
  1534. format(str1, sizeof(str1), "SERVER:{FFFFFF} You sold business ID: %d for %d!", i, bInfo[i][Price]);
  1535. pNearBiz[playerid] = 1;
  1536. pInfo[playerid][BizOwner] = 9999;
  1537. format(newname, 25, "None");
  1538. bInfo[i][Owner] = newname;
  1539. bInfo[i][Bought] = 0;
  1540. fee = bInfo[i][Price];
  1541. }
  1542. else format(str1, sizeof(str1), "SERVER:{FFFFFF} You don't own this business!");
  1543. }
  1544. }
  1545. if(pNearBiz[playerid] == 0) format(str1, sizeof(str1), "SERVER:{FFFFFF} You're not near your business!");
  1546. SendClientMessage(playerid, 0x46E850FF, str1);
  1547. GivePlayerMoney(playerid, fee);
  1548. ReloadLabels();
  1549. return 1;
  1550. }
  1551. CMD:bizname(playerid, params[])
  1552. {
  1553. new str1[128], pNearBiz[MAX_PLAYERS] = 0, name[45];
  1554. if(sscanf(params, "s[45]", name)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /bizname [name]");
  1555. if(pInfo[playerid][BizOwner] == 9999) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You don't own a business!");
  1556. for(new i = 0; i < MAX_BUSINESSES; i++)
  1557. {
  1558. if(IsPlayerInRangeOfPoint(playerid, 2.0, bInfo[i][extX], bInfo[i][extY], bInfo[i][extZ]))
  1559. {
  1560. if(pInfo[playerid][BizOwner] == i)
  1561. {
  1562. bInfo[i][Name] = name;
  1563. format(str1, sizeof(str1), "SERVER:{FFFFFF} You have set your business name to %s.", name);
  1564. pNearBiz[playerid] = 1;
  1565. }
  1566. else format(str1, sizeof(str1), "SERVER:{FFFFFF} You don't own this business!");
  1567. }
  1568. }
  1569. if(pNearBiz[playerid] == 0) format(str1, sizeof(str1), "SERVER:{FFFFFF} You're not near your business!");
  1570. SendClientMessage(playerid, 0x46E850FF, str1);
  1571. ReloadLabels();
  1572. return 1;
  1573. }
  1574. CMD:bizbuy(playerid, params[])
  1575. {
  1576. new str1[128], name[MAX_PLAYER_NAME+1], pNearBiz[MAX_PLAYERS] = 0, fee, str2[128];
  1577. GetPlayerName(playerid, name, sizeof(name));
  1578. if(pInfo[playerid][BizOwner] < 9999) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You already own a business!");
  1579. for(new i = 0; i < MAX_BUSINESSES; i++)
  1580. {
  1581. if(IsPlayerInRangeOfPoint(playerid, 2.0, bInfo[i][extX], bInfo[i][extY], bInfo[i][extZ]))
  1582. {
  1583. if(bInfo[i][Bought] == 1) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} This business is already bought!");
  1584. if(GetPlayerMoney(playerid) < bInfo[i][Price]) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You can't afford this business!");
  1585. else if(bInfo[i][Bought] == 0)
  1586. {
  1587. pNearBiz[playerid] = 1;
  1588. pInfo[playerid][BizOwner] = i;
  1589. bInfo[i][Owner] = name;
  1590. bInfo[i][Bought] = 1;
  1591. format(str2, 128, "[BUSINESS]\n{46E850}[Owner]{FFFFFF}: %s\n{46E850}[Entry]{FFFFFF}: %d", bInfo[i][Owner], bInfo[i][Fee]);
  1592. Update3DTextLabelText(Text3D: i, 0x46E850FF, str2);
  1593. format(str1, sizeof(str1), "SERVER:{FFFFFF} You bought business ID %d for %d! Alter it using /bizlock, /bizfee and /bizname!", i, bInfo[i][Price], pInfo[playerid][BizOwner]);
  1594. fee = bInfo[i][Price];
  1595. }
  1596. }
  1597. }
  1598. if(pNearBiz[playerid] == 0) format(str1, sizeof(str1), "SERVER:{FFFFFF} You're not near any business!");
  1599. SendClientMessage(playerid, 0x46E850FF, str1);
  1600. GivePlayerMoney(playerid, -fee);
  1601. ReloadLabels();
  1602. return 1;
  1603. }
  1604. CMD:biznear(playerid, params[])
  1605. {
  1606. new str1[128], pNearBiz[MAX_PLAYERS] = 0;
  1607. for(new i = 0; i < MAX_BUSINESSES; i++)
  1608. {
  1609. if(IsPlayerInRangeOfPoint(playerid, 1.0, bInfo[i][extX], bInfo[i][extY], bInfo[i][extZ]))
  1610. {
  1611. format(str1, sizeof(str1), "SERVER:{FFFFFF} You're near business ID: %d. Price: %d Owner: %s.", i, bInfo[i][Price], bInfo[i][Owner]);
  1612. pNearBiz[playerid] = 1;
  1613. }
  1614. }
  1615. if(pNearBiz[playerid] == 0) format(str1, sizeof(str1), "SERVER:{FFFFFF} You're not near any business!");
  1616. SendClientMessage(playerid, 0x46E850FF, str1);
  1617. return 1;
  1618. }
  1619. CMD:bizfee(playerid, params[])
  1620. {
  1621. new str1[128], pNearBiz[MAX_PLAYERS] = 0, fee;
  1622. if(sscanf(params, "i", fee)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /bizfee [fee]");
  1623. if(fee > 2500) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} The entrance fee can't be higher than $2500!");
  1624. if(pInfo[playerid][BizOwner] == 9999) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You don't own a business!");
  1625. for(new i = 0; i < MAX_BUSINESSES; i++)
  1626. {
  1627. if(IsPlayerInRangeOfPoint(playerid, 2.0, bInfo[i][extX], bInfo[i][extY], bInfo[i][extZ]))
  1628. {
  1629. if(pInfo[playerid][BizOwner] == i)
  1630. {
  1631. bInfo[i][Fee] = fee;
  1632. format(str1, sizeof(str1), "SERVER:{FFFFFF} You have set your entry fee to %d.", fee);
  1633. pNearBiz[playerid] = 1;
  1634. }
  1635. else format(str1, sizeof(str1), "SERVER:{FFFFFF} You don't own this business!");
  1636. }
  1637. }
  1638. if(pNearBiz[playerid] == 0) format(str1, sizeof(str1), "SERVER:{FFFFFF} You're not near your business!");
  1639. SendClientMessage(playerid, 0x46E850FF, str1);
  1640. ReloadLabels();
  1641. return 1;
  1642. }
  1643. CMD:bizlock(playerid, params[])
  1644. {
  1645. new str1[128], pNearBiz[MAX_PLAYERS] = 0;
  1646. if(pInfo[playerid][BizOwner] == 9999) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You don't own a business!");
  1647. for(new i = 0; i < MAX_BUSINESSES; i++)
  1648. {
  1649. if(IsPlayerInRangeOfPoint(playerid, 2.0, bInfo[i][extX], bInfo[i][extY], bInfo[i][extZ]))
  1650. {
  1651. if(pInfo[playerid][BizOwner] == i)
  1652. {
  1653. if(bInfo[i][Locked] == 0)
  1654. {
  1655. format(str1, sizeof(str1), "SERVER:{FFFFFF} You've locked your business!");
  1656. pNearBiz[playerid] = 1;
  1657. bInfo[i][Locked] = 1;
  1658. }
  1659. else if(bInfo[i][Locked] == 1)
  1660. {
  1661. format(str1, sizeof(str1), "SERVER:{FFFFFF} You've unlocked your business!");
  1662. pNearBiz[playerid] = 1;
  1663. bInfo[i][Locked] = 0;
  1664. }
  1665. }
  1666. else format(str1, sizeof(str1), "SERVER:{FFFFFF} You don't own this business!");
  1667. }
  1668. }
  1669. if(pNearBiz[playerid] == 0) format(str1, sizeof(str1), "SERVER:{FFFFFF} You're not near your business!");
  1670. SendClientMessage(playerid, 0x46E850FF, str1);
  1671. ReloadLabels();
  1672. return 1;
  1673. }
  1674. // Vehicle
  1675. CMD:carlocate(playerid, params[])
  1676. {
  1677. new v = pInfo[playerid][VehicleOwner], string[128], Float: X, Float: Y, Float: Z;
  1678. GetVehiclePos(v, X, Y, Z);
  1679. if(pInfo[playerid][VehicleOwner] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You don't own a vehicle!");
  1680. format(string, sizeof(string), "SERVER:{FFFFFF} Your vehicle has been {DE3535}marked{FFFFFF} on your minimap (ID: %d)! To hide the checkpoint, use /nocp!", v);
  1681. SendClientMessage(playerid, 0x46E850FF, string);
  1682. SetPlayerCheckpoint(playerid, X, Y, Z, 3.0);
  1683. return 1;
  1684. }
  1685. CMD:cartow(playerid, params[])
  1686. {
  1687. new v = pInfo[playerid][VehicleOwner], string[128];
  1688. if(pInfo[playerid][VehicleOwner] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You don't own a vehicle!");
  1689. format(string, sizeof(string), "SERVER:{FFFFFF} You have respawned your vehicle. (ID: %d)", v);
  1690. SendClientMessage(playerid, 0x46E850FF, string);
  1691. SetVehicleToRespawn(v);
  1692. return 1;
  1693. }
  1694. CMD:cargive(playerid, params[])
  1695. {
  1696. new targetid, Float: X, Float: Y, Float: Z, string[128], pname[MAX_PLAYER_NAME], tname[MAX_PLAYER_NAME], v = pInfo[playerid][VehicleOwner], fix[30];
  1697. if(sscanf(params, "u", targetid))return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /cargive [player]");
  1698. if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You need to be in a car in order to do this command!");
  1699. if(pInfo[playerid][VehicleOwner] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You don't own a vehicle!");
  1700. GetPlayerPos(targetid, X, Y, Z), GetPlayerName(playerid, pname, sizeof(pname)), GetPlayerName(targetid, tname, sizeof(tname));
  1701. format(fix, sizeof(fix), "%s", tname);
  1702. if(GetPlayerVehicleID(playerid) == v)
  1703. {
  1704. if(IsPlayerInRangeOfPoint(playerid, 3.0, X, Y, Z))
  1705. {
  1706. format(string, sizeof(string), "SERVER:{FFFFFF} (%d) %s has just given you their vehicle! ID: %d", playerid, pname, v);
  1707. SendClientMessage(targetid, 0x46E850FF, string);
  1708. format(string, sizeof(string), "SERVER:{FFFFFF} You've just given (%d) %s your vehicle! ID: %d", targetid, tname, v);
  1709. SendClientMessage(playerid, 0x46E850FF, string);
  1710. pInfo[playerid][VehicleOwner] = 0;
  1711. pInfo[targetid][VehicleOwner] = v;
  1712. vInfo[v][Owner] = fix;
  1713. SaveVehicles();
  1714. }
  1715. else SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You've not near the player!");
  1716. }
  1717. else SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} This isn't your vehicle!");
  1718. return 1;
  1719. }
  1720. CMD:carregister(playerid, params[])
  1721. {
  1722. new v = GetPlayerVehicleID(playerid), randnr = random(400), string[128], plate[8];
  1723. randnr += 4600;
  1724. if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You need to be in a car in order to do this command!");
  1725. if(pInfo[playerid][VehicleOwner] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You don't own a vehicle!");
  1726. if(GetPlayerVehicleID(playerid) == v)
  1727. {
  1728. if(IsPlayerInRangeOfPoint(playerid, 3.0, 168.6218, -49.5795, 1.5781))
  1729. {
  1730. if(pInfo[playerid][VehicleOwner] == v)
  1731. {
  1732. format(plate, sizeof(plate), "BB %d", randnr);
  1733. vInfo[v][NrPlate] = plate;
  1734. format(string, sizeof(string), "SERVER:{FFFFFF} You've registered your vehicle plate as {638A91}%s{FFFFFF}!", plate);
  1735. SendClientMessage(playerid, 0x46E850FF, string);
  1736. SetVehicleNumberPlate(v, plate);
  1737. SetVehicleToRespawn(v);
  1738. PutPlayerInVehicle(playerid, v, 0);
  1739. SaveVehicles();
  1740. }
  1741. else SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You don't own this car!");
  1742. }
  1743. else SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not near the dealership!");
  1744. }
  1745. else SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} This isn't your vehicle!");
  1746. return 1;
  1747. }
  1748. CMD:carlights(playerid, params[])
  1749. {
  1750. new v = GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective, string[128], pname[MAX_PLAYER_NAME+1];
  1751. GetVehicleParamsEx(v, engine, lights, alarm, doors, bonnet, boot, objective);
  1752. GetPlayerName(playerid, pname, sizeof(pname));
  1753. if(IsPlayerInAnyVehicle(playerid))
  1754. {
  1755. if(vLights[v] == 0)
  1756. {
  1757. SetVehicleParamsEx(v, engine, 1, alarm, doors, bonnet, boot, objective); // ONLY the engine param was changed (to 1)
  1758. format(string, sizeof(string), "%s has just turned their vehicles' lights on.", pname);
  1759. vLights[v] = 1;
  1760. }
  1761. else if(vLights[v] == 1)
  1762. {
  1763. SetVehicleParamsEx(v, engine, 0, alarm, doors, bonnet, boot, objective); // ONLY the engine param was changed (to 1)
  1764. format(string, sizeof(string), "%s has just turned their vehicles' lights off.", pname);
  1765. vLights[v] = 0;
  1766. }
  1767. SendNearbyMessage(playerid, 0xC2A2DAAA, string, 6.0);
  1768. }
  1769. else SendClientMessage(playerid, -1, "You must be in a vehicle in order to do this command!");
  1770. return 1;
  1771. }
  1772. CMD:carhood(playerid, params[])
  1773. {
  1774. new v = GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective, string[128], pname[MAX_PLAYER_NAME+1];
  1775. GetVehicleParamsEx(v, engine, lights, alarm, doors, bonnet, boot, objective);
  1776. GetPlayerName(playerid, pname, sizeof(pname));
  1777. if(IsPlayerInAnyVehicle(playerid))
  1778. {
  1779. if(vBonnet[v] == 0)
  1780. {
  1781. SetVehicleParamsEx(v, engine, lights, alarm, doors, 1, boot, objective); // ONLY the engine param was changed (to 1)
  1782. format(string, sizeof(string), "%s has just opened their vehicles' bonnet.", pname);
  1783. vBonnet[v] = 1;
  1784. }
  1785. else if(vBonnet[v] == 1)
  1786. {
  1787. SetVehicleParamsEx(v, engine, lights, alarm, doors, 0, boot, objective); // ONLY the engine param was changed (to 1)
  1788. format(string, sizeof(string), "%s has just closed their vehicles' bonnet.", pname);
  1789. vBonnet[v] = 0;
  1790. }
  1791. SendNearbyMessage(playerid, 0xC2A2DAAA, string, 6.0);
  1792. }
  1793. else SendClientMessage(playerid, -1, "You must be in a vehicle in order to do this command!");
  1794. return 1;
  1795. }
  1796. CMD:cartrunk(playerid, params[])
  1797. {
  1798. new v = GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective, string[128], pname[MAX_PLAYER_NAME+1];
  1799. GetVehicleParamsEx(v, engine, lights, alarm, doors, bonnet, boot, objective);
  1800. GetPlayerName(playerid, pname, sizeof(pname));
  1801. if(IsPlayerInAnyVehicle(playerid))
  1802. {
  1803. if(vTrunk[v] == 0)
  1804. {
  1805. SetVehicleParamsEx(v, engine, lights, alarm, doors, bonnet, 1, objective); // ONLY the engine param was changed (to 1)
  1806. format(string, sizeof(string), "%s has just opened their vehicles' trunk.", pname);
  1807. vTrunk[v] = 1;
  1808. }
  1809. else if(vTrunk[v] == 1)
  1810. {
  1811. SetVehicleParamsEx(v, engine, lights, alarm, doors, bonnet, 0, objective); // ONLY the engine param was changed (to 1)
  1812. format(string, sizeof(string), "%s has just closed their vehicles' trunk.", pname);
  1813. vTrunk[v] = 0;
  1814. }
  1815. SendNearbyMessage(playerid, 0xC2A2DAAA, string, 6.0);
  1816. }
  1817. else SendClientMessage(playerid, -1, "You must be in a vehicle in order to do this command!");
  1818. return 1;
  1819. }
  1820. CMD:carlock(playerid, params[])
  1821. {
  1822. new string[128], v = pInfo[playerid][VehicleOwner], Float: X, Float: Y, Float: Z, pname[MAX_PLAYER_NAME+1];
  1823. GetVehiclePos(v, X, Y, Z), GetPlayerName(playerid, pname, sizeof(pname));
  1824. if(pInfo[playerid][VehicleOwner] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You don't own a vehicle!");
  1825. if(IsPlayerInRangeOfPoint(playerid, 3.0, X, Y, Z))
  1826. {
  1827. if(vInfo[v][Locked] == 0)
  1828. {
  1829. format(string, sizeof(string), "SERVER:{FFFFFF} You've locked your vehicle! (ID: %d)", v);
  1830. SetVehicleParamsForPlayer(v, playerid, 0, 1);
  1831. format(string, sizeof(string), "%s has just locked their vehicle.", pname);
  1832. vInfo[v][Locked] = 1;
  1833. }
  1834. else if(vInfo[v][Locked] == 1)
  1835. {
  1836. format(string, sizeof(string), "SERVER:{FFFFFF} You've unlocked your vehicle! (ID: %d)", v);
  1837. SetVehicleParamsForPlayer(v, playerid, 0, 0);
  1838. format(string, sizeof(string), "%s has just unlocked their vehicle.", pname);
  1839. vInfo[v][Locked] = 0;
  1840. }
  1841. SendNearbyMessage(playerid, 0xC2A2DAAA, string, 6.0);
  1842. }
  1843. else if(!IsPlayerInRangeOfPoint(playerid, 3.0, X, Y, Z)) format(string, sizeof(string), "SERVER:{FFFFFF} You're not near your car!");
  1844. SendClientMessage(playerid, 0x46E850FF, string);
  1845. return 1;
  1846. }
  1847. CMD:carpark(playerid, params[])
  1848. {
  1849. new v = GetPlayerVehicleID(playerid), Float: X, Float: Y, Float: Z, Float: A;
  1850. GetPlayerPos(playerid, X, Y, Z), GetPlayerFacingAngle(playerid, A);
  1851. if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You need to be in a car in order to do this command!");
  1852. if(pInfo[playerid][VehicleOwner] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You don't own a vehicle!");
  1853. if(GetPlayerVehicleID(playerid) == v)
  1854. {
  1855. if(pInfo[playerid][VehicleOwner] == v)
  1856. {
  1857. vInfo[v][posX] = X;
  1858. vInfo[v][posY] = Y;
  1859. vInfo[v][posZ] = Z;
  1860. vInfo[v][posA] = A;
  1861. SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You've parked your vehicle!");
  1862. SaveVehicles();
  1863. }
  1864. else SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You don't own this car!");
  1865. }
  1866. else SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} This isn't your vehicle!");
  1867. return 1;
  1868. }
  1869. CMD:carbuy(playerid, params[])
  1870. {
  1871. new string[690];
  1872. if(IsPlayerInRangeOfPoint(playerid, 3.0, 168.6218, -49.5795, 1.5781))
  1873. {
  1874. format(string, 230, "Sabre (30,000)\nClover (30,000)\nBroadway (30,000)\nBuccaneer (30,000)\nSlamvan (45,000)\nBlade (45,000)\nVincent (45,000)\nElegant (45,000)\nIntruder (45,000)\nPrimo (45,000)\nMerit (45,000)\nEmperor (45,000)\n");
  1875. format(string, 460, "%s Sentinel (45,000)\nVoodoo (45,000)\nBlista Compact (45,000)\nSolair ( 45,000)\nPerenail (45,000)\nClub (45,000)\nWasington (50,000)\nPremier ( 50,000)\nStafford (50,000)\nFeltzer (50,000)\nSavanna (50,000)\nTornado (50,000)\n", string);
  1876. format(string, 690, "%s Tahoma (50,000)\nMajestic (50,000)\nPicador (50,000)\nRancher (60,000)\nRegina (60,000)\nLandstalker (60,000)\nHuntley (60,000)\nBuffalo (75,000)\nElegy (75,000)\nFlash (75,000)\nSultan (75,000)\nJester (75,000)\n", string);
  1877. ShowPlayerDialog(playerid, DIALOG_CARBUY, DIALOG_STYLE_LIST, "Car Dealership", string, "Purchase", "Cancel");
  1878. }
  1879. else SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not near the dealership!");
  1880. return 1;
  1881. }
  1882. CMD:bikebuy(playerid, params[])
  1883. {
  1884. if(IsPlayerInRangeOfPoint(playerid, 3.0, 168.6218, -49.5795, 1.5781))
  1885. {
  1886. ShowPlayerDialog(playerid, DIALOG_CARBUY, DIALOG_STYLE_LIST, "Bike Dealership", "Faggio (15,000)\nPCJ 600 (45,000)\nBF 400 (45,000)\nFCR 900 (45,000)\nSanchez (30,000)\nFreeway (25,000)\nWayfarer (25,000)\n", "Purchase", "Cancel");
  1887. }
  1888. else SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not near the dealership!");
  1889. return 1;
  1890. }
  1891. // House
  1892. CMD:housesell(playerid, params[])
  1893. {
  1894. new name[25], str1[128], pNearHouse[MAX_PLAYERS] = 0, newname[25], fee = 0;
  1895. GetPlayerName(playerid, name, 25);
  1896. if(pInfo[playerid][HouseOwner] == 9999) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You don't own a house!");
  1897. for(new i = 0; i < MAX_HOUSES; i++)
  1898. {
  1899. if(IsPlayerInRangeOfPoint(playerid, 2.0, hInfo[i][extX], hInfo[i][extY], hInfo[i][extZ]))
  1900. {
  1901. if(pInfo[playerid][HouseOwner] == i)
  1902. {
  1903. format(str1, sizeof(str1), "SERVER:{FFFFFF} You sold house ID: %d for %d!", i, hInfo[i][Price]);
  1904. pNearHouse[playerid] = 1;
  1905. pInfo[playerid][HouseOwner] = 9999;
  1906. format(newname, 25, "None");
  1907. hInfo[i][Owner] = newname;
  1908. hInfo[i][Bought] = 0;
  1909. fee = hInfo[i][Price];
  1910. }
  1911. else format(str1, sizeof(str1), "SERVER:{FFFFFF} You don't own this house!");
  1912. }
  1913. }
  1914. if(pNearHouse[playerid] == 0) format(str1, sizeof(str1), "SERVER:{FFFFFF} You're not near your house!");
  1915. SendClientMessage(playerid, 0x46E850FF, str1);
  1916. GivePlayerMoney(playerid, fee);
  1917. ReloadLabels();
  1918. return 1;
  1919. }
  1920. CMD:houselock(playerid, params[])
  1921. {
  1922. new str1[128], pNearHouse[MAX_PLAYERS] = 0;
  1923. if(pInfo[playerid][HouseOwner] == 9999) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You don't own a house!");
  1924. for(new i = 0; i < MAX_HOUSES; i++)
  1925. {
  1926. if(IsPlayerInRangeOfPoint(playerid, 2.0, hInfo[i][extX], hInfo[i][extY], hInfo[i][extZ]))
  1927. {
  1928. if(pInfo[playerid][HouseOwner] == i)
  1929. {
  1930. if(hInfo[i][Locked] == 0)
  1931. {
  1932. format(str1, sizeof(str1), "SERVER:{FFFFFF} You've locked your door!");
  1933. pNearHouse[playerid] = 1;
  1934. hInfo[i][Locked] = 1;
  1935. }
  1936. else if(hInfo[i][Locked] == 1)
  1937. {
  1938. format(str1, sizeof(str1), "SERVER:{FFFFFF} You've unlocked your door!");
  1939. pNearHouse[playerid] = 1;
  1940. hInfo[i][Locked] = 0;
  1941. }
  1942. }
  1943. else format(str1, sizeof(str1), "SERVER:{FFFFFF} You don't own this house!");
  1944. }
  1945. }
  1946. if(pNearHouse[playerid] == 0) format(str1, sizeof(str1), "SERVER:{FFFFFF} You're not near your house!");
  1947. SendClientMessage(playerid, 0x46E850FF, str1);
  1948. ReloadLabels();
  1949. return 1;
  1950. }
  1951. CMD:housebuy(playerid, params[])
  1952. {
  1953. new str1[128], name[MAX_PLAYER_NAME+1], pNearHouse[MAX_PLAYERS] = 0, fee, str2[128];
  1954. GetPlayerName(playerid, name, sizeof(name));
  1955. if(pInfo[playerid][HouseOwner] < 9999) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You already own a house!");
  1956. for(new i = 0; i < MAX_HOUSES; i++)
  1957. {
  1958. if(IsPlayerInRangeOfPoint(playerid, 2.0, hInfo[i][extX], hInfo[i][extY], hInfo[i][extZ]))
  1959. {
  1960. if(hInfo[i][Bought] == 1) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} This house is already bought!");
  1961. if(GetPlayerMoney(playerid) < hInfo[i][Price]) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You can't afford this house!");
  1962. else if(hInfo[i][Bought] == 0)
  1963. {
  1964. pNearHouse[playerid] = 1;
  1965. pInfo[playerid][HouseOwner] = i;
  1966. hInfo[i][Owner] = name;
  1967. hInfo[i][Bought] = 1;
  1968. format(str2, 128, "[HOUSE]\n{46E850}[Owner]{FFFFFF}: %s\n{46E850}[Price]{FFFFFF}: %d", hInfo[i][Owner], hInfo[i][Price]);
  1969. Update3DTextLabelText(Text3D: i, 0x46E850FF, str2);
  1970. format(str1, sizeof(str1), "SERVER:{FFFFFF} You bought house ID %d for %d! (DEBUG: %d)", i, hInfo[i][Price], pInfo[playerid][HouseOwner]);
  1971. fee = hInfo[i][Price];
  1972. }
  1973. }
  1974. }
  1975. if(pNearHouse[playerid] == 0) format(str1, sizeof(str1), "SERVER:{FFFFFF} You're not near any house!");
  1976. SendClientMessage(playerid, 0x46E850FF, str1);
  1977. GivePlayerMoney(playerid, -fee);
  1978. ReloadLabels();
  1979. return 1;
  1980. }
  1981. CMD:housenear(playerid, params[])
  1982. {
  1983. new str1[128], pNearHouse[MAX_PLAYERS] = 0;
  1984. for(new i = 0; i < MAX_HOUSES; i++)
  1985. {
  1986. if(IsPlayerInRangeOfPoint(playerid, 1.0, hInfo[i][extX], hInfo[i][extY], hInfo[i][extZ]))
  1987. {
  1988. format(str1, sizeof(str1), "SERVER:{FFFFFF} You're near house ID: %d. Price: %d Owner: %s.", i, hInfo[i][Price], hInfo[i][Owner]);
  1989. pNearHouse[playerid] = 1;
  1990. }
  1991. }
  1992. if(pNearHouse[playerid] == 0) format(str1, sizeof(str1), "SERVER:{FFFFFF} You're not near any house!");
  1993. SendClientMessage(playerid, 0x46E850FF, str1);
  1994. return 1;
  1995. }
  1996. CMD:houselocate(playerid, params[])
  1997. {
  1998. new hid;
  1999. if(sscanf(params, "i", hid)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /houselocate [house id]");
  2000. SetPlayerCheckpoint(playerid, hInfo[hid][extX], hInfo[hid][extY], hInfo[hid][extZ], 3.0);
  2001. SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} The location of the house has been {DE3535}marked{FFFFFF} on your map! Use /nocp to hide the checkpoint!");
  2002. return 1;
  2003. }
  2004. // =-=-=-=-=-=-=-=-= COMMUNICATION COMMANDS =-=-=-=-=-=-=-=-= //
  2005. CMD:pm(playerid, params[])
  2006. {
  2007. new str[128], text[128], targetid, pname[MAX_PLAYER_NAME], tname[MAX_PLAYER_NAME];
  2008. if(sscanf(params, "us[128]", targetid, text)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /pm [player] [text]");
  2009. if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Player isn't connected!");
  2010. GetPlayerName(playerid, pname, sizeof(pname)), GetPlayerName(targetid, tname, sizeof(tname));
  2011. format(str, sizeof(str), "PM To %s (%d): %s", tname, targetid, text);
  2012. SendClientMessage(playerid, 0xE0E800FF, str);
  2013. format(str, sizeof(str), "PM From %s (%d): %s", pname, playerid, text);
  2014. SendClientMessage(targetid, 0xE8C900FF, str);
  2015. return 1;
  2016. }
  2017. CMD:privmsg(playerid, params[]) return cmd_pm(playerid, params);
  2018. CMD:o(playerid, params[])
  2019. {
  2020. new text[128], string[128], pname[MAX_PLAYER_NAME+1];
  2021. if(sscanf(params, "s[128]", text)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /o [text]");
  2022. GetPlayerName(playerid, pname, sizeof(pname));
  2023. format(string, sizeof(string), "(( [%d] %s: %s ))", playerid, pname, text);
  2024. SendClientMessageToAll(-1, string);
  2025. return 1;
  2026. }
  2027. CMD:b(playerid, params[])
  2028. {
  2029. new text[128], string[128], pname[MAX_PLAYER_NAME+1];
  2030. if(sscanf(params, "s[128]", text)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /b [text]");
  2031. GetPlayerName(playerid, pname, sizeof(pname));
  2032. format(string, sizeof(string), "(( [%d] %s: %s ))", playerid, pname, text);
  2033. SendNearbyMessage(playerid, 0xB3B3B3FF, string, 5.0);
  2034. return 1;
  2035. }
  2036. CMD:low(playerid, params[])
  2037. {
  2038. new text[128], string[128], pname[MAX_PLAYER_NAME+1];
  2039. if(sscanf(params, "s[128]", text)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /low [text]");
  2040. GetPlayerName(playerid, pname, sizeof(pname));
  2041. if(pMask[playerid] == 0) format(string, sizeof(string), "%s says [low]: %s", pname, text);
  2042. else if(pMask[playerid] == 1) format(string, sizeof(string), "Stranger %d says [low]: %s", pInfo[playerid][MaskID], text);
  2043. SendNearbyMessage(playerid, 0xA3A3A3FF, string, 2.0);
  2044. return 1;
  2045. }
  2046. CMD:shout(playerid, params[])
  2047. {
  2048. new text[128], string[128], pname[MAX_PLAYER_NAME+1];
  2049. if(sscanf(params, "s[128]", text)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /s(hout) [text]");
  2050. GetPlayerName(playerid, pname, sizeof(pname));
  2051. if(pMask[playerid] == 0) format(string, sizeof(string), "%s se dere: %s", pname, text);
  2052. else if(pMask[playerid] == 1) format(string, sizeof(string), "Tuginec %d se dere: %s", pInfo[playerid][MaskID], text);
  2053. SendNearbyMessage(playerid, -1, string, 9.0);
  2054. return 1;
  2055. }
  2056. CMD:s(playerid, params[]) return cmd_shout(playerid, params);
  2057. CMD:me(playerid, params[])
  2058. {
  2059. new text[128], string[128], pname[MAX_PLAYER_NAME+1];
  2060. if(sscanf(params, "s[128]", text)) return SendClientMessage(playerid, 0x46E850FF, "INFO:{FFFFFF} /me [akcija]");
  2061. GetPlayerName(playerid, pname, sizeof(pname));
  2062. if(pMask[playerid] == 0) format(string, sizeof(string), "%s %s", pname, text);
  2063. else if(pMask[playerid] == 1) format(string, sizeof(string), "Tuginec %d %s", pInfo[playerid][MaskID], text);
  2064. SendNearbyMessage(playerid, 0xC2A2DAAA, string, 6.0);
  2065. return 1;
  2066. }
  2067. CMD:mes(playerid, params[])
  2068. {
  2069. new text[128], string[128], pname[MAX_PLAYER_NAME+1];
  2070. if(sscanf(params, "s[128]", text)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /mes [action]");
  2071. GetPlayerName(playerid, pname, sizeof(pname));
  2072. if(pMask[playerid] == 0) format(string, sizeof(string), "%s's %s", pname, text);
  2073. else if(pMask[playerid] == 1) format(string, sizeof(string), "Stranger %d's %s", pInfo[playerid][MaskID], text);
  2074. SendNearbyMessage(playerid, 0xC2A2DAAA, string, 6.0);
  2075. return 1;
  2076. }
  2077. CMD:do(playerid, params[])
  2078. {
  2079. new text[128], string[128], pname[MAX_PLAYER_NAME+1];
  2080. if(sscanf(params, "s[128]", text)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /do [action]");
  2081. GetPlayerName(playerid, pname, sizeof(pname));
  2082. if(pMask[playerid] == 0) format(string, sizeof(string), "%s (( %s ))", text, pname);
  2083. else if(pMask[playerid] == 1) format(string, sizeof(string), "%s ((Tuginec %d ))", text, pInfo[playerid][MaskID]);
  2084. SendNearbyMessage(playerid, 0xC2A2DAAA, string, 6.0);
  2085. return 1;
  2086. }
  2087. // =-=-=-=-=-=-=-=-= FACTION COMMANDS =-=-=-=-=-=-=-=-= //
  2088. CMD:finvite(playerid, params[])
  2089. {
  2090. new pname[MAX_PLAYER_NAME], tname[MAX_PLAYER_NAME], targetid, string[128], factionid = pInfo[playerid][Faction];
  2091. if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /finvite [player]");
  2092. if(pInfo[playerid][FactionTier] == 3 || pInfo[playerid][Faction] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're either not in a faction or you're not tier 1/2!");
  2093. GetPlayerName(playerid, pname, sizeof(pname)), GetPlayerName(targetid, tname, sizeof(tname));
  2094. pInfo[targetid][Faction] = factionid;
  2095. format(string, sizeof(string), "{ [%d] %s has just invited [%d] %s }", playerid, pname, targetid, tname);
  2096. SendFactionMessage(factionid, string);
  2097. return 1;
  2098. }
  2099. CMD:funinvite(playerid, params[])
  2100. {
  2101. new pname[MAX_PLAYER_NAME], tname[MAX_PLAYER_NAME], targetid, string[128], factionid = pInfo[playerid][Faction];
  2102. if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /funinvite [player]");
  2103. if(pInfo[playerid][FactionTier] == 3 || pInfo[playerid][Faction] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're either not in a faction or you're not tier 1/2!");
  2104. GetPlayerName(playerid, pname, sizeof(pname)), GetPlayerName(targetid, tname, sizeof(tname));
  2105. pInfo[targetid][Faction] = 0;
  2106. format(string, sizeof(string), "{ [%d] %s has just uninvited [%d] %s }", playerid, pname, targetid, tname);
  2107. SendFactionMessage(factionid, string);
  2108. return 1;
  2109. }
  2110. CMD:fsettier(playerid, params[])
  2111. {
  2112. new pname[MAX_PLAYER_NAME], tname[MAX_PLAYER_NAME], targetid, tier, string[128], factionid = pInfo[playerid][Faction];
  2113. if(sscanf(params, "ui", targetid, tier)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /factionsettier [player] [tier]");
  2114. if(pInfo[playerid][FactionTier] == 3 || pInfo[playerid][Faction] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're either not in a faction or you're not tier 1/2!");
  2115. GetPlayerName(playerid, pname, sizeof(pname)), GetPlayerName(targetid, tname, sizeof(tname));
  2116. pInfo[targetid][FactionTier] = tier;
  2117. format(string, sizeof(string), "{ [%d] %s has just set [%d] %s to tier %d }", playerid, pname, targetid, tname, tier);
  2118. SendFactionMessage(factionid, string);
  2119. return 1;
  2120. }
  2121. CMD:fsetrank(playerid, params[])
  2122. {
  2123. new pname[MAX_PLAYER_NAME], tname[MAX_PLAYER_NAME], targetid, rank[30], string[128], factionid = pInfo[playerid][Faction];
  2124. if(sscanf(params, "us[30]", targetid, rank)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /factionsetrank [player] [rank]");
  2125. if(pInfo[playerid][FactionTier] == 3 || pInfo[playerid][Faction] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're either not in a faction or you're not tier 1/2!");
  2126. GetPlayerName(playerid, pname, sizeof(pname)), GetPlayerName(targetid, tname, sizeof(tname));
  2127. pInfo[targetid][FactionRank] = rank;
  2128. format(string, sizeof(string), "{ [%d] %s has just set [%d] %s's rank to %s }", playerid, pname, targetid, tname, rank);
  2129. SendFactionMessage(factionid, string);
  2130. return 1;
  2131. }
  2132. CMD:ftowcars(playerid, params[])
  2133. {
  2134. new factionid = pInfo[playerid][Faction], string[128], pname[MAX_PLAYER_NAME+1];
  2135. if(pInfo[playerid][Faction] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not in a faction!");
  2136. if(pInfo[playerid][FactionTier] == 3 || pInfo[playerid][FactionTier] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Only tier 1 or 2 can do this command!");
  2137. GetPlayerName(playerid, pname, sizeof(pname));
  2138. if(pInfo[playerid][Faction] <= 3 && pInfo[playerid][FactionTier] < 3)
  2139. {
  2140. format(string, sizeof(string), "(%d) %s has just towed all the faction vehicles!", playerid, pname);
  2141. SendFactionMessage(factionid, string);
  2142. TowFactionVehicles(factionid);
  2143. printf(string);
  2144. }
  2145. return 1;
  2146. }
  2147. CMD:faction(playerid, params[])
  2148. {
  2149. new string[128], text[120], pname[MAX_PLAYER_NAME+1], factionid = pInfo[playerid][Faction];
  2150. if(sscanf(params, "s[64]", text)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /f(action) [text]");
  2151. if(pInfo[playerid][Faction] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not in a faction!");
  2152. if(FactionChat[factionid] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Faction chat is disabled!");
  2153. GetPlayerName(playerid, pname, sizeof(pname));
  2154. format(string, sizeof(string), "{ [%d] %s %s: %s }", playerid, pInfo[playerid][FactionRank], pname, text);
  2155. SendFactionMessage(factionid, string);
  2156. return 1;
  2157. }
  2158. CMD:f(playerid, params[]) return cmd_faction(playerid, params);
  2159. CMD:fnochat(playerid, params[])
  2160. {
  2161. new string[128], pname[MAX_PLAYER_NAME+1], factionid = pInfo[playerid][Faction];
  2162. if(pInfo[playerid][FactionTier] == 3 || pInfo[playerid][Faction] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're either not in a faction or you're not tier 1/2!");
  2163. GetPlayerName(playerid, pname, sizeof(pname));
  2164. if(FactionChat[factionid] == 0)
  2165. {
  2166. format(string, sizeof(string), "{ [%d] %s has just turned the faction chat on. }", playerid, pname);
  2167. FactionChat[factionid] = 1;
  2168. }
  2169. else if(FactionChat[factionid] == 1)
  2170. {
  2171. format(string, sizeof(string), "{ [%d] %s has just turned the faction chat off. }", playerid, pname);
  2172. FactionChat[factionid] = 0;
  2173. }
  2174. SendFactionMessage(factionid, string);
  2175. return 1;
  2176. }
  2177. // =-=-=-=-=-=-=-=-= ADMIN COMMANDS =-=-=-=-=-=-=-=-= //
  2178. CMD:makeadmin(playerid, params[])
  2179. {
  2180. new targetid, input, pname[MAX_PLAYER_NAME +1], tname[MAX_PLAYER_NAME +1], string[128];
  2181. if(sscanf(params, "ui", targetid, input)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /makeadmin [player] [level]");
  2182. GetPlayerName(playerid, pname, sizeof(pname)), GetPlayerName(targetid, tname, sizeof(tname));
  2183. if(IsPlayerAdmin(playerid) || pInfo[playerid][Admin] >= 3)
  2184. {
  2185. format(string, sizeof(string), "ADMCMD: (%d) %s has set (%d) %s to a level %d admin.", playerid, pname, targetid, tname, input);
  2186. SendAdminMessage(0x46E850FF, string);
  2187. format(string, sizeof(string), "You have been made a level %d administrator by (%d) %s.", input, playerid, pname);
  2188. SendClientMessage(targetid, -1, string);
  2189. pInfo[targetid][Admin] = input;
  2190. }
  2191. else SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Your admin level isn't high enough!");
  2192. if(pInfo[playerid][Admin] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not an administrator!");
  2193. return 1;
  2194. }
  2195. CMD:ahelp(playerid, params[])
  2196. {
  2197. if(pInfo[playerid][Admin] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not an administrator!");
  2198. SendClientMessage(playerid, 0x46E850FF, "Administrator Commands");
  2199. if(pInfo[playerid][Admin] > 0)
  2200. SendClientMessage(playerid, 0x46E850FF, "[LEVEL 1]:{FFFFFF} /a(chat), /aduty, /ann(ounce), /kick, /ban, /slap, /gethere, /goto, /gotopos, gotoveh, /getveh, /networkinfo");
  2201. SendClientMessage(playerid, 0x46E850FF, "[LEVEL 1]:{FFFFFF} /arevive");
  2202. if(pInfo[playerid][Admin] > 1)
  2203. SendClientMessage(playerid, 0x46E850FF, "[LEVEL 2]:{FFFFFF} /setskin, /sethealth, /setarmor, /fillhealth, /fillarmor, /giveweapon, /setmaskid, /setphonenr, /changegender");
  2204. SendClientMessage(playerid, 0x46E850FF, "[LEVEL 2]:{FFFFFF} /setfaction, /givemoney, /setmoney, /takemoney, /bizgoto, /housegoto, /setinterior, /setvirtualworld");
  2205. if(pInfo[playerid][Admin] > 2)
  2206. SendClientMessage(playerid, 0x46E850FF, "[LEVEL 3]:{FFFFFF} /housecreate, /housedelete, /housesellall, /houseedit, /bizcreate, /bizdelete, /bizaname");
  2207. return 1;
  2208. }
  2209. CMD:aduty(playerid, params[])
  2210. {
  2211. new string[128], pname[MAX_PLAYER_NAME+1];
  2212. GetPlayerName(playerid, pname, sizeof(pname));
  2213. if(pAdminDuty[playerid] == 0)
  2214. {
  2215. pAdminDuty[playerid] = 1;
  2216. SetPlayerColor(playerid, 0x46E850FF);
  2217. format(string, sizeof(string), "(%d) %s has just gone on admin duty!", playerid, pname);
  2218. SendAdminMessage(0x46E850FF, string);
  2219. }
  2220. else if(pAdminDuty[playerid] == 1)
  2221. {
  2222. pAdminDuty[playerid] = 0;
  2223. SetPlayerColor(playerid, 0x46E850FF);
  2224. format(string, sizeof(string), "(%d) %s has just gone off admin duty!", playerid, pname);
  2225. SendAdminMessage(0x46E850FF, string);
  2226. }
  2227. return 1;
  2228. }
  2229. CMD:achat(playerid, params[])
  2230. {
  2231. new string[128], text[128], pname[MAX_PLAYER_NAME+1];
  2232. GetPlayerName(playerid, pname, sizeof(pname));
  2233. if(sscanf(params, "s[128]", text)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /a(chat) [text]");
  2234. if(pInfo[playerid][Admin] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not an administrator!");
  2235. format(string, sizeof(string), "[LVL: %d]{FFFFFF} (%d) %s: %s", pInfo[playerid][Admin], playerid, pname, text);
  2236. SendAdminMessage(0x46E850FF, string);
  2237. return 1;
  2238. }
  2239. CMD:a(playerid, params[]) return cmd_achat(playerid, params);
  2240. CMD:arevive(playerid, params[])
  2241. {
  2242. new targetid, targetname[MAX_PLAYER_NAME], playername[MAX_PLAYER_NAME], string[128];
  2243. if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, -1, "/revive [target]");
  2244. if(pInfo[playerid][Admin] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not an administrator!");
  2245. GetPlayerName(playerid, playername, sizeof(playername)), GetPlayerName(targetid, targetname, sizeof(targetname));
  2246. if(pDeathMode[targetid] == 1)
  2247. {
  2248. KillTimer(pDeathModeTimer[targetid]);
  2249. TogglePlayerControllable(targetid, true);
  2250. SetPlayerColor(targetid, -1);
  2251. pDeathMode[targetid] = 0;
  2252. format(string, sizeof(string), "%s has just revived you!", playername);
  2253. SendClientMessage(targetid, -1, string);
  2254. format(string, sizeof(string), "You have just revived %s!", targetname);
  2255. SendClientMessage(playerid, -1, string);
  2256. }
  2257. else SendClientMessage(playerid, -1, "You can't revive that player because they're not in death mode!");
  2258. return 1;
  2259. }
  2260. CMD:announce(playerid, params[])
  2261. {
  2262. new string[128], text[128], pname[MAX_PLAYER_NAME+1];
  2263. GetPlayerName(playerid, pname, sizeof(pname));
  2264. if(sscanf(params, "s[128]", text)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /ann(ounce) [text]");
  2265. if(pInfo[playerid][Admin] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not an administrator!");
  2266. format(string, sizeof(string), "[ADM]{FFFFFF} (%d) %s: %s", playerid, pname, text);
  2267. SendClientMessageToAll(0x46E850FF, string);
  2268. return 1;
  2269. }
  2270. CMD:ann(playerid, params[]) return cmd_announce(playerid, params);
  2271. CMD:kick(playerid, params[])
  2272. {
  2273. new targetid, reason[128], string[128], tname[MAX_PLAYER_NAME+1], pname[MAX_PLAYER_NAME+1];
  2274. if(sscanf(params, "us[128]", targetid, reason)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /kick [player] [reason]");
  2275. if(pInfo[playerid][Admin] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not an administrator!");
  2276. GetPlayerName(playerid, pname, sizeof(pname)), GetPlayerName(targetid, tname, sizeof(tname));
  2277. format(string, sizeof(string), "ADMWRN: (%d) %s has just kicked (%d) %s for %s", playerid, pname, targetid, tname, reason);
  2278. SendClientMessageToAll(0x46E850FF, string);
  2279. Kick(targetid);
  2280. return 1;
  2281. }
  2282. CMD:ban(playerid, params[])
  2283. {
  2284. new targetid, reason[128], string[128], tname[MAX_PLAYER_NAME+1], pname[MAX_PLAYER_NAME+1];
  2285. if(sscanf(params, "us[128]", targetid, reason)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /ban [player] [reason]");
  2286. if(pInfo[playerid][Admin] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not an administrator!");
  2287. GetPlayerName(playerid, pname, sizeof(pname)), GetPlayerName(targetid, tname, sizeof(tname));
  2288. format(string, sizeof(string), "ADMWRN: (%d) %s has just banned (%d) %s for %s", playerid, pname, targetid, tname, reason);
  2289. SendClientMessageToAll(0x46E850FF, string);
  2290. Ban(targetid);
  2291. return 1;
  2292. }
  2293. CMD:slap(playerid, params[])
  2294. {
  2295. new targetid, string[128], tname[MAX_PLAYER_NAME+1], pname[MAX_PLAYER_NAME+1], Float: X, Float: Y, Float: Z;
  2296. if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /slap [player]");
  2297. if(pInfo[playerid][Admin] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not an administrator!");
  2298. if(pInfo[playerid][Admin] < 3 && pAdminDuty[playerid] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You need to be on admin duty in order to do this command!");
  2299. GetPlayerName(playerid, pname, sizeof(pname)), GetPlayerName(targetid, tname, sizeof(tname));
  2300. format(string, sizeof(string), "ADMCMD: (%d) %s has just slapped (%d) %s.", playerid, pname, targetid, tname);
  2301. SendAdminMessage(0x46E850FF, string);
  2302. format(string, sizeof(string), "You have been slapped by administrator (%d) %s.", playerid, pname);
  2303. SendClientMessage(targetid, -1, string);
  2304. GetPlayerPos(targetid, X, Y, Z);
  2305. SetPlayerPos(targetid, X, Y, Z +10);
  2306. return 1;
  2307. }
  2308. CMD:networkinfo(playerid, params[])
  2309. {
  2310. new targetid, string[128], tname[MAX_PLAYER_NAME+1], pname[MAX_PLAYER_NAME+1], vers[40], ipport[24];
  2311. if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /networkinfo [player]");
  2312. if(pInfo[playerid][Admin] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not an administrator!");
  2313. if(pInfo[playerid][Admin] < 3 && pAdminDuty[playerid] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You need to be on admin duty in order to do this command!");
  2314. GetPlayerName(playerid, pname, sizeof(pname)), GetPlayerName(targetid, tname, sizeof(tname));
  2315. GetPlayerVersion(targetid, vers, sizeof(vers)), GetPlayerIp(targetid, ipport, sizeof(ipport));
  2316. format(string, sizeof(string), "ADMCMD: (%d) %s has just checked (%d) %s's network information.", playerid, pname, targetid, tname);
  2317. SendAdminMessage(0x46E850FF, string);
  2318. format(string, sizeof(string), "{FFBB00}INFO:{FFFFFF} (%d) %s {FFBB00}MESSAGES SENT:{FFFFFF} %i", playerid, pname, (targetid));
  2319. SendClientMessage(playerid, -1, string);
  2320. format(string, sizeof(string), "{FFBB00}CLIENT VERSION:{FFFFFF} %s {FFBB00}CONNECTED FOR:{FFFFFF} %i ms.", vers, (targetid));
  2321. SendClientMessage(playerid, -1, string);
  2322. format(string, sizeof(string), "{FFBB00}IP ADDRESS:{FFFFFF} %s {FFBB00}PACKET LOSS:{FFFFFF} %0.2f", ipport, (targetid));
  2323. SendClientMessage(playerid, -1, string);
  2324. format(string, sizeof(string), "{FFBB00}CURRENT PING:{FFFFFF} %d {FFBB00}BYTES RECIEVED:{FFFFFF} %i", GetPlayerPing(targetid), (targetid));
  2325. SendClientMessage(playerid, -1, string);
  2326. return 1;
  2327. }
  2328. CMD:gethere(playerid, params[])
  2329. {
  2330. new targetid, string[128], tname[MAX_PLAYER_NAME+1], pname[MAX_PLAYER_NAME+1], Float: X, Float: Y, Float: Z;
  2331. if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /gethere [player]");
  2332. if(pInfo[playerid][Admin] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not an administrator!");
  2333. if(pInfo[playerid][Admin] < 3 && pAdminDuty[playerid] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You need to be on admin duty in order to do this command!");
  2334. GetPlayerName(playerid, pname, sizeof(pname)), GetPlayerName(targetid, tname, sizeof(tname));
  2335. format(string, sizeof(string), "ADMCMD: (%d) %s has just teleported (%d) %s to themself.", playerid, pname, targetid, tname);
  2336. SendAdminMessage(0x46E850FF, string);
  2337. format(string, sizeof(string), "You have been teleported to administrator (%d) %s.", playerid, pname);
  2338. SendClientMessage(targetid, -1, string);
  2339. GetPlayerPos(playerid, X, Y, Z);
  2340. SetPlayerPos(targetid, X, Y, Z);
  2341. return 1;
  2342. }
  2343. CMD:goto(playerid, params[])
  2344. {
  2345. new targetid, string[128], tname[MAX_PLAYER_NAME+1], pname[MAX_PLAYER_NAME+1], Float: X, Float: Y, Float: Z;
  2346. if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /goto [player]");
  2347. if(pInfo[playerid][Admin] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not an administrator!");
  2348. if(pInfo[playerid][Admin] < 3 && pAdminDuty[playerid] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You need to be on admin duty in order to do this command!");
  2349. GetPlayerName(playerid, pname, sizeof(pname)), GetPlayerName(targetid, tname, sizeof(tname));
  2350. format(string, sizeof(string), "ADMCMD: (%d) %s has just teleported to (%d) %s.", playerid, pname, targetid, tname);
  2351. SendAdminMessage(0x46E850FF, string);
  2352. format(string, sizeof(string), "Administrator (%d) %s has just teleported to you.", playerid, pname);
  2353. SendClientMessage(targetid, -1, string);
  2354. GetPlayerPos(targetid, X, Y, Z);
  2355. SetPlayerPos(playerid, X, Y, Z);
  2356. return 1;
  2357. }
  2358. CMD:gotopos(playerid, params[])
  2359. {
  2360. new string[128], pname[MAX_PLAYER_NAME+1], Float: X, Float: Y, Float: Z;
  2361. if(sscanf(params, "fff", X, Y, Z)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /gotopos [x] [y] [z]");
  2362. if(pInfo[playerid][Admin] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not an administrator!");
  2363. if(pInfo[playerid][Admin] < 3 && pAdminDuty[playerid] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You need to be on admin duty in order to do this command!");
  2364. GetPlayerName(playerid, pname, sizeof(pname));
  2365. format(string, sizeof(string), "ADMCMD: (%d) %s has just teleported to coordinates: %f %f %f.", playerid, pname, X, Y, Z);
  2366. SendAdminMessage(0x46E850FF, string);
  2367. SetPlayerPos(playerid, X, Y, Z);
  2368. return 1;
  2369. }
  2370. CMD:gotoveh(playerid, params[])
  2371. {
  2372. new vehicle, string[128], pname[MAX_PLAYER_NAME+1], Float: X, Float: Y, Float: Z;
  2373. if(sscanf(params, "i", vehicle)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /gotoveh [vehicle]");
  2374. if(pInfo[playerid][Admin] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not an administrator!");
  2375. if(pInfo[playerid][Admin] < 3 && pAdminDuty[playerid] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You need to be on admin duty in order to do this command!");
  2376. GetPlayerName(playerid, pname, sizeof(pname));
  2377. format(string, sizeof(string), "ADMCMD: (%d) %s has just teleported to vehicle ID %d.", playerid, pname, vehicle);
  2378. SendAdminMessage(0x46E850FF, string);
  2379. GetVehiclePos(vehicle, X, Y, Z);
  2380. SetPlayerPos(playerid, X, Y, Z);
  2381. return 1;
  2382. }
  2383. CMD:getveh(playerid, params[])
  2384. {
  2385. new vehicle, string[128], pname[MAX_PLAYER_NAME+1], Float: X, Float: Y, Float: Z;
  2386. if(sscanf(params, "i", vehicle)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /getveh [vehicle]");
  2387. if(pInfo[playerid][Admin] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not an administrator!");
  2388. if(pInfo[playerid][Admin] < 3 && pAdminDuty[playerid] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You need to be on admin duty in order to do this command!");
  2389. GetPlayerName(playerid, pname, sizeof(pname));
  2390. format(string, sizeof(string), "ADMCMD: (%d) %s has just teleported vehicle ID %d to themself.", playerid, pname, vehicle);
  2391. SendAdminMessage(0x46E850FF, string);
  2392. GetPlayerPos(playerid, X, Y, Z);
  2393. SetVehiclePos(vehicle, X, Y, Z);
  2394. return 1;
  2395. }
  2396. // Level two administrator commands
  2397. CMD:setint(playerid, params[])
  2398. {
  2399. new targetid, interior, string[128], tname[MAX_PLAYER_NAME+1], pname[MAX_PLAYER_NAME+1];
  2400. if(sscanf(params, "ui", targetid, interior)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /setint [player] [interior]");
  2401. if(pInfo[playerid][Admin] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not an administrator!");
  2402. if(pInfo[playerid][Admin] < 3 && pAdminDuty[playerid] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You need to be on admin duty in order to do this command!");
  2403. if(pInfo[playerid][Admin] > 1)
  2404. {
  2405. GetPlayerName(playerid, pname, sizeof(pname)), GetPlayerName(targetid, tname, sizeof(tname));
  2406. format(string, sizeof(string), "ADMCMD: (%d) %s has just set (%d) %s's interior to %d.", playerid, pname, targetid, tname, interior);
  2407. SendAdminMessage(0x46E850FF, string);
  2408. format(string, sizeof(string), "Administrator (%d) %s has just set your interior to %d.", playerid, pname, interior);
  2409. SendClientMessage(targetid, -1, string);
  2410. SetPlayerInterior(playerid, interior);
  2411. }
  2412. return 1;
  2413. }
  2414. CMD:setvirtualworld(playerid, params[])
  2415. {
  2416. new targetid, interior, string[128], tname[MAX_PLAYER_NAME+1], pname[MAX_PLAYER_NAME+1];
  2417. if(sscanf(params, "ui", targetid, interior)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /setvirtualworld [player] [virtualworld]");
  2418. if(pInfo[playerid][Admin] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not an administrator!");
  2419. if(pInfo[playerid][Admin] < 3 && pAdminDuty[playerid] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You need to be on admin duty in order to do this command!");
  2420. if(pInfo[playerid][Admin] > 1)
  2421. {
  2422. GetPlayerName(playerid, pname, sizeof(pname)), GetPlayerName(targetid, tname, sizeof(tname));
  2423. format(string, sizeof(string), "ADMCMD: (%d) %s has just set (%d) %s's virtual world to %d.", playerid, pname, targetid, tname, interior);
  2424. SendAdminMessage(0x46E850FF, string);
  2425. format(string, sizeof(string), "Administrator (%d) %s has just set your virtual world to %d.", playerid, pname, interior);
  2426. SendClientMessage(targetid, -1, string);
  2427. SetPlayerVirtualWorld(playerid, interior);
  2428. }
  2429. return 1;
  2430. }
  2431. CMD:setskin(playerid, params[])
  2432. {
  2433. new targetid, skin, string[128], tname[MAX_PLAYER_NAME+1], pname[MAX_PLAYER_NAME+1];
  2434. if(sscanf(params, "ui", targetid, skin)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /setskin [player] [skin]");
  2435. if(pInfo[playerid][Admin] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not an administrator!");
  2436. if(pInfo[playerid][Admin] < 3 && pAdminDuty[playerid] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You need to be on admin duty in order to do this command!");
  2437. if(pInfo[playerid][Admin] > 1)
  2438. {
  2439. GetPlayerName(playerid, pname, sizeof(pname)), GetPlayerName(targetid, tname, sizeof(tname));
  2440. format(string, sizeof(string), "ADMCMD: (%d) %s has just set (%d) %s's skin to ID %d.", playerid, pname, targetid, tname, skin);
  2441. SendAdminMessage(0x46E850FF, string);
  2442. format(string, sizeof(string), "Administrator (%d) %s has just set your skin to ID %d.", playerid, pname, skin);
  2443. SendClientMessage(targetid, -1, string);
  2444. SetPlayerSkin(targetid, skin);
  2445. }
  2446. return 1;
  2447. }
  2448. CMD:sethealth(playerid, params[])
  2449. {
  2450. new targetid, amount, string[128], tname[MAX_PLAYER_NAME+1], pname[MAX_PLAYER_NAME+1];
  2451. if(sscanf(params, "ui", targetid, amount)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /sethealth [player] [amount]");
  2452. if(pInfo[playerid][Admin] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not an administrator!");
  2453. if(pInfo[playerid][Admin] < 3 && pAdminDuty[playerid] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You need to be on admin duty in order to do this command!");
  2454. if(pInfo[playerid][Admin] > 1)
  2455. {
  2456. GetPlayerName(playerid, pname, sizeof(pname)), GetPlayerName(targetid, tname, sizeof(tname));
  2457. format(string, sizeof(string), "ADMCMD: (%d) %s has just set (%d) %s's health to %d.", playerid, pname, targetid, tname, amount);
  2458. SendAdminMessage(0x46E850FF, string);
  2459. format(string, sizeof(string), "Administrator (%d) %s has just set your health to %d.", playerid, pname, amount);
  2460. SendClientMessage(targetid, -1, string);
  2461. SetPlayerHealth(targetid, amount);
  2462. }
  2463. return 1;
  2464. }
  2465. CMD:setarmor(playerid, params[])
  2466. {
  2467. new targetid, amount, string[128], tname[MAX_PLAYER_NAME+1], pname[MAX_PLAYER_NAME+1];
  2468. if(sscanf(params, "ui", targetid, amount)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /setarmor [player] [amount]");
  2469. if(pInfo[playerid][Admin] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not an administrator!");
  2470. if(pInfo[playerid][Admin] < 3 && pAdminDuty[playerid] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You need to be on admin duty in order to do this command!");
  2471. if(pInfo[playerid][Admin] > 1)
  2472. {
  2473. GetPlayerName(playerid, pname, sizeof(pname)), GetPlayerName(targetid, tname, sizeof(tname));
  2474. format(string, sizeof(string), "ADMCMD: (%d) %s has just set (%d) %s's armor to %d.", playerid, pname, targetid, tname, amount);
  2475. SendAdminMessage(0x46E850FF, string);
  2476. format(string, sizeof(string), "Administrator (%d) %s has just set your armor to %d.", playerid, pname, amount);
  2477. SendClientMessage(targetid, -1, string);
  2478. SetPlayerArmour(targetid, amount);
  2479. }
  2480. return 1;
  2481. }
  2482. CMD:fillhealth(playerid, params[])
  2483. {
  2484. new targetid, string[128], tname[MAX_PLAYER_NAME+1], pname[MAX_PLAYER_NAME+1];
  2485. if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /fillhealth [player]");
  2486. if(pInfo[playerid][Admin] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not an administrator!");
  2487. if(pInfo[playerid][Admin] < 3 && pAdminDuty[playerid] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You need to be on admin duty in order to do this command!");
  2488. if(pInfo[playerid][Admin] > 1)
  2489. {
  2490. GetPlayerName(playerid, pname, sizeof(pname)), GetPlayerName(targetid, tname, sizeof(tname));
  2491. format(string, sizeof(string), "ADMCMD: (%d) %s has just set (%d) %s's armor to 100.", playerid, pname, targetid, tname);
  2492. SendAdminMessage(0x46E850FF, string);
  2493. format(string, sizeof(string), "Administrator (%d) %s has just set your armor to 100.", playerid, pname);
  2494. SendClientMessage(targetid, -1, string);
  2495. SetPlayerHealth(targetid, 100);
  2496. }
  2497. return 1;
  2498. }
  2499. CMD:fillarmor(playerid, params[])
  2500. {
  2501. new targetid, string[128], tname[MAX_PLAYER_NAME+1], pname[MAX_PLAYER_NAME+1];
  2502. if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /fillarmor [player]");
  2503. if(pInfo[playerid][Admin] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not an administrator!");
  2504. if(pInfo[playerid][Admin] < 3 && pAdminDuty[playerid] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You need to be on admin duty in order to do this command!");
  2505. if(pInfo[playerid][Admin] > 1)
  2506. {
  2507. GetPlayerName(playerid, pname, sizeof(pname)), GetPlayerName(targetid, tname, sizeof(tname));
  2508. format(string, sizeof(string), "ADMCMD: (%d) %s has just set (%d) %s's armor to 100.", playerid, pname, targetid, tname);
  2509. SendAdminMessage(0x46E850FF, string);
  2510. format(string, sizeof(string), "Administrator (%d) %s has just set your armor to 100.", playerid, pname);
  2511. SendClientMessage(targetid, -1, string);
  2512. SetPlayerArmour(targetid, 100);
  2513. }
  2514. return 1;
  2515. }
  2516. CMD:giveweapon(playerid, params[])
  2517. {
  2518. new targetid, weapon, ammo, string[128], tname[MAX_PLAYER_NAME+1], pname[MAX_PLAYER_NAME+1];
  2519. if(sscanf(params, "uii", targetid, weapon, ammo)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /giveweapon [player] [weapon] [ammo]");
  2520. if(pInfo[playerid][Admin] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not an administrator!");
  2521. if(pInfo[playerid][Admin] < 3 && pAdminDuty[playerid] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You need to be on admin duty in order to do this command!");
  2522. if(pInfo[playerid][Admin] > 1)
  2523. {
  2524. GetPlayerName(playerid, pname, sizeof(pname)), GetPlayerName(targetid, tname, sizeof(tname));
  2525. GivePlayerWeapon(targetid, weapon, ammo);
  2526. format(string, sizeof(string), "ADMCMD: (%d) %s has just given (%d) %s a %s with %d ammo.", playerid, pname, targetid, tname, GunName[weapon], ammo);
  2527. SendAdminMessage(0x46E850FF, string);
  2528. format(string, sizeof(string), "Administrator (%d) %s has just given you a %s with %d ammo.", playerid, pname, GunName[weapon], ammo);
  2529. SendClientMessage(targetid, -1, string);
  2530. }
  2531. return 1;
  2532. }
  2533. CMD:givemask(playerid, params[])
  2534. {
  2535. new targetid, string[128], tname[MAX_PLAYER_NAME+1], pname[MAX_PLAYER_NAME+1];
  2536. if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /givemask [player]");
  2537. if(pInfo[playerid][Admin] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not an administrator!");
  2538. if(pInfo[playerid][Admin] < 3 && pAdminDuty[playerid] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You need to be on admin duty in order to do this command!");
  2539. if(pInfo[playerid][Admin] > 1)
  2540. {
  2541. GetPlayerName(playerid, pname, sizeof(pname)), GetPlayerName(targetid, tname, sizeof(tname));
  2542. format(string, sizeof(string), "ADMCMD: (%d) %s has just given (%d) %s a mask.", playerid, pname, targetid, tname);
  2543. SendAdminMessage(0x46E850FF, string);
  2544. format(string, sizeof(string), "Administrator (%d) %s has just given you a mask.", playerid, pname);
  2545. SendClientMessage(targetid, -1, string);
  2546. pInfo[playerid][Mask] = 1;
  2547. }
  2548. return 1;
  2549. }
  2550. CMD:takemask(playerid, params[])
  2551. {
  2552. new targetid, string[128], tname[MAX_PLAYER_NAME+1], pname[MAX_PLAYER_NAME+1];
  2553. if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /takemask [player]");
  2554. if(pInfo[playerid][Admin] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not an administrator!");
  2555. if(pInfo[playerid][Admin] < 3 && pAdminDuty[playerid] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You need to be on admin duty in order to do this command!");
  2556. if(pInfo[playerid][Admin] > 1)
  2557. {
  2558. GetPlayerName(playerid, pname, sizeof(pname)), GetPlayerName(targetid, tname, sizeof(tname));
  2559. format(string, sizeof(string), "ADMCMD: (%d) %s has just taken (%d) %s's mask.", playerid, pname, targetid, tname);
  2560. SendAdminMessage(0x46E850FF, string);
  2561. format(string, sizeof(string), "Administrator (%d) %s has just taken your mask.", playerid, pname);
  2562. SendClientMessage(targetid, -1, string);
  2563. pInfo[playerid][Mask] = 0;
  2564. }
  2565. return 1;
  2566. }
  2567. CMD:setmaskid(playerid, params[])
  2568. {
  2569. new targetid, input, string[128], tname[MAX_PLAYER_NAME+1], pname[MAX_PLAYER_NAME+1];
  2570. if(sscanf(params, "ui", targetid, input)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /setmaskid [player] [mask ID]");
  2571. if(pInfo[playerid][Admin] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not an administrator!");
  2572. if(pInfo[playerid][Admin] < 3 && pAdminDuty[playerid] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You need to be on admin duty in order to do this command!");
  2573. if(pInfo[playerid][Admin] > 1)
  2574. {
  2575. GetPlayerName(playerid, pname, sizeof(pname)), GetPlayerName(targetid, tname, sizeof(tname));
  2576. format(string, sizeof(string), "ADMCMD: (%d) %s has just set (%d) %s's mask ID to %d.", playerid, pname, targetid, tname, input);
  2577. SendAdminMessage(0x46E850FF, string);
  2578. format(string, sizeof(string), "Administrator (%d) %s has just set your mask ID to %d.", playerid, pname, input);
  2579. SendClientMessage(targetid, -1, string);
  2580. pInfo[playerid][MaskID] = input;
  2581. }
  2582. return 1;
  2583. }
  2584. CMD:setphonenr(playerid, params[])
  2585. {
  2586. new targetid, input, string[128], tname[MAX_PLAYER_NAME+1], pname[MAX_PLAYER_NAME+1];
  2587. if(sscanf(params, "ui", targetid, input)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /setphonenr [player] [number]");
  2588. if(pInfo[playerid][Admin] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not an administrator!");
  2589. if(pInfo[playerid][Admin] < 3 && pAdminDuty[playerid] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You need to be on admin duty in order to do this command!");
  2590. if(pInfo[playerid][Admin] > 1)
  2591. {
  2592. GetPlayerName(playerid, pname, sizeof(pname)), GetPlayerName(targetid, tname, sizeof(tname));
  2593. format(string, sizeof(string), "ADMCMD: (%d) %s has just set (%d) %s's phone number to %d.", playerid, pname, targetid, tname, input);
  2594. SendAdminMessage(0x46E850FF, string);
  2595. format(string, sizeof(string), "Administrator (%d) %s has just set your phone number to %d.", playerid, pname, input);
  2596. SendClientMessage(targetid, -1, string);
  2597. pInfo[playerid][PhoneNumber] = input;
  2598. }
  2599. return 1;
  2600. }
  2601. CMD:changegender(playerid, params[])
  2602. {
  2603. new targetid, input, string[128], tname[MAX_PLAYER_NAME+1], pname[MAX_PLAYER_NAME+1], holder[30];
  2604. if(sscanf(params, "ui", targetid, input)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /changegender [player] [gender: 1 = male, 2 = female]");
  2605. if(pInfo[playerid][Admin] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not an administrator!");
  2606. if(pInfo[playerid][Admin] < 3 && pAdminDuty[playerid] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You need to be on admin duty in order to do this command!");
  2607. if(pInfo[playerid][Admin] > 1)
  2608. {
  2609. GetPlayerName(playerid, pname, sizeof(pname)), GetPlayerName(targetid, tname, sizeof(tname));
  2610. if(input == 1) holder = "male";
  2611. else if(input == 2) holder = "female";
  2612. format(string, sizeof(string), "ADMCMD: (%d) %s has just set (%d) %s's gender to %s (I: %d).", playerid, pname, targetid, tname, holder, input);
  2613. SendAdminMessage(0x46E850FF, string);
  2614. format(string, sizeof(string), "Administrator (%d) %s has just set your gender to %s (I: %d).", playerid, pname, holder, input);
  2615. SendClientMessage(targetid, -1, string);
  2616. pInfo[playerid][Gender] = input;
  2617. }
  2618. return 1;
  2619. }
  2620. CMD:setfaction(playerid, params[])
  2621. {
  2622. new targetid, input, tier, string[128], tname[MAX_PLAYER_NAME+1], pname[MAX_PLAYER_NAME+1];
  2623. if(sscanf(params, "uii", targetid, input, tier)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /setfaction [player] [faction] [tier]");
  2624. if(input > 5) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} There are only five factions. Value can't be higher than five.");
  2625. if(pInfo[playerid][Admin] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not an administrator!");
  2626. if(pInfo[playerid][Admin] < 3 && pAdminDuty[playerid] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You need to be on admin duty in order to do this command!");
  2627. if(pInfo[playerid][Admin] > 1)
  2628. {
  2629. GetPlayerName(playerid, pname, sizeof(pname)), GetPlayerName(targetid, tname, sizeof(tname));
  2630. pInfo[playerid][Faction] = input; // before messages because GetFactionName
  2631. pInfo[targetid][FactionTier] = tier;
  2632. format(string, sizeof(string), "ADMCMD: (%d) %s has just set (%d) %s's faction to (I: %d) %s with tier %d.", playerid, pname, targetid, tname, input, GetFactionName(targetid), tier);
  2633. SendAdminMessage(0x46E850FF, string);
  2634. format(string, sizeof(string), "Administrator (%d) %s has just set your faction to (I: %d) %s with tier %d.", playerid, pname, input, GetFactionName(targetid), tier);
  2635. SendClientMessage(targetid, -1, string);
  2636. }
  2637. return 1;
  2638. }
  2639. CMD:givemoney(playerid, params[])
  2640. {
  2641. new targetid, money, string[128], tname[MAX_PLAYER_NAME+1], pname[MAX_PLAYER_NAME+1];
  2642. if(sscanf(params, "ui", targetid, money)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /givemoney [player] [money]");
  2643. if(pInfo[playerid][Admin] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not an administrator!");
  2644. if(pInfo[playerid][Admin] < 3 && pAdminDuty[playerid] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You need to be on admin duty in order to do this command!");
  2645. if(pInfo[playerid][Admin] > 1)
  2646. {
  2647. GetPlayerName(playerid, pname, sizeof(pname)), GetPlayerName(targetid, tname, sizeof(tname));
  2648. GivePlayerMoney(playerid, money);
  2649. format(string, sizeof(string), "ADMCMD: (%d) %s has just given (%d) %s $%d.", playerid, pname, targetid, tname, money);
  2650. SendAdminMessage(0x46E850FF, string);
  2651. format(string, sizeof(string), "Administrator (%d) %s has just given you $%d.", playerid, pname, money);
  2652. SendClientMessage(targetid, -1, string);
  2653. }
  2654. return 1;
  2655. }
  2656. CMD:takemoney(playerid, params[])
  2657. {
  2658. new targetid, money, string[128], tname[MAX_PLAYER_NAME+1], pname[MAX_PLAYER_NAME+1];
  2659. if(sscanf(params, "ui", targetid, money)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /takemoney [player] [money]");
  2660. if(pInfo[playerid][Admin] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not an administrator!");
  2661. if(pInfo[playerid][Admin] < 3 && pAdminDuty[playerid] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You need to be on admin duty in order to do this command!");
  2662. if(pInfo[playerid][Admin] > 1)
  2663. {
  2664. GetPlayerName(playerid, pname, sizeof(pname)), GetPlayerName(targetid, tname, sizeof(tname));
  2665. GivePlayerMoney(playerid, -money);
  2666. format(string, sizeof(string), "ADMCMD: (%d) %s has just fined (%d) %s $%d.", playerid, pname, targetid, tname, money);
  2667. SendAdminMessage(0x46E850FF, string);
  2668. format(string, sizeof(string), "Administrator (%d) %s has just fined you $%d.", playerid, pname, money);
  2669. SendClientMessage(targetid, -1, string);
  2670. }
  2671. return 1;
  2672. }
  2673. CMD:setmoney(playerid, params[])
  2674. {
  2675. new targetid, money, string[128], tname[MAX_PLAYER_NAME+1], pname[MAX_PLAYER_NAME+1];
  2676. if(sscanf(params, "ui", targetid, money)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /setmoney [id/ime] [pari]");
  2677. if(pInfo[playerid][Admin] == 0) return SendClientMessage(playerid, 0x46E850FF, "GRESKA:{FFFFFF} Ne ste administrator!");
  2678. if(pInfo[playerid][Admin] < 3 && pAdminDuty[playerid] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Mora da bidete admin da dolznost za da ja koristite ovaa komanda!");
  2679. if(pInfo[playerid][Admin] > 1)
  2680. {
  2681. GetPlayerName(playerid, pname, sizeof(pname)), GetPlayerName(targetid, tname, sizeof(tname));
  2682. ResetPlayerMoney(playerid);
  2683. GivePlayerMoney(playerid, money);
  2684. format(string, sizeof(string), "ADMCMD: (%d) %s gi namesti parite na (%d) %s $%d.", playerid, pname, targetid, tname, money);
  2685. SendAdminMessage(0x46E850FF, string);
  2686. format(string, sizeof(string), "Administrator (%d) %s samo sto vi gi namesti parite na $%d.", playerid, pname, money);
  2687. SendClientMessage(targetid, -1, string);
  2688. }
  2689. return 1;
  2690. }
  2691. CMD:housegoto(playerid, params[])
  2692. {
  2693. new id;
  2694. if(sscanf(params, "i", id)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /housegoto [id]");
  2695. if(pInfo[playerid][Admin] < 3 && pAdminDuty[playerid] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not an administrator!");
  2696. if(pInfo[playerid][Admin] > 1)
  2697. {
  2698. SetPlayerPos(playerid, hInfo[id][extX], hInfo[id][extY], hInfo[id][extZ]);
  2699. }
  2700. return 1;
  2701. }
  2702. CMD:bizgoto(playerid, params[])
  2703. {
  2704. new id;
  2705. if(sscanf(params, "i", id)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /bizgoto [id]");
  2706. if(pInfo[playerid][Admin] < 3 && pAdminDuty[playerid] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not an administrator!");
  2707. if(pInfo[playerid][Admin] > 1)
  2708. {
  2709. SetPlayerPos(playerid, bInfo[id][extX], bInfo[id][extY], bInfo[id][extZ]);
  2710. }
  2711. return 1;
  2712. }
  2713. // Level three admin commands
  2714. // admin
  2715. // house
  2716. CMD:housecreate(playerid, params[])
  2717. {
  2718. new Float: X, Float: Y, Float: Z, hlabel[128], h;
  2719. GetPlayerPos(playerid, X, Y, Z);
  2720. if(pInfo[playerid][Admin] < 3) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Ne ste administrator!");
  2721. new INI:File = INI_Open(HousePath(h));
  2722. INI_SetTag(File, "House Data");
  2723. INI_WriteString(File, "Owner", "None");
  2724. INI_WriteInt(File, "Price", 25000);
  2725. INI_WriteInt(File, "Bought", 0);
  2726. INI_WriteFloat(File, "extX", X);
  2727. INI_WriteFloat(File, "extY", Y);
  2728. INI_WriteFloat(File, "extZ", Z);
  2729. INI_WriteFloat(File, "intX", 244.411987);
  2730. INI_WriteFloat(File, "intY", 305.032989);
  2731. INI_WriteFloat(File, "intZ", 999.148437);
  2732. INI_WriteInt(File, "intVW", random(999));
  2733. INI_WriteInt(File, "intW", 1);
  2734. INI_Close(File);
  2735. format(hlabel, 128, "[Kukja na prodazba]\n{46E850}[Owner]{FFFFFF}: None\n{46E850}[Price]{FFFFFF}: $25000");
  2736. Create3DTextLabel(hlabel, 0xFFFFFFFF, X, Y, Z, 15.0, 0, 1);
  2737. return 1;
  2738. }
  2739. CMD:housedelete(playerid, params[])
  2740. {
  2741. new hid, loc[30], string[128];
  2742. if(sscanf(params, "i", hid)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /housedelete [hid]");
  2743. if(pInfo[playerid][Admin] < 3) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Ne ste administrator!");
  2744. format(loc, 30, "Houses/%d.ini", hid);
  2745. if(!fexist(loc)) SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Nepostoi ID'ot od kukjata.");
  2746. else if(fexist(loc))
  2747. {
  2748. format(string, sizeof(string), "SERVER:{FFFFFF} Ja izbrisavte kukjata so ID: %d", hid);
  2749. SendClientMessage(playerid, 0x46E850FF, string);
  2750. fremove(loc);
  2751. }
  2752. return 1;
  2753. }
  2754. CMD:housesellall(playerid, params[])
  2755. {
  2756. new string[25];
  2757. format(string, 25, "None");
  2758. if(pInfo[playerid][Admin] < 3) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Ne ste administrator!");
  2759. for(new i = 0; i < MAX_HOUSES; i++)
  2760. {
  2761. hInfo[i][Owner] = string;
  2762. hInfo[i][Bought] = 0;
  2763. pInfo[i][HouseOwner] = 9999;
  2764. }
  2765. SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You sold all houses!");
  2766. ReloadLabels();
  2767. return 1;
  2768. }
  2769. CMD:houseedit(playerid, params[])
  2770. {
  2771. new hid, interior, price, string[128];
  2772. if(sscanf(params, "iii", hid, interior, price)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /houseedit [hid] [interior] [price]");
  2773. if(pInfo[playerid][Admin] < 3) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not an administrator!");
  2774. hInfo[hid][Price] = price;
  2775. if(interior == 1) // Small
  2776. {
  2777. hInfo[hid][intX] = 244.411987;
  2778. hInfo[hid][intY] = 305.032989;
  2779. hInfo[hid][intZ] = 999.148437;
  2780. hInfo[hid][intW] = 1;
  2781. format(string, sizeof(string), "SERVER:{FFFFFF} ID: %d's interior changed to ID: 1 {46E850}(small){FFFFFF}.", hid);
  2782. SendClientMessage(playerid, 0x46E850FF, string);
  2783. }
  2784. else if(interior == 2) // Average
  2785. {
  2786. hInfo[hid][intX] = 223.1329;
  2787. hInfo[hid][intY] = 1287.0760;
  2788. hInfo[hid][intZ] = 1082.1406;
  2789. hInfo[hid][intW] = 1;
  2790. format(string, sizeof(string), "SERVER:{FFFFFF} ID: %d's interior changed to ID: 2 {46E850}(average){FFFFFF}.", hid);
  2791. SendClientMessage(playerid, 0x46E850FF, string);
  2792. }
  2793. else if(interior == 3) // Above Average
  2794. {
  2795. hInfo[hid][intX] = 327.97980;
  2796. hInfo[hid][intY] = 1478.0880;
  2797. hInfo[hid][intZ] = 1084.4375;
  2798. hInfo[hid][intW] = 15;
  2799. format(string, sizeof(string), "SERVER:{FFFFFF} ID: %d's interior changed to ID: 3 {46E850}(above average){FFFFFF}.", hid);
  2800. SendClientMessage(playerid, 0x46E850FF, string);
  2801. }
  2802. else if(interior == 4) // Luxury
  2803. {
  2804. hInfo[hid][intX] = 446.9538;
  2805. hInfo[hid][intY] = 1397.5261;
  2806. hInfo[hid][intZ] = 1084.3047;
  2807. hInfo[hid][intW] = 2;
  2808. format(string, sizeof(string), "SERVER:{FFFFFF} ID: %d's interior changed to ID: 4 {46E850}(luxury){FFFFFF}.", hid);
  2809. SendClientMessage(playerid, 0x46E850FF, string);
  2810. }
  2811. ReloadLabels();
  2812. return 1;
  2813. }
  2814. //biz
  2815. CMD:bizaname(playerid, params[])
  2816. {
  2817. new str1[128], bid, name[45];
  2818. if(sscanf(params, "is[45]", bid, name)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /bizaname [name]");
  2819. bInfo[bid][Name] = name;
  2820. format(str1, sizeof(str1), "SERVER:{FFFFFF} You have set business ID: %d's name to %s.", bid, name);
  2821. SendClientMessage(playerid, 0x46E850FF, str1);
  2822. ReloadLabels();
  2823. return 1;
  2824. }
  2825. CMD:bizcreate(playerid, params[])
  2826. {
  2827. new Float: X, Float: Y, Float: Z, blabel[128], b;
  2828. GetPlayerPos(playerid, X, Y, Z);
  2829. if(pInfo[playerid][Admin] < 3) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not an administrator!");
  2830. new INI:File = INI_Open(BizPath(b));
  2831. INI_SetTag(File, "Business Data");
  2832. INI_WriteString(File, "Name", "None");
  2833. INI_WriteString(File, "Owner", "None");
  2834. INI_WriteInt(File, "Price", 150000);
  2835. INI_WriteInt(File, "Bought", 0);
  2836. INI_WriteInt(File, "Locked", 0);
  2837. INI_WriteInt(File, "Fee", 0);
  2838. INI_WriteInt(File, "Till", 0);
  2839. INI_WriteInt(File, "IntSet", 0);
  2840. INI_WriteFloat(File, "extX", X);
  2841. INI_WriteFloat(File, "extY", Y);
  2842. INI_WriteFloat(File, "extZ", Z);
  2843. INI_WriteFloat(File, "intX", 2131.507812);
  2844. INI_WriteFloat(File, "intY", 1600.818481);
  2845. INI_WriteFloat(File, "intZ", 1008.359375);
  2846. INI_WriteInt(File, "intVW", random(999));
  2847. INI_WriteInt(File, "intW", 1);
  2848. INI_Close(File);
  2849. format(blabel, 128, "[BUSINESS: FOR SALE]\n{46E850}[Owner]{FFFFFF}: None\n{46E850}[Price]{FFFFFF}: $25000");
  2850. Create3DTextLabel(blabel, 0xFFFFFF, X, Y, Z, 15.0, 0, 1);
  2851. return 1;
  2852. }
  2853. CMD:bizdelete(playerid, params[])
  2854. {
  2855. new bid, loc[30], string[128];
  2856. if(sscanf(params, "i", bid)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /bizdelete [bid]");
  2857. if(pInfo[playerid][Admin] < 3) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not an administrator!");
  2858. format(loc, 30, "Businesses/%d.ini", bid);
  2859. if(!fexist(loc)) SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} The business ID you entered doesn't exist.");
  2860. else if(fexist(loc))
  2861. {
  2862. format(string, sizeof(string), "SERVER:{FFFFFF} You have deleted business ID: %d", bid);
  2863. SendClientMessage(playerid, 0x46E850FF, string);
  2864. fremove(loc);
  2865. }
  2866. return 1;
  2867. }
  2868. CMD:reloadbizzes(playerid, params[])
  2869. {
  2870. new string[128], pname[MAX_PLAYER_NAME];
  2871. GetPlayerName(playerid, pname, sizeof(pname));
  2872. if(pInfo[playerid][Admin] < 3) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not an administrator!");
  2873. ReloadLabels();
  2874. format(string, sizeof(string), "SERVER:{FFFFFF} All businesses have been reloaded by administrator %s (%d)!", pname, playerid);
  2875. SendClientMessageToAll(0x46E850FF, string);
  2876. return 1;
  2877. }
  2878. forward LoadUser_data(playerid, name[], value[]);
  2879. public LoadUser_data(playerid, name[], value[])
  2880. {
  2881. INI_Int("Password", pInfo[playerid][Pass]);
  2882. INI_Int("Admin", pInfo[playerid][Admin]);
  2883. INI_Int("Level", pInfo[playerid][Level]);
  2884. INI_Int("Skin", pInfo[playerid][Skin]);
  2885. INI_Int("Exp", pInfo[playerid][Exp]);
  2886. INI_Int("CurExp", pInfo[playerid][CurExp]);
  2887. INI_Int("Gender", pInfo[playerid][Gender]);
  2888. INI_Int("Registered", pInfo[playerid][Registered]);
  2889. INI_Float("Armour", pInfo[playerid][Armour]);
  2890. INI_Float("Health", pInfo[playerid][Health]);
  2891. INI_Int("HandMoney", pInfo[playerid][HandMoney]);
  2892. INI_Int("BankMoney", pInfo[playerid][BankMoney]);
  2893. INI_Int("Faction", pInfo[playerid][Faction]);
  2894. INI_Int("FactionTier", pInfo[playerid][FactionTier]);
  2895. INI_String("FactionRank", pInfo[playerid][FactionRank], 128);
  2896. INI_Int("Weapon1", pInfo[playerid][Weapon1]);
  2897. INI_Int("Wep1Ammo", pInfo[playerid][Wep1Ammo]);
  2898. INI_Int("Weapon2", pInfo[playerid][Weapon2]);
  2899. INI_Int("Wep2Ammo", pInfo[playerid][Wep2Ammo]);
  2900. INI_Int("Weapon3", pInfo[playerid][Weapon3]);
  2901. INI_Int("Wep3Ammo", pInfo[playerid][Wep3Ammo]);
  2902. INI_Int("Weapon4", pInfo[playerid][Weapon4]);
  2903. INI_Int("Wep4Ammo", pInfo[playerid][Wep4Ammo]);
  2904. INI_Int("Weapon5", pInfo[playerid][Weapon5]);
  2905. INI_Int("Wep5Ammo", pInfo[playerid][Wep5Ammo]);
  2906. INI_Int("Mask", pInfo[playerid][Mask]);
  2907. INI_Int("MaskID", pInfo[playerid][MaskID]);
  2908. INI_Int("PhoneNumber", pInfo[playerid][PhoneNumber]);
  2909. INI_Int("HouseOwner", pInfo[playerid][HouseOwner]);
  2910. INI_Int("VehicleOwner", pInfo[playerid][VehicleOwner]);
  2911. INI_Int("BizOwner", pInfo[playerid][BizOwner]);
  2912. INI_Int("lvDay", pInfo[playerid][lvDay]);
  2913. INI_Int("lvMonth", pInfo[playerid][lvMonth]);
  2914. INI_Int("lvYear", pInfo[playerid][lvYear]);
  2915. INI_Int("lvHour", pInfo[playerid][lvHour]);
  2916. INI_Int("lvMinute", pInfo[playerid][lvMinute]);
  2917. INI_Int("lvSecond", pInfo[playerid][lvSecond]);
  2918. INI_Int("LastPos", pInfo[playerid][LastPos]);
  2919. INI_Int("LastInt", pInfo[playerid][LastInt]);
  2920. INI_Int("LastVW", pInfo[playerid][LastVW]);
  2921. INI_Float("LastX", pInfo[playerid][LastX]);
  2922. INI_Float("LastY", pInfo[playerid][LastY]);
  2923. INI_Float("LastZ", pInfo[playerid][LastZ]);
  2924. return 1;
  2925. }
  2926. stock SendNearbyMessage(playerid, color, string[], Float: range)
  2927. { // Mione
  2928. new Float: X, Float: Y, Float:Z;
  2929. GetPlayerPos(playerid, X, Y, Z);
  2930. for(new i = 0; i < MAX_PLAYERS; i ++)
  2931. {
  2932. if(IsPlayerInRangeOfPoint(i, range, X, Y, Z))
  2933. {
  2934. SendClientMessage(i, color, string);
  2935. }
  2936. }
  2937. return 1;
  2938. }
  2939. stock SendAdminMessage(col, string[])
  2940. {
  2941. // Mione
  2942. for(new i = 0; i < MAX_PLAYERS; i++)
  2943. {
  2944. if(pInfo[i][Admin] > 0)
  2945. SendClientMessage(i, col, string);
  2946. }
  2947. return 1;
  2948. }
  2949. stock GetFactionChat(playerid, factionid)
  2950. {
  2951. new value;
  2952. factionid = pInfo[playerid][Faction];
  2953. if(factionid == 1)
  2954. {
  2955. if(FactionChat[factionid] == 0) value = 0;
  2956. else if(FactionChat[factionid] == 1) value = 2;
  2957. }
  2958. return value;
  2959. }
  2960. stock SendFactionMessage(factionid, string[])
  2961. {
  2962. for(new i = 0; i < MAX_PLAYERS; i++)
  2963. {
  2964. if(pInfo[i][Faction] == factionid)
  2965. {
  2966. SendClientMessage(i, 0xFFFFFAA, string);
  2967. printf(string); // logging purposes
  2968. }
  2969. }
  2970. return 1;
  2971. }
  2972. stock TowFactionVehicles(factionid)
  2973. {
  2974. if(factionid == 1)
  2975. {
  2976. for(new i = 0; i < 6; i++)
  2977. {
  2978. SetVehicleToRespawn(LEOveh[i]);
  2979. }
  2980. }
  2981. else if(factionid == 2)
  2982. {
  2983. for(new i = 0; i < 5; i++)
  2984. {
  2985. SetVehicleToRespawn(EMSveh[i]);
  2986. }
  2987. }
  2988. else if(factionid == 3)
  2989. {
  2990. for(new i = 0; i < 5; i++)
  2991. {
  2992. SetVehicleToRespawn(SANAveh[i]);
  2993. }
  2994. }
  2995. return 1;
  2996. }
  2997. stock GetFactionName(playerid)
  2998. {
  2999. new name[30];
  3000. if(pInfo[playerid][Faction] == 0)
  3001. name = "Civilian";
  3002. else if(pInfo[playerid][Faction] == 1)
  3003. name = "Law Enforcement Officials";
  3004. else if(pInfo[playerid][Faction] == 2)
  3005. name = "Emergency Medical Services";
  3006. else if(pInfo[playerid][Faction] == 3)
  3007. name = "Empty Faction";
  3008. else if(pInfo[playerid][Faction] == 4)
  3009. name = "Empty Faction";
  3010. else if(pInfo[playerid][Faction] == 5)
  3011. name = "Empty Faction";
  3012. return name;
  3013. }
  3014. stock UserPath(playerid)
  3015. {
  3016. new string[128], playername[MAX_PLAYER_NAME];
  3017. GetPlayerName(playerid, playername, sizeof(playername));
  3018. format(string, sizeof(string), "/Players/%s.ini", playername);
  3019. return string;
  3020. }
  3021. stock udb_hash(buf[])
  3022. { // Dracoblue
  3023. new length = strlen(buf);
  3024. new s1 = 1;
  3025. new s2 = 0;
  3026. new n;
  3027. for (n= 0; n < length; n ++)
  3028. {
  3029. s1 = (s1 + buf[n]) % 65521;
  3030. s2 = (s2 + s1) % 65521;
  3031. }
  3032. return (s2 << 16) + s1;
  3033. }
  3034. stock SaveHouses()
  3035. {
  3036. new file[64];
  3037. for(new h = 0; h < MAX_HOUSES; h++)
  3038. {
  3039. format(file, 64, "Houses/%d.ini", h);
  3040. if(fexist(file))
  3041. {
  3042. new INI:File = INI_Open(file);
  3043. INI_SetTag(File, "House Data");
  3044. INI_WriteString(File, "Owner", hInfo[h][Owner]);
  3045. INI_WriteInt(File, "Price", hInfo[h][Price]);
  3046. INI_WriteInt(File, "Bought", hInfo[h][Bought]);
  3047. INI_WriteFloat(File, "extX", hInfo[h][extX]);
  3048. INI_WriteFloat(File, "extY", hInfo[h][extY]);
  3049. INI_WriteFloat(File, "extZ", hInfo[h][extZ]);
  3050. INI_WriteFloat(File, "intX", hInfo[h][intX]);
  3051. INI_WriteFloat(File, "intY", hInfo[h][intY]);
  3052. INI_WriteFloat(File, "intZ", hInfo[h][intZ]);
  3053. INI_WriteInt(File, "intVW", hInfo[h][intVW]);
  3054. INI_WriteInt(File, "intW", hInfo[h][intW]);
  3055. INI_WriteInt(File, "Locked", hInfo[h][Locked]);
  3056. INI_Close(File);
  3057. }
  3058. }
  3059. return 1;
  3060. }
  3061. stock LoadHouses()
  3062. {
  3063. new hlabel[128], file[64], s[64], count;
  3064. print("\n Loading Houses: \n");
  3065. for(new h = 0; h < MAX_HOUSES; h++)
  3066. {
  3067. format(file, 64, "Houses/%d.ini", h);
  3068. if(fexist(file))
  3069. {
  3070. INI_ParseFile(HousePath(h), "LoadHouseData", false, true, h, true, false );
  3071. format(hlabel, 128, "[HOUSE]\n{46E850}[Owner]{FFFFFF}: %s\n{46E850}[Price]{FFFFFF}: %d", hInfo[h][Owner], hInfo[h][Price]);
  3072. Create3DTextLabel(hlabel, 0xFFFFFF, hInfo[h][extX], hInfo[h][extY], hInfo[h][extZ], 15.0, 0, 1);
  3073. format(s, 64, " [!!] Loaded house ID: %d at %f %f %f", h, hInfo[h][extX], hInfo[h][extY], hInfo[h][extZ]);
  3074. printf(s);
  3075. count++;
  3076. }
  3077. }
  3078. printf("\n %d houses loaded!", count);
  3079. return 1;
  3080. }
  3081. stock ReloadLabels()
  3082. {
  3083. for(new i = 0; i < 100; i++)
  3084. {
  3085. Delete3DTextLabel(Text3D: i);
  3086. }
  3087. Create3DTextLabel("Vehicle Dealership\n/carbuy, /bikebuy, /carregister", 0xADDBDBFF, 168.6218, -49.5795, 1.5781, 25.0, 0, 1);
  3088. Create3DTextLabel("24/7 MARKET \n/buy", 0xADDBDBFF, 254.4757,-63.5021,1.5781, 25.0, 0, 1);
  3089. Create3DTextLabel("/buy", 0xADDBDBFF, 252.0834,-56.3722,1.5703, 25.0, 0, 1);
  3090. Create3DTextLabel("Fishing Point\n{FFFFFF}/rentrod\n/returnrod\n/sellfish", 0xADDBDBFF, 382.7930, -260.5501, 1.6535, 25.0, 0, 1);
  3091. Create3DTextLabel("Fishing Point\n{FFFFFF}/fish", 0xADDBDBFF, 373.4215, -275.4926, 1.0578, 25.0, 0, 1);
  3092. Create3DTextLabel("Fishing Point\n{FFFFFF}/fish", 0xADDBDBFF, 386.2177, -267.5155, 1.0633, 25.0, 0, 1);
  3093. Create3DTextLabel("Fishing Point\n{FFFFFF}/fish", 0xADDBDBFF, 356.2553, -286.0096, 1.4032, 25.0, 0, 1);
  3094. Create3DTextLabel("Police Station", 0xADDBDBFF, -1716.2312, 1018.1048, 17.5859, 25.0, 0, 1);
  3095. Create3DTextLabel("Police Station", 0xADDBDBFF, 322.1928, 317.6448, 999.1484, 25.0, 0, 1);
  3096. Create3DTextLabel("Police Station", 0xADDBDBFF, 207.8708, -61.6880, 1.9766, 25.0, 0, 1);
  3097. Create3DTextLabel("Police Station", 0xADDBDBFF, 322.197998, 302.497985, 999.148437, 25.0, 0, 1);
  3098. Create3DTextLabel("Health Station", 0xADDBDBFF, 43.6618, -188.0078, 2.2442, 25.0, 0, 1);
  3099. Create3DTextLabel("Health Station", 0xADDBDBFF, 54.2550, -190.9127, 1.6579, 25.0, 0, 1);
  3100. Create3DTextLabel("Health Station", 0xADDBDBFF, -204.4846, -1735.8840, 675.7687, 25.0, 0, 1);
  3101. Create3DTextLabel("Health Station", 0xADDBDBFF, 326.4513, -1492.8029, 24.9219, 25.0, 0, 1);
  3102. Create3DTextLabel("Local Bank", 0xADDBDBFF, 273.1700, -195.5689, 1.5705, 25.0, 0, 1);
  3103. Create3DTextLabel("Local Bank", 0xADDBDBFF, 2305.1003, -16.2768, 26.7422, 25.0, 0, 1);
  3104. Create3DTextLabel("Local Bank\n{FFFFFF}/deposit | /withdraw", 0xADDBDBFF, 2316.5581, -11.3381, 26.7422, 25.0, 0, 1);
  3105. Create3DTextLabel("Barrier\n{FFFFFF}If the barrier doesn't open, please exit your car and press ~k~~CONVERSATION_YES~ here.", 0xADDBDBFF, -1739.5716, 985.0, 17.8529, 25.0, 0, 1);
  3106. Create3DTextLabel("Enter Garage\n{FFFFFF}/pass", 0xADDBDBFF, 210.8901, -33.2288, 1.5781, 25.0, 0, 1);
  3107. Create3DTextLabel("Exit Garage\n{FFFFFF}/pass", 0xADDBDBFF, -1777.1486, 968.5923, 24.7344, 25.0, 0, 1);
  3108. Create3DTextLabel("Exit Garage\n{FFFFFF}/pass", 0xADDBDBFF, -1777.6991, 997.2271, 24.7344, 25.0, 0, 1);
  3109. Create3DTextLabel("Enter Garage\n{FFFFFF}/pass", 0xADDBDBFF, 58.8201, -195.7375, 1.6446, 25.0, 0, 1);
  3110. Create3DTextLabel("Enter Garage\n{FFFFFF}/pass", 0xADDBDBFF, 318.6588, -1491.4716, 24.5918, 25.0, 0, 1);
  3111. LoadHouses();
  3112. LoadBizzes();
  3113. return 1;
  3114. }
  3115. forward LoadHouseData(h, name[], value[]);
  3116. public LoadHouseData(h, name[], value[])
  3117. {
  3118. INI_String("Owner", hInfo[h][Owner], 32);
  3119. INI_Int("Price", hInfo[h][Price]);
  3120. INI_Int("Bought", hInfo[h][Bought]);
  3121. INI_Float("extX", hInfo[h][extX]);
  3122. INI_Float("extY", hInfo[h][extY]);
  3123. INI_Float("extZ", hInfo[h][extZ]);
  3124. INI_Float("intX", hInfo[h][intX]);
  3125. INI_Float("intY", hInfo[h][intY]);
  3126. INI_Float("intZ", hInfo[h][intZ]);
  3127. INI_Int("intVW", hInfo[h][intVW]);
  3128. INI_Int("intW", hInfo[h][intW]);
  3129. INI_Int("Locked", hInfo[h][Locked]);
  3130. return 1;
  3131. }
  3132. stock HousePath(h)
  3133. {
  3134. new house[64], hid = h;
  3135. hid = hIDInfo[hID] +1;
  3136. format(house, 30, "Houses/%d.ini", hid);
  3137. hIDInfo[hID] ++; // multiplying
  3138. return house;
  3139. }
  3140. stock RegisterFix(playerid)
  3141. {
  3142. new string[30];
  3143. if(pInfo[playerid][Gender] == 0) ShowPlayerDialog(playerid, DIALOG_GENDER, DIALOG_STYLE_LIST, "Gender", "Male\nFemale", "Select", "Select");
  3144. if(pInfo[playerid][MaskID] == 0) pInfo[playerid][MaskID] = random(99999);
  3145. if(pInfo[playerid][PhoneNumber] == 0) pInfo[playerid][PhoneNumber] = random(99999);
  3146. if(pInfo[playerid][Level] == 0) pInfo[playerid][Level] = 1;
  3147. if(pInfo[playerid][FactionTier] == 0) pInfo[playerid][FactionTier] = 3;
  3148. if(pInfo[playerid][HouseOwner] == 0) pInfo[playerid][HouseOwner] = 9999;
  3149. if(pInfo[playerid][VehicleOwner] == 0) pInfo[playerid][VehicleOwner] = 9999;
  3150. if(pInfo[playerid][BizOwner] == 0) pInfo[playerid][BizOwner] = 9999;
  3151. if(pInfo[playerid][HandMoney] == 0) GivePlayerMoney(playerid, 250);
  3152. if(pInfo[playerid][BankMoney] == 0) pInfo[playerid][BankMoney] = 5000;
  3153. if(pInfo[playerid][Health] == 0) pInfo[playerid][Health] = 100;
  3154. if(pInfo[playerid][Exp] == 0) pInfo[playerid][Exp] = 8;
  3155. format(string, 128, "None");
  3156. pInfo[playerid][FactionRank] = string;
  3157. pInfo[playerid][Registered] = 1;
  3158. return 1;
  3159. }
  3160. stock CreatePlayerVehicle(playerid, model)
  3161. {
  3162. new pname[30], file[64], playercar, v;
  3163. GetPlayerName(playerid, pname, sizeof(pname));
  3164. playercar = CreateVehicle(model, 170.8668, -16.1531, 1.5781, 220.7102, random(5), random(5), -1);
  3165. PutPlayerInVehicle(playerid, playercar, 0);
  3166. new INI:File = INI_Open(VehiclePath(v));
  3167. vInfo[playercar][ModelID] = model;
  3168. vInfo[playercar][NrPlate] = "BB-0000";
  3169. vInfo[playercar][Owner] = pname;
  3170. vInfo[playercar][posX] = 170.8668;
  3171. vInfo[playercar][posY] = -16.1531;
  3172. vInfo[playercar][posZ] = 1.5781;
  3173. vInfo[playercar][posA] = 220.7102;
  3174. vInfo[playercar][ColorA] = random(5);
  3175. vInfo[playercar][ColorB] = random(5);
  3176. vInfo[playercar][Locked] = 1;
  3177. vInfo[playercar][Faction] = 0;
  3178. INI_Close(File);
  3179. format(file, 64, "Vehicles/%d.ini", v);
  3180. if(fexist(file))
  3181. {
  3182. INI_ParseFile(VehiclePath(v), "LoadVehicleData", false, true, v, true, false );
  3183. }
  3184. SaveVehicles();
  3185. pInfo[playerid][VehicleOwner] = playercar;
  3186. vEngine[playercar] = 1;
  3187. return 1;
  3188. }
  3189. stock SaveVehicles()
  3190. {
  3191. new file[64];
  3192. for(new v = 0; v < MAX_CARS; v ++)
  3193. {
  3194. format(file, 64, "Vehicles/%d.ini", v);
  3195. if(fexist(file))
  3196. {
  3197. new INI:File = INI_Open(file);
  3198. INI_SetTag(File, "Vehicle Data");
  3199. INI_WriteInt(File, "ModelID", vInfo[v][ModelID]);
  3200. INI_WriteString(File, "Owner", vInfo[v][Owner]);
  3201. INI_WriteString(File, "NrPlate", vInfo[v][NrPlate]);
  3202. INI_WriteFloat(File, "posX", vInfo[v][posX]);
  3203. INI_WriteFloat(File, "posY", vInfo[v][posY]);
  3204. INI_WriteFloat(File, "posZ", vInfo[v][posZ]);
  3205. INI_WriteFloat(File, "posA", vInfo[v][posA]);
  3206. INI_WriteInt(File, "ColorA", vInfo[v][ColorA]);
  3207. INI_WriteInt(File, "ColorB", vInfo[v][ColorB]);
  3208. INI_WriteInt(File, "Locked", vInfo[v][Locked]);
  3209. INI_WriteInt(File, "Faction", vInfo[v][Faction]);
  3210. INI_Close(File);
  3211. }
  3212. }
  3213. return 1;
  3214. }
  3215. stock LoadVehicles()
  3216. {
  3217. new file[64], s[64], count;
  3218. print("\n Loading vehicles: \n");
  3219. for(new v = 0; v < MAX_CARS; v ++)
  3220. {
  3221. format(file, 64, "Vehicles/%d.ini", v);
  3222. if(fexist(file))
  3223. {
  3224. INI_ParseFile(VehiclePath(v), "LoadVehicleData", false, true, v, true, false );
  3225. CreateVehicle(vInfo[v][ModelID], vInfo[v][posX], vInfo[v][posY], vInfo[v][posZ], vInfo[v][posA], vInfo[v][ColorA], vInfo[v][ColorB], -1);
  3226. SetVehicleNumberPlate(v, vInfo[v][NrPlate]);
  3227. SetVehicleParamsForPlayer(v, v, 0, 1);
  3228. SetVehicleToRespawn(v); // numberplate
  3229. format(s, 64, " [!!] Loaded Vehicle ID: %d at %f %f %f", v, vInfo[v][posX], vInfo[v][posY], vInfo[v][posZ]);
  3230. printf(s);
  3231. count++;
  3232. }
  3233. }
  3234. printf("\n %d vehicles loaded!", count);
  3235. return 1;
  3236. }
  3237. forward LoadVehicleData(v, name[], value[]);
  3238. public LoadVehicleData(v, name[], value[])
  3239. {
  3240. INI_String("Owner", vInfo[v][Owner], 31);
  3241. INI_Int("ModelID", vInfo[v][ModelID]);
  3242. INI_String("NrPlate", vInfo[v][NrPlate], 8);
  3243. INI_Float("posX", vInfo[v][posX]);
  3244. INI_Float("posY", vInfo[v][posY]);
  3245. INI_Float("posZ", vInfo[v][posZ]);
  3246. INI_Float("posA", vInfo[v][posA]);
  3247. INI_Int("ColorA", vInfo[v][ColorA]);
  3248. INI_Int("ColorB", vInfo[v][ColorB]);
  3249. INI_Int("Locked", vInfo[v][Locked]);
  3250. INI_Int("Faction", vInfo[v][Faction]);
  3251. return 1;
  3252. }
  3253. stock VehiclePath(v)
  3254. {
  3255. new vehicle[64], vid = v;
  3256. vid = vIDInfo[vID] +1;
  3257. format(vehicle, 30, "Vehicles/%d.ini", vid);
  3258. vIDInfo[vID] ++; // multiplying
  3259. return vehicle;
  3260. }
  3261. stock SaveBizzes()
  3262. {
  3263. new file[64];
  3264. for(new b = 0; b < MAX_BUSINESSES; b++)
  3265. {
  3266. format(file, 64, "Businesses/%d.ini", b);
  3267. if(fexist(file))
  3268. {
  3269. new INI:File = INI_Open(file);
  3270. INI_SetTag(File, "Business Data");
  3271. INI_WriteString(File, "Name", bInfo[b][Name]);
  3272. INI_WriteString(File, "Owner", bInfo[b][Owner]);
  3273. INI_WriteInt(File, "Price", bInfo[b][Price]);
  3274. INI_WriteInt(File, "Bought", bInfo[b][Bought]);
  3275. INI_WriteInt(File, "Locked", bInfo[b][Bought]);
  3276. INI_WriteInt(File, "Fee", bInfo[b][Fee]);
  3277. INI_WriteInt(File, "Till", bInfo[b][Till]);
  3278. INI_WriteInt(File, "IntSet", bInfo[b][IntSet]);
  3279. INI_WriteFloat(File, "extX", bInfo[b][extX]);
  3280. INI_WriteFloat(File, "extY", bInfo[b][extY]);
  3281. INI_WriteFloat(File, "extZ", bInfo[b][extZ]);
  3282. INI_WriteFloat(File, "intX", bInfo[b][intX]);
  3283. INI_WriteFloat(File, "intY", bInfo[b][intY]);
  3284. INI_WriteFloat(File, "intZ", bInfo[b][intZ]);
  3285. INI_WriteInt(File, "intVW", bInfo[b][intVW]);
  3286. INI_WriteInt(File, "intW", bInfo[b][intW]);
  3287. INI_Close(File);
  3288. }
  3289. }
  3290. return 1;
  3291. }
  3292. stock LoadBizzes()
  3293. {
  3294. new blabel[256], file[64], s[64], count;
  3295. print("\n Loading Businesses: \n");
  3296. for(new b = 0; b < MAX_BUSINESSES; b++)
  3297. {
  3298. format(file, 64, "Businesses/%d.ini", b);
  3299. if(fexist(file))
  3300. {
  3301. INI_ParseFile(BizPath(b), "LoadBizData", false, true, b, true, false );
  3302. format(blabel, 256, "[BUSINESS]\n{46E850}[Name]{FFFFFF}: %s\n{46E850}[Owner]{FFFFFF}: %s\n{46E850}[Entry]{FFFFFF}: $%d\n{46E850}[Price]{FFFFFF}: $%d", bInfo[b][Name], bInfo[b][Owner], bInfo[b][Fee], bInfo[b][Price]);
  3303. Create3DTextLabel(blabel, 0xFFFFFF, bInfo[b][extX], bInfo[b][extY], bInfo[b][extZ], 15.0, 0, 1);
  3304. format(s, 64, " [!!] Loaded business ID: %d at %f %f %f", b, bInfo[b][extX], bInfo[b][extY], bInfo[b][extZ]);
  3305. printf(s);
  3306. count++;
  3307. }
  3308. }
  3309. printf("\n %d businesses loaded!", count);
  3310. return 1;
  3311. }
  3312. forward LoadBizData(b, name[], value[]);
  3313. public LoadBizData(b, name[], value[])
  3314. {
  3315. INI_String("Name", bInfo[b][Name], 45);
  3316. INI_String("Owner", bInfo[b][Owner], 32);
  3317. INI_Int("Price", bInfo[b][Price]);
  3318. INI_Int("Bought", bInfo[b][Bought]);
  3319. INI_Int("Fee", bInfo[b][Fee]);
  3320. INI_Int("Till", bInfo[b][Till]);
  3321. INI_Int("IntSet", bInfo[b][IntSet]);
  3322. INI_Float("extX", bInfo[b][extX]);
  3323. INI_Float("extY", bInfo[b][extY]);
  3324. INI_Float("extZ", bInfo[b][extZ]);
  3325. INI_Float("intX", bInfo[b][intX]);
  3326. INI_Float("intY", bInfo[b][intY]);
  3327. INI_Float("intZ", bInfo[b][intZ]);
  3328. INI_Int("intVW", bInfo[b][intVW]);
  3329. INI_Int("intW", bInfo[b][intW]);
  3330. return 1;
  3331. }
  3332. stock BizPath(b)
  3333. {
  3334. new biz[64], bid = b;
  3335. bid = bIDInfo[bID] +1;
  3336. format(biz, 30, "Businesses/%d.ini", bid);
  3337. bIDInfo[bID] ++; // multiplying
  3338. return biz;
  3339. }
  3340. forward Float: GetVehicleSpeed(vehicleid);
  3341. public Float: GetVehicleSpeed(vehicleid)
  3342. {
  3343. new Float:Vel[3];
  3344. GetVehicleVelocity(vehicleid, Vel[0], Vel[1], Vel[2]);
  3345. Vel[0] *= 175;
  3346. Vel[1] *= 175;
  3347. Vel[2] *= 175;
  3348. return Float: VectorSize(Vel[0], Vel[1], Vel[2]);
  3349. }
  3350. forward StartEngine(playerid, vehicleid);
  3351. public StartEngine(playerid, vehicleid)
  3352. {
  3353. new engine, lights, alarm, doors, bonnet, boot, objective;
  3354. GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
  3355. vehicleid = GetPlayerVehicleID(playerid);
  3356. if(IsPlayerInAnyVehicle(playerid))
  3357. {
  3358. if(vEngine[vehicleid] == 2)
  3359. {
  3360. SetVehicleParamsEx(vehicleid, 1, lights, alarm, doors, bonnet, boot, objective);
  3361. SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You have turned the vehicle's engine on!");
  3362. vEngine[vehicleid] = 1;
  3363. }
  3364. else if(vEngine[vehicleid] == 1)
  3365. {
  3366. SetVehicleParamsEx(vehicleid, 0, lights, alarm, doors, bonnet, boot, objective);
  3367. SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You have turned the vehicle's engine off!");
  3368. vEngine[vehicleid] = 0;
  3369. }
  3370. }
  3371. return 1;
  3372. }
  3373. stock GetVehicleEngine(vehicleid)
  3374. {
  3375. new engine[10];
  3376. if(vEngine[vehicleid] == 1) engine = "~g~On";
  3377. else if(vEngine[vehicleid] == 0) engine = "~r~Off";
  3378. else if(vEngine[vehicleid] == 2) engine = "~y~Srt";
  3379. return engine;
  3380. }
  3381. forward FishingCooldown(playerid);
  3382. public FishingCooldown(playerid)
  3383. {
  3384. new str[80];
  3385. if(fishtimervalue[playerid] > 0)
  3386. {
  3387. fishtimervalue[playerid] -= 1;
  3388. format(str, sizeof(str), "~w~Time left: ~r~%d", fishtimervalue);
  3389. GameTextForPlayer(playerid, str, 1000, 3);
  3390. }
  3391. else if(fishtimervalue[playerid] == 0)
  3392. {
  3393. KillTimer(fishtimer[playerid]);
  3394. FishRandomCatch(playerid);
  3395. TogglePlayerControllable(playerid, true);
  3396. }
  3397. return 1;
  3398. }
  3399. stock FishRandomCatch(playerid)
  3400. {
  3401. new randlbs = random(15), str[128];
  3402. if(randlbs == 0) randlbs = random(5); // bug fix
  3403. switch(random(5))
  3404. {
  3405. case 0: format(str, sizeof(str), "SERVER{FFFFFF}: You've caught some {FFBB00}trout{FFFFFF}! (lbs: %d - {FFBB00}/checkfish{FFFFFF})", randlbs);
  3406. case 1: format(str, sizeof(str), "SERVER{FFFFFF}: You've caught some {FFBB00}tuna{FFFFFF}! (lbs: %d - {FFBB00}/checkfish{FFFFFF})", randlbs);
  3407. case 2: format(str, sizeof(str), "SERVER{FFFFFF}: You've caught some {FFBB00}shrimp{FFFFFF}! (lbs: %d - {FFBB00}/checkfish{FFFFFF})", randlbs);
  3408. case 3: format(str, sizeof(str), "SERVER{FFFFFF}: You've caught some {FFBB00}salmon{FFFFFF}! (lbs: %d - {FFBB00}/checkfish{FFFFFF})", randlbs);
  3409. case 4: format(str, sizeof(str), "SERVER{FFFFFF}: You've caught nothing!"), randlbs = 0; // format for bug fix, lbs = 0 to avoid lbs being added
  3410. }
  3411. pCarryingFish[playerid] += randlbs;
  3412. SendClientMessage(playerid, 0x46E850FF, str);
  3413. return 1;
  3414. }
  3415. forward PlayerDeathMode(playerid);
  3416. public PlayerDeathMode(playerid)
  3417. {
  3418. ApplyAnimation(playerid, "KNIFE", "KILL_Knife_Ped_Die", 4.1, 0, 0, 0, 1, 0, 1);
  3419. SetPlayerColor(playerid, 0xE83A46FF);
  3420. pDeathModeTimer[playerid] = SetTimer("PlayerDeathModeWait", 1250, true);
  3421. pDeathModeWait[playerid] = 320;
  3422. pDeathMode[playerid] = 1;
  3423. return 1;
  3424. }
  3425. forward PlayerDeathModeWait(playerid);
  3426. public PlayerDeathModeWait(playerid)
  3427. {
  3428. new string[128];
  3429. if(pDeathModeWait[playerid] == 0)
  3430. {
  3431. if(pDeathMode[playerid] == 1)
  3432. {
  3433. KillTimer(pDeathModeTimer[playerid]);
  3434. SetPlayerHealth(playerid, 0);
  3435. SendClientMessage(playerid, -1, "You have died.");
  3436. GivePlayerMoney(playerid, -500);
  3437. }
  3438. }
  3439. else if(pDeathModeWait[playerid] > 0)
  3440. {
  3441. pDeathModeWait[playerid] -= 1;
  3442. format(string, sizeof(string), "~w~Time left: ~r~%d", pDeathModeWait[playerid]);
  3443. GameTextForPlayer(playerid, string, 1000, 4);
  3444. }
  3445. return 1;
  3446. }
  3447. forward LevelTimer(playerid);
  3448. public LevelTimer(playerid)
  3449. {
  3450. new string[128], oldmoney = pInfo[playerid][BankMoney];
  3451. if(pInfo[playerid][CurExp] != pInfo[playerid][Exp])
  3452. {
  3453. pInfo[playerid][CurExp] += 1;
  3454. pInfo[playerid][BankMoney] += 450;
  3455. SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Bank Balance Receipt: {60B34B}$450 added{FFFFFF} to bank account!");
  3456. format(string, sizeof(string), "SERVER:{FFFFFF} {D9D9D9}[Old Amount:{FFBB00} %d{D9D9D9}] [New Amount:{60B34B} %d{D9D9D9}]", oldmoney, pInfo[playerid][BankMoney]);
  3457. SendClientMessage(playerid, 0x46E850FF, string);
  3458. format(string, sizeof(string), "SERVER:{FFFFFF} Level progression: {BF4B4B}%d{FFFFFF}/{60B34B}%d{FFFFFF}. Next payday in 30 minutes.", pInfo[playerid][CurExp], pInfo[playerid][Exp]);
  3459. SendClientMessage(playerid, 0x46E850FF, string);
  3460. }
  3461. else if(pInfo[playerid][CurExp] == pInfo[playerid][Exp])
  3462. {
  3463. pInfo[playerid][CurExp] = 0;
  3464. pInfo[playerid][Exp] += 8;
  3465. pInfo[playerid][Level] += 1;
  3466. format(string, sizeof(string), "SERVER:{FFFFFF} You have leveled up! New level: {FFBB00}%d{FFFFFF}!", pInfo[playerid][Level]);
  3467. SendClientMessage(playerid, 0x46E850FF, string);
  3468. format(string, sizeof(string), "SERVER:{FFFFFF} Experience necessities upgraded: {BF4B4B}%d{FFFFFF}/{FFBB00}%d{FFFFFF}.", pInfo[playerid][CurExp], pInfo[playerid][Exp]);
  3469. SendClientMessage(playerid, 0x46E850FF, string);
  3470. }
  3471. return 1;
  3472. }
  3473. PreloadAnimLib(playerid, animlib[]) ApplyAnimation(playerid, animlib, "null", 0.0, 0, 0, 0, 0, 0);

Here :)