SA-MP Forums Archive
Bomb code help - 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: Bomb code help (/showthread.php?tid=191238)



Bomb code help - blackwave - 18.11.2010

I have these:
Код:
new plantada[MAX_PLAYERS], detonada[MAX_PLAYERS]; // Plantada = planted | detonada = detoned
Код:
if(strcmp("/plant",cmdtext, true, 10) == 0)
	 {

	   if(plantada[playerid] == 0 && detonada[playerid] == 0)
	   {
       SendClientMessageToAll(0xFF000000, "The bomb has been planted");
	   plantada[playerid]=1;
	   }
	   else if(plantada[playerid] == 1)
	   {
	   SendClientMessage(playerid, 0xFF000000, "You cannot plant the bomb, cuz it's already planted");
	   }
	   return 1;
	 }
	 if(strcmp("/detone",cmdtext, true, 10) == 0)
	 {
	   if(detonada[playerid] == 0 && plantada[playerid] == 1)
	   {
		 CreateExplosion(getpos, 7, 100);
		 SendClientMessageToAll(0xFF000000, "The bomb has been detoned");
		 plantada[playerid]=0;
		 detonada[playerid]=1;
	   }
	   else if(plantada[playerid] == 0 && detonada[playerid] == 1)
	   {
		 SendClientMessage(playerid, 0xFF000000, "The bomb hasn't been planted yet");
	   }
	   return 1;
    }
I'd pretend to, when a player use /plant on a pos, such as 111, 111, 111 (example), and use /detone, it explodes on 111, 111, 111. Anyone help please


Re: Bomb code help - blackwave - 18.11.2010

Please help, Im waiting for over 4hours, time I was out. Everyone help everyone, except me =s


Re: Bomb code help - WillyP - 18.11.2010

Isn't that what it's supposed to do? :S

This forum requires that you wait 120 seconds between posts. Please try again in 71 seconds.


Re: Bomb code help - MadeMan - 18.11.2010

pawn Код:
new Float:BombPos[MAX_PLAYERS][3];
pawn Код:
if(strcmp("/plant",cmdtext, true) == 0)
{
    if(plantada[playerid] == 0 && detonada[playerid] == 0)
    {
        SendClientMessageToAll(0xFF000000, "The bomb has been planted");
        plantada[playerid]=1;
        GetPlayerPos(playerid, BombPos[playerid][0], BombPos[playerid][1], BombPos[playerid][2]);
    }
    else if(plantada[playerid] == 1)
    {
        SendClientMessage(playerid, 0xFF000000, "You cannot plant the bomb, cuz it's already planted");
    }
    return 1;
}

if(strcmp("/detone",cmdtext, true) == 0)
{
    if(detonada[playerid] == 0 && plantada[playerid] == 1)
    {
        CreateExplosion(BombPos[playerid][0], BombPos[playerid][1], BombPos[playerid][2], 7, 100);
        SendClientMessageToAll(0xFF000000, "The bomb has been detoned");
        plantada[playerid]=0;
        detonada[playerid]=1;
    }
    else if(plantada[playerid] == 0 && detonada[playerid] == 1)
    {
        SendClientMessage(playerid, 0xFF000000, "The bomb hasn't been planted yet");
    }
    return 1;
}



Re: Bomb code help - blackwave - 18.11.2010

Quote:
Originally Posted by MadeMan
Посмотреть сообщение
pawn Код:
new Float:BombPos[MAX_PLAYERS][3];
pawn Код:
if(strcmp("/plant",cmdtext, true) == 0)
{
    if(plantada[playerid] == 0 && detonada[playerid] == 0)
    {
        SendClientMessageToAll(0xFF000000, "The bomb has been planted");
        plantada[playerid]=1;
        GetPlayerPos(playerid, BombPos[playerid][0], BombPos[playerid][1], BombPos[playerid][2]);
    }
    else if(plantada[playerid] == 1)
    {
        SendClientMessage(playerid, 0xFF000000, "You cannot plant the bomb, cuz it's already planted");
    }
    return 1;
}

if(strcmp("/detone",cmdtext, true) == 0)
{
    if(detonada[playerid] == 0 && plantada[playerid] == 1)
    {
        CreateExplosion(BombPos[playerid][0], BombPos[playerid][1], BombPos[playerid][2], 7, 100);
        SendClientMessageToAll(0xFF000000, "The bomb has been detoned");
        plantada[playerid]=0;
        detonada[playerid]=1;
    }
    else if(plantada[playerid] == 0 && detonada[playerid] == 1)
    {
        SendClientMessage(playerid, 0xFF000000, "The bomb hasn't been planted yet");
    }
    return 1;
}
Thank you


Re: Bomb code help - dark_clown - 18.11.2010

u bumped >.> u shouldnt