Tokio

[HELP] How to fix this?

Recommended Posts

vas1 = createObject ( 3529, -2112.55103, -249.87376, 35.32031, 0, 0, 0 )

function repairClickedVehicle( button, state, player )
    if button == "left" and state == "down" then
        if getElementType( source ) == "object" then
			destroyElement(vas1)
        end
    end
end
addEventHandler( "onElementClicked", getRootElement( ), repairClickedVehicle ) 

This working fine... but when i reconnect, the object appear again.. how to fix this?

Share this post


Link to post

You should use onPlayerQuit then use if isElement(vas1) then destroyElements(vas1)

and 

addEventHandler("onResourceStart", resourceRootElement(getThisResource()), function()

vas1 = createObject ( 3529, -2112.55103, -249.87376, 35.32031, 0, 0, 0 )

end)

 

Edited by TheMOG
  • Thanks 1

Share this post


Link to post
6 minutes ago, TheMOG said:

You should use onPlayerQuit then use if isElement(vas1) then destroyElements(vas1)

thaanks :D

Share this post


Link to post

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.