Guest User

Untitled

a guest
Oct 22nd, 2013
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 31.22 KB | None | 0 0
  1. public OnPlayerStateChange(playerid, newstate, oldstate)
  2. {
  3. if(newstate != 2) NOPTrigger[playerid] = 0;
  4. if(IsPlayerNPC(playerid))
  5. {
  6. if(newstate == PLAYER_STATE_SPECTATING)
  7. {
  8. TogglePlayerSpectating(playerid, false);
  9. }
  10. return 1;
  11. }
  12. if(GettingSpectated[playerid] != 999)
  13. {
  14. new spectator = GettingSpectated[playerid];
  15. if(!IsPlayerConnected(spectator))
  16. {
  17. GettingSpectated[playerid] = 999;
  18. Spectate[spectator] = 999;
  19. }
  20.  
  21. if(newstate == PLAYER_STATE_DRIVER && PlayerInfo[spectator][pAdmin] >= 2 || newstate == PLAYER_STATE_PASSENGER && PlayerInfo[spectator][pAdmin] >= 2)
  22. {
  23. TogglePlayerSpectating(spectator, true);
  24. new carid = GetPlayerVehicleID( playerid );
  25. PlayerSpectateVehicle( spectator, carid );
  26. SetPVarInt(spectator, "SpecState", newstate);
  27. }
  28. else if(newstate == PLAYER_STATE_ONFOOT && PlayerInfo[spectator][pAdmin] >= 2)
  29. {
  30. TogglePlayerSpectating(spectator, true);
  31. PlayerSpectatePlayer( spectator, playerid );
  32. SetPlayerInterior( spectator, GetPlayerInterior( playerid ) );
  33. SetPVarInt(spectator, "SpecState", newstate);
  34. }
  35. }
  36. if(newstate == PLAYER_STATE_ONFOOT)
  37. {
  38. if(Audio_IsClientConnected(playerid))
  39. {
  40. Audio_Stop(playerid, stationidp[playerid]);
  41. stationidp[playerid] = 0;
  42. }
  43.  
  44.  
  45. new spectator = GettingSpectated[playerid];
  46. if(PlayerInfo[spectator][pAdmin] >= 2) {
  47. // Preventing possible buffer overflows with the arrays
  48. TogglePlayerSpectating(spectator, true);
  49. PlayerSpectatePlayer( spectator, playerid );
  50. SetPlayerInterior( spectator, GetPlayerInterior( playerid ) );
  51. SetPVarInt(spectator, "SpecState", newstate);
  52. SetPlayerInterior( spectator, GetPlayerInterior( playerid ) );
  53. SetPlayerVirtualWorld( spectator, GetPlayerVirtualWorld( playerid ) );
  54. }
  55.  
  56. if(oldstate == PLAYER_STATE_DRIVER)
  57. {
  58. SetPlayerWeaponsEx(playerid);
  59. }
  60. else if(oldstate == PLAYER_STATE_PASSENGER) SetPlayerWeaponsEx(playerid);
  61.  
  62. if(newstate == PLAYER_STATE_DRIVER)
  63. {
  64. bGas[playerid] = CreateProgressBar(501.00, 13.50, 101.50, 7.19, -7665665, 100.0);
  65. ShowProgressBarForPlayer(playerid, bGas[playerid]);
  66. }
  67. if(oldstate == PLAYER_STATE_DRIVER)
  68. {
  69. DestroyProgressBar(bGas[playerid]);
  70. bGas[playerid] = INVALID_BAR_ID;
  71. }
  72. if(ConnectedToPC[playerid] == 1337)//mdc
  73. {
  74. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* You are now logged off the MDC.");
  75. ConnectedToPC[playerid] = 0;
  76. }
  77. if(TransportDuty[playerid] > 0)
  78. {
  79. if(TransportDuty[playerid] == 1)
  80. {
  81. TaxiDrivers -= 1;
  82. }
  83. else if(TransportDuty[playerid] == 2)
  84. {
  85. BusDrivers -= 1;
  86. }
  87. TransportDuty[playerid] = 0;
  88. new string[42];
  89. format(string, sizeof(string), "* You are now off duty and earned $%d.", TransportMoney[playerid]);
  90. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  91. GivePlayerCash(playerid, TransportMoney[playerid]);
  92. ConsumingMoney[playerid] = 1; TransportValue[playerid] = 0; TransportMoney[playerid] = 0;
  93. SetPlayerColor(playerid, TEAM_HIT_COLOR);
  94. TransportTime[playerid] = 0;
  95. TransportCost[playerid] = 0;
  96. }
  97. if(TransportDriver[playerid] < 999)
  98. {
  99. new string[128];
  100. TransportMoney[TransportDriver[playerid]] += TransportCost[playerid];
  101. format(string, sizeof(string), "~w~The ride cost~n~~r~$%d",TransportCost[playerid]);
  102. GameTextForPlayer(playerid, string, 5000, 3);
  103. format(string, sizeof(string), "~w~Passenger left the taxi.~n~~g~Earned $%d",TransportCost[playerid]);
  104. GameTextForPlayer(TransportDriver[playerid], string, 5000, 3);
  105. GivePlayerCash(playerid, -TransportCost[playerid]);
  106.  
  107. new ip[32], ipex[32];
  108. GetPlayerIp(playerid, ip, sizeof(ip));
  109. GetPlayerIp(TransportDriver[playerid], ipex, sizeof(ipex));
  110. TaxiWarn[playerid][TransportDriver[playerid]] += TransportCost[playerid];
  111. if(TaxiWarn[playerid][TransportDriver[playerid]] >= 10000)
  112. {
  113. format(string, sizeof(string), "%s (IP:%s) has taxied %s (IP:%s) $%d in this session.", GetPlayerNameEx(playerid), ip, GetPlayerNameEx(TransportDriver[playerid]), ipex, TaxiWarn[playerid][TransportDriver[playerid]]);
  114. Log("logs/pay.log", string);
  115. ABroadCast(COLOR_YELLOW, string, 2);
  116. }
  117. TransportTime[TransportDriver[playerid]] = 0;
  118. TransportCost[TransportDriver[playerid]] = 0;
  119. TransportCost[playerid] = 0;
  120. TransportTime[playerid] = 0;
  121. TransportDriver[playerid] = 999;
  122. }
  123. TelePos[playerid][0] = 0.0;
  124. TelePos[playerid][1] = 0.0;
  125. }
  126. if(newstate == PLAYER_STATE_PASSENGER) // TAXI & BUSSES
  127. {
  128. if(stationidv[GetPlayerVehicleID(playerid)] != 0)
  129. {
  130. new station[64];
  131. switch(stationidv[GetPlayerVehicleID(playerid)])
  132. {
  133. case 1: format(station, sizeof(station), "http://216.246.109.162:8000");
  134. case 2: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1415249");
  135. case 3: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1415249");
  136. case 4: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1628721");
  137. case 5: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1283687");
  138. case 6: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1628932");
  139. case 7: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1756658");
  140. case 8: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1377200");
  141. case 9: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=2057197");
  142. case 10: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=18695");
  143. case 11: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=412093");
  144. case 12: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=181367");
  145. case 13: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1275071");
  146. case 14: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=412093");
  147. case 15: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1280356");
  148. case 16: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1279013");
  149. case 17: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1281016");
  150. case 18: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1280855");
  151. case 19: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1116397");
  152. case 20: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=2057543");
  153. case 21: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=616366");
  154. case 22: format(station, sizeof(station), "http://38.107.220.164:8014");
  155. case 23: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=847066");
  156. }
  157. if(Audio_IsClientConnected(playerid))
  158. {
  159. Audio_Stop(playerid, stationidp[playerid]);
  160. stationidp[playerid] = Audio_PlayStreamed(playerid, station, false, true, false);
  161. }
  162. }
  163. new vehicleid = GetPlayerVehicleID(playerid);
  164. if(vehicleid == PWVehicles[12] ||
  165. vehicleid == PWVehicles[13] ||
  166. vehicleid == PWVehicles[14] ||
  167. vehicleid == PWVehicles[15] ||
  168. vehicleid == PWVehicles[16] ||
  169. vehicleid == PWVehicles[17])
  170. {
  171. TogglePlayerSpectating(playerid, 1);
  172. PlayerSpectateVehicle(playerid, vehicleid);
  173. SetPVarInt(playerid, "NGPassenger", 1);
  174. SetPVarInt(playerid, "NGPassengerVeh", vehicleid);
  175. SetPVarInt(playerid, "NGPassengerSkin", GetPlayerSkin(playerid));
  176. new Float:health, Float:armour;
  177. GetPlayerHealth(playerid, health);
  178. GetPlayerArmour(playerid, armour);
  179. SetPVarFloat(playerid, "NGPassengerHP", health);
  180. SetPVarFloat(playerid, "NGPassengerArmor", armour);
  181. }
  182.  
  183. if(PlayerInfo[playerid][pGuns][4] > 0) SetPlayerArmedWeapon(playerid,PlayerInfo[playerid][pGuns][4]);
  184. else SetPlayerArmedWeapon(playerid,0);
  185.  
  186. if( GetPVarInt( playerid, "ToBeEjected" ) >= 1 )
  187. {
  188. SetPVarInt( playerid, "ToBeEjected", 0 );
  189. RemovePlayerFromVehicle( playerid );
  190. new Float:X, Float:Y, Float:Z;
  191. GetPlayerPos(playerid, X, Y, Z);
  192. SetPlayerPos(playerid, X, Y, Z+2);
  193.  
  194. if(GetPVarInt(playerid, "Injured") == 1)
  195. {
  196. Streamer_UpdateEx(playerid, GetPVarFloat(playerid,"MedicX"), GetPVarFloat(playerid,"MedicY"), GetPVarFloat(playerid,"MedicZ"));
  197. SetPlayerPos(playerid, GetPVarFloat(playerid,"MedicX"), GetPVarFloat(playerid,"MedicY"), GetPVarFloat(playerid,"MedicZ"));
  198. SetPlayerVirtualWorld(playerid, GetPVarInt(playerid,"MedicVW"));
  199. SetPlayerInterior(playerid, GetPVarInt(playerid,"MedicInt"));
  200. ClearAnimations(playerid);
  201. ApplyAnimation(playerid, "KNIFE", "KILL_Knife_Ped_Die", 4.0, 0, 1, 1, 1, 0, 1);
  202. }
  203. }
  204. //SetPVarInt(playerid, "LastWeapon", GetPlayerWeapon(playerid));
  205. gLastCar[playerid] = vehicleid;
  206. foreach(Player, i)
  207. {
  208. if(IsPlayerInVehicle(i, vehicleid) && GetPlayerState(i) == 2 && TransportDuty[i] > 0)
  209. {
  210. if(GetPlayerCash(playerid) < TransportValue[i])
  211. {
  212. new string[28];
  213. format(string, sizeof(string), "* You need $%d to enter.", TransportValue[i]);
  214. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  215. RemovePlayerFromVehicle(playerid);
  216. new Float:X, Float:Y, Float:Z;
  217. GetPlayerPos(playerid, X, Y, Z);
  218. SetPlayerPos(playerid, X, Y, Z+2);
  219. TogglePlayerControllable(playerid, 1);
  220. }
  221. else
  222. {
  223. new string[38];
  224. if(TransportDuty[i] == 1)
  225. {
  226. format(string, sizeof(string), "* You paid $%d to the taxi driver.", TransportValue[i]);
  227. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  228. format(string, sizeof(string), "* Passenger %s has entered your taxi.", GetPlayerNameEx(playerid));
  229. SendClientMessageEx(i, COLOR_LIGHTBLUE, string);
  230. TransportTime[i] = 1;
  231. TransportTime[playerid] = 1;
  232. TransportCost[playerid] = TransportValue[i];
  233. TransportCost[i] = TransportValue[i];
  234. TransportDriver[playerid] = i;
  235. }
  236. else if(TransportDuty[i] == 2)
  237. {
  238. format(string, sizeof(string), "* You paid $%d to the Taxi Driver.", TransportValue[i]);
  239. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  240. format(string, sizeof(string), "* Passenger %s has entered your Taxi.", GetPlayerNameEx(playerid));
  241. SendClientMessageEx(i, COLOR_LIGHTBLUE, string);
  242. }
  243. GivePlayerCash(playerid, - TransportValue[i]);
  244. TransportMoney[i] += TransportValue[i];
  245. }
  246. }
  247. }
  248. }
  249. if(newstate == PLAYER_STATE_WASTED)
  250. {
  251. if(GetPVarInt(playerid, "EventToken") == 0)
  252. {
  253. SetPVarInt(playerid, "MedicBill", 1);
  254. }
  255. if(ConnectedToPC[playerid] == 1337)//mdc
  256. {
  257. ConnectedToPC[playerid] = 0;
  258. }
  259. Seatbelt[playerid] = 0;
  260. }
  261. if(newstate == PLAYER_STATE_DRIVER)
  262. {
  263. if(stationidv[GetPlayerVehicleID(playerid)] != 0)
  264. {
  265. new station[64];
  266. switch(stationidv[GetPlayerVehicleID(playerid)])
  267. {
  268. case 1: format(station, sizeof(station), "http://216.246.109.162:8000");
  269. case 2: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1415249");
  270. case 3: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1415249");
  271. case 4: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1628721");
  272. case 5: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1283687");
  273. case 6: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1628932");
  274. case 7: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1756658");
  275. case 8: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1377200");
  276. case 9: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=2057197");
  277. case 10: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=18695");
  278. case 11: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=412093");
  279. case 12: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=181367");
  280. case 13: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1275071");
  281. case 14: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=412093");
  282. case 15: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1280356");
  283. case 16: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1279013");
  284. case 17: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1281016");
  285. case 18: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1280855");
  286. case 19: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1116397");
  287. case 20: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=2057543");
  288. case 21: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=616366");
  289. case 22: format(station, sizeof(station), "http://38.107.220.164:8014");
  290. case 23: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=847066");
  291. }
  292. if(Audio_IsClientConnected(playerid))
  293. {
  294. Audio_Stop(playerid, stationidp[playerid]);
  295. stationidp[playerid] = Audio_PlayStreamed(playerid, station, false, true, false);
  296. }
  297. }
  298.  
  299. SetPlayerArmedWeapon(playerid, 0);
  300.  
  301. new
  302. newcar = GetPlayerVehicleID(playerid),
  303. engine, lights, alarm, doors, bonnet, boot, objective, v;
  304.  
  305. gLastCar[playerid] = newcar;
  306.  
  307. foreach(Player, i) {
  308. v = GetPlayerVehicle(i, newcar);
  309. if(v != -1) {
  310. if(i == playerid) {
  311.  
  312. new
  313. string[96];
  314.  
  315. format(string, sizeof(string),"You are the owner of this %s.", GetVehicleName(newcar));
  316. SendClientMessageEx(playerid, COLOR_GREY, string);
  317. if(PlayerVehicleInfo[i][v][pvTicket] != 0)
  318. {
  319. format(string, sizeof(string),"A $%d parking ticket was left on your vehicle. You must pay the ticket at the DMV in Dilimore.", PlayerVehicleInfo[i][v][pvTicket]);
  320. SendClientMessageEx(playerid, COLOR_GREY, string);
  321. SendClientMessageEx(playerid, COLOR_GREY, "Failure to pay this ticket as soon as possible will result in a fine, or even an arrest.");
  322. }
  323. }
  324. else if(i == PlayerInfo[playerid][pVehicleKeysFrom]) {
  325.  
  326. new
  327. string[64 + MAX_PLAYER_NAME];
  328.  
  329. format(string, sizeof(string),"You have the keys for this %s from owner %s.", GetVehicleName(newcar), GetPlayerNameEx(i));
  330. SendClientMessageEx(playerid, COLOR_GREY, string);
  331. }
  332. else if(PlayerVehicleInfo[i][v][pvLocked] == 1 && PlayerVehicleInfo[i][v][pvLock] == 1) {
  333. GetVehicleParamsEx(newcar,engine,lights,alarm,doors,bonnet,boot,objective);
  334. SetVehicleParamsEx(newcar,engine,lights,VEHICLE_PARAMS_ON,doors,bonnet,boot,objective);
  335. SetTimerEx("DisableVehicleAlarm", 20000, 0, "d", newcar);
  336. }
  337. else if(PlayerVehicleInfo[i][v][pvLocked] == 1 && PlayerVehicleInfo[i][v][pvLock] == 2) {
  338.  
  339. new
  340. string[49 + MAX_PLAYER_NAME];
  341.  
  342. if(PlayerInfo[playerid][pAdmin] < 2)
  343. {
  344. format(string, sizeof(string), "* %s has been stunned by the electric anti-theft.",GetPlayerNameEx(playerid));
  345. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  346. new Float:X, Float:Y, Float:Z, Float:HP;
  347. GetPlayerPos(playerid, X, Y, Z);
  348. SendAudioToRange(10300, 100, 0, X, Y, Z, 20.0);
  349. SetPlayerPos(playerid, X + 1, Y, Z);
  350. RemovePlayerFromVehicle(playerid);
  351. SetPVarInt(playerid, "IsFrozen", 1);
  352. TogglePlayerControllable(playerid,0);
  353. SetTimerEx("ReleasePlayer", 10000, 0, "d", playerid);
  354. GameTextForPlayer(playerid,"~r~STUNNED!",11000,3);
  355. GetPlayerHealth(playerid,HP);
  356. SetPlayerHealth(playerid,HP-15);
  357. }
  358. else
  359. {
  360. format(string, sizeof(string), "Warning: This %s is owned by %s.", GetVehicleName(newcar), GetPlayerNameEx(i));
  361. SendClientMessageEx(playerid, COLOR_GREY, string);
  362. }
  363. }
  364. return 1;
  365. }
  366. }
  367.  
  368. for(new f = 0; f < MAX_FAMILY; f++) {
  369. v = GetGangVehicle(f, newcar);
  370. if(v != -1) {
  371. new string[49 + MAX_PLAYER_NAME];
  372. if(PlayerInfo[playerid][pFMember] == f)
  373. {
  374. format(string, sizeof(string), "You are in the family that owns this %s.", GetVehicleName(newcar));
  375. SendClientMessageEx(playerid, COLOR_GREY, string);
  376. }
  377. else if(FamilyVehicleInfo[f][v][fvLocked] == 1 && FamilyVehicleInfo[f][v][fvLock] == 1)
  378. {
  379. GetVehicleParamsEx(newcar,engine,lights,alarm,doors,bonnet,boot,objective);
  380. SetVehicleParamsEx(newcar,engine,lights,VEHICLE_PARAMS_ON,doors,bonnet,boot,objective);
  381. SetTimerEx("DisableVehicleAlarm", 20000, 0, "d", newcar);
  382. }
  383. else if(FamilyVehicleInfo[f][v][fvLocked] == 1 && FamilyVehicleInfo[f][v][fvLock] == 2)
  384. {
  385. format(string, sizeof(string), "* %s has been stunned by the electric anti-theft.",GetPlayerNameEx(playerid));
  386. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  387. new Float:X, Float:Y, Float:Z, Float:HP;
  388. GetPlayerPos(playerid, X, Y, Z);
  389. SendAudioToRange(10300, 100, 0, X, Y, Z, 20.0);
  390. SetPlayerPos(playerid, X + 1, Y, Z);
  391. RemovePlayerFromVehicle(playerid);
  392. new Float:slx, Float:sly, Float:slz;
  393. GetPlayerPos(playerid, slx, sly, slz);
  394. SetPlayerPos(playerid, slx, sly, slz);
  395. SetPVarInt(playerid, "IsFrozen", 1);
  396. TogglePlayerControllable(playerid,0);
  397. SetTimerEx("ReleasePlayer", 10000, 0, "d", playerid);
  398. GameTextForPlayer(playerid,"~r~STUNNED!",11000,3);
  399. GetPlayerHealth(playerid,HP);
  400. SetPlayerHealth(playerid,HP-15);
  401. }
  402. return 1;
  403. }
  404. }
  405. new vehicleid = newcar;
  406. if(IsVIPcar(vehicleid))
  407. {
  408. if(PlayerInfo[playerid][pDonateRank] > 0)
  409. {
  410. SendClientMessageEx(playerid, COLOR_YELLOW, "VIP: This is a VIP vehicle from the VIP garage, therefore it has unlimited fuel.");
  411. }
  412. else
  413. {
  414. new Float:slx, Float:sly, Float:slz;
  415. GetPlayerPos(playerid, slx, sly, slz);
  416. SetPlayerPos(playerid, slx, sly, slz+1.3);
  417. PlayerPlaySound(playerid, 1130, slx, sly, slz+1.3);
  418. RemovePlayerFromVehicle(playerid);
  419. NOPCheck(playerid);
  420. SendClientMessageEx(playerid, COLOR_GRAD2, "You are not a VIP, this is a vehicle from the VIP Garage!");
  421. }
  422. }
  423. else if(IsAnAmbulance(vehicleid))
  424. {
  425. if(PlayerInfo[playerid][pMember] == 4||PlayerInfo[playerid][pLeader] == 4)
  426. {
  427. if(FDSAVehicles[13] == vehicleid && PlayerInfo[playerid][pRank] < 5)
  428. {
  429. RemovePlayerFromVehicle(playerid);
  430. new Float:slx, Float:sly, Float:slz;
  431. GetPlayerPos(playerid, slx, sly, slz);
  432. SetPlayerPos(playerid, slx, sly, slz);
  433. NOPCheck(playerid);
  434. SendClientMessageEx(playerid, COLOR_GRAD2, "Only ranks 5+ can drive this vehicle.");
  435. }
  436. }
  437. else
  438. {
  439. SendClientMessageEx(playerid,COLOR_GREY," You are not in the LAFD!");
  440. RemovePlayerFromVehicle(playerid);
  441. new Float:slx, Float:sly, Float:slz;
  442. GetPlayerPos(playerid, slx, sly, slz);
  443. SetPlayerPos(playerid, slx, sly, slz);
  444. NOPCheck(playerid);
  445. }
  446. }
  447. else if(IsAnSASDCar(vehicleid))
  448. {
  449. if(PlayerInfo[playerid][pMember] == 7 || PlayerInfo[playerid][pLeader] == 7)
  450. {
  451. }
  452. else
  453. {
  454. RemovePlayerFromVehicle(playerid);
  455. new Float:slx, Float:sly, Float:slz;
  456. GetPlayerPos(playerid, slx, sly, slz);
  457. SetPlayerPos(playerid, slx, sly, slz);
  458. NOPCheck(playerid);
  459. SendClientMessageEx(playerid, COLOR_GRAD2, "You are not in DOC!");
  460. }
  461. }
  462. else if(IsAnSFPDCar(vehicleid))
  463. {
  464. if(PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3)
  465. {
  466. }
  467. else
  468. {
  469. RemovePlayerFromVehicle(playerid);
  470. new Float:slx, Float:sly, Float:slz;
  471. GetPlayerPos(playerid, slx, sly, slz);
  472. SetPlayerPos(playerid, slx, sly, slz);
  473. NOPCheck(playerid);
  474. SendClientMessageEx(playerid, COLOR_GRAD2, "You are not in the CL Tow & Repairs!");
  475. }
  476. }
  477. else if(IsAnEPCar(vehicleid))
  478. {
  479. if(PlayerInfo[playerid][pMember] == 3 && PlayerInfo[playerid][pDivision] == 2 || PlayerInfo[playerid][pMember] == 3 && PlayerInfo[playerid][pRank] >= 5)
  480. {
  481. }
  482. else
  483. {
  484. RemovePlayerFromVehicle(playerid);
  485. new Float:slx, Float:sly, Float:slz;
  486. GetPlayerPos(playerid, slx, sly, slz);
  487. SetPlayerPos(playerid, slx, sly, slz);
  488. NOPCheck(playerid);
  489. SendClientMessageEx(playerid, COLOR_GRAD2, "You are not in the CL Tow & Repairs Executive Protection Division!");
  490. }
  491. }
  492. else if(IsAnWPCar(vehicleid))
  493. {
  494. if(PlayerInfo[playerid][pMember] == 7 || PlayerInfo[playerid][pMember] == 7){
  495. }
  496. else
  497. {
  498. RemovePlayerFromVehicle(playerid);
  499. new Float:slx, Float:sly, Float:slz;
  500. GetPlayerPos(playerid, slx, sly, slz);
  501. SetPlayerPos(playerid, slx, sly, slz);
  502. NOPCheck(playerid);
  503. SendClientMessageEx(playerid, COLOR_GRAD2, "You are not in DOC!");
  504. }
  505. }
  506. else if(IsACopCar(vehicleid))
  507. {
  508. if(PlayerInfo[playerid][pMember] == 1||PlayerInfo[playerid][pLeader] == 1)
  509. {
  510. }
  511. else
  512. {
  513. RemovePlayerFromVehicle(playerid);
  514. new Float:slx, Float:sly, Float:slz;
  515. GetPlayerPos(playerid, slx, sly, slz);
  516. SetPlayerPos(playerid, slx, sly, slz);
  517. NOPCheck(playerid);
  518. SendClientMessageEx(playerid, COLOR_GRAD2, "You are not in the LAPD!");
  519. }
  520. }
  521. else if(IsAHouse275Car(vehicleid))
  522. {
  523. TogglePlayerControllable(playerid, false);
  524. ShowPlayerDialog(playerid, House275CAR, DIALOG_STYLE_INPUT, "KeyPad", "Password:", "ENTER", "ENTER");
  525. }
  526. else if(IsACHPCar(vehicleid))
  527. {
  528. if(PlayerInfo[playerid][pMember] == 2||PlayerInfo[playerid][pLeader] == 2)
  529. {
  530. }
  531. else
  532. {
  533. RemovePlayerFromVehicle(playerid);
  534. new Float:slx, Float:sly, Float:slz;
  535. GetPlayerPos(playerid, slx, sly, slz);
  536. SetPlayerPos(playerid, slx, sly, slz);
  537. NOPCheck(playerid);
  538. SendClientMessageEx(playerid, COLOR_GRAD2, "You are not in the CHP!");
  539. }
  540. }
  541. else if(vehicleid == FDSAVehicles[12] || vehicleid == FDSAVehicles[33] || vehicleid == FDSAVehicles[34] || vehicleid == FDSAVehicles[35])
  542. {
  543. if(PlayerInfo[playerid][pLeader] == 4 || PlayerInfo[playerid][pMember] == 4 && PlayerInfo[playerid][pDivision] == 1)
  544. {
  545. }
  546. else
  547. {
  548. RemovePlayerFromVehicle(playerid);
  549. new Float:slx, Float:sly, Float:slz;
  550. GetPlayerPos(playerid, slx, sly, slz);
  551. SetPlayerPos(playerid, slx, sly, slz);
  552. NOPCheck(playerid);
  553. SendClientMessageEx(playerid, COLOR_GRAD2, "You are not in the Fire Department Division!");
  554. }
  555. }
  556. else if(vehicleid == FDSAVehicles[37] || vehicleid == FDSAVehicles[36])
  557. {
  558. if(PlayerInfo[playerid][pLeader] == 4 || PlayerInfo[playerid][pMember] == 4 && PlayerInfo[playerid][pDivision] == 2)
  559. {
  560. }
  561. else
  562. {
  563. RemovePlayerFromVehicle(playerid);
  564. new Float:slx, Float:sly, Float:slz;
  565. GetPlayerPos(playerid, slx, sly, slz);
  566. SetPlayerPos(playerid, slx, sly, slz);
  567. NOPCheck(playerid);
  568. SendClientMessageEx(playerid, COLOR_GRAD2, "You are not in the Life Flight Division!");
  569. }
  570. }
  571. else if(IsAnNGAIRCar(vehicleid))
  572. {
  573. if((PlayerInfo[playerid][pMember] == 11||PlayerInfo[playerid][pLeader] == 11) && (PlayerInfo[playerid][pDivision] == 1 || PlayerInfo[playerid][pDivision] == 4))
  574. {
  575. }
  576. else
  577. {
  578. RemovePlayerFromVehicle(playerid);
  579. new Float:slx, Float:sly, Float:slz;
  580. GetPlayerPos(playerid, slx, sly, slz);
  581. SetPlayerPos(playerid, slx, sly, slz);
  582. NOPCheck(playerid);
  583. SendClientMessageEx(playerid, COLOR_GRAD2, "You are not in the NG AIR Division!");
  584. }
  585. }
  586. else if(IsAnNGCar(vehicleid))
  587. {
  588. if(PlayerInfo[playerid][pMember] == 11||PlayerInfo[playerid][pLeader] == 11)
  589. {
  590. }
  591. else
  592. {
  593. RemovePlayerFromVehicle(playerid);
  594. new Float:slx, Float:sly, Float:slz;
  595. GetPlayerPos(playerid, slx, sly, slz);
  596. SetPlayerPos(playerid, slx, sly, slz);
  597. NOPCheck(playerid);
  598. SendClientMessageEx(playerid, COLOR_GRAD2, "You are not in the NG!");
  599. }
  600. }
  601. else if(IsAnDOCCar(vehicleid))
  602. {
  603. if(PlayerInfo[playerid][pMember] == 11||PlayerInfo[playerid][pLeader] == 11)
  604. {
  605. }
  606. else
  607. {
  608. NOPCheck(playerid);
  609. RemovePlayerFromVehicle(playerid);
  610. new Float:slx, Float:sly, Float:slz;
  611. GetPlayerPos(playerid, slx, sly, slz);
  612. SetPlayerPos(playerid, slx, sly, slz);
  613. SendClientMessageEx(playerid, COLOR_GRAD2, "You are not in the NG!");
  614. }
  615. }
  616. else if(IsAnMPSCar(vehicleid))
  617. {
  618. if(IsACop(playerid))
  619. {
  620. }
  621. else
  622. {
  623. RemovePlayerFromVehicle(playerid);
  624. new Float:slx, Float:sly, Float:slz;
  625. GetPlayerPos(playerid, slx, sly, slz);
  626. SetPlayerPos(playerid, slx, sly, slz);
  627. NOPCheck(playerid);
  628. SendClientMessageEx(playerid, COLOR_GRAD2, "You aren't in a LEO Faction.");
  629. }
  630. }
  631. else if(IsACoastguardCar(vehicleid))
  632. {
  633. if( ( PlayerInfo[playerid][pMember] == 4 || PlayerInfo[playerid][pLeader] == 4 ) || ( PlayerInfo[playerid][pMember] == 3 && PlayerInfo[playerid][pDivision] == 3 ))
  634. {
  635. }
  636. else
  637. {
  638. RemovePlayerFromVehicle(playerid);
  639. new Float:slx, Float:sly, Float:slz;
  640. GetPlayerPos(playerid, slx, sly, slz);
  641. SetPlayerPos(playerid, slx, sly, slz);
  642. SendClientMessageEx(playerid, COLOR_GRAD2, "You are not in the Coastguard division!");
  643. }
  644. }
  645. else if(IsANewsCar(vehicleid))
  646. {
  647. if(PlayerInfo[playerid][pMember] == 9 ||PlayerInfo[playerid][pLeader] == 9)
  648. {
  649. }
  650. else
  651. {
  652. RemovePlayerFromVehicle(playerid);
  653. new Float:slx, Float:sly, Float:slz;
  654. GetPlayerPos(playerid, slx, sly, slz);
  655. SetPlayerPos(playerid, slx, sly, slz);
  656. NOPCheck(playerid);
  657. SendClientMessageEx(playerid, COLOR_GRAD2, "You are not in the SANews!");
  658. }
  659. }
  660. else if(IsAPlane(vehicleid))
  661. {
  662. if(PlayerInfo[playerid][pFlyLic] != 1)
  663. {
  664. RemovePlayerFromVehicle(playerid);
  665. new Float:slx, Float:sly, Float:slz;
  666. GetPlayerPos(playerid, slx, sly, slz);
  667. SetPlayerPos(playerid, slx, sly, slz);
  668. NOPCheck(playerid);
  669. SendClientMessageEx(playerid,COLOR_GREY,"You don't have a pilot license!");
  670. }
  671. }
  672. else if(IsAHelicopter(vehicleid))
  673. {
  674. PlayerInfo[playerid][pAGuns][GetWeaponSlot(46)] = 46;
  675. GivePlayerValidWeapon(playerid, 46, 60000);
  676. }
  677. else if(IsAnTaxi(vehicleid) || IsAnBus(vehicleid))
  678. {
  679. if(PlayerInfo[playerid][pJob] == 17 || PlayerInfo[playerid][pJob2] == 17 || PlayerInfo[playerid][pMember] == 10 || PlayerInfo[playerid][pLeader] == 10 || PlayerInfo[playerid][pTaxiLicense] == 1)
  680. {
  681. }
  682. else
  683. {
  684. SendClientMessageEx(playerid,COLOR_GREY," You are not a Taxi/Bus Driver!");
  685. RemovePlayerFromVehicle(playerid);
  686. new Float:slx, Float:sly, Float:slz;
  687. GetPlayerPos(playerid, slx, sly, slz);
  688. SetPlayerPos(playerid, slx, sly, slz);
  689. }
  690. }
  691. if( GetPVarInt( playerid, "ToBeEjected" ) >= 1 )
  692. {
  693. SetPVarInt( playerid, "ToBeEjected", 0 );
  694. RemovePlayerFromVehicle( playerid );
  695. new Float:X, Float:Y, Float:Z;
  696. GetPlayerPos(playerid, X, Y, Z);
  697. SetPlayerPos(playerid, X, Y, Z+2);
  698.  
  699. if(GetPVarInt(playerid, "Injured") == 1)
  700. {
  701. Streamer_UpdateEx(playerid, GetPVarFloat(playerid,"MedicX"), GetPVarFloat(playerid,"MedicY"), GetPVarFloat(playerid,"MedicZ"));
  702. SetPlayerPos(playerid, GetPVarFloat(playerid,"MedicX"), GetPVarFloat(playerid,"MedicY"), GetPVarFloat(playerid,"MedicZ"));
  703. SetPlayerVirtualWorld(playerid, GetPVarInt(playerid,"MedicVW"));
  704. SetPlayerInterior(playerid, GetPVarInt(playerid,"MedicInt"));
  705. ClearAnimations(playerid);
  706. ApplyAnimation(playerid, "KNIFE", "KILL_Knife_Ped_Die", 4.0, 0, 1, 1, 1, 0, 1);
  707. }
  708. }
  709. //if(lights == VEHICLE_PARAMS_UNSET) SetVehicleParamsEx(newcar,engine,VEHICLE_PARAMS_OFF,alarm,doors,bonnet,boot,objective);
  710. TelePos[playerid][0] = 0.0;
  711. TelePos[playerid][1] = 0.0;
  712. //SetPVarInt(playerid, "LastWeapon", GetPlayerWeapon(playerid));
  713. if(IsARental(newcar) && gBike[playerid] == 0 && gBikeRenting[playerid] == 0)
  714. {
  715. TogglePlayerControllable(playerid,0);
  716. ShowPlayerDialog(playerid, RENTMENU, DIALOG_STYLE_LIST, "Bike Shed BMX Rentals","15 Minutes - 1000$\n30 Minutes - 2000$\n1 Hour - 4000$", "Rent", "Cancel");
  717. }
  718. if(GetCarDealershipVehicleId(newcar) != -1 && GetCarDealershipVehicleId(newcar) == GetPVarInt(playerid, "editingcdveh")) return 1;
  719. if(GetCarDealershipVehicleId(newcar) != -1)
  720. {
  721. new string[57 + 20 + 4];
  722. format(string, sizeof(string),"Would you like to buy this %s?\n\nThis vehicle costs $%d.", GetVehicleName(newcar), CarDealershipInfo[GetCarDealershipId(newcar)][cdVehicleCost][GetCarDealershipVehicleId(newcar)]);
  723. ShowPlayerDialog(playerid,DIALOG_CDBUY,DIALOG_STYLE_MSGBOX,"Warning:",string,"Buy","Cancel");
  724. TogglePlayerControllable(playerid, false);
  725. return 1;
  726. }
  727. GetVehicleParamsEx(newcar,engine,lights,alarm,doors,bonnet,boot,objective);
  728. if((engine == VEHICLE_PARAMS_UNSET || engine == VEHICLE_PARAMS_OFF) && GetVehicleModel(newcar) != 509 && GetVehicleModel(newcar) != 481 && GetVehicleModel(newcar) != 510) {
  729. SendClientMessageEx(playerid, COLOR_WHITE, "This vehicle's engine is not running - if you wish to start it, type /car engine.");
  730. }
  731. else
  732. {
  733. if(GetVehicleModel(GetPlayerVehicleID(playerid)) != 481 && GetVehicleModel(GetPlayerVehicleID(playerid)) != 509 && GetVehicleModel(GetPlayerVehicleID(playerid)) != 510)
  734. {
  735. SetPVarInt(playerid, "fuelonoff", 1);
  736. bGas[playerid] = CreateProgressBar(548.00, 26.00, 57.50, 3.20, 866792447, 100.0);
  737. textdrawscount++;
  738. SetProgressBarValue(bGas[playerid], Gas[GetPlayerVehicleID(playerid)]);
  739. ShowProgressBarForPlayer(playerid, bGas[playerid]);
  740. }
  741. }
  742. }
  743. if((newstate == 2 || newstate == 3 || newstate == 7 || newstate == 9) && pTazer[playerid] == 1)
  744. {
  745. GivePlayerValidWeapon(playerid, pTazerReplace[playerid], 60000);
  746. pTazer[playerid] = 0;
  747. }
  748. if(newstate == PLAYER_STATE_SPAWNED)
  749. {
  750. if(ConnectedToPC[playerid] == 1337)//mdc
  751. {
  752. ConnectedToPC[playerid] = 0;
  753. }
  754. TelePos[playerid][0] = 0.0;
  755. TelePos[playerid][1] = 0.0;
  756. gPlayerSpawned[playerid] = 1;
  757. SafeTime[playerid] = 60;
  758. }
  759. if(newstate == PLAYER_STATE_PASSENGER && GetVehicleModel(GetPlayerVehicleID(playerid)) == 519)
  760. {
  761. new vehicleid = GetPlayerVehicleID(playerid);
  762. if(VehicleStatus{vehicleid} == 1) return SendClientMessageEx(playerid, COLOR_WHITE, "You are not allowed to enter this Shamal as it's been damaged!");
  763. new string[47 + MAX_PLAYER_NAME];
  764. format(string, sizeof(string), "* %s enters the Shamal airplane as a passenger.", GetPlayerNameEx(playerid));
  765. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  766. SetPlayerPos(playerid, 2.509036, 23.118730, 1199.593750);
  767. SetPlayerFacingAngle(playerid, 82.14);
  768. SetCameraBehindPlayer(playerid);
  769. PlayerInfo[playerid][pVW] = vehicleid;
  770. SetPlayerVirtualWorld(playerid, vehicleid);
  771. PlayerInfo[playerid][pInt] = 1;
  772. SetPlayerInterior(playerid, 1);
  773. InsideShamal[playerid] = vehicleid;
  774. }
  775. IsPlayerSteppingInVehicle[playerid] = -1;
  776. return 1;
  777. }
Advertisement
Add Comment
Please, Sign In to add comment