Bully-Board
Bully Modding Section => Modding Questions/Help => Topic started by: Ming on April 12, 2022, 10:34:43 PM
-
FPS6 = function()
while true do
local HX, HY, HZ = PedGetHeadPos(gPlayer)
local Heading = PedGetHeading(gPlayer)
local DeltaX = -math.sin(Heading)
local DeltaY = math.cos(Heading)
if math.deg(Heading) > 0 then
Rotation = math.deg(Heading) - 180
else
Rotation = math.deg(Heading) + 179.99
end
Qiang = CreatePersistentEntity("WPCannon", HX + DeltaX, HY + DeltaY, HZ - 0.5, Rotation, AreaGetVisible())
DeletePersistentEntity(Qiang)
Wait(0)
end
end
Why DeletePersistentEntity(Qiang) not work, it will be a lot of cannon and game crash
-
CreatePersistentEntity returns 2 value, the object index & the object itself/type/geometry(or something like that), so it must have 2 variable that assign to this function, example:
local objIdx, obj = CreatePersistentEntity(bla, bla, ...)
DeletePersistentEntity also takes 2 arguments, example:
DeletePersistentEntity(objIdx, obj)
You can see the usage of those functions in decompiled 1_06_01.lur.
-
CreatePersistentEntity returns 2 value, the object index & the object itself/type/geometry(or something like that), so it must have 2 variable that assign to this function, example:
local objIdx, obj = CreatePersistentEntity(bla, bla, ...)
DeletePersistentEntity also takes 2 arguments, example:
DeletePersistentEntity(objIdx, obj)
You can see the usage of those functions in decompiled 1_06_01.lur.
Get it !