Advertisement
Guest User

Untitled

a guest
Jul 24th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  1. public OnPlayerLeaveDynamicArea(playerid, areaid)
  2. {
  3. if(!Bit_Get(Spawned, playerid)) return 1;
  4. if(GetPlayerVirtualWorld(playerid) != 0) return 1;
  5. if(GetPlayerState(playerid) == PLAYER_STATE_SPECTATING) return 1;
  6.  
  7. foreach(new i : Areas)
  8. {
  9. if (Areas[i][cpID] == areaid)
  10. {
  11. if (Areas[i][Attacker] != INVALID_PLAYER_ID)
  12. {
  13. if (PlayerInfo[playerid][pTeam] == PlayerInfo[Areas[i][Attacker]][pTeam])
  14. {
  15. Areas[i][Player]--;
  16. if (! Areas[i][Player])
  17. {
  18. GangZoneStopFlashForAll(Areas[i][gzID]);
  19. Areas[i][Attacker] = INVALID_PLAYER_ID;
  20. stop Areas[i][ZoneTimer];
  21. SendClientMessageToAll(-1, "leave 1");
  22. }
  23. else if (Areas[i][Attacker] == playerid)
  24. {
  25. foreach(new j : Player)
  26. {
  27. if(PlayerInfo[j][pTeam] == PlayerInfo[playerid][pTeam])
  28. {
  29. if (IsPlayerInDynamicArea(j, areaid))
  30. {
  31. Areas[i][Attacker] = j;
  32. SendClientMessageToAll(-1, "leave 2");
  33. break;
  34. }
  35. }
  36. }
  37. }
  38. }
  39. }
  40.  
  41. SetPlayerProgressBarValue(playerid, gPlayerCaptureBar[playerid], 0.0);
  42. HidePlayerProgressBar(playerid, gPlayerCaptureBar[playerid]);
  43. break;
  44. }
  45. }
  46.  
  47. return 1;
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement