Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2011
430
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 43.63 KB | None | 0 0
  1. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  2. {
  3. if(IsPlayerNPC(playerid)) return 1;
  4. if((newkeys & KEY_FIRE) && GetPVarInt(playerid, "SpeedRadar") == 1 && GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
  5. {
  6. if(GetPVarInt(playerid, "RadarTimeout") == 0)
  7. {
  8. if(GetPlayerWeapon(playerid) == SPEEDGUN)
  9. {
  10. new Float:x,Float:y,Float:z;
  11. for(new veh = 1; veh < MAX_VEHICLES; veh++)
  12. {
  13. if(IsVehicleStreamedIn(veh, playerid))
  14. {
  15. GetVehiclePos(veh,x,y,z);
  16. if(IsPlayerAimingAt(playerid,x,y,z,10))
  17. {
  18. new Float: Speed = GetVehicleSpeed(veh, 0);
  19. new string[68];
  20. format(string, sizeof(string), "~n~~n~~n~~n~~n~~n~~b~License Plate: ~w~%d~n~~b~Speed: ~w~%d MPH", veh, floatround(Speed/1.609));
  21. GameTextForPlayer(playerid, string,3500, 3);
  22. format(string, sizeof(string), "License Plate: %d Speed: %d MPH", veh, floatround(Speed/1.609));
  23. SendClientMessageEx(playerid, COLOR_GRAD4, string);
  24. SetPVarInt(playerid, "RadarTimeout", 1);
  25. SetTimerEx("RadarCooldown", 3000, 0, "i", playerid);
  26. return 1;
  27. }
  28. }
  29. }
  30. }
  31. }
  32. }
  33. if((newkeys & KEY_FIRE) && pTazer[playerid] == 1 && GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
  34. {
  35. if(TazerTimeout[playerid] > 0)
  36. {
  37. return 1;
  38. }
  39. new Float:X, Float:Y, Float:Z;
  40. foreach(Player, i)
  41. {
  42. if(IsPlayerStreamedIn(i, playerid))
  43. {
  44. GetPlayerPos(i, X, Y, Z);
  45. if(IsPlayerAimingAt(playerid,X,Y,Z,1) && PlayerCuffed[i] == 0 && GetPlayerState(i) == PLAYER_STATE_ONFOOT && (GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i)))
  46. {
  47. if(PlayerInfo[i][pAdmin] >= 2 && PlayerInfo[i][pTogReports] != 1)
  48. {
  49. SendClientMessageEx(playerid, COLOR_GRAD2, "Admins can not be tazed!");
  50. return 1;
  51. }
  52. new string[44 + (MAX_PLAYER_NAME * 2)];
  53. format(string, sizeof(string), "* %s fires their tazer at %s, stunning them.", GetPlayerNameEx(playerid), GetPlayerNameEx(i));
  54. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  55. GameTextForPlayer(i, "~r~Tazed", 3500, 3);
  56. SendAudioToRange(10300, 100, 0, X, Y, Z, 20.0);
  57. TogglePlayerControllable(i, 0);
  58. ApplyAnimation(i,"CRACK","crckdeth2",4.1,0,1,1,1,1,1);
  59. PlayerPlaySound(i, 1085, X, Y, Z);
  60. PlayerPlaySound(playerid, 1085, X, Y, Z);
  61. PlayerCuffed[i] = 1;
  62. SetPVarInt(i, "PlayerCuffed", 1);
  63. PlayerCuffedTime[i] = 16;
  64. SetPVarInt(i, "IsFrozen", 1);
  65. //Frozen[i] = 1;
  66. TazerTimeout[playerid] = 4;
  67. SetTimerEx("TazerTimer",1000,false,"d",playerid);
  68. GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~r~Tazer reloading... ~w~5", 1500,3);
  69. return 1;
  70. }
  71. }
  72. }
  73. }
  74. if((newkeys & 16) && GetPVarInt(playerid,"UsingAnim") == 1 && GetPVarInt(playerid, "IsFrozen") == 0 && GetPlayerState(playerid) == 1 && PlayerCuffed[playerid] == 0 && PlayerInfo[playerid][pBeingSentenced] == 0)
  75. {
  76. ClearAnimations(playerid);
  77. DeletePVar(playerid,"UsingAnim");
  78. }
  79. if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_DRINK_BEER && (newkeys & KEY_FIRE))
  80. {
  81. if(GetPVarInt(playerid, "DrinkCooledDown") == 1)
  82. {
  83. new Float: cHealth;
  84. GetPlayerHealth(playerid, cHealth);
  85. if(cHealth < 100)
  86. {
  87. SetPlayerHealth(playerid, cHealth+5);
  88. }
  89. else
  90. {
  91. SendClientMessageEx(playerid, COLOR_GREY, "* You finish up the drink and throw it away.");
  92. SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
  93. }
  94. DeletePVar(playerid, "DrinkCooledDown");
  95. SetTimerEx("DrinkCooldown", 2500, 0, "i", playerid);
  96. return 1;
  97. }
  98. }
  99. if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_DRINK_WINE && (newkeys & KEY_FIRE))
  100. {
  101. if(GetPVarInt(playerid, "DrinkCooledDown") == 1)
  102. {
  103. new Float: cHealth;
  104. GetPlayerHealth(playerid, cHealth);
  105. if(cHealth < 100)
  106. {
  107. SetPlayerHealth(playerid, cHealth+8);
  108. }
  109. else
  110. {
  111. SendClientMessageEx(playerid, COLOR_GREY, "* You finish up the drink and throw it away.");
  112. SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
  113. }
  114. DeletePVar(playerid, "DrinkCooledDown");
  115. SetTimerEx("DrinkCooldown", 2500, 0, "i", playerid);
  116. return 1;
  117. }
  118. }
  119.  
  120. if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_DRINK_SPRUNK && (newkeys & KEY_FIRE))
  121. {
  122. if(GetPVarInt(playerid, "DrinkCooledDown") == 1)
  123. {
  124. new Float: cHealth;
  125. GetPlayerHealth(playerid, cHealth);
  126. if(cHealth < 100)
  127. {
  128. SetPlayerHealth(playerid, cHealth+2);
  129. }
  130. else
  131. {
  132. SendClientMessageEx(playerid, COLOR_GREY, "* You finish up the drink and throw it away.");
  133. SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
  134. }
  135. DeletePVar(playerid, "DrinkCooledDown");
  136. SetTimerEx("DrinkCooldown", 2500, 0, "i", playerid);
  137. return 1;
  138. }
  139. }
  140. if(IsKeyJustDown(KEY_SECONDARY_ATTACK, newkeys, oldkeys))
  141. {
  142. if(GetPVarInt(playerid, "NGPassenger") == 1)
  143. {
  144. TogglePlayerSpectating(playerid, 0);
  145. }
  146. if(GetPVarInt(playerid, "UsingSprunk"))
  147. {
  148. DeletePVar(playerid, "UsingSprunk");
  149. SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
  150. return 1;
  151. }
  152. }
  153. if (IsKeyJustDown(KEY_FIRE, newkeys, oldkeys))
  154. {
  155. if( PlayerInfo[playerid][pC4Used] == 1 )
  156. {
  157. if(GoChase[playerid] < 999)
  158. {
  159. if(IsPlayerInRangeOfPoint(GoChase[playerid], 12.0, GetPVarFloat(playerid, "DYN_C4_FLOAT_X"), GetPVarFloat(playerid, "DYN_C4_FLOAT_Y"), GetPVarFloat(playerid, "DYN_C4_FLOAT_Z")))
  160. {
  161. if(PlayerInfo[GoChase[playerid]][pHeadValue] >= 1)
  162. {
  163. if(PlayerInfo[playerid][pMember] == 8 || PlayerInfo[playerid][pLeader] == 8)
  164. {
  165. new string[128];
  166. new takemoney = PlayerInfo[GoChase[playerid]][pHeadValue] / 4 * 2;
  167. GivePlayerCash(playerid, takemoney);
  168. GivePlayerCash(GoChase[playerid], -takemoney);
  169. format(string,sizeof(string),"Hitman %s has fulfilled the contract on %s and collected $%d",GetPlayerNameEx(playerid),GetPlayerNameEx(GoChase[playerid]),PlayerInfo[GoChase[playerid]][pHeadValue] / 4 * 2);
  170. SendFamilyMessage(8, COLOR_YELLOW, string);
  171. format(string,sizeof(string),"You have been critically injured by a Hitman and lost $%d!",takemoney);
  172. ResetPlayerWeaponsEx(GoChase[playerid]);
  173. // SpawnPlayer(GoChase[playerid]);
  174. SendClientMessageEx(GoChase[playerid], COLOR_YELLOW, string);
  175. PlayerInfo[GoChase[playerid]][pHeadValue] = 0;
  176. PlayerInfo[playerid][pCHits] += 1;
  177. SetPlayerHealth(GoChase[playerid], 0.0);
  178. // KillEMSQueue(GoChase[playerid]);
  179. GotHit[GoChase[playerid]] = 0;
  180. GetChased[GoChase[playerid]] = 999;
  181. GoChase[playerid] = 999;
  182. }
  183. }
  184. }
  185. }
  186. PlayerInfo[playerid][pC4Used] = 0;
  187. CreateExplosion(GetPVarFloat(playerid, "DYN_C4_FLOAT_X"), GetPVarFloat(playerid, "DYN_C4_FLOAT_Y"), GetPVarFloat(playerid, "DYN_C4_FLOAT_Z"), 7, 8);
  188. PickUpC4(playerid);
  189. SendClientMessageEx(playerid, COLOR_YELLOW, " Bomb has been detonated!");
  190. PlayerInfo[playerid][pC4Used] = 0;
  191. return 1;
  192. }
  193. if(GetPVarInt(playerid, "MovingStretcher") != -1)
  194. {
  195. KillTimer(GetPVarInt(playerid, "TickEMSMove"));
  196. MoveEMS(playerid);
  197. return 1;
  198. }
  199. if(GetPVarInt(playerid, "editingcdvehpos"))
  200. {
  201. TogglePlayerControllable(playerid, false);
  202. ShowPlayerDialog(playerid,DIALOG_CDEDITPARK,DIALOG_STYLE_MSGBOX,"Warning:","Is this the new position you want?","Ok","Cancel");
  203. }
  204. if(GetPVarInt(playerid, "editingcdvehnew"))
  205. {
  206. TogglePlayerControllable(playerid, false);
  207. ShowPlayerDialog(playerid,DIALOG_CDEDITPARK,DIALOG_STYLE_MSGBOX,"Warning:","Is this the new position you want?","Ok","Cancel");
  208. }
  209. if(GetPVarInt(playerid, "editingfamhq") != 255)
  210. {
  211. if(GetPVarInt(playerid, "editingfamhqaction") == 1)
  212. {
  213. DeletePVar(playerid, "editingfamhqaction");
  214. TogglePlayerControllable(playerid, false);
  215. ShowPlayerDialog(playerid,HQENTRANCE,DIALOG_STYLE_MSGBOX,"Warning:","Is this the entrance you want?","Ok","Cancel");
  216. }
  217. else if(GetPVarInt(playerid, "editingfamhqaction") == 2)
  218. {
  219. DeletePVar(playerid, "editingfamhqaction");
  220. TogglePlayerControllable(playerid, false);
  221. ShowPlayerDialog(playerid,HQEXIT,DIALOG_STYLE_MSGBOX,"Warning:","Is this the exit you want?","Ok","Cancel");
  222. }
  223. else if(GetPVarInt(playerid, "editingfamhqaction") == 5)
  224. {
  225. TogglePlayerControllable(playerid, false);
  226. ShowPlayerDialog(playerid,HQENTRANCE,DIALOG_STYLE_MSGBOX,"Warning:","Is this the entrance you want?","Ok","Cancel");
  227. }
  228. else if(GetPVarInt(playerid, "editingfamhqaction") == 6)
  229. {
  230. TogglePlayerControllable(playerid, false);
  231. ShowPlayerDialog(playerid,HQEXIT,DIALOG_STYLE_MSGBOX,"Warning:","Is this the exit you want?","Ok","Cancel");
  232. }
  233.  
  234. }
  235. new Float:health;
  236. GetPlayerHealth(playerid, health);
  237.  
  238. if(GetPVarInt(playerid, "UsingSprunk"))
  239. {
  240. new hpint = floatround( health, floatround_round );
  241. if( hpint >= 100 )
  242. {
  243. SendClientMessageEx(playerid, COLOR_GREY, " You already have full health.");
  244. return 1;
  245. }
  246. else
  247. {
  248. GetPlayerHealth(playerid, health);
  249. SetPlayerHealth(playerid, health+1.0);
  250. }
  251. }
  252. }
  253. return 1;
  254. }
  255.  
  256. public OnPlayerStateChange(playerid, newstate, oldstate)
  257. {
  258. if(newstate != 2) NOPTrigger[playerid] = 0;
  259. if(IsPlayerNPC(playerid))
  260. {
  261. if(newstate == PLAYER_STATE_SPECTATING)
  262. {
  263. TogglePlayerSpectating(playerid, false);
  264. }
  265. return 1;
  266. }
  267. if(GettingSpectated[playerid] != 999)
  268. {
  269. new spectator = GettingSpectated[playerid];
  270. if(!IsPlayerConnected(spectator))
  271. {
  272. GettingSpectated[playerid] = 999;
  273. Spectate[spectator] = 999;
  274. }
  275.  
  276. if(newstate == PLAYER_STATE_DRIVER && PlayerInfo[spectator][pAdmin] >= 2 || newstate == PLAYER_STATE_PASSENGER && PlayerInfo[spectator][pAdmin] >= 2)
  277. {
  278. TogglePlayerSpectating(spectator, true);
  279. new carid = GetPlayerVehicleID( playerid );
  280. PlayerSpectateVehicle( spectator, carid );
  281. SetPVarInt(spectator, "SpecState", newstate);
  282. }
  283. else if(newstate == PLAYER_STATE_ONFOOT && PlayerInfo[spectator][pAdmin] >= 2)
  284. {
  285. TogglePlayerSpectating(spectator, true);
  286. PlayerSpectatePlayer( spectator, playerid );
  287. SetPlayerInterior( spectator, GetPlayerInterior( playerid ) );
  288. SetPVarInt(spectator, "SpecState", newstate);
  289. }
  290. }
  291. if(newstate == PLAYER_STATE_ONFOOT)
  292. {
  293. if(Audio_IsClientConnected(playerid))
  294. {
  295. Audio_Stop(playerid, stationidp[playerid]);
  296. stationidp[playerid] = 0;
  297. }
  298.  
  299.  
  300. new spectator = GettingSpectated[playerid];
  301. if(PlayerInfo[spectator][pAdmin] >= 2) {
  302. // Preventing possible buffer overflows with the arrays
  303. TogglePlayerSpectating(spectator, true);
  304. PlayerSpectatePlayer( spectator, playerid );
  305. SetPlayerInterior( spectator, GetPlayerInterior( playerid ) );
  306. SetPVarInt(spectator, "SpecState", newstate);
  307. SetPlayerInterior( spectator, GetPlayerInterior( playerid ) );
  308. SetPlayerVirtualWorld( spectator, GetPlayerVirtualWorld( playerid ) );
  309. }
  310.  
  311. if(oldstate == PLAYER_STATE_DRIVER)
  312. {
  313. SetPlayerWeaponsEx(playerid);
  314. }
  315. else if(oldstate == PLAYER_STATE_PASSENGER) SetPlayerWeaponsEx(playerid);
  316.  
  317. if(ConnectedToPC[playerid] == 1337)//mdc
  318. {
  319. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* You are now logged off the MDC.");
  320. ConnectedToPC[playerid] = 0;
  321. }
  322. if(TransportDuty[playerid] > 0)
  323. {
  324. if(TransportDuty[playerid] == 1)
  325. {
  326. TaxiDrivers -= 1;
  327. }
  328. else if(TransportDuty[playerid] == 2)
  329. {
  330. BusDrivers -= 1;
  331. }
  332. TransportDuty[playerid] = 0;
  333. new string[42];
  334. format(string, sizeof(string), "* You are now off duty and earned $%d.", TransportMoney[playerid]);
  335. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  336. GivePlayerCash(playerid, TransportMoney[playerid]);
  337. ConsumingMoney[playerid] = 1; TransportValue[playerid] = 0; TransportMoney[playerid] = 0;
  338. SetPlayerColor(playerid, TEAM_HIT_COLOR);
  339. TransportTime[playerid] = 0;
  340. TransportCost[playerid] = 0;
  341. }
  342. if(TransportDriver[playerid] < 999)
  343. {
  344. new string[128];
  345. TransportMoney[TransportDriver[playerid]] += TransportCost[playerid];
  346. format(string, sizeof(string), "~w~The ride cost~n~~r~$%d",TransportCost[playerid]);
  347. GameTextForPlayer(playerid, string, 5000, 3);
  348. format(string, sizeof(string), "~w~Passenger left the taxi.~n~~g~Earned $%d",TransportCost[playerid]);
  349. GameTextForPlayer(TransportDriver[playerid], string, 5000, 3);
  350. GivePlayerCash(playerid, -TransportCost[playerid]);
  351.  
  352. new ip[32], ipex[32];
  353. GetPlayerIp(playerid, ip, sizeof(ip));
  354. GetPlayerIp(TransportDriver[playerid], ipex, sizeof(ipex));
  355. TaxiWarn[playerid][TransportDriver[playerid]] += TransportCost[playerid];
  356. if(TaxiWarn[playerid][TransportDriver[playerid]] >= 10000)
  357. {
  358. 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]]);
  359. Log("logs/pay.log", string);
  360. ABroadCast(COLOR_YELLOW, string, 2);
  361. }
  362. TransportTime[TransportDriver[playerid]] = 0;
  363. TransportCost[TransportDriver[playerid]] = 0;
  364. TransportCost[playerid] = 0;
  365. TransportTime[playerid] = 0;
  366. TransportDriver[playerid] = 999;
  367. }
  368. TelePos[playerid][0] = 0.0;
  369. TelePos[playerid][1] = 0.0;
  370. }
  371. if(newstate == PLAYER_STATE_PASSENGER) // TAXI & BUSSES
  372. {
  373. if(stationidv[GetPlayerVehicleID(playerid)] != 0)
  374. {
  375. new station[64];
  376. switch(stationidv[GetPlayerVehicleID(playerid)])
  377. {
  378. case 1: format(station, sizeof(station), "http://216.246.109.162:8000");
  379. case 2: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1415249");
  380. case 3: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1415249");
  381. case 4: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1628721");
  382. case 5: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1283687");
  383. case 6: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1628932");
  384. case 7: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1756658");
  385. case 8: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1377200");
  386. case 9: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=2057197");
  387. case 10: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=18695");
  388. case 11: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=412093");
  389. case 12: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=181367");
  390. case 13: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1275071");
  391. case 14: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=412093");
  392. case 15: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1280356");
  393. case 16: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1279013");
  394. case 17: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1281016");
  395. case 18: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1280855");
  396. case 19: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1116397");
  397. case 20: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=2057543");
  398. case 21: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=616366");
  399. case 22: format(station, sizeof(station), "http://38.107.220.164:8014");
  400. case 23: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=847066");
  401. }
  402. if(Audio_IsClientConnected(playerid))
  403. {
  404. Audio_Stop(playerid, stationidp[playerid]);
  405. stationidp[playerid] = Audio_PlayStreamed(playerid, station, false, true, false);
  406. }
  407. }
  408. new vehicleid = GetPlayerVehicleID(playerid);
  409. if(vehicleid == NGVehicles[12] ||
  410. vehicleid == NGVehicles[13] ||
  411. vehicleid == NGVehicles[14] ||
  412. vehicleid == NGVehicles[15] ||
  413. vehicleid == NGVehicles[16] ||
  414. vehicleid == NGVehicles[17])
  415. {
  416. TogglePlayerSpectating(playerid, 1);
  417. PlayerSpectateVehicle(playerid, vehicleid);
  418. SetPVarInt(playerid, "NGPassenger", 1);
  419. SetPVarInt(playerid, "NGPassengerVeh", vehicleid);
  420. SetPVarInt(playerid, "NGPassengerSkin", GetPlayerSkin(playerid));
  421. new Float:health, Float:armour;
  422. GetPlayerHealth(playerid, health);
  423. GetPlayerArmour(playerid, armour);
  424. SetPVarFloat(playerid, "NGPassengerHP", health);
  425. SetPVarFloat(playerid, "NGPassengerArmor", armour);
  426. }
  427.  
  428. /*new gun,tmp;
  429. GetPlayerWeaponData(playerid,4,gun,tmp);
  430. #pragma unused tmp
  431. if(gun)SetPlayerArmedWeapon(playerid,gun);
  432. else SetPlayerArmedWeapon(playerid,0);*/
  433. if(PlayerInfo[playerid][pGuns][4] > 0) SetPlayerArmedWeapon(playerid,PlayerInfo[playerid][pGuns][4]);
  434. else SetPlayerArmedWeapon(playerid,0);
  435.  
  436. if( GetPVarInt( playerid, "ToBeEjected" ) >= 1 )
  437. {
  438. SetPVarInt( playerid, "ToBeEjected", 0 );
  439. RemovePlayerFromVehicle( playerid );
  440. new Float:X, Float:Y, Float:Z;
  441. GetPlayerPos(playerid, X, Y, Z);
  442. SetPlayerPos(playerid, X, Y, Z+2);
  443.  
  444. if(GetPVarInt(playerid, "Injured") == 1)
  445. {
  446. Streamer_UpdateEx(playerid, GetPVarFloat(playerid,"MedicX"), GetPVarFloat(playerid,"MedicY"), GetPVarFloat(playerid,"MedicZ"));
  447. SetPlayerPos(playerid, GetPVarFloat(playerid,"MedicX"), GetPVarFloat(playerid,"MedicY"), GetPVarFloat(playerid,"MedicZ"));
  448. SetPlayerVirtualWorld(playerid, GetPVarInt(playerid,"MedicVW"));
  449. SetPlayerInterior(playerid, GetPVarInt(playerid,"MedicInt"));
  450. ClearAnimations(playerid);
  451. ApplyAnimation(playerid, "KNIFE", "KILL_Knife_Ped_Die", 4.0, 0, 1, 1, 1, 0, 1);
  452. }
  453. }
  454. //SetPVarInt(playerid, "LastWeapon", GetPlayerWeapon(playerid));
  455. gLastCar[playerid] = vehicleid;
  456. foreach(Player, i)
  457. {
  458. if(IsPlayerInVehicle(i, vehicleid) && GetPlayerState(i) == 2 && TransportDuty[i] > 0)
  459. {
  460. if(GetPlayerCash(playerid) < TransportValue[i])
  461. {
  462. new string[28];
  463. format(string, sizeof(string), "* You need $%d to enter.", TransportValue[i]);
  464. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  465. RemovePlayerFromVehicle(playerid);
  466. new Float:X, Float:Y, Float:Z;
  467. GetPlayerPos(playerid, X, Y, Z);
  468. SetPlayerPos(playerid, X, Y, Z+2);
  469. TogglePlayerControllable(playerid, 1);
  470. }
  471. else
  472. {
  473. new string[38];
  474. if(TransportDuty[i] == 1)
  475. {
  476. format(string, sizeof(string), "* You paid $%d to the taxi driver.", TransportValue[i]);
  477. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  478. format(string, sizeof(string), "* Passenger %s has entered your taxi.", GetPlayerNameEx(playerid));
  479. SendClientMessageEx(i, COLOR_LIGHTBLUE, string);
  480. TransportTime[i] = 1;
  481. TransportTime[playerid] = 1;
  482. TransportCost[playerid] = TransportValue[i];
  483. TransportCost[i] = TransportValue[i];
  484. TransportDriver[playerid] = i;
  485. }
  486. else if(TransportDuty[i] == 2)
  487. {
  488. format(string, sizeof(string), "* You paid $%d to the Taxi Driver.", TransportValue[i]);
  489. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  490. format(string, sizeof(string), "* Passenger %s has entered your Taxi.", GetPlayerNameEx(playerid));
  491. SendClientMessageEx(i, COLOR_LIGHTBLUE, string);
  492. }
  493. GivePlayerCash(playerid, - TransportValue[i]);
  494. TransportMoney[i] += TransportValue[i];
  495. }
  496. }
  497. }
  498. }
  499. if(newstate == PLAYER_STATE_WASTED)
  500. {
  501. if(GetPVarInt(playerid, "EventToken") == 0)
  502. {
  503. SetPVarInt(playerid, "MedicBill", 1);
  504. }
  505. if(ConnectedToPC[playerid] == 1337)//mdc
  506. {
  507. ConnectedToPC[playerid] = 0;
  508. }
  509. Seatbelt[playerid] = 0;
  510. }
  511. if(newstate == PLAYER_STATE_DRIVER)
  512. {
  513. if(stationidv[GetPlayerVehicleID(playerid)] != 0)
  514. {
  515. new station[64];
  516. switch(stationidv[GetPlayerVehicleID(playerid)])
  517. {
  518. case 1: format(station, sizeof(station), "http://216.246.109.162:8000");
  519. case 2: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1415249");
  520. case 3: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1415249");
  521. case 4: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1628721");
  522. case 5: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1283687");
  523. case 6: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1628932");
  524. case 7: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1756658");
  525. case 8: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1377200");
  526. case 9: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=2057197");
  527. case 10: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=18695");
  528. case 11: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=412093");
  529. case 12: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=181367");
  530. case 13: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1275071");
  531. case 14: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=412093");
  532. case 15: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1280356");
  533. case 16: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1279013");
  534. case 17: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1281016");
  535. case 18: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1280855");
  536. case 19: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1116397");
  537. case 20: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=2057543");
  538. case 21: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=616366");
  539. case 22: format(station, sizeof(station), "http://38.107.220.164:8014");
  540. case 23: format(station, sizeof(station), "http://yp.shoutcast.com/sbin/tunein-station.pls?id=847066");
  541. }
  542. if(Audio_IsClientConnected(playerid))
  543. {
  544. Audio_Stop(playerid, stationidp[playerid]);
  545. stationidp[playerid] = Audio_PlayStreamed(playerid, station, false, true, false);
  546. }
  547. }
  548.  
  549. SetPlayerArmedWeapon(playerid, 0);
  550.  
  551. new
  552. newcar = GetPlayerVehicleID(playerid),
  553. engine, lights, alarm, doors, bonnet, boot, objective, v;
  554.  
  555. gLastCar[playerid] = newcar;
  556.  
  557. foreach(Player, i) {
  558. v = GetPlayerVehicle(i, newcar);
  559. if(v != -1) {
  560. if(i == playerid) {
  561.  
  562. new
  563. string[96];
  564.  
  565. format(string, sizeof(string),"You are the owner of this %s.", GetVehicleName(newcar));
  566. SendClientMessageEx(playerid, COLOR_GREY, string);
  567. if(PlayerVehicleInfo[i][v][pvTicket] != 0)
  568. {
  569. 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]);
  570. SendClientMessageEx(playerid, COLOR_GREY, string);
  571. SendClientMessageEx(playerid, COLOR_GREY, "Failure to pay this ticket as soon as possible will result in a fine, or even an arrest.");
  572. }
  573. }
  574. else if(i == PlayerInfo[playerid][pVehicleKeysFrom]) {
  575.  
  576. new
  577. string[64 + MAX_PLAYER_NAME];
  578.  
  579. format(string, sizeof(string),"You have the keys for this %s from owner %s.", GetVehicleName(newcar), GetPlayerNameEx(i));
  580. SendClientMessageEx(playerid, COLOR_GREY, string);
  581. }
  582. else if(PlayerVehicleInfo[i][v][pvLocked] == 1 && PlayerVehicleInfo[i][v][pvLock] == 1) {
  583. GetVehicleParamsEx(newcar,engine,lights,alarm,doors,bonnet,boot,objective);
  584. SetVehicleParamsEx(newcar,engine,lights,VEHICLE_PARAMS_ON,doors,bonnet,boot,objective);
  585. SetTimerEx("DisableVehicleAlarm", 20000, 0, "d", newcar);
  586. }
  587. else if(PlayerVehicleInfo[i][v][pvLocked] == 1 && PlayerVehicleInfo[i][v][pvLock] == 2) {
  588.  
  589. new
  590. string[49 + MAX_PLAYER_NAME];
  591.  
  592. if(PlayerInfo[playerid][pAdmin] < 2)
  593. {
  594. format(string, sizeof(string), "* %s has been stunned by the electric anti-theft.",GetPlayerNameEx(playerid));
  595. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  596. new Float:X, Float:Y, Float:Z, Float:HP;
  597. GetPlayerPos(playerid, X, Y, Z);
  598. SendAudioToRange(10300, 100, 0, X, Y, Z, 20.0);
  599. SetPlayerPos(playerid, X + 1, Y, Z);
  600. RemovePlayerFromVehicle(playerid);
  601. SetPVarInt(playerid, "IsFrozen", 1);
  602. TogglePlayerControllable(playerid,0);
  603. SetTimerEx("ReleasePlayer", 10000, 0, "d", playerid);
  604. GameTextForPlayer(playerid,"~r~STUNNED!",11000,3);
  605. GetPlayerHealth(playerid,HP);
  606. SetPlayerHealth(playerid,HP-15);
  607. }
  608. else
  609. {
  610. format(string, sizeof(string), "Warning: This %s is owned by %s.", GetVehicleName(newcar), GetPlayerNameEx(i));
  611. SendClientMessageEx(playerid, COLOR_GREY, string);
  612. }
  613. }
  614. return 1;
  615. }
  616. }
  617.  
  618. for(new f = 0; f < MAX_FAMILY; f++) {
  619. v = GetGangVehicle(f, newcar);
  620. if(v != -1) {
  621. new string[49 + MAX_PLAYER_NAME];
  622. if(PlayerInfo[playerid][pFMember] == f)
  623. {
  624. format(string, sizeof(string), "You are in the family that owns this %s.", GetVehicleName(newcar));
  625. SendClientMessageEx(playerid, COLOR_GREY, string);
  626. }
  627. else if(FamilyVehicleInfo[f][v][fvLocked] == 1 && FamilyVehicleInfo[f][v][fvLock] == 1)
  628. {
  629. GetVehicleParamsEx(newcar,engine,lights,alarm,doors,bonnet,boot,objective);
  630. SetVehicleParamsEx(newcar,engine,lights,VEHICLE_PARAMS_ON,doors,bonnet,boot,objective);
  631. SetTimerEx("DisableVehicleAlarm", 20000, 0, "d", newcar);
  632. }
  633. else if(FamilyVehicleInfo[f][v][fvLocked] == 1 && FamilyVehicleInfo[f][v][fvLock] == 2)
  634. {
  635. format(string, sizeof(string), "* %s has been stunned by the electric anti-theft.",GetPlayerNameEx(playerid));
  636. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  637. new Float:X, Float:Y, Float:Z, Float:HP;
  638. GetPlayerPos(playerid, X, Y, Z);
  639. SendAudioToRange(10300, 100, 0, X, Y, Z, 20.0);
  640. SetPlayerPos(playerid, X + 1, Y, Z);
  641. RemovePlayerFromVehicle(playerid);
  642. new Float:slx, Float:sly, Float:slz;
  643. GetPlayerPos(playerid, slx, sly, slz);
  644. SetPlayerPos(playerid, slx, sly, slz);
  645. SetPVarInt(playerid, "IsFrozen", 1);
  646. TogglePlayerControllable(playerid,0);
  647. SetTimerEx("ReleasePlayer", 10000, 0, "d", playerid);
  648. GameTextForPlayer(playerid,"~r~STUNNED!",11000,3);
  649. GetPlayerHealth(playerid,HP);
  650. SetPlayerHealth(playerid,HP-15);
  651. }
  652. return 1;
  653. }
  654. }
  655. new vehicleid = newcar;
  656. if(IsVIPcar(vehicleid))
  657. {
  658. if(PlayerInfo[playerid][pDonateRank] > 0)
  659. {
  660. SendClientMessageEx(playerid, COLOR_YELLOW, "VIP: This is a VIP vehicle from the VIP garage, therefore it has unlimited fuel.");
  661. }
  662. else
  663. {
  664. new Float:slx, Float:sly, Float:slz;
  665. GetPlayerPos(playerid, slx, sly, slz);
  666. SetPlayerPos(playerid, slx, sly, slz+1.3);
  667. PlayerPlaySound(playerid, 1130, slx, sly, slz+1.3);
  668. RemovePlayerFromVehicle(playerid);
  669. NOPCheck(playerid);
  670. SendClientMessageEx(playerid, COLOR_GRAD2, "You are not a VIP, this is a vehicle from the VIP Garage!");
  671. }
  672. }
  673. else if(IsAnAmbulance(vehicleid))
  674. {
  675. if(PlayerInfo[playerid][pMember] == 4||PlayerInfo[playerid][pLeader] == 4)
  676. {
  677. if(FDSAVehicles[13] == vehicleid && PlayerInfo[playerid][pRank] < 5)
  678. {
  679. RemovePlayerFromVehicle(playerid);
  680. new Float:slx, Float:sly, Float:slz;
  681. GetPlayerPos(playerid, slx, sly, slz);
  682. SetPlayerPos(playerid, slx, sly, slz);
  683. NOPCheck(playerid);
  684. SendClientMessageEx(playerid, COLOR_GRAD2, "Only ranks 5+ can drive this vehicle.");
  685. }
  686. }
  687. else
  688. {
  689. SendClientMessageEx(playerid,COLOR_GREY," You are not in the FDSA!");
  690. RemovePlayerFromVehicle(playerid);
  691. new Float:slx, Float:sly, Float:slz;
  692. GetPlayerPos(playerid, slx, sly, slz);
  693. SetPlayerPos(playerid, slx, sly, slz);
  694. NOPCheck(playerid);
  695. }
  696. }
  697. else if(IsAnSASDCar(vehicleid))
  698. {
  699. if(PlayerInfo[playerid][pMember] == 7 || PlayerInfo[playerid][pLeader] == 7)
  700. {
  701. }
  702. else
  703. {
  704. RemovePlayerFromVehicle(playerid);
  705. new Float:slx, Float:sly, Float:slz;
  706. GetPlayerPos(playerid, slx, sly, slz);
  707. SetPlayerPos(playerid, slx, sly, slz);
  708. NOPCheck(playerid);
  709. SendClientMessageEx(playerid, COLOR_GRAD2, "You are not in the SASD!");
  710. }
  711. }
  712. else if(IsAnSFPDCar(vehicleid))
  713. {
  714. if(PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3)
  715. {
  716. }
  717. else
  718. {
  719. RemovePlayerFromVehicle(playerid);
  720. new Float:slx, Float:sly, Float:slz;
  721. GetPlayerPos(playerid, slx, sly, slz);
  722. SetPlayerPos(playerid, slx, sly, slz);
  723. NOPCheck(playerid);
  724. SendClientMessageEx(playerid, COLOR_GRAD2, "You are not in the SFPD!");
  725. }
  726. }
  727. else if(IsAnEPCar(vehicleid))
  728. {
  729. if(PlayerInfo[playerid][pMember] == 3 && PlayerInfo[playerid][pDivision] == 2 || PlayerInfo[playerid][pMember] == 3 && PlayerInfo[playerid][pRank] >= 5)
  730. {
  731. }
  732. else
  733. {
  734. RemovePlayerFromVehicle(playerid);
  735. new Float:slx, Float:sly, Float:slz;
  736. GetPlayerPos(playerid, slx, sly, slz);
  737. SetPlayerPos(playerid, slx, sly, slz);
  738. NOPCheck(playerid);
  739. SendClientMessageEx(playerid, COLOR_GRAD2, "You are not in the SFPD Executive Protection Division!");
  740. }
  741. }
  742. else if(IsAnWPCar(vehicleid))
  743. {
  744. if(PlayerInfo[playerid][pMember] == 7 || PlayerInfo[playerid][pMember] == 7){
  745. }
  746. else
  747. {
  748. RemovePlayerFromVehicle(playerid);
  749. new Float:slx, Float:sly, Float:slz;
  750. GetPlayerPos(playerid, slx, sly, slz);
  751. SetPlayerPos(playerid, slx, sly, slz);
  752. NOPCheck(playerid);
  753. SendClientMessageEx(playerid, COLOR_GRAD2, "You are not in the SASD!");
  754. }
  755. }
  756. else if(IsACopCar(vehicleid))
  757. {
  758. if(PlayerInfo[playerid][pMember] == 1||PlayerInfo[playerid][pLeader] == 1)
  759. {
  760. }
  761. else
  762. {
  763. RemovePlayerFromVehicle(playerid);
  764. new Float:slx, Float:sly, Float:slz;
  765. GetPlayerPos(playerid, slx, sly, slz);
  766. SetPlayerPos(playerid, slx, sly, slz);
  767. NOPCheck(playerid);
  768. SendClientMessageEx(playerid, COLOR_GRAD2, "You are not in the LSPD!");
  769. }
  770. }
  771. else if(IsAHouse275Car(vehicleid))
  772. {
  773. TogglePlayerControllable(playerid, false);
  774. ShowPlayerDialog(playerid, House275CAR, DIALOG_STYLE_INPUT, "KeyPad", "Password:", "ENTER", "ENTER");
  775. }
  776. else if(IsAFBICar(vehicleid))
  777. {
  778. if(PlayerInfo[playerid][pMember] == 2||PlayerInfo[playerid][pLeader] == 2)
  779. {
  780. }
  781. else
  782. {
  783. RemovePlayerFromVehicle(playerid);
  784. new Float:slx, Float:sly, Float:slz;
  785. GetPlayerPos(playerid, slx, sly, slz);
  786. SetPlayerPos(playerid, slx, sly, slz);
  787. NOPCheck(playerid);
  788. SendClientMessageEx(playerid, COLOR_GRAD2, "You are not in the FBI!");
  789. }
  790. }
  791. /* else if(IsAnNGARMCar(vehicleid))
  792. {
  793. 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))
  794. {
  795. }
  796. else
  797. {
  798. RemovePlayerFromVehicle(playerid);
  799. new Float:slx, Float:sly, Float:slz;
  800. GetPlayerPos(playerid, slx, sly, slz);
  801. SetPlayerPos(playerid, slx, sly, slz);
  802. NOPCheck(playerid);
  803. SendClientMessageEx(playerid, COLOR_GRAD2, "You are not in the NG ARM Division!");
  804. }
  805. } */
  806. else if(vehicleid == FDSAVehicles[12] || vehicleid == FDSAVehicles[33] || vehicleid == FDSAVehicles[34] || vehicleid == FDSAVehicles[35])
  807. {
  808. if(PlayerInfo[playerid][pLeader] == 4 || PlayerInfo[playerid][pMember] == 4 && PlayerInfo[playerid][pDivision] == 1)
  809. {
  810. }
  811. else
  812. {
  813. RemovePlayerFromVehicle(playerid);
  814. new Float:slx, Float:sly, Float:slz;
  815. GetPlayerPos(playerid, slx, sly, slz);
  816. SetPlayerPos(playerid, slx, sly, slz);
  817. NOPCheck(playerid);
  818. SendClientMessageEx(playerid, COLOR_GRAD2, "You are not in the Fire Department Division!");
  819. }
  820. }
  821. else if(vehicleid == FDSAVehicles[37] || vehicleid == FDSAVehicles[36])
  822. {
  823. if(PlayerInfo[playerid][pLeader] == 4 || PlayerInfo[playerid][pMember] == 4 && PlayerInfo[playerid][pDivision] == 2)
  824. {
  825. }
  826. else
  827. {
  828. RemovePlayerFromVehicle(playerid);
  829. new Float:slx, Float:sly, Float:slz;
  830. GetPlayerPos(playerid, slx, sly, slz);
  831. SetPlayerPos(playerid, slx, sly, slz);
  832. NOPCheck(playerid);
  833. SendClientMessageEx(playerid, COLOR_GRAD2, "You are not in the Life Flight Division!");
  834. }
  835. }
  836. else if(IsAnNGAIRCar(vehicleid))
  837. {
  838. if((PlayerInfo[playerid][pMember] == 11||PlayerInfo[playerid][pLeader] == 11) && (PlayerInfo[playerid][pDivision] == 1 || PlayerInfo[playerid][pDivision] == 4))
  839. {
  840. }
  841. else
  842. {
  843. RemovePlayerFromVehicle(playerid);
  844. new Float:slx, Float:sly, Float:slz;
  845. GetPlayerPos(playerid, slx, sly, slz);
  846. SetPlayerPos(playerid, slx, sly, slz);
  847. NOPCheck(playerid);
  848. SendClientMessageEx(playerid, COLOR_GRAD2, "You are not in the NG AIR Division!");
  849. }
  850. }
  851. else if(IsAnNGCar(vehicleid))
  852. {
  853. if(PlayerInfo[playerid][pMember] == 11||PlayerInfo[playerid][pLeader] == 11)
  854. {
  855. }
  856. else
  857. {
  858. RemovePlayerFromVehicle(playerid);
  859. new Float:slx, Float:sly, Float:slz;
  860. GetPlayerPos(playerid, slx, sly, slz);
  861. SetPlayerPos(playerid, slx, sly, slz);
  862. NOPCheck(playerid);
  863. SendClientMessageEx(playerid, COLOR_GRAD2, "You are not in the National Guard!");
  864. }
  865. }
  866. else if(IsAnDOCCar(vehicleid))
  867. {
  868. if(PlayerInfo[playerid][pMember] == 11||PlayerInfo[playerid][pLeader] == 11)
  869. {
  870. }
  871. else
  872. {
  873. NOPCheck(playerid);
  874. RemovePlayerFromVehicle(playerid);
  875. new Float:slx, Float:sly, Float:slz;
  876. GetPlayerPos(playerid, slx, sly, slz);
  877. SetPlayerPos(playerid, slx, sly, slz);
  878. SendClientMessageEx(playerid, COLOR_GRAD2, "You are not in the National Guard!");
  879. }
  880. }
  881. else if(IsAnMPSCar(vehicleid))
  882. {
  883. if(IsACop(playerid))
  884. {
  885. }
  886. else
  887. {
  888. RemovePlayerFromVehicle(playerid);
  889. new Float:slx, Float:sly, Float:slz;
  890. GetPlayerPos(playerid, slx, sly, slz);
  891. SetPlayerPos(playerid, slx, sly, slz);
  892. NOPCheck(playerid);
  893. SendClientMessageEx(playerid, COLOR_GRAD2, "You aren't in a LEO Faction.");
  894. }
  895. }
  896. else if(IsACoastguardCar(vehicleid))
  897. {
  898. if( ( PlayerInfo[playerid][pMember] == 4 || PlayerInfo[playerid][pLeader] == 4 ) || ( PlayerInfo[playerid][pMember] == 3 && PlayerInfo[playerid][pDivision] == 3 ))
  899. {
  900. }
  901. else
  902. {
  903. RemovePlayerFromVehicle(playerid);
  904. new Float:slx, Float:sly, Float:slz;
  905. GetPlayerPos(playerid, slx, sly, slz);
  906. SetPlayerPos(playerid, slx, sly, slz);
  907. SendClientMessageEx(playerid, COLOR_GRAD2, "You are not in the Coastguard division!");
  908. }
  909. }
  910. else if(IsANewsCar(vehicleid))
  911. {
  912. if(PlayerInfo[playerid][pMember] == 9 ||PlayerInfo[playerid][pLeader] == 9)
  913. {
  914. }
  915. else
  916. {
  917. RemovePlayerFromVehicle(playerid);
  918. new Float:slx, Float:sly, Float:slz;
  919. GetPlayerPos(playerid, slx, sly, slz);
  920. SetPlayerPos(playerid, slx, sly, slz);
  921. NOPCheck(playerid);
  922. SendClientMessageEx(playerid, COLOR_GRAD2, "You are not in the SANews!");
  923. }
  924. }
  925. else if(IsAPlane(vehicleid))
  926. {
  927. if(PlayerInfo[playerid][pFlyLic] != 1)
  928. {
  929. RemovePlayerFromVehicle(playerid);
  930. new Float:slx, Float:sly, Float:slz;
  931. GetPlayerPos(playerid, slx, sly, slz);
  932. SetPlayerPos(playerid, slx, sly, slz);
  933. NOPCheck(playerid);
  934. SendClientMessageEx(playerid,COLOR_GREY,"You don't have a pilot license!");
  935. }
  936. }
  937. else if(IsAHelicopter(vehicleid))
  938. {
  939. PlayerInfo[playerid][pAGuns][GetWeaponSlot(46)] = 46;
  940. GivePlayerValidWeapon(playerid, 46, 60000);
  941. }
  942. else if(IsAnTaxi(vehicleid) || IsAnBus(vehicleid))
  943. {
  944. if(PlayerInfo[playerid][pJob] == 17 || PlayerInfo[playerid][pJob2] == 17 || PlayerInfo[playerid][pMember] == 10 || PlayerInfo[playerid][pLeader] == 10 || PlayerInfo[playerid][pTaxiLicense] == 1)
  945. {
  946. }
  947. else
  948. {
  949. SendClientMessageEx(playerid,COLOR_GREY," You are not a Taxi/Bus Driver!");
  950. RemovePlayerFromVehicle(playerid);
  951. new Float:slx, Float:sly, Float:slz;
  952. GetPlayerPos(playerid, slx, sly, slz);
  953. SetPlayerPos(playerid, slx, sly, slz);
  954. }
  955. }
  956. if( GetPVarInt( playerid, "ToBeEjected" ) >= 1 )
  957. {
  958. SetPVarInt( playerid, "ToBeEjected", 0 );
  959. RemovePlayerFromVehicle( playerid );
  960. new Float:X, Float:Y, Float:Z;
  961. GetPlayerPos(playerid, X, Y, Z);
  962. SetPlayerPos(playerid, X, Y, Z+2);
  963.  
  964. if(GetPVarInt(playerid, "Injured") == 1)
  965. {
  966. Streamer_UpdateEx(playerid, GetPVarFloat(playerid,"MedicX"), GetPVarFloat(playerid,"MedicY"), GetPVarFloat(playerid,"MedicZ"));
  967. SetPlayerPos(playerid, GetPVarFloat(playerid,"MedicX"), GetPVarFloat(playerid,"MedicY"), GetPVarFloat(playerid,"MedicZ"));
  968. SetPlayerVirtualWorld(playerid, GetPVarInt(playerid,"MedicVW"));
  969. SetPlayerInterior(playerid, GetPVarInt(playerid,"MedicInt"));
  970. ClearAnimations(playerid);
  971. ApplyAnimation(playerid, "KNIFE", "KILL_Knife_Ped_Die", 4.0, 0, 1, 1, 1, 0, 1);
  972. }
  973. }
  974. //if(lights == VEHICLE_PARAMS_UNSET) SetVehicleParamsEx(newcar,engine,VEHICLE_PARAMS_OFF,alarm,doors,bonnet,boot,objective);
  975. TelePos[playerid][0] = 0.0;
  976. TelePos[playerid][1] = 0.0;
  977. //SetPVarInt(playerid, "LastWeapon", GetPlayerWeapon(playerid));
  978. if(IsARental(newcar) && gBike[playerid] == 0 && gBikeRenting[playerid] == 0)
  979. {
  980. TogglePlayerControllable(playerid,0);
  981. ShowPlayerDialog(playerid, RENTMENU, DIALOG_STYLE_LIST, "Bike Shed BMX Rentals","15 Minutes - 1000$\n30 Minutes - 2000$\n1 Hour - 4000$", "Rent", "Cancel");
  982. }
  983. if(GetCarDealershipVehicleId(newcar) != -1 && GetCarDealershipVehicleId(newcar) == GetPVarInt(playerid, "editingcdveh")) return 1;
  984. if(GetCarDealershipVehicleId(newcar) != -1)
  985. {
  986. new string[57 + 20 + 4];
  987. format(string, sizeof(string),"Would you like to buy this %s?\n\nThis vehicle costs $%d.", GetVehicleName(newcar), CarDealershipInfo[GetCarDealershipId(newcar)][cdVehicleCost][GetCarDealershipVehicleId(newcar)]);
  988. ShowPlayerDialog(playerid,DIALOG_CDBUY,DIALOG_STYLE_MSGBOX,"Warning:",string,"Buy","Cancel");
  989. TogglePlayerControllable(playerid, false);
  990. return 1;
  991. }
  992. GetVehicleParamsEx(newcar,engine,lights,alarm,doors,bonnet,boot,objective);
  993. if((engine == VEHICLE_PARAMS_UNSET || engine == VEHICLE_PARAMS_OFF) && GetVehicleModel(newcar) != 509 && GetVehicleModel(newcar) != 481 && GetVehicleModel(newcar) != 510) {
  994. SendClientMessageEx(playerid, COLOR_WHITE, "This vehicle's engine is not running - if you wish to start it, type /car engine.");
  995. }
  996. else
  997. {
  998. if(GetVehicleModel(GetPlayerVehicleID(playerid)) != 481 && GetVehicleModel(GetPlayerVehicleID(playerid)) != 509 && GetVehicleModel(GetPlayerVehicleID(playerid)) != 510)
  999. {
  1000. SetPVarInt(playerid, "fuelonoff", 1);
  1001. FuelBar[playerid] = CreateProgressBar(548.00, 26.00, 57.50, 3.20, 866792447, 100.0);
  1002. textdrawscount++;
  1003. SetProgressBarValue(FuelBar[playerid], VehicleFuel[GetPlayerVehicleID(playerid)]);
  1004. ShowProgressBarForPlayer(playerid, FuelBar[playerid]);
  1005. }
  1006. }
  1007. }
  1008. if((newstate == 2 || newstate == 3 || newstate == 7 || newstate == 9) && pTazer[playerid] == 1)
  1009. {
  1010. GivePlayerValidWeapon(playerid, pTazerReplace[playerid], 60000);
  1011. pTazer[playerid] = 0;
  1012. }
  1013. if(newstate == PLAYER_STATE_SPAWNED)
  1014. {
  1015. if(ConnectedToPC[playerid] == 1337)//mdc
  1016. {
  1017. ConnectedToPC[playerid] = 0;
  1018. }
  1019. TelePos[playerid][0] = 0.0;
  1020. TelePos[playerid][1] = 0.0;
  1021. gPlayerSpawned[playerid] = 1;
  1022. SafeTime[playerid] = 60;
  1023. }
  1024. if(newstate == PLAYER_STATE_PASSENGER && GetVehicleModel(GetPlayerVehicleID(playerid)) == 519)
  1025. {
  1026. new vehicleid = GetPlayerVehicleID(playerid);
  1027. if(VehicleStatus{vehicleid} == 1) return SendClientMessageEx(playerid, COLOR_WHITE, "You are not allowed to enter this Shamal as it's been damaged!");
  1028. new string[47 + MAX_PLAYER_NAME];
  1029. format(string, sizeof(string), "* %s enters the Shamal airplane as a passenger.", GetPlayerNameEx(playerid));
  1030. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1031. SetPlayerPos(playerid, 2.509036, 23.118730, 1199.593750);
  1032. SetPlayerFacingAngle(playerid, 82.14);
  1033. SetCameraBehindPlayer(playerid);
  1034. PlayerInfo[playerid][pVW] = vehicleid;
  1035. SetPlayerVirtualWorld(playerid, vehicleid);
  1036. PlayerInfo[playerid][pInt] = 1;
  1037. SetPlayerInterior(playerid, 1);
  1038. InsideShamal[playerid] = vehicleid;
  1039. SendClientMessageEx(playerid, COLOR_WHITE, "Type /exit near the door to exit the vehicle, or /window to look outside.");
  1040. }
  1041. IsPlayerSteppingInVehicle[playerid] = -1;
  1042. return 1;
  1043. }
  1044.  
  1045. stock HireCost(carid)
  1046. {
  1047. switch (carid)
  1048. {
  1049. case 69:
  1050. {
  1051. return 90000; //bullit
  1052. }
  1053. case 70:
  1054. {
  1055. return 130000; //infurnus
  1056. }
  1057. case 71:
  1058. {
  1059. return 100000; //turismo
  1060. }
  1061. case 72:
  1062. {
  1063. return 80000;
  1064. }
  1065. case 73:
  1066. {
  1067. return 70000;
  1068. }
  1069. case 74:
  1070. {
  1071. return 60000;
  1072. }
  1073. }
  1074. return 0;
  1075. }
  1076.  
  1077. player_remove_vip_toys(iTargetID) {
  1078. if(PlayerInfo[iTargetID][pDonateRank] >= 3) return 1;
  1079. else for(new iToyIter; iToyIter < MAX_PLAYER_ATTACHED_OBJECTS; ++iToyIter) {
  1080. for(new LoopRapist; LoopRapist < sizeof(HoldingObjectsCop); ++LoopRapist) {
  1081. if(HoldingObjectsCop[LoopRapist][holdingmodelid] == PlayerToyInfo[iTargetID][iToyIter][ptModelID]) {
  1082. PlayerToyInfo[iTargetID][iToyIter][ptModelID] = 0;
  1083. PlayerToyInfo[iTargetID][iToyIter][ptBone] = 0;
  1084. PlayerToyInfo[iTargetID][iToyIter][ptPosX] = 0.0;
  1085. PlayerToyInfo[iTargetID][iToyIter][ptPosY] = 0.0;
  1086. PlayerToyInfo[iTargetID][iToyIter][ptPosZ] = 0.0;
  1087. PlayerToyInfo[iTargetID][iToyIter][ptPosX] = 0.0;
  1088. PlayerToyInfo[iTargetID][iToyIter][ptPosY] = 0.0;
  1089. PlayerToyInfo[iTargetID][iToyIter][ptPosZ] = 0.0;
  1090. if(IsPlayerAttachedObjectSlotUsed(iTargetID, iToyIter)) RemovePlayerAttachedObject(iTargetID, iToyIter);
  1091. }
  1092. }
  1093. }
  1094. SendClientMessageEx(iTargetID, COLOR_WHITE, "All accessories/toys that were property of your former employer have been removed.");
  1095. return 1;
  1096. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement