Advertisement
Guest User

snow

a guest
Nov 23rd, 2014
553
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.54 KB | None | 0 0
  1. #define FILTERSCRIPT
  2.  
  3. #include a_samp
  4. #include zcmd
  5.  
  6. #define MAX_SNOW 4
  7. #define function%0(%1) forward%0(%1);public%0(%1)
  8.  
  9. new Hav[MAX_PLAYERS][MAX_SNOW], Float:sPos[3];
  10.  
  11. public OnFilterScriptExit() {
  12. for(new x=0; x < MAX_PLAYERS; x++) {
  13. for(new i = 0; i < MAX_SNOW; i++) DestroyPlayerObject(x, Hav[x][i]);
  14. }
  15. return 1;
  16. }
  17.  
  18. public OnPlayerDisconnect(playerid, reason) {
  19. if(GetPVarInt(playerid, "Havazas")) cmd_havazaski(playerid);
  20. return 1;
  21. }
  22.  
  23. CMD:havazas(playerid) {
  24. if(GetPVarInt(playerid, "Havazas")) return SendClientMessage(playerid, 0xff0000ff, "Hiba! Neked már be van állítva a hóesés!");
  25. SetPVarInt(playerid, "Havazas", 1);
  26. SetPVarInt(playerid, "SnowTimer", SetTimerEx("Snow", 600, true, "i", playerid));
  27.  
  28. GetPlayerPos(playerid, sPos[0], sPos[1], sPos[2]);
  29.  
  30. for(new i = 0; i < MAX_SNOW; i++) Hav[playerid][i] = CreatePlayerObject(playerid, 18864, sPos[0] + random(20), sPos[1] + random(20), sPos[2] + random(5)+1, random(360), random(360), random(360), 0.0);
  31. SetPlayerTime(playerid, 0, 0);
  32. SendClientMessage(playerid, -1, "Jelenlegi időjárás: Havazás (Kikapcsolás: /havazaski)");
  33. return 1;
  34. }
  35.  
  36. CMD:havazaski(playerid) {
  37. if(!GetPVarInt(playerid, "Havazas")) return SendClientMessage(playerid, 0xff0000ff, "Hiba! Neked nincs beállítva havazás!");
  38.  
  39. SetPVarInt(playerid, "Havazas", 0);
  40. for(new i = 0; i < MAX_SNOW; i++) DestroyPlayerObject(playerid, Hav[playerid][i]);
  41. KillTimer(GetPVarInt(playerid, "SnowTimer"));
  42. SetPlayerTime(playerid, 12, 0);
  43. SendClientMessage(playerid, -1, "Havazás megszakítva!");
  44. return 1;
  45. }
  46.  
  47. CMD:havazasall(playerid) {
  48. if(!IsPlayerAdmin(playerid)) return 0; // Ha nem vagy RCON admin akkor erre a parancsra UNKNOW COMMAND-ot ír.
  49.  
  50. for(new x=0; x < MAX_PLAYERS; x++) {
  51. if(!GetPVarInt(x, "Havazas")) cmd_havazas(x);
  52. }
  53. SendClientMessageToAll(-1, "Havazás mindenkinek elindítva admin által! (Kikapcsolás: /havazasallki)");
  54. return 1;
  55. }
  56.  
  57. CMD:havazasallki(playerid) {
  58. if(!IsPlayerAdmin(playerid)) return 0; // Ha nem vagy RCON admin akkor erre a parancsra UNKNOW COMMAND-ot ír.
  59.  
  60. for(new x=0; x < MAX_PLAYERS; x++) {
  61. if(GetPVarInt(x, "Havazas")) cmd_havazaski(x);
  62. }
  63. SendClientMessageToAll(0xff0000ff, "Havazás mindenkinek kikapcsolva admin által!");
  64. return 1;
  65. }
  66.  
  67. function Snow(playerid) {
  68. if(GetPVarInt(playerid, "Havazas")) {
  69. GetPlayerPos(playerid, sPos[0], sPos[1], sPos[2]);
  70. for(new i = 0; i < MAX_SNOW; i++) Hav[playerid][i] = SetPlayerObjectPos(playerid, 18864, sPos[0] + random(20), sPos[1] + random(20), sPos[2] + random(5)+1);
  71. }
  72. return 1;
  73. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement