Cimbur

Untitled

Feb 11th, 2017
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.19 KB | None | 0 0
  1. public OnPlayerDisconnect(playerid, reason)
  2. {
  3. gActivePlayers[playerid]--;
  4. numplayers--;
  5. if(reason == 0)
  6. {
  7. PlayerInfo[playerid][pCrashed] = 1;
  8. for(new slot = 0; slot != 12; slot++)
  9. {
  10. new wep, ammo;
  11. GetPlayerWeaponData(playerid, slot, wep, ammo);
  12.  
  13. if(wep != 0 && ammo != 0)
  14. {
  15. if(PlayerInfo[playerid][pGun1] == 0) { PlayerInfo[playerid][pGun1] = wep; PlayerInfo[playerid][pAmmo1] = ammo; }
  16. else if(PlayerInfo[playerid][pGun2] == 0) { PlayerInfo[playerid][pGun2] = wep; PlayerInfo[playerid][pAmmo2] = ammo; }
  17. else if(PlayerInfo[playerid][pGun3] == 0) { PlayerInfo[playerid][pGun3] = wep; PlayerInfo[playerid][pAmmo3] = ammo; }
  18. else if(PlayerInfo[playerid][pGun4] == 0) { PlayerInfo[playerid][pGun4] = wep; PlayerInfo[playerid][pAmmo4] = ammo; }
  19. }
  20. }
  21. }
  22. OnPlayerUpdate(playerid);
  23. for(new i = 0; i < MAX_PLAYERS; i++)
  24. {
  25. if(IsPlayerConnected(i))
  26. {
  27. if(TaxiAccepted[i] < 999)
  28. {
  29. if(TaxiAccepted[i] == playerid)
  30. {
  31. TaxiAccepted[i] = 999;
  32. GameTextForPlayer(i, "~w~Taxi Caller~n~~r~Left the game", 5000, 1);
  33. TaxiCallTime[i] = 0;
  34. DisablePlayerCheckpoint(i);
  35. }
  36. }
  37. else if(BusAccepted[i] < 999)
  38. {
  39. if(BusAccepted[i] == playerid)
  40. {
  41. BusAccepted[i] = 999;
  42. GameTextForPlayer(i, "~w~Bus Caller~n~~r~Left the game", 5000, 1);
  43. BusCallTime[i] = 0;
  44. DisablePlayerCheckpoint(i);
  45. }
  46. }
  47. }
  48. }
  49. /*if(GettingCK[playerid] < 999)
  50. {
  51. if(IsPlayerConnected(GettingCK[playerid]))
  52. {
  53. SendClientMessage(GettingCK[playerid], COLOR_YELLOW, "Your Character Kill has left the server, try again later.");
  54. OnCK[GettingCK[playerid]] = 999;
  55. }
  56. }*/
  57. if (GetPlayerVehicleID(playerid) == 131) SetVehicleToRespawn(131);
  58. OnPlayerUpdate(playerid);
  59. //----------------------------------------------------------
  60. if(TransportCost[playerid] > 0 && TransportDriver[playerid] < 999)
  61. {
  62. if(IsPlayerConnected(TransportDriver[playerid]))
  63. {
  64. new string[64];
  65. TransportMoney[TransportDriver[playerid]] += TransportCost[playerid];
  66. TransportTime[TransportDriver[playerid]] = 0;
  67. TransportCost[TransportDriver[playerid]] = 0;
  68. format(string, sizeof(string), "~w~Passenger left~n~~g~Earned $%d",TransportCost[playerid]);
  69. GameTextForPlayer(TransportDriver[playerid], string, 5000, 1);
  70. }
  71. }
  72. if(GotHit[playerid] > 0)
  73. {
  74. if(GetChased[playerid] < 999)
  75. {
  76. if(IsPlayerConnected(GetChased[playerid]))
  77. {
  78. SendClientMessage(GetChased[playerid], COLOR_YELLOW, "Your Hit has left the server.");
  79. GoChase[GetChased[playerid]] = 999;
  80. }
  81. }
  82. }
  83. if(PlayerPaintballing[playerid] != 0)
  84. {
  85. PaintballPlayers --;
  86. }
  87. if(PlayerKarting[playerid] > 0 && PlayerInKart[playerid] > 0)
  88. {
  89. KartingPlayers --;
  90. }
  91. if(PlayersChannel[playerid] < 999)
  92. {
  93. IRCInfo[PlayersChannel[playerid]][iPlayers] -= 1;
  94. }
  95. if(HireCar[playerid] != 299)
  96. {
  97. gLastDriver[HireCar[playerid]] = 300;
  98. gCarLock[HireCar[playerid]] = 0;
  99. UnLockCar(HireCar[playerid]);
  100. if(reason != 0)
  101. {
  102. SetVehicleToRespawn(HireCar[playerid]);
  103. }
  104. }
  105. if(GangCar[playerid] != 512)
  106. {
  107. gLastDriver[GangCar[playerid]] = 520;
  108. gCarLock[GangCar[playerid]] = 0;
  109. UnLockCar(GangCar[playerid]);
  110. }
  111. if (gLastCar[playerid] > 0)
  112. {
  113. gLastDriver[gLastCar[playerid]] = 300;
  114. if(PlayerInfo[playerid][pPhousekey] != gLastCar[playerid]-1)
  115. {
  116. gCarLock[gLastCar[playerid]] = 0;
  117. UnLockCar(gLastCar[playerid]);
  118. }
  119. }
  120. if(PlayerBoxing[playerid] > 0)
  121. {
  122. if(Boxer1 == playerid)
  123. {
  124. if(IsPlayerConnected(Boxer2))
  125. {
  126. PlayerBoxing[Boxer2] = 0;
  127. SetPlayerPos(Boxer2, 765.8433,3.2924,1000.7186);
  128. SetPlayerInterior(Boxer2, 5);
  129. PlayerInfo[Boxer2][pInt] = 5;
  130. GameTextForPlayer(Boxer2, "~r~Match interupted", 5000, 1);
  131. }
  132. }
  133. else if(Boxer2 == playerid)
  134. {
  135. if(IsPlayerConnected(Boxer1))
  136. {
  137. PlayerBoxing[Boxer1] = 0;
  138. SetPlayerPos(Boxer1, 765.8433,3.2924,1000.7186);
  139. SetPlayerInterior(Boxer1, 5);
  140. PlayerInfo[Boxer2][pInt] = 5;
  141. GameTextForPlayer(Boxer1, "~r~Match interupted", 5000, 1);
  142. }
  143. }
  144. InRing = 0;
  145. RoundStarted = 0;
  146. Boxer1 = 255;
  147. Boxer2 = 255;
  148. TBoxer = 255;
  149. }
  150. if(TransportDuty[playerid] == 1)
  151. {
  152. TaxiDrivers -= 1;
  153. }
  154. else if(TransportDuty[playerid] == 2)
  155. {
  156. BusDrivers -= 1;
  157. }
  158. if(PlayerInfo[playerid][pJob] == 11)
  159. {
  160. if(JobDuty[playerid] == 1) { Medics -= 1; }
  161. }
  162. else if(PlayerInfo[playerid][pJob] == 7)
  163. {
  164. if(JobDuty[playerid] == 1) { Mechanics -= 1; }
  165. }
  166. else if(PlayerInfo[playerid][pJob] == 17)
  167. {
  168. if(JobDuty[playerid] == 1) { PizzaBoys -= 1; }
  169. }
  170. if (PlayerInfo[playerid][pRoadblock] != 0)
  171. {
  172. RemoveRoadblock(playerid);
  173. }
  174. BusrouteEast[playerid][0] = 0;
  175. BusrouteWest[playerid][0] = 0;
  176. TextDrawHideForPlayer(playerid,lbt);
  177. TextDrawHideForPlayer(playerid,lbb);
  178. }
Advertisement
Add Comment
Please, Sign In to add comment