Advertisement
Guest User

Untitled

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