Bomb help sricpt
#1

Hey i did bomb system but when i do /plantbomb the door not blowup code here


Код:
	}
	
	if(strcmp(cmd, "/buybomb", true) == 0)
	{
	    if (IsPlayerInRangeOfPoint(playerid, 1, 1857.8447,-1848.9974,13.5808))
	    {
	        PlayerInfo[playerid][pBomb] = 1;
	        SendClientMessage(playerid, COLOR_LIGHTBLUE, "You bought a bomb for $5,000.");
	        SafeGivePlayerMoney(playerid, -5000);
	        return 1;
	    }
	}
	
	if(strcmp(cmd, "/plantbomb", true) == 0)
	{
	    if (IsPlayerInRangeOfPoint(playerid, 1, 1459.8588,-1743.1594,721.2321))
	    {
	        if(PlayerInfo[playerid][pBomb] >= 1)
	        {
	            SendClientMessage(playerid, COLOR_LIGHTRED, "You planted the bomb the door will explode shortly");
			 	DestroyPlayerObject(playerid, dooratbank);
	            LoopingAnim(playerid, "BOMBER","BOM_Plant_Loop",4.0,1,0,0,1,0);
			}
			else
			{
				SendClientMessage(playerid, COLOR_CREAM, "You don't have a bomb.");
			}
		}
	}
Reply
#2

plox help me
Reply
#3

mhh, what does it say?
Is the other code executed?
Or does only the DestroyObject not work?

You can also print(); certain script parts so u know what is exectued or where it stops to work.
Reply
#4


this happend and not more :S
Reply
#5

yes that i mean DestroyObject not work
Reply
#6

do this to fix the server unknown cmd message.

pawn Код:
if(strcmp(cmd, "/plantbomb", true) == 0)
    {
        if (IsPlayerInRangeOfPoint(playerid, 1, 1459.8588,-1743.1594,721.2321))
        {
            if(PlayerInfo[playerid][pBomb] >= 1)
            {
                SendClientMessage(playerid, COLOR_LIGHTRED, "You planted the bomb the door will explode shortly");
                DestroyPlayerObject(playerid, dooratbank);
                LoopingAnim(playerid, "BOMBER","BOM_Plant_Loop",4.0,1,0,0,1,0);
            }
            else
            {
                SendClientMessage(playerid, COLOR_CREAM, "You don't have a bomb.");
            }
        }
        return 1; //here
    }
How did u create the object? Can u show me that part pls.
Reply
#7

here
Код:
dooratbank = CreateObject(2634,1459.93823242,-1742.63354492,721.84729004,0.00000000,0.00000000,180.00000000); //object(ab_vaultdoor) (1)
Reply
#8

It has to be a playerobject if you want to destroy a playerobject in /plantbomb
Global objects created with CreateObject can only be destroyed with DestroyObject.
Reply
#9

like mauzen said...

pawn Код:
new dooratbank[MAX_PLAYERS];

dooratbank[playerid]=CreatePlayerObject(playerid, modelid, Float:X, Float:Y, Float:Z, Float:rX, Float:rY, Float:rZ)

DestroyPlayerObject(playerid,dooratbank[playerid]);
Reply
#10

Thnx for helping us out... we will try it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)