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