Jump to content

Flying image


Recommended Posts

Posted

function showClientImage()
 
k1=guiCreateStaticImage( 0, 544, 500, 100, "winner.png", false )
end
addEventHandler( "onClientResourceStart", getResourceRootElement( getThisResource() ), showClientImage )
 
move1_1 ()
end
addEventHandler ( "onResourceStart", getRootElement(), recourse_says_hai )
 
function move1_1 ()
moveObject ( k1, 5000, 780, 544,  )
setTimer ( move1_2, 5000, 1 )
end

i want that the image fly from right to left why it dont work

Posted

image is not an object!

its gui element..

you have no idea about it.. re-read everything

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted

billboard, lol, he wants a gui element, not object..

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted

I hope i can :mrgreen:

You should use DirectX Pictures because its difficult moving GUI Images.

This example should work.

And btw. you should work with guiSetPosition instead of setElementPosition

/movepic

local k1= {}
k1["xPos"] = 0  -- Startposition of the Picture
k1["EventAdded"] = 0
k1["Picspeed"] = 1 -- The Speed of the Moving Picture
k1["Picture"] = "winner.png" -- Filename
k1["screenWidth"], k1["screenHeight"] = guiGetScreenSize()
 
function moveClientImage(filename)
if k1["EventAdded"] == 0 then
addEventHandler ( "onClientRender", getRootElement(), moveClientImage )
         k1["EventAdded"] = 1
end
    k1["xPos"] = k1["xPos"] + k1["Picspeed"]
    k1["image"] = dxDrawImage( k1["xPos"], 544, 500, 100, filename )
if  k1["xPos"] > k1["screenWidth"] then
         k1["xPos"] = 0
         k1["EventAdded"] = 0
removeEventHandler ( "onClientRender", getRootElement(), moveClientImage )
end
end
 
function cmdMoveClientImage(cmd, speed)
if speed then
if tonumber(speed) > 0 then
                k1["Picspeed"] = tonumber(speed)
else
return outputChatBox("Please use a Speed over 0. Syntax: /movepic ")
end
end
outputChatBox("Moving Picture '"..k1["Picture"].."' with "..speed.."/Frame per Second !")
    moveClientImage(k1["Picture"])
end
addCommandHandler("movepic", cmdMoveClientImage)

edit a billboard with youre image and everything will be ok : )

kevin11 stop talking bull sh it you f*cking nolifer

Stats_Signature.php?name=Jason_Gregory
Contact me if you need a Website / Signature ↑ / Mapuploadsystem

(HTML5, JS, PHP, ASP.NET, MySQL / Sybase)

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...