SA-MP Forums Archive
[HELP] Please. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP] Please. (/showthread.php?tid=113818)



[HELP] Please. - Lynn09© - 16.12.2009

Why does this not work?
I have forward Bomb(playerid) also.
I also tried without playerid, but didn't work.
Код:
public Bomb(playerid)
{
  for(new i = 0; i < MAX_PLAYERS; i++)
  {
    if(IsPlayerConnected(i))
    {
      if(PlayerToPoint(3.0,i,91.631355285645, 1991.6337890625, 17.122562408447))// Bomb 1
      {
		CreateExplosion(91.631355285645, 1991.6337890625, 17.122562408447, 7, 4);
      }
      if(PlayerToPoint(2.0,i,55.910453796387, 1974.9185791016, 16.650043487549))// Bomb 2
      {
        CreateExplosion(55.910453796387, 1974.9185791016, 16.650043487549, 7, 4);
      }
      if(PlayerToPoint(2.0,i,83.481628417969, 1920.892578125, 16.734594345093))// Bomb 3
      {
        CreateExplosion(35.212314605713, 1878.9379882813, 16.650043487549, 7, 4);
      }
      if(PlayerToPoint(2.0,i,35.212314605713, 1878.9379882813, 16.650043487549))// Bomb 4
      {
        CreateExplosion(91.631355285645, 1991.6337890625, 17.122562408447, 7, 4);
      }
      if(PlayerToPoint(2.0,i,6.7346382141113, 1960.7672119141, 16.650043487549))// Bomb 5
      {
        CreateExplosion(6.7346382141113, 1960.7672119141, 16.650043487549, 7, 4);
      }
      if(PlayerToPoint(2.0,i, 86.725624084473, 2020.4542236328, 16.853578567505))// Bomb 6
      {
        CreateExplosion( 86.725624084473, 2020.4542236328, 16.853578567505, 7, 4);
      }
      if(PlayerToPoint(2.0,i,62.491638183594, 1852.3330078125, 16.650043487549))// Bomb 7
      {
        CreateExplosion( 62.491638183594, 1852.3330078125, 16.650043487549, 7, 4);
      }
      if(PlayerToPoint(2.0,i,84.569557189941, 1885.6547851563, 16.708818435669))// Bomb 8
      {
        CreateExplosion(84.569557189941, 1885.6547851563, 16.708818435669, 7, 4);
      }
      if(PlayerToPoint(2.0,i,6.5193672180176, 1882.9143066406, 16.650043487549))// Bomb 9
      {
        CreateExplosion(6.5193672180176, 1882.9143066406, 16.650043487549, 7, 4);
      }
      if(PlayerToPoint(2.0,i,28.795841217041, 1982.9211425781, 16.650043487549))// Bomb 10
      {
        CreateExplosion(28.795841217041, 1982.9211425781, 16.650043487549, 7, 4);
      }
      if(PlayerToPoint(2.0,i,78.266075134277, 1950.1732177734, 16.650043487549))// Bomb 10
      {
        CreateExplosion(78.266075134277, 1950.1732177734, 16.650043487549, 7, 4);
      }
	}
  }
}



Re: [HELP] Please. - BP13 - 16.12.2009

Quote:
Originally Posted by Lynn09©
Why does this not work?
I have forward Bomb(playerid) also.
I also tried without playerid, but didn't work.
Код:
public Bomb(playerid)
{
  for(new i = 0; i < MAX_PLAYERS; i++)
  {
    if(IsPlayerConnected(i))
    {
      if(PlayerToPoint(3.0,i,91.631355285645, 1991.6337890625, 17.122562408447))// Bomb 1
      {
		CreateExplosion(91.631355285645, 1991.6337890625, 17.122562408447, 7, 4);
      }
      if(PlayerToPoint(2.0,i,55.910453796387, 1974.9185791016, 16.650043487549))// Bomb 2
      {
        CreateExplosion(55.910453796387, 1974.9185791016, 16.650043487549, 7, 4);
      }
      if(PlayerToPoint(2.0,i,83.481628417969, 1920.892578125, 16.734594345093))// Bomb 3
      {
        CreateExplosion(35.212314605713, 1878.9379882813, 16.650043487549, 7, 4);
      }
      if(PlayerToPoint(2.0,i,35.212314605713, 1878.9379882813, 16.650043487549))// Bomb 4
      {
        CreateExplosion(91.631355285645, 1991.6337890625, 17.122562408447, 7, 4);
      }
      if(PlayerToPoint(2.0,i,6.7346382141113, 1960.7672119141, 16.650043487549))// Bomb 5
      {
        CreateExplosion(6.7346382141113, 1960.7672119141, 16.650043487549, 7, 4);
      }
      if(PlayerToPoint(2.0,i, 86.725624084473, 2020.4542236328, 16.853578567505))// Bomb 6
      {
        CreateExplosion( 86.725624084473, 2020.4542236328, 16.853578567505, 7, 4);
      }
      if(PlayerToPoint(2.0,i,62.491638183594, 1852.3330078125, 16.650043487549))// Bomb 7
      {
        CreateExplosion( 62.491638183594, 1852.3330078125, 16.650043487549, 7, 4);
      }
      if(PlayerToPoint(2.0,i,84.569557189941, 1885.6547851563, 16.708818435669))// Bomb 8
      {
        CreateExplosion(84.569557189941, 1885.6547851563, 16.708818435669, 7, 4);
      }
      if(PlayerToPoint(2.0,i,6.5193672180176, 1882.9143066406, 16.650043487549))// Bomb 9
      {
        CreateExplosion(6.5193672180176, 1882.9143066406, 16.650043487549, 7, 4);
      }
      if(PlayerToPoint(2.0,i,28.795841217041, 1982.9211425781, 16.650043487549))// Bomb 10
      {
        CreateExplosion(28.795841217041, 1982.9211425781, 16.650043487549, 7, 4);
      }
      if(PlayerToPoint(2.0,i,78.266075134277, 1950.1732177734, 16.650043487549))// Bomb 10
      {
        CreateExplosion(78.266075134277, 1950.1732177734, 16.650043487549, 7, 4);
      }
	}
  }
}
You need it on a timer.


