How to make a command that lets someone blowup a building
#1

I am making a CnR gamemode, and i need to know how to make a building "fall" to the ground.
The command is /blowup.

I really need help.

Thanks.
Reply
#2

You can't make buildings fall to ground though if it GTA SA buildings.
Reply
#3

No, i know you can use rotation to make it fall downwards... But i just dont know how to.
Reply
#4

Use RemoveBuildingForPlayer and remove the object and readd it afterwards
Now use SetObjectRot and SetObjectPos to blow it up within a timer which gets called by your command
Reply
#5

Quote:
Originally Posted by Nero_3D
Посмотреть сообщение
Use RemoveBuildingForPlayer and remove the object and readd it afterwards
Now use SetObjectRot and SetObjectPos to blow it up within a timer which gets called by your command
I dont understand it that much (sorry), can you please explain a little more?
Reply
#6

Also first use RemoveBuildingForPlayer to remove the original gta-sa object because we cant move or rotate it
Afterwards re add the object and save the objectid into a variable
Now you can move or rotate it with the function SetObjectPos and SetObjectRot
To let the "fall" look smooth you should use a timer which calls SetObjectPos and SetObjectRot repeatedly
This timer you start with your command
Reply
#7

How about creating a few HUGE explosions (https://sampwiki.blast.hk/wiki/CreateExplosion) at some parts of the building when someone types the command /blowup, then set a timer which remove that building (https://sampwiki.blast.hk/wiki/RemoveBuildingForPlayer(I can help ya if ya don't know how to remove it for all players)) a few seconds after the explosion. If you could do a merged script using my method ^ and Nero_3D's one it will be epic.
Reply
#8

How do you do it for all players?
And does set object rotation like "move" it to that rotation. And i mean like: it doesnt just dissapear and re-appear at the position you set?
Reply
#9

Quote:
Originally Posted by stormchaser206
Посмотреть сообщение
How do you do it for all players?
pawn Код:
for(new p = 0; p < MAX_PLAYERS; p++)
{
    if(IsPlayerConnected(p))
    {
        RemoveBuildingForPlayer(p, modelid, fX, fY, fZ, fRadius);
    }
}
Reply
#10

Bump - And would the rotation params of MoveObject work?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)