Advertisement
Guest User

Untitled

a guest
Nov 30th, 2018
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.09 KB | None | 0 0
  1. task spawnDeer[5000]() {
  2. switch(deerVariables[deerState]) {
  3. case E_STATE_WAITING: {
  4. if(deerVariables[deerTime] && deerVariables[deerTime] <= gettime() && !deerVariables[deerID]) {
  5. deerVariables[deerState] = E_STATE_SPAWNED;
  6. deerVariables[deerTime] = gettime() + 1600;
  7.  
  8. new rand = random(sizeof(deerPosition));
  9. new string[256];
  10.  
  11. deerVariables[deerPosX] = deerPosition[rand][0];
  12. deerVariables[deerPosY] = deerPosition[rand][1];
  13. deerVariables[deerPosZ] = deerPosition[rand][2];
  14. deerVariables[deerID] = CreateDynamicObject(1247, deerVariables[deerPosX], deerVariables[deerPosY], deerVariables[deerPosZ], 0.0, 0.0, 0.0);
  15. GetPlayer3DZone2(deerVariables[deerPosX], deerVariables[deerPosY], deerVariables[deerPosZ], deerZone, sizeof deerZone);
  16.  
  17. foreach(new x : Player) {
  18. format(string, sizeof(string), "{008080}[Treasure Hunt] {FFFFFF}Un obiect tocmai a fost spawnat pe server. Primul care il va gasi v-a primi un premiu special.", deerZone);
  19. SendClientMessageToAll(-1, string);
  20. format(string, sizeof(string), "{008080}[Treasure Hunt] {FFFFFF}Daca acesta nu va fi gasit in 30 minute, server-ul va spawna alt obiect");
  21. SendClientMessageToAll(-1, string);
  22. format(string, sizeof(string), "{FF0000}[Hint] {FFFFFF}Obiectul se afla in zona %s.", deerZone);
  23. SendClientMessageToAll(-1, string);
  24. }
  25. return 1;
  26. }
  27. }
  28.  
  29. case E_STATE_SPAWNED: {
  30. if(deerVariables[deerTime] && deerVariables[deerTime] <= gettime()) {
  31. deerVariables[deerTime] = gettime() + 600;
  32. deerVariables[deerState] = E_STATE_WAITING;
  33. deerVariables[deerID] = 0;
  34. DestroyDynamicObject(deerVariables[deerID]);
  35.  
  36. foreach(new x : Player) {
  37. SCM(x, -1, "{008080}[Treasure Info]: {FFFFFF}Nimeni nu a reusit sa gaseasca obiect-ul ascuns, server-ul va spawna alt obiect in aprox. 10 min");
  38. }
  39. return 1;
  40. }
  41. if(deerVariables[deerTime] && deerVariables[deerTime] - gettime() <= 60) {
  42. GetPlayer3DZone2(deerVariables[deerPosX], deerVariables[deerPosY], deerVariables[deerPosZ], deerZone, sizeof deerZone);
  43. }
  44. }
  45. }
  46. return 1;
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement