Advertisement
CreativityLacker

Untitled

Feb 8th, 2013
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.79 KB | None | 0 0
  1. stock StartCapture(zoneid, byplayer)
  2. {
  3. SendClientMessage(byplayer, LIGHTBLUE, "[ZONE] You've entered this zone! Stay for 30 seconds inside the red checkpoint to capture it! ");
  4. GangZoneFlashForAll(zoneid, GetTeamColor(GetPlayerTeam(byplayer)) );
  5. GZ[zoneid][Attacked] = true;
  6. GangZoneFlashForAll(zoneid, GetTeamZoneColor(GetPlayerTeam(byplayer)) );
  7. new Float:Pos[3];
  8. GetPlayerPos(byplayer, Pos[0], Pos[1], Pos[2]);
  9. SetPlayerCheckpoint(byplayer, Pos[0], Pos[1], Pos[2], 2.5);
  10. GZ[zoneid][Timer] = SetTimerEx("CompleteCapture", 30*1000, false, "idd", byplayer, zoneid, SUCCESS);
  11. pInfo[byplayer][Inzone] = zoneid;
  12. UpdateZoneInfo(zoneid);
  13. return 1;
  14. }
  15.  
  16. public CompleteCapture(playerid, zoneid, cap_state)
  17. {
  18. switch(cap_state)
  19. {
  20. case SUCCESS:
  21. {
  22. GZ[zoneid][Owner] = GetPlayerTeam(playerid);
  23. KillTimer(GZ[zoneid][Timer]);
  24. GZ[zoneid][Attacked] = false;
  25. GangZoneStopFlashForAll(zoneid);
  26. GangZoneHideForAll(zoneid);
  27. GangZoneShowForAll(zoneid, GetTeamZoneColor(GetPlayerTeam(playerid)) );
  28. new str[150];
  29. format(str, 120, "[SUCCESSFUL CAPTURE] You've successfully captured %s! +5 score and 750$! ", GZ[zoneid][GName]);
  30. GivePlayerExperience(playerid, 5);
  31. GivePlayerMoney_(playerid, 750);
  32. SendClientMessage(playerid, GREEN, str);
  33. format(str, 120, "[LATEST CAPTURE] %s has captured %s", pname(playerid), GZ[zoneid][GName] );
  34. CreateNews(NEWS_CAPTURE, str);
  35. }
  36. case FAIL:
  37. {
  38. KillTimer(GZ[zoneid][Timer]);
  39. GZ[zoneid][Attacked] = false;
  40. GangZoneStopFlashForAll(zoneid);
  41. new str[150];
  42. format(str, 120, "[FAIL CAPTURE] You failed to capture %s! ", GZ[zoneid][GName]);
  43. SendClientMessage(playerid, RED, str);
  44. }
  45. }
  46. DisablePlayerCheckpoint(playerid);
  47. pInfo[playerid][Inzone] = -1;
  48. UpdateZoneInfo(zoneid);
  49. return 1;
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement