Jump to content

I require assistance please


ls-rp

Recommended Posts

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 by Guest
Link to comment
  • 1 month later...
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

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...