ls-rp Posted October 13, 2013 Share Posted October 13, 2013 (edited) Lets start with Hello. My names Lewis and i require a bit of help on my script. I made a script but i am not sure if it requires something. As the GUI doesn't show up when i enter the Pay 'n' Spray shop. function startCount() mainWindow = guiCreateWindow(541, 563, 261, 82, "Repairing...", false) bar = guiCreateProgressBar(33, 55, 198, 16, false, mainWindow) label = guiCreateLabel(33, 21, 196, 29, "Replacing oil", false, mainWindow) setTimer(addCount, 1000, 50) end addEvent("startCount", true) addEventHandler("startCount", getRootElement(), startCount) function addCount() local theVehicle = getPedOccupiedVehicle (getLocalPlayer()) if isElement(mainWindow) then guiProgressBarSetProgress( bar, guiProgressBarGetProgress( bar ) + 4 ); if (guiProgressBarGetProgress(bar) == 20 ) then guiSetText(label, "Replacing tires") elseif (guiProgressBarGetProgress(bar) == 40 ) then guiSetText(label, "Clearing air duct") setVehicleWheelStates(theVehicle, 0, 0, 0, 0) elseif (guiProgressBarGetProgress(bar) == 60 ) then guiSetText(label, "Repairing Bodywork") elseif (guiProgressBarGetProgress(bar) == 80) then destroyElement(mainWindow) elseif (guiProgressBarGetProgress(bar) == 100) then guiSetText(label, "Touching up paint") end end end addEvent("addCount", true) addEventHandler("addCount", getRootElement(), addCount) function destroyElements() if isElement(mainWindow) then destroyElement(mainWindow) end end addEvent("destroyAll", true) addEventHandler("destroyAll", getRootElement(), destroyElements) I forgot to add this is the other half of it local file = xmlLoadFile("pns.xml") for k, v in ipairs(xmlNodeGetChildren(file)) do local pos = split(xmlNodeGetAttribute(v,"pos"),string.byte(",")) local marker = createMarker(pos[1],pos[2],pos[3],"cylinder") createBlipAttachedTo(marker,63,2,255,0,0,255,0,250) setElementData(marker,"pnsMarker",true) setGarageOpen(tonumber(xmlNodeGetAttribute(v,"garage")),true) end xmlUnloadFile(file) end addEventHandler("onResourceStart",getResourceRootElement(),startup) function payNSpray(hitElement) if (getElementData(source,"pnsMarker") == true) then if (getElementType(hitElement) == "vehicle") then if (getElementHealth(hitElement) < 1000) then if (getVehicleOccupant(hitElement)) then local driver = getVehicleOccupant(hitElement) local charge = math.floor(1000-getElementHealth(hitElement)) if (getPlayerMoney(driver) >= charge) then outputChatBox("Your vehicle has been repaired for $"..charge..".",driver,255,255,0) fixVehicle(hitElement) takePlayerMoney(driver,charge) for k, v in ipairs({"accelerate","enter_exit","handbrake"}) do toggleControl(driver,v,false) end setControlState(driver,"handbrake",true) fadeCamera(driver,false,1) setTimer(restoreControl,1000,1,driver) else local extraCost = math.floor(charge-getPlayerMoney(driver)) outputChatBox("You need an additional $"..extraCost.." for a repair.",driver,255,0,0) end end end end end end addEventHandler("onMarkerHit",getRootElement(),payNSpray) function restoreControl(driver) for k, v in ipairs({"accelerate","enter_exit","handbrake"}) do toggleControl(driver,v,true) end setControlState(driver,"handbrake",false) fadeCamera(driver,true) end Edited October 13, 2013 by Guest Link to comment
Castillo Posted October 13, 2013 Share Posted October 13, 2013 The server side is the same leaked code from valhalla, mint3d? Link to comment
ls-rp Posted October 13, 2013 Author Share Posted October 13, 2013 That Server side is not from Valhalla maybe take your time to read it and no I'm not mint3d i don't know who that is Link to comment
Castillo Posted October 13, 2013 Share Posted October 13, 2013 That server side script never triggers any client event. And yes, you are mint3d. Link to comment
ls-rp Posted October 13, 2013 Author Share Posted October 13, 2013 No I am not i am asking if i need to trigger a event because it doesn't show the GUI Link to comment
Castillo Posted October 13, 2013 Share Posted October 13, 2013 Same script as the one posted by mint3d, same IP. The server side script never triggers the client side events, there you got your problem. Link to comment
ls-rp Posted October 13, 2013 Author Share Posted October 13, 2013 Ok so how can i do that? what should i add to the server side and add to the client side? Link to comment
Atton Posted December 3, 2013 Share Posted December 3, 2013 The server side is the same leaked code from valhalla, mint3d? No one on earth cares. Link to comment
pa3ck Posted December 3, 2013 Share Posted December 3, 2013 The server side is the same leaked code from valhalla, mint3d? No one on earth cares. Because your not the one who wrote it. If you wrote a complete RP gamemode and some bastard leaked it, you would care, but you did not, you have nothing to worry about. Link to comment
glowdemon1 Posted December 3, 2013 Share Posted December 3, 2013 The server side is the same leaked code from valhalla, mint3d? No one on earth cares. It's because we don't offer support with leaked gamemodes. 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