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); } } } }
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); } } } } |
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. |
#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;
}
Originally Posted by Lynn09©
Thanks, but its
KillTimer(Explosion); :P |