Checking if bomb is already planted 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)
+--- Thread: Checking if bomb is already planted HELP PLEASE? (
/showthread.php?tid=282223)
Checking if bomb is already planted HELP PLEASE? -
BigAl - 10.09.2011
Hello and I have this gamemode that is Mafia VS Police. Mafia have to plant bomb in the police station... How do i check if the bomb is already planted? so that if it's planted, and someone else tries to plant it, i want it to say 'you can't plant the bomb, it's already planted'
Re: Checking if bomb is already planted HELP PLEASE? -
iPLEOMAX - 10.09.2011
How about making a new variable for that?
pawn Код:
//On top of script:
new bool:BombPlanted;
//Somewhere when the bomb is planted:
BombPlanted = true;
//Somehwre when the bomb is destroyed:
BombPlanted = false;
//When someone is trying to plant it:
if(BombPlanted) return SendClientMessage(playerid, 0xFF0000FF, "Sorry, the bomb is already planted.");
Re: Checking if bomb is already planted HELP PLEASE? -
Dylan_Madigan69 - 08.02.2012
new BombPlanted;
//_______________________
On CMD
if (BombPlanted ==1)
{
SendMessage( Bomb Alredy Planted!"
}
else
{
Create Object...
BombPlanted == 1;
}
}
on detonation
{
CreateExplosion
BombPlanted == 0;
}
//_________________________________________
Re: Checking if bomb is already planted HELP PLEASE? -
Twinki1993 - 09.02.2012
This might work. Not sure. Havent tested it yet.
PHP код:
new BombPlanted;
if (strcmp("/plantbomb", cmdtext, true) == 0)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
if(BombPlanted == 1) return SendClientMessage(playerid, COLOR_RED, "<!>Bomb is already planted!");
{
CreateObject(1252, x, y, z, 0, 0, 0, 5);
}
return 1;
}