Share Pastebin
Guest
Public paste!

LDTLuxurY

By: a guest | Dec 23rd, 2008 | Syntax: C++ | Size: 16.26 KB | Hits: 113 | Expires: Never
Copy text to clipboard
  1. /*
  2. ================================================================================
  3. |          Title: LuxurY Bomb Explosion (Bomb shop + Lots of bomb commands)    |
  4. |          Version: 0.1.3                                                      |
  5. |          Date: 9 July 2007                                                   |
  6. |          Creator: LuxurY                                                     |
  7. |          Language: English                                                   |
  8. |                                                                              |
  9. | (c) LuxurY scripts 2007                                                      |
  10. ================================================================================
  11. ________________________________________________________________________________
  12.  
  13.                                                            888
  14.                                  88
  15.                                  88
  16.                               88[ ]88
  17.                              8888[ ]8888
  18.                            8888888[ ]88888
  19.                          8888888888[ ]888888   88
  20.                     8888888888888888[ ]888888888
  21.                    88    8888888888[ ]888888
  22.                            8888888[ ]88888
  23.                              8888[ ]8888
  24.                               88[ ]88
  25.                                 88
  26.                                 88
  27.                                  888
  28.  
  29. ________________________________________________________________________________
  30. */
  31. //includes
  32. #include <a_samp>
  33. #include <dini>
  34. #include <dutils>
  35. #include <dudb>
  36.  
  37. //color defines
  38. #define COLOR_GREY 0xAFAFAFAA
  39. #define COLOR_GREEN 0x33AA33AA
  40. #define COLOR_RED 0xAA3333AA
  41. #define COLOR_YELLOW 0xFFFF00AA
  42. #define COLOR_WHITE 0xFFFFFFAA
  43. #define COLOR_BLUE 0x0000BBAA
  44. #define COLOR_LIGHTBLUE 0x33CCFFAA
  45. #define COLOR_ORANGE 0xFF9900AA
  46.  
  47. //filterscript configuration
  48. new statusfs[10] = { "v.0.1.3" };
  49. new allowbomb;
  50.  
  51. //player statuses
  52. new bombarea[MAX_PLAYERS];
  53. new Float:Xbombb[MAX_PLAYERS];
  54. new Float:Ybombb[MAX_PLAYERS];
  55. new Float:Zbombb[MAX_PLAYERS];
  56. new curvplt[MAX_PLAYERS];
  57. new curvpld[MAX_PLAYERS];
  58. new allowtoport[MAX_PLAYERS];
  59. new timebomb[MAX_PLAYERS];
  60.  
  61. //vehicles statuses
  62. new bombhave[MAX_VEHICLES];
  63. new bombt[MAX_VEHICLES];
  64. new bombd[MAX_VEHICLES];
  65.  
  66. //forwards
  67. forward BombCheck();
  68. forward AreaCheck();
  69. forward AllowBomb();
  70. forward Tport();
  71.  
  72. public OnFilterScriptInit()
  73. {
  74.         print("\n----------------------------------");
  75.         printf("  Bomb Explosion %s by LuxurY",statusfs);
  76.         print("----------------------------------\n");
  77.         SetTimer("AreaCheck",1000,1);
  78.         SetTimer("BombCheck",2000,1);
  79.         SetTimer("AllowBomb",1000,1);
  80.         SetTimer("Tport",120000,1);
  81.         allowbomb = 0;
  82.         return 1;
  83. }
  84.  
  85. stock IsPlayerInCubeArea(playerid, Float:minx, Float:maxx, Float:miny, Float:maxy, Float:minz, Float:maxz)
  86. {
  87.         new Float:x, Float:y, Float:z;
  88.         GetPlayerPos(playerid, x, y, z);
  89.         if (x > minx && x < maxx && y > miny && y < maxy && z > minz && z < maxz) return 1;
  90.         return 0;
  91. }
  92.  
  93. stock GetDistanceBetweenVehicles(v1,v2)
  94.         {
  95.         new Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2;
  96.         new Float:tmpdis;
  97.         GetVehiclePos(v1,x1,y1,z1);
  98.         GetVehiclePos(v2,x2,y2,z2);
  99.         tmpdis = floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2));
  100.         return floatround(tmpdis);
  101.         }
  102.  
  103. stock GetDistanceBetweenVAP(playerid,v) {
  104.         new Float:x1 = Xbombb[playerid];
  105.         new Float:y1 = Ybombb[playerid];
  106.         new Float:z1 = Zbombb[playerid];
  107.         new Float:x2,Float:y2,Float:z2;
  108.         new Float:tmpdis;
  109.         GetVehiclePos(v,x2,y2,z2);
  110.         tmpdis = floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2));
  111.         return floatround(tmpdis);
  112.         }
  113.  
  114. stock GiveVehicleHealth(vehicleid,Float:heal) {
  115.         new Float:vh;
  116.         GetVehicleHealth(vehicleid,vh);
  117.         SetVehicleHealth(vehicleid,vh+heal);
  118.         return 1;
  119.         }
  120.        
  121. public OnPlayerSpawn(playerid) {
  122.         Xbombb[playerid] = 0;
  123.         Ybombb[playerid] = 0;
  124.         Zbombb[playerid] = 0;
  125.         bombarea[playerid] = 1;
  126.         curvplt[playerid] = 999;
  127.         curvpld[playerid] = 999;
  128.         allowtoport[playerid] = 1;
  129.         return 1;
  130.         }
  131.  
  132. public OnPlayerCommandText(playerid, cmdtext[])
  133. {
  134.         new tmp[255];
  135.         new playername[24];
  136.         GetPlayerName(playerid,playername,sizeof(playername));
  137.         new cmd[256], idx;
  138.         cmd = strtok(cmdtext, idx);
  139.         new Float:X, Float:Y, Float:Z;
  140.         new VID = GetPlayerVehicleID(playerid);
  141.  
  142.     if(strcmp(cmd, "/bombcmd", true) == 0) {
  143.     SendClientMessage(playerid, COLOR_YELLOW, "=========== LuxurY Bomb Explosion Commands ===========");
  144.     SendClientMessage(playerid, COLOR_YELLOW, " /killb - kill youself with bomb");
  145.     SendClientMessage(playerid, COLOR_YELLOW, " /bt - to create timer on vehicle");
  146.     SendClientMessage(playerid, COLOR_YELLOW, " /bd - to create detomator on vehicle");
  147.     SendClientMessage(playerid, COLOR_YELLOW, " /cb - to create bomb on place");
  148.     SendClientMessage(playerid, COLOR_YELLOW, " /dv - to activate detomator on vehicle");
  149.     SendClientMessage(playerid, COLOR_YELLOW, " /db - to explose bomb");
  150.     SendClientMessage(playerid, COLOR_YELLOW, " To deactivate: /ccb - bomb /cct - timer /ccd - detonator");
  151.     SendClientMessage(playerid, COLOR_YELLOW, " /bs - teleport to the Bomb Shop");
  152.     SendClientMessage(playerid, COLOR_YELLOW, "____________________________________________________________________");
  153.         return 1;
  154.         }
  155.         if(strcmp(cmd, "/abombcmd", true) == 0) {
  156.     SendClientMessage(playerid, COLOR_YELLOW, "=========== LuxurY Bomb Explosion Commands Admin ===========");
  157.     SendClientMessage(playerid, COLOR_YELLOW, " /setbt [playerid] [time] [0(no) or 1(yes)] - to create timer on player's vehicle");
  158.     SendClientMessage(playerid, COLOR_YELLOW, " /setbd [playerid] [0(no) or 1(yes)] - to create detonator on player's vehicle");
  159.     SendClientMessage(playerid, COLOR_YELLOW, " /explose [playerid] - explose player");
  160.     SendClientMessage(playerid, COLOR_YELLOW, " /abomb - allow/disallow automatically creating bombs on vehicles");
  161.     SendClientMessage(playerid, COLOR_YELLOW, " /setbombv [playerid] - to create bomb on player's vehicle");
  162.     SendClientMessage(playerid, COLOR_YELLOW, "____________________________________________________________________");
  163.         return 1;
  164.         }
  165.         if(strcmp(cmd, "/bt", true) == 0) {
  166.         if (bombhave[VID] == 1) {
  167.         new time;
  168.         tmp = strtok(cmdtext, idx);
  169.         if(!strlen(tmp)) {
  170.         SendClientMessage(playerid, 0xFFFFFFAA, "Usage: /bt [time]");
  171.         return 1;
  172.         }
  173.         time = strval(tmp);
  174.         curvplt[playerid] = VID;
  175.         bombt[VID] = 1;
  176.         timebomb[playerid] = time;
  177.         bombhave[VID] = 0;
  178.         SendClientMessage(playerid, 0xFFFFFFAA, "Timer has been activated. To cancel type /cct");
  179.         SetTimer("BombCheck",2000,1);
  180.         } else {
  181.         SendClientMessage(playerid,COLOR_RED,"There is no bomb on you vehicle!");
  182.         }
  183.         return 1;
  184.         }
  185.        
  186.         if(strcmp(cmd, "/setbt", true) == 0) {
  187.         new time, plidd, boolt;
  188.         tmp = strtok(cmdtext, idx);
  189.         new pliddv = GetPlayerVehicleID(plidd);
  190.         if(!strlen(tmp)) {
  191.         SendClientMessage(playerid, 0xFFFFFFAA, "Usage: /setbt [playerid] [time] [0 or 1]");
  192.         return 1;
  193.         }
  194.         plidd = strval(tmp);
  195.         tmp = strtok(cmdtext, idx);
  196.         if(!strlen(tmp)) {
  197.         SendClientMessage(playerid, 0xFFFFFFAA, "Usage: /setsbt [playerid] [time] [0 or 1]");
  198.         return 1;
  199.         }
  200.         time = strval(tmp);
  201.         tmp = strtok(cmdtext, idx);
  202.         if(!strlen(tmp)) {
  203.         SendClientMessage(playerid, 0xFFFFFFAA, "Usage: /setsbt [playerid] [time] [0 or 1]");
  204.         return 1;
  205.         }
  206.         boolt = strval(tmp);
  207.         if(IsPlayerAdmin(playerid)) {
  208.         if(IsPlayerInAnyVehicle(plidd)) {
  209.         curvplt[playerid] = pliddv;
  210.         bombt[pliddv] = boolt;
  211.         timebomb[plidd] = time;
  212.         } else {
  213.         SendClientMessage(playerid,COLOR_RED,"This player is not in vehicle!");
  214.         }}
  215.         else {
  216.         SendClientMessage(playerid,0xFF0000AA,"You are not an admin!");
  217.         }
  218.         return 1;
  219.         }
  220.        
  221.         if(strcmp(cmd, "/setbd", true) == 0) {
  222.         new boold, plidd;
  223.         tmp = strtok(cmdtext, idx);
  224.         new pliddv = GetPlayerVehicleID(plidd);
  225.         if(!strlen(tmp)) {
  226.         SendClientMessage(playerid, 0xFFFFFFAA, "Usage: /setbd [playerid] [0 or 1]");
  227.         return 1;
  228.         }
  229.         plidd = strval(tmp);
  230.         tmp = strtok(cmdtext, idx);
  231.         if(!strlen(tmp)) {
  232.         SendClientMessage(playerid, 0xFFFFFFAA, "Usage: /setsbd [playerid] [0 or 1]");
  233.         return 1;
  234.         }
  235.         boold = strval(tmp);
  236.         if(IsPlayerAdmin(playerid)) {
  237.         if(IsPlayerInAnyVehicle(plidd)) {
  238.         curvplt[playerid] = pliddv;
  239.         bombd[pliddv] = boold;
  240.         } else {
  241.         SendClientMessage(playerid,COLOR_RED,"This player is not in vehicle!");
  242.         }}
  243.         else {
  244.         SendClientMessage(playerid,0xFF0000AA,"You are not an admin!");
  245.         }
  246.         return 1;
  247.         }
  248.        
  249.         if(strcmp(cmd, "/bd", true) == 0) {
  250.         if (bombhave[VID] == 1) {
  251.         GetVehiclePos(VID,X,Y,Z);
  252.         bombd[VID] = 1;
  253.         curvpld[playerid] = VID;
  254.         bombhave[VID] = 0;
  255.         SendClientMessage(playerid, 0xFFFFFFAA, "Detomator has been activated. To cancel type /ccd");
  256.         } else {
  257.         SendClientMessage(playerid,COLOR_RED,"There is no bomb on you vehicle!");
  258.         }
  259.         return 1;
  260.         }
  261.        
  262.         if(strcmp(cmd, "/dv", true) == 0) {
  263.         if(curvpld[playerid] == 999) {
  264.         SendClientMessage(playerid,COLOR_RED,"You didn't create detomator on vehicle!");
  265.         } else {
  266.         GetVehiclePos(curvpld[playerid],X,Y,Z);
  267.         SetVehicleHealth(curvpld[playerid],0);
  268.         CreateExplosion(X,Y,Z,6,2);
  269.         CreateExplosion(X,Y,Z,7,2);
  270.         SendClientMessage(playerid, 0xFFFFFFAA, "Vehicle has been explosed");
  271.         for (new v = 1; v < MAX_VEHICLES; v++) {
  272.         new dis = GetDistanceBetweenVehicles(curvpld[playerid],v);
  273.         if (dis < 5) {
  274.         SetVehicleHealth(v,0);
  275.         }
  276.         else if (dis > 5 && dis < 10) {
  277.         GiveVehicleHealth(v,-650);
  278.         }
  279.         else if (dis > 10 && dis < 15) {
  280.         GiveVehicleHealth(v,-300);
  281.         }
  282.         }
  283.         }
  284.         return 1;
  285.         }
  286.        
  287.         if(strcmp(cmd, "/killb", true) == 0) {
  288.         GetPlayerPos(playerid,X,Y,Z);
  289.         if (IsPlayerInAnyVehicle(playerid)) {
  290.         CreateExplosion(X,Y,Z,6,2);
  291.         CreateExplosion(X,Y,Z,7,2);
  292.         SetVehicleHealth(VID,0);
  293.         } else {
  294.         SetPlayerHealth(playerid,10);
  295.         CreateExplosion(X,Y,Z,6,2);
  296.         CreateExplosion(X,Y,Z,7,2);
  297.         SendClientMessage(playerid, 0xFFFFFFAA, "You explosed.");
  298.         }
  299.         return 1;
  300.         }
  301.        
  302.         if(strcmp(cmd, "/cb", true) == 0) {
  303.         GetPlayerPos(playerid,X,Y,Z);
  304.         Xbombb[playerid] = X;
  305.         Ybombb[playerid] = Y;
  306.         Zbombb[playerid] = Z;
  307.         CreateObject(1252,X,Y + 0.5,Z,0,0,0);
  308.         SendClientMessage(playerid,COLOR_GREEN,"Bomb created! To explose type /db");
  309.         return 1;
  310.         }
  311.        
  312.         if(strcmp(cmd, "/db", true) == 0) {
  313.         if (Xbombb[playerid] == 0 || Ybombb[playerid] == 0 || Zbombb[playerid] == 0) {
  314.         SendClientMessage(playerid,COLOR_RED,"You didn't create bomb!");
  315.         } else {
  316.         CreateExplosion(Xbombb[playerid],Ybombb[playerid],Zbombb[playerid],6,1);
  317.         CreateExplosion(Xbombb[playerid],Ybombb[playerid],Zbombb[playerid],7,1);
  318.         Xbombb[playerid] = 0;
  319.         Ybombb[playerid] = 0;
  320.         Zbombb[playerid] = 0;
  321.         SendClientMessage(playerid,COLOR_GREEN,"Bomb has been explosed.");
  322.         for (new v = 1; v < MAX_VEHICLES; v++) {
  323.         new dis = GetDistanceBetweenVAP(playerid,v);
  324.         if (dis < 5) {
  325.         SetVehicleHealth(v,0);
  326.         }
  327.         else if (dis > 5 && dis < 10) {
  328.         GiveVehicleHealth(v,-650);
  329.         }
  330.         else if (dis > 10 && dis < 15) {
  331.         GiveVehicleHealth(v,-300);
  332.         }
  333.         }
  334.         Xbombb[playerid] = 0;
  335.         Ybombb[playerid] = 0;
  336.         Zbombb[playerid] = 0;
  337.         }
  338.         return 1;
  339.         }
  340.        
  341.         if(strcmp(cmd, "/ccb", true) == 0) {
  342.         if (Xbombb[playerid] == 0 || Ybombb[playerid] == 0 || Zbombb[playerid] == 0) {
  343.         SendClientMessage(playerid,COLOR_YELLOW,"There is nothing to deactivate.");
  344.         } else {
  345.         Xbombb[playerid] = 0;
  346.         Ybombb[playerid] = 0;
  347.         Zbombb[playerid] = 0;
  348.         SendClientMessage(playerid,COLOR_YELLOW,"Bomb has been deactivated.");
  349.         }
  350.         return 1;
  351.         }
  352.        
  353.         if(strcmp(cmd, "/cct", true) == 0) {
  354.         new v = curvplt[playerid];
  355.         if (bombt[v] == 0 || curvplt[playerid] == 999) {
  356.         SendClientMessage(playerid,COLOR_YELLOW,"There is nothing to deactivate.");
  357.         } else {
  358.         bombt[v] = 0;
  359.         curvplt[playerid] = 999;
  360.         SendClientMessage(playerid,COLOR_YELLOW,"Timer on vehicle has been deactivated.");
  361.         }
  362.         return 1;
  363.         }
  364.        
  365.         if(strcmp(cmd, "/ccd", true) == 0) {
  366.         new v = curvpld[playerid];
  367.         if (bombd[v] == 0 || curvpld[playerid] == 999) {
  368.         SendClientMessage(playerid,COLOR_YELLOW,"There is nothing to deactivate.");
  369.         } else {
  370.         bombd[v] = 0;
  371.         curvpld[playerid] = 999;
  372.         SendClientMessage(playerid,COLOR_YELLOW,"Detonator on vehicle has been deactivated.");
  373.         }
  374.         return 1;
  375.         }
  376.        
  377.         if(strcmp(cmd, "/explose", true) == 0 && IsPlayerAdmin(playerid)) {
  378.         new plid;
  379.         tmp = strtok(cmdtext, idx);
  380.         if(!strlen(tmp)) {
  381.         SendClientMessage(playerid, COLOR_WHITE, "Usage: /explose [playerid]");
  382.         return 1;
  383.         }
  384.         plid = strval(tmp);
  385.         GetPlayerPos(plid,X,Y,Z);
  386.         if (IsPlayerInAnyVehicle(plid)) {
  387.         new plidv = GetPlayerVehicleID(plid);
  388.         SetVehicleHealth(plidv,0);
  389.         CreateExplosion(X,Y,Z,6,2);
  390.         CreateExplosion(X,Y,Z,7,2);
  391.         } else {
  392.         SetPlayerHealth(plid,10);
  393.         CreateExplosion(X,Y,Z,6,2);
  394.         CreateExplosion(X,Y,Z,7,2);
  395.         }
  396.         return 1;
  397.         }
  398.        
  399.         if(strcmp(cmd, "/abomb", true) == 0 && IsPlayerAdmin(playerid)) {
  400.         if (allowbomb == 0) {
  401.         allowbomb = 1;
  402.         SendClientMessageToAll(COLOR_GREEN,"Now all vehicles will always have bombs");
  403.         } else {
  404.         allowbomb = 0;
  405.         SendClientMessageToAll(COLOR_RED, "Bomb can be bought in Bomb Shop. To teleport type /bs");
  406.         }
  407.         return 1;
  408.         }
  409.        
  410.         if(strcmp(cmd, "/setbombv", true) == 0 && IsPlayerAdmin(playerid)) {
  411.         new plid;
  412.         tmp = strtok(cmdtext, idx);
  413.         if(!strlen(tmp)) {
  414.         SendClientMessage(playerid, COLOR_WHITE, "Usage: /setbombv [playerid]");
  415.         return 1;
  416.         }
  417.         plid = strval(tmp);
  418.         GetPlayerPos(plid,X,Y,Z);
  419.         if (IsPlayerInAnyVehicle(plid)) {
  420.         new plidv = GetPlayerVehicleID(plid);
  421.         bombhave[plidv] = 1;
  422.         } else {
  423.         SendClientMessage(playerid,COLOR_RED,"This player is not in vehicle!");
  424.         }
  425.         return 1;
  426.         }
  427.        
  428.         if(strcmp(cmdtext, "/bs", true) == 0) {
  429.         if (allowtoport[playerid] == 1) {
  430.         if(IsPlayerInAnyVehicle(playerid)) {
  431.         SetVehiclePos(VID, 1842, -1852.8, 14);
  432.         } else {
  433.         SetPlayerPos(playerid, 1842, -1852.8, 14);
  434.         }
  435.         SetTimer("Tport",120000,1);
  436.         allowtoport[playerid] = 0;
  437.         } else {
  438.         SendClientMessage(playerid,COLOR_RED,"You can't teleport now! Please wait for a few minutes");
  439.         }
  440.         return 1;
  441.         }
  442.         return 0;
  443.         }
  444.  
  445. public BombCheck() {
  446.         for (new i = 0; i < MAX_PLAYERS; i++) {
  447.         if (curvplt[i] == 999) {
  448.         return 1;
  449.         } else {
  450.         if (bombt[curvplt[i]] == 1) {
  451.         if (timebomb[i] > 0) {
  452.         new Float:Xv, Float:Yv, Float:Zv;
  453.         GetVehiclePos(curvplt[i],Xv,Yv,Zv);
  454.         timebomb[i]--;
  455.         new string[255];
  456.         format(string,sizeof(string)," Explosion: %d",timebomb[i]);
  457.         SendClientMessageToAll(COLOR_RED,string);
  458.         if (timebomb[i] == 1) {
  459.         SetVehicleHealth(curvplt[i],0);
  460.         CreateExplosion(Xv,Yv,Zv,6,1);
  461.         CreateExplosion(Xv,Yv,Zv,7,1);
  462.         for (new v = 1; v < MAX_VEHICLES; v++) {
  463.         new dis = GetDistanceBetweenVehicles(curvpld[i],v);
  464.         if (dis < 5) {
  465.         SetVehicleHealth(v,0);
  466.         }
  467.         else if (dis > 5 && dis < 10) {
  468.         GiveVehicleHealth(v,-650);
  469.         }
  470.         else if (dis > 10 && dis < 15) {
  471.         GiveVehicleHealth(v,-300);
  472.         }
  473.         }
  474.         } else {
  475.         new kt = SetTimer("BombCheck",2000,1);
  476.         KillTimer(kt);
  477.         }
  478.         }
  479.         }
  480.         }
  481.         }
  482.         return 1;
  483.         }
  484.        
  485. public AreaCheck() {
  486.         for (new i=0; i < MAX_PLAYERS; i++) {
  487.         new v = GetPlayerVehicleID(i);
  488.         if (IsPlayerInCubeArea(i,1843,1857,-1860,-1852.8,13,17.5)) {
  489.         if (bombarea[i] == 1) {
  490.         if (GetPlayerMoney(i) > 499) {
  491.         if (IsPlayerInAnyVehicle(i)) {
  492.         SendClientMessage(i,COLOR_GREEN,"======== Wellcome to the Bomb Shop ========");
  493.         SendClientMessage(i,COLOR_GREEN,"* Bomb has been installed.");
  494.         SendClientMessage(i,COLOR_GREEN,"* To create timet type /bt [time]");
  495.         SendClientMessage(i,COLOR_GREEN,"* To create detomator type /bd");
  496.         SendClientMessage(i,COLOR_GREEN,"* Other commands: /bombcmd");
  497.         bombarea[i] = 0;
  498.         bombhave[v] = 1;
  499.         } else {
  500.         SendClientMessage(i,COLOR_GREEN,"You are not in vehicle!");
  501.         bombarea[i] = 0;
  502.         }} else {
  503.         SendClientMessage(i,COLOR_GREEN,"Not enough money!");
  504.         bombarea[i] = 0;
  505.         }}} else {
  506.         bombarea[i] = 1;
  507.         }}
  508.         return 1;
  509.         }
  510.        
  511. public AllowBomb() {
  512.         for (new i=0; i < MAX_PLAYERS; i++) {
  513.         if(allowbomb == 1) {
  514.         new av = GetPlayerVehicleID(i);
  515.         bombhave[av] = 1;
  516.         }
  517.         }
  518.         return 1;
  519.         }
  520.        
  521. public Tport() {
  522.         for (new i=0; i < MAX_PLAYERS; i++) {
  523.         if (IsPlayerConnected(i)) {
  524.         if (allowtoport[i] == 0) {
  525.         allowtoport[i] = 1;
  526.         }
  527.         }
  528.         }
  529.         return 1;
  530.         }
  531.        
  532. public OnVehicleDeath(vehicleid,killerid) {
  533.         if (bombt[vehicleid] == 1) {
  534.         for (new v = 1; v < MAX_VEHICLES; v++) {
  535.         new dis = GetDistanceBetweenVehicles(vehicleid,v);
  536.         if (dis < 5) {
  537.         SetVehicleHealth(v,0);
  538.         }
  539.         else if (dis > 5 && dis < 10) {
  540.         GiveVehicleHealth(v,-650);
  541.         }
  542.         else if (dis > 10 && dis < 15) {
  543.         GiveVehicleHealth(v,-300);
  544.         }
  545.         }
  546.         }
  547.         return 1;
  548.         }