Bomb help sricpt -
GTA-Roleplay - 03.09.2011
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.");
}
}
}
Re: Bomb help sricpt -
GTA-Roleplay - 03.09.2011
plox help me
Re: Bomb help sricpt -
BlackWolf120 - 03.09.2011
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.
Re: Bomb help sricpt -
GTA-Roleplay - 03.09.2011
this happend and not more :S
Re: Bomb help sricpt -
GTA-Roleplay - 03.09.2011
yes that i mean DestroyObject not work
Re: Bomb help sricpt -
BlackWolf120 - 03.09.2011
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.
Re: Bomb help sricpt -
GTA-Roleplay - 03.09.2011
here
Код:
dooratbank = CreateObject(2634,1459.93823242,-1742.63354492,721.84729004,0.00000000,0.00000000,180.00000000); //object(ab_vaultdoor) (1)
Re: Bomb help sricpt -
Mauzen - 03.09.2011
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.
Re: Bomb help sricpt -
BlackWolf120 - 03.09.2011
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]);
Re: Bomb help sricpt -
ModianO - 03.09.2011
Thnx for helping us out... we will try it.