Re: [HELP] Please. - Lynn09© - 16.12.2009

Then how would I make it to where, if they step there, it goes boom?
I want it to do it anytime they are there.


Re: [HELP] Please. - BP13 - 16.12.2009

Quote:
Originally Posted by Lynn09©
Then how would I make it to where, if they step there, it goes boom?
I want it to do it anytime they are there.
pawn Код:
#include <a_samp>

new Explosion;

public OnGameModeInit()
{
    Explosion = SetTimer("Bomb", 2000, 1);
    return 1;
}

foward Bomb(playerid);
public Bomb(playerid)
{
  for(new i = 0; i < MAX_PLAYERS; i++)
  {
    if(IsPlayerConnected(i))
    {
      if(PlayerToPoint(3.0,i,91.631355285645, 1991.6337890625, 17.122562408447))// Bomb 1
      {
        CreateExplosion(91.631355285645, 1991.6337890625, 17.122562408447, 7, 4);
      }
      if(PlayerToPoint(2.0,i,55.910453796387, 1974.9185791016, 16.650043487549))// Bomb 2
      {
        CreateExplosion(55.910453796387, 1974.9185791016, 16.650043487549, 7, 4);
      }
      if(PlayerToPoint(2.0,i,83.481628417969, 1920.892578125, 16.734594345093))// Bomb 3
      {
        CreateExplosion(35.212314605713, 1878.9379882813, 16.650043487549, 7, 4);
      }
      if(PlayerToPoint(2.0,i,35.212314605713, 1878.9379882813, 16.650043487549))// Bomb 4
      {
        CreateExplosion(91.631355285645, 1991.6337890625, 17.122562408447, 7, 4);
      }
      if(PlayerToPoint(2.0,i,6.7346382141113, 1960.7672119141, 16.650043487549))// Bomb 5
      {
        CreateExplosion(6.7346382141113, 1960.7672119141, 16.650043487549, 7, 4);
      }
      if(PlayerToPoint(2.0,i, 86.725624084473, 2020.4542236328, 16.853578567505))// Bomb 6
      {
        CreateExplosion( 86.725624084473, 2020.4542236328, 16.853578567505, 7, 4);
      }
      if(PlayerToPoint(2.0,i,62.491638183594, 1852.3330078125, 16.650043487549))// Bomb 7
      {
        CreateExplosion( 62.491638183594, 1852.3330078125, 16.650043487549, 7, 4);
      }
      if(PlayerToPoint(2.0,i,84.569557189941, 1885.6547851563, 16.708818435669))// Bomb 8
      {
        CreateExplosion(84.569557189941, 1885.6547851563, 16.708818435669, 7, 4);
      }
      if(PlayerToPoint(2.0,i,6.5193672180176, 1882.9143066406, 16.650043487549))// Bomb 9
      {
        CreateExplosion(6.5193672180176, 1882.9143066406, 16.650043487549, 7, 4);
      }
      if(PlayerToPoint(2.0,i,28.795841217041, 1982.9211425781, 16.650043487549))// Bomb 10
      {
        CreateExplosion(28.795841217041, 1982.9211425781, 16.650043487549, 7, 4);
      }
      if(PlayerToPoint(2.0,i,78.266075134277, 1950.1732177734, 16.650043487549))// Bomb 10
      {
        CreateExplosion(78.266075134277, 1950.1732177734, 16.650043487549, 7, 4);
      }
    }
  }
}

public OnGameModeExit()
{
    KillTimer(Bomb);
    return 1;
}



Re: [HELP] Please. - Lynn09© - 16.12.2009

Thanks, but its
KillTimer(Explosion);
:P


Re: [HELP] Please. - BP13 - 16.12.2009

Quote:
Originally Posted by Lynn09©
Thanks, but its
KillTimer(Explosion);
:P
oh whoops my bad. Glad you have it working.