I want to show just one non animate image, in the centre of screen, and full screen.
When I tested it, the prompts ("Press E To showed image" and "Press E To hide image") are showed with "E" pressed, but image does not.
local img_state = {}
function showimg_init(e)
LoadImages("test",0)
SetImagePosition(50,50)
img_state[e] = "hideimg"
end
function showimg_main(e)
PlayerDX = g_Entity[e]['x'] - g_PlayerPosX;
PlayerDY = g_Entity[e]['y'] - g_PlayerPosY;
PlayerDZ = g_Entity[e]['z'] - g_PlayerPosZ;
PlayerDist = math.sqrt(math.abs(PlayerDX^2)+math.abs(PlayerDY^2)+math.abs(PlayerDZ^2));
if PlayerDist < 100 then
if img_state[e] == "hideimg" then
Prompt ("Press E To showed image")
if g_KeyPressE == 1 then
ShowImage(0)
img_state[e] = "showed"
return
end
end -- img_state[e] == "hideimg"
end -- PlayerDist < 100
if img_state[e] == "showed" then
Prompt ("Press E To hide image")
if g_KeyPressE == 1 then
HideImage(0)
img_state[e] = "hideimg"
end
end --img_state[e] == "showed"
end -- function showimg
function showimg_exit(e)
end
What I am doing wrong?
What I've missing here?
Thanks in advance for all feedbacks.
3om
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz
OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics