Checking if bomb is already planted HELP PLEASE?
#1

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'
Reply
#2

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.");
Reply
#3

new BombPlanted;
//_______________________
On CMD
if (BombPlanted ==1)
{
SendMessage( Bomb Alredy Planted!"
}
else
{
Create Object...
BombPlanted == 1;
}
}

on detonation
{
CreateExplosion
BombPlanted == 0;
}
//_________________________________________
Reply
#4

This might work. Not sure. Havent tested it yet.

PHP код:
 new BombPlanted;
        if (
strcmp("/plantbomb"cmdtexttrue) == 0)
    {
        new 
Float:xFloat:yFloat:z;
        
GetPlayerPos(playeridxyz);
        if(
BombPlanted == 1) return SendClientMessage(playeridCOLOR_RED"<!>Bomb is already planted!");
        {
            
CreateObject(1252xyz0005);
        }
        return 
1;
    } 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)