Advertisement
Guest User

Untitled

a guest
Dec 13th, 2013
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.79 KB | None | 0 0
  1. public OnPlayerDisconnect(playerid,reason)
  2. { //
  3. //
  4. if(PlayerAFK[playerid] == 1)
  5. {
  6. PlayerAFK[playerid] = 0;
  7. }
  8. SetPVarInt(playerid, "laser", 0);
  9. RemovePlayerAttachedObject(playerid, 0);
  10. //
  11. Delete3DTextLabel(Premium[playerid]);
  12. if(SpielerInfo[playerid][pMauled] == 1)
  13. {
  14. SpielerInfo[playerid][pMauled] = 0;
  15. }
  16. //
  17. if(Desktop_Timer_Started[playerid] == 1) { KillTimer(Desktop_Timer[playerid]); }
  18. new h[3];
  19. SpielerInfo[playerid][pLastOnline] = gettime(h[0],h[1],h[2]);
  20. GetPlayerWeapons(playerid);
  21. SpielerInfo[playerid][pOnline] = 0;
  22. SpielerIstTot[playerid] = 0;
  23. Sperrebit[playerid]=0;
  24. HasReport[playerid]=0; HisReport[playerid]=0;
  25. gActivePlayers[playerid]--;
  26. numplayers--;
  27. KillTimer(CarTimer[playerid]);
  28. new caller = Mobile[playerid];
  29. if(caller != INVALID_PLAYER_ID) {
  30. if(caller < 999) {
  31. if(PhoneOnline[caller] != 1) {
  32. SendClientMessage(caller, COLOR_GRAD2, " Aufgelegt. (Disconnect)");
  33. }
  34. if(CallZelle[playerid] == true || CallZelle[caller] == true) {
  35. CallZelle[playerid] = false; CallZelle[caller] = false;
  36. }
  37. CellTime[caller] = 0;
  38. CellTime[playerid] = 0;
  39. Mobile[caller] = INVALID_PLAYER_ID;
  40. SetPlayerSpecialAction(playerid,13);
  41. SetPlayerSpecialAction(caller,13);
  42. PlayerPlaySound(caller, 1069, 0.0, 0.0, 0.0);
  43. Mobile[playerid] = INVALID_PLAYER_ID;
  44. CellTime[playerid] = 0;
  45. RingTone[playerid] = 0;
  46. }
  47. }
  48. //TextDrawHideForPlayer(playerid, ServerInfoo);
  49. if(IsPlayerInAnyVehicle(playerid))
  50. {
  51. /*
  52. if(IsABus(GetPlayerVehicleID(playerid))){
  53. TextDrawHideForPlayer(playerid, BusText[playerid]);
  54. TextDrawHideForPlayer(playerid, BusHeader[playerid]);}
  55. else{*/
  56. }
  57. // Hier die Spawned Fahrzeuge Destroyen
  58. if(GetPVarInt(playerid, "NewbRoller") == 1) DestroyVehicle(NewbRoller[playerid]);
  59. if(GetPVarInt(playerid, "SupCar") == 1) DestroyVehicle(Supcar[playerid]);
  60. //DeleteMysqlCars(GetName(playerid));
  61. //(schadet nichts)
  62. SetPlayerChatBubble(playerid, "", COLOR_YELLOW, 1.0, 1);
  63. if(Ticket[playerid][TicketStatus] != 0) {
  64. new xid = Ticket[playerid][TicketBearbeiter];
  65. Ticket[playerid][TicketStatus] = 0;
  66. Ticket[xid][TicketStatus] = 0;
  67. SetPlayerChatBubble(playerid, "", COLOR_YELLOW, 1.0, 1);
  68. }
  69. if(Notruf[playerid][NotrufStatus] != 0) {
  70. new xid = Notruf[playerid][NotrufBearbeiter];
  71. Notruf[playerid][NotrufStatus] = 0;
  72. Notruf[xid][NotrufStatus] = 0;
  73. }
  74. RemovePlayerAttachedObject(playerid, 1);
  75. DestroyObject(Sperre[playerid][0]);
  76. DestroyObject(Sperre[playerid][1]);
  77. DestroyObject(Sperre[playerid][2]);
  78. DestroyObject(Sperre[playerid][3]);
  79. DestroyObject(Sperre[playerid][4]);
  80. if(SpielerInfo[playerid][nErstellt] == 1) {
  81. SpielerInfo[playerid][nErstellt] = 0;
  82. SpielerInfo[playerid][nNagelBandX] = 0.0;
  83. SpielerInfo[playerid][nNagelBandY] = 0.0;
  84. SpielerInfo[playerid][nNagelBandZ] = 0.0;
  85. DestroyObject(SpielerInfo[playerid][nID]);
  86. }
  87. if(SpielerInfo[playerid][nErstellt1] == 1) {
  88. SpielerInfo[playerid][nErstellt1] = 0;
  89. SpielerInfo[playerid][nNagelBandX1] = 0.0;
  90. SpielerInfo[playerid][nNagelBandY1] = 0.0;
  91. SpielerInfo[playerid][nNagelBandZ1] = 0.0;
  92. DestroyObject(SpielerInfo[playerid][nID1]);
  93. }
  94. if(reason == 1) {
  95. for(new i = 0; i < MAX_PLAYERS; i++) {
  96. new Float:xo,Float:yo,Float:zo;
  97. GetPlayerPos(playerid,xo,yo,zo);
  98. if(IsPlayerInRangeOfPoint(i,20.0,xo,yo,zo)) {
  99. if(IsPlayerConnected(i)) {
  100. new str1[64];
  101. format(str1,sizeof(str1),"[SERVER] %s hat den Server verlassen(Normal)",GetName(playerid));
  102. SendClientMessage(i,COLOR_WHITE,str1);
  103. }
  104. }
  105. }
  106. }
  107. if(reason == 0) {
  108. for(new i = 0; i < MAX_PLAYERS; i++) {
  109. new Float:xo,Float:yo,Float:zo;
  110. GetPlayerPos(playerid,xo,yo,zo);
  111. if(IsPlayerInRangeOfPoint(i,20.0,xo,yo,zo)) {
  112. if(IsPlayerConnected(i)) {
  113. new str1[64];
  114. format(str1,sizeof(str1),"[SERVER] %s hat den Server verlassen(TimeOut)",GetName(playerid));
  115. SendClientMessage(i,COLOR_WHITE,str1);
  116. }
  117. }
  118. }
  119. }
  120. for(new i = 0; i < MAX_PLAYERS; i++) {
  121. if(IsPlayerConnected(i)) {
  122. if(TaxiAccepted[i] < 999) {
  123. if(TaxiAccepted[i] == playerid) {
  124. TaxiAccepted[i] = 999;
  125. GameTextForPlayer(i, "~w~Taxikunde~n~~r~Hat das Spiel Verlassen", 5000, 1);
  126. TaxiCallTime[i] = 0;
  127. DisablePlayerCheckpoint(i);
  128. }
  129. }
  130. }
  131. }
  132. if(TransportCost[playerid] > 0 && TransportDriver[playerid] < 999) {
  133. if(IsPlayerConnected(TransportDriver[playerid])) {
  134. new string[64];
  135. TransportMoney[TransportDriver[playerid]] += TransportCost[playerid];
  136. TransportTime[TransportDriver[playerid]] = 0;
  137. TransportCost[TransportDriver[playerid]] = 0;
  138. format(string, sizeof(string), "~w~Kunde ist ausgestiegen~n~~g~Verdienst: $%d",TransportCost[playerid]);
  139. GameTextForPlayer(TransportDriver[playerid], string, 5000, 1);
  140. }
  141. }
  142. if(GotHit[playerid] > 0) {
  143. if(GetChased[playerid] < 999) {
  144. if(IsPlayerConnected(GetChased[playerid])) {
  145. new name[MAX_PLAYER_NAME], string[128];
  146. GetPlayerName(playerid, name, sizeof(name));
  147. format(string, sizeof(string), "Dein Auftragskill %s hat den Server verlassen.", name);
  148. SendClientMessage(GetChased[playerid], COLOR_YELLOW,string);
  149. SetPVarInt(GetChased[playerid],"KillID",-1);
  150. GoChase[GetChased[playerid]] = 999;
  151. }
  152. }
  153. }
  154. if(PlayerPaintballing[playerid] != 0) {
  155. PaintballPlayers --;
  156. }
  157. if(PlayerKarting[playerid] > 0 && PlayerInKart[playerid] > 0) {
  158. KartingPlayers --;
  159. }
  160. if (gLastCar[playerid] > 0) {
  161. gLastDriver[gLastCar[playerid]] = 300;
  162. if(SpielerInfo[playerid][pPhousekey] != gLastCar[playerid]-1) {
  163. gCarLock[gLastCar[playerid]] = 0;
  164. UnLockCar(gLastCar[playerid]);
  165. }
  166. }
  167. if(PlayerBoxing[playerid] > 0) {
  168. if(Boxer1 == playerid) {
  169. if(IsPlayerConnected(Boxer2)) {
  170. PlayerBoxing[Boxer2] = 0;
  171. SetPlayerPos(Boxer2, 765.8433,3.2924,1000.7186);
  172. SetPlayerInterior(Boxer2, 5);
  173. GameTextForPlayer(Boxer2, "~r~Kampf unterbrochen", 5000, 1);
  174. }
  175. }
  176. else if(Boxer2 == playerid) {
  177. if(IsPlayerConnected(Boxer1)) {
  178. PlayerBoxing[Boxer1] = 0;
  179. SetPlayerPos(Boxer1, 765.8433,3.2924,1000.7186);
  180. SetPlayerInterior(Boxer1, 5);
  181. GameTextForPlayer(Boxer1, "~r~Kampf unterbrochen", 5000, 1);
  182. }
  183. }
  184. InRing = 0;
  185. RoundStarted = 0;
  186. Boxer1 = 999;
  187. Boxer2 = 999;
  188. TBoxer = 999;
  189. }
  190. if(TransportDuty[playerid] == 1) {
  191. TaxiDrivers -= 1;
  192. }
  193. if(SpielerInfo[playerid][sMember] == 4) {
  194. if(JobDuty[playerid] == 1) { Medics -= 1; }
  195. }
  196. if(SpielerInfo[playerid][sMember] == 1 || SpielerInfo[playerid][sMember] == 2) {
  197. if(OnDuty[playerid] == 1) { CopsOnline -= 1; }
  198. }
  199. else if(SpielerInfo[playerid][sJob] == 7) {
  200. if(JobDuty[playerid] == 1) { Mechanics -= 1; }
  201. }
  202. if (SpielerInfo[playerid][pRoadblock] != 0) {
  203. RemoveRoadblock(playerid);
  204. }
  205. RobVar[playerid] = 0;
  206. SetPlayerSkin(playerid, SpielerInfo[playerid][pChar]);
  207. SaveMysqlPlayer(playerid); // GANZ OBEN STEHEN LASSEN
  208. OnPlayerCarUpdate_SQL(playerid);
  209. return 1;
  210. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement