stevensalvaro Posted February 23, 2016 Share Posted February 23, 2016 Hello, How to make my 'guiCreateStaticImage' disappear when i leave the pickup ? Server function carshop_pickupUse(thePlayer) local parentCar = getElementData(source, "carshop:parentCar") if parentCar and isElement(parentCar) then local costCar = getElementData(parentCar, "carshop:cost") local costTax = getElementData(parentCar, "carshop:taxcost") if costCar and costTax then triggerClientEvent(thePlayer, "carshop:showInfo", parentCar, costCar, costTax) end cancelEvent() end end addEventHandler("onPickupHit", getResourceRootElement(), carshop_pickupUse) Client function carshop_showInfo(carPrice, taxPrice) box = guiCreateStaticImage(120, 350, 150, 50, "mulai.png" , false, nil) end addEvent("carshop:showInfo", true) addEventHandler("carshop:showInfo", getRootElement(), carshop_showInfo) Link to comment
stevensalvaro Posted February 23, 2016 Author Share Posted February 23, 2016 May i must to make OnClientPickupLeave function to destroy the box ? Link to comment
Bonus Posted February 23, 2016 Share Posted February 23, 2016 There is no onPickupLeave. trigger the pickup too and create an addEventHandler with onClientEvent. There you can ask if the player is near the pickup (getElementDistanceBetweenPoints3D <= 3 should do it). If not, remove the eventhandler and destroy gui. Link to comment
KariiiM Posted February 23, 2016 Share Posted February 23, 2016 There's onClientPickupLeave --Client sided You can make a trigger to do that Link to comment
stevensalvaro Posted February 23, 2016 Author Share Posted February 23, 2016 ah nice , thanks for your tips Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now