FelipeMallmann Posted January 25, 2015 Share Posted January 25, 2015 Hello guys, can someone help me? my doubt is how to make this command just work one time, I mean, when the object is already created it should be impossible to create another, but when it explode you should be able to create again function createBarrier(thePlayer) local x, y, z = getElementPosition(thePlayer) barrierObject = createObject(1225, x-1, y, z-0.6) if (isPedInVehicle(thePlayer)) then end end addCommandHandler("explosivo", createBarrier) function deleteBarrier(thePlayer) if (isElement(barrierObject)) then destroyElement(barrierObject) else outputChatBox("Nao existe nenhum explosivo criado!", thePlayer, 250, 0, 0) end end addCommandHandler("removerexplosivo", deleteBarrier) Link to comment
Et-win Posted January 25, 2015 Share Posted January 25, 2015 local blockCreate = false function createBarrier(thePlayer) if (blockCreate ~= true) then local x, y, z = getElementPosition(thePlayer) barrierObject = createObject(1225, x-1, y, z-0.6) if (barrierObject ~= false) then blockCreate = true end if (isPedInVehicle(thePlayer)) then end else outputChatBox("Creating barrier blocked, delete your existing one first.") end end addCommandHandler("explosivo", createBarrier) function deleteBarrier(thePlayer) if (isElement(barrierObject)) then destroyElement(barrierObject) blockCreate = false else outputChatBox("Nao existe nenhum explosivo criado!", thePlayer, 250, 0, 0) end end addCommandHandler("removerexplosivo", deleteBarrier) Link to comment
FelipeMallmann Posted January 25, 2015 Author Share Posted January 25, 2015 It worked, but not how it should because it's not a barreir, it's a barrel explosive. I can just create another if I remove the first one I created, but when I shoot the barrel (it explodes) I can't create again, I need to use /remove to be able to to that. And how to turn this just to admin use? thanks Link to comment
Et-win Posted January 25, 2015 Share Posted January 25, 2015 https://wiki.multitheftauto.com/wiki/OnClientExplosion Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now