Advertisement
Guest User

Solar Flare v1.0

a guest
Jan 7th, 2012
367
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.79 KB | None | 0 0
  1. /*
  2.  
  3. Lonelymoo's Solar Flare Script v1.0
  4. Plan & Make by Lonelymoo
  5. (c), 2012, January 7
  6.  
  7. */
  8.  
  9. #include <a_samp>
  10. #include <zcmd>
  11.  
  12. forward SolarHit(playerid);
  13.  
  14. new SolarFlare[MAX_PLAYERS];
  15. new SolarTimer;
  16.  
  17. #define COLOR_RED 0xFF0000FF
  18.  
  19. #if defined FILTERSCRIPT
  20.  
  21. public OnFilterScriptInit()
  22. {
  23. print("****************************************");
  24. print(" Lonelymoo's Solar Flare v1.0 ");
  25. print(" Made & Plan by Lonelymoo ");
  26. print("****************************************");
  27. return 1;
  28. }
  29.  
  30. public OnFilterScriptExit()
  31. {
  32. KillTimer(SolarTimer);
  33. return 1;
  34. }
  35.  
  36. #else
  37. #endif
  38.  
  39. public SolarHit(playerid)
  40. {
  41. SendClientMessageToAll(COLOR_RED, "Solar Flare has hit the earth! we died!");
  42. SolarFlare[playerid] = 0;
  43. KillTimer(SolarTimer);
  44. for(new i = 0; i < MAX_PLAYERS; i++)
  45. {
  46. if(IsPlayerConnected(i) && (i != playerid))
  47. {
  48. SendClientMessage(playerid,COLOR_RED,"You have been hitted by Solar Flare!");
  49. SetPlayerHealth(i,0.0);
  50. }
  51. }
  52. return 1;
  53. }
  54.  
  55. CMD:solarflare(playerid, params[])
  56. {
  57. new string[500],rconname[MAX_PLAYER_NAME];
  58. GetPlayerName(playerid, rconname, MAX_PLAYER_NAME);
  59. if(IsPlayerAdmin(playerid))
  60. {
  61. if(SolarFlare[playerid] == 1) return SendClientMessage(playerid, COLOR_RED, "Solar Flare is already starting and it will take 2 days (ingame) to hit us");
  62. SolarFlare[playerid] = 1;
  63. SolarTimer = SetTimer("SolarHit",2880000, false);
  64. format(string,sizeof(string),"RCON %s has announce that Solar Flare will gonna hit us after 2 days (ingame day)",rconname);
  65. SendClientMessageToAll(COLOR_RED, string);
  66. print("Solar Flare will reach the earth in 2 days get ready!");
  67. }
  68. else return SendClientMessage(playerid, COLOR_RED, "* Only Server Owner can announce when gonna hit solar flare");
  69. return 1;
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement