Guest User

Freddes Bomb Script

a guest
Aug 18th, 2010
1,124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 3.90 KB | None | 0 0
  1. ////////////////////////////////////////////////////////////////////////////////
  2. /*
  3. This is created by Fj0rtizFredde. Dont remove credits!
  4. If you remove credits Garfield will come home to you and eat all your lasange!!!
  5. */
  6. ////////////////////////////////////////////////////////////////////////////////
  7.  
  8. #include <a_samp>
  9.  
  10. #define BOMBID  512
  11.  
  12. new Float:A, Float:B, Float:C;
  13.  
  14. forward ItsShowTime(playerid);
  15.  
  16. public OnFilterScriptInit()
  17. {
  18.     print("\n--------------------------------------");
  19.     print(" Terrorist Bomb Script By Fj0rtizFredde Loaded");
  20.     print("--------------------------------------\n");
  21.     return 1;
  22. }
  23.  
  24. public OnFilterScriptExit()
  25. {
  26.     print("\n--------------------------------------");
  27.     print(" Terrorist Bomb Script By Fj0rtizFredde Unloaded");
  28.     print("--------------------------------------\n");
  29.     return 1;
  30. }
  31.  
  32. public OnPlayerDeath(playerid, killerid, reason)
  33. {
  34.     //This is just so the system dont bug!
  35.     StopPlayerHoldingObject(playerid);
  36.     SetPVarInt(playerid, "MeatBalls", 0);
  37.     SetPVarInt(playerid, "SuperMario", 0);
  38.     return 1;
  39. }
  40.  
  41. public OnPlayerCommandText(playerid, cmdtext[])
  42. {
  43.     if (strcmp("/BlowMe", cmdtext, true) == 0)
  44.     {
  45.         if(GetPVarInt(playerid, "MeatBalls") == 1) return SendClientMessage(playerid,0xE60000FF,"You already got a bomb on you.. Blow youself up first!");
  46.         if(GetPlayerMoney(playerid) <= 5000) return SendClientMessage(playerid,0xE60000FF,"You need at least $5000 to buy a bomb");
  47.         ShowPlayerDialog(playerid,BOMBID,DIALOG_STYLE_INPUT,"Freddes Terrorist Bomb System","Do you want a timed bomb or a controlled bomb? \n(Type in Timed or Controlled)","Buy","Cancel");
  48.         return 1;
  49.     }
  50.     return 0;
  51. }
  52.  
  53. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  54. {
  55.     if (newkeys == KEY_FIRE && GetPVarInt(playerid,"SuperMario") == 1)
  56.     {
  57.         GetPlayerPos(playerid, A, B, C);
  58.         for(new i; i < MAX_PLAYERS; i++)
  59.         {
  60.             if(IsPlayerInRangeOfPoint(i,8.0,A,B,C))
  61.             {
  62.                 SetPlayerHealth(i,0);
  63.             }
  64.         }
  65.         CreateExplosion(A, B, C, 6, 50.0);
  66.         StopPlayerHoldingObject(playerid);
  67.         SetPVarInt(playerid, "MeatBalls", 0);
  68.         SetPVarInt(playerid, "SuperMario", 0);
  69.         GameTextForPlayer(playerid, "BOOOOOM!!", 3000, 0);
  70.     }
  71.     return 1;
  72. }
  73.  
  74. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  75. {
  76.     if(dialogid == BOMBID && response)
  77.     {
  78.         if(!strcmp(inputtext, "Timed", true))
  79.         {
  80.             ShowPlayerDialog(playerid,BOMBID+1,DIALOG_STYLE_INPUT,"Freddes Terrorist Bomb System","What should we set the timer to? \n(Type in how many seconds)","Buy","Cancel");
  81.         }
  82.         if(!strcmp(inputtext, "Controlled", true))
  83.         {
  84.             SetPVarInt(playerid, "MeatBalls", 1);
  85.             SetPVarInt(playerid, "SuperMario", 1);
  86.             SetPlayerHoldingObject(playerid, 1654, 1,0.1,0.20,0.0,180.0,100.0,0.0);
  87.             GivePlayerWeapon(playerid, 40, 1);
  88.             GivePlayerMoney(playerid, -5000);
  89.             SendClientMessage(playerid,0x21DD00FF,"Great you got a bomb. Now go to a place with a lot of people and press the mouse botton!");
  90.         }
  91.     }
  92.    
  93.     if(dialogid == BOMBID+1 && response)
  94.     {
  95.         new time = strval(inputtext);
  96.         SetPVarInt(playerid, "MeatBalls", 1);
  97.         SetPlayerHoldingObject(playerid, 1654, 1,0.1,0.20,0.0,180.0,100.0,0.0);
  98.         GivePlayerMoney(playerid, -5000);
  99.         SetTimerEx("ItsShowTime", time*1000, 0, "i", playerid);
  100.         SendClientMessage(playerid,0x21DD00FF,"Great you got a bomb. Now run in to a place with a lot of people but dont be to late!");
  101.     }
  102.     return 1;
  103. }
  104.  
  105. public ItsShowTime(playerid)
  106. {
  107.     if(GetPVarInt(playerid,"MeatBalls") == 1)
  108.     {
  109.         GetPlayerPos(playerid, A, B, C);
  110.         for(new i; i < MAX_PLAYERS; i++)
  111.         {
  112.             if(IsPlayerInRangeOfPoint(i,8.0,A,B,C))
  113.             {
  114.                 SetPlayerHealth(i,0);
  115.                 PlayerPlaySound(i, 1057, A, B, C);
  116.             }
  117.         }
  118.         CreateExplosion(A, B, C, 6, 50.0);
  119.         StopPlayerHoldingObject(playerid);
  120.         SetPVarInt(playerid, "MeatBalls", 0);
  121.         GameTextForPlayer(playerid, "BOOOOOM!!", 3000, 0);
  122.     }
  123.     return 1;
  124. }
Advertisement
Add Comment
Please, Sign In to add comment