Jump to content

help me to fix car shader script


darbka2002

Recommended Posts

    pjs = { 
    { car = 562, texture= "elegyrasta.png", shader= "texture.fx", num = 1, worldname = "elegy1body256", friendname = "Rasta Paintjob", owner = "darbka2002" }, 
    { car = 560, texture= "mah.png", shader= "texture.fx", num = 1, worldname = "sultan2body256", friendname = "Sultan Paintjob", owner = "mahmoudembaby", pj = 2 }, 
      
    }   
        addEvent("paintjob.SonApplyToAllServer", true ) 
        function applyitdude(val, player) 
            triggerClientEvent(root, "paintjob.onApplyToAllServer", root, val, player) 
    end 
        addEventHandler("paintjob.SonApplyToAllServer", root, applyitdude) 
            addEvent("paintjob.SunApplyToAllServer", true ) 
        function unapplyitdude(val, player) 
            triggerClientEvent(root, "paintjob.unApplyToAllServer", root, val, player) 
    end 
        addEventHandler("paintjob.SunApplyToAllServer", root, unapplyitdude) 
        
            function setpaintjob(plr,cmd,number) 
            if number then 
            for ind,val in ipairs(pjs) do 
            local pf = val.car..val.num 
                if getPedOccupiedVehicle(plr) and pf == getElementModel(getPedOccupiedVehicle(plr)..number and getElementModel(getPedOccupiedVehicle(plr)) == val.car and getAccountName(getPlayerAccount(plr)) == val.owner then 
                
                triggerEvent("paintjob.SonApplyToAllServer", plr, pf, getPedOccupiedVehicle(plr)) 
                car = getPedOccupiedVehicle(plr) 
                setVehiclePaintjob(car,2) 
                outputChatBox("You have enabled "..val.friendname,plr,255,255,255) 
                end 
            end 
        else 
        outputChatBox("Use /carshader 'Number'.") 
        end 
    addCommandHandler("carshader", setpaintjob) 

Should work now, and btw; If you are trying to combine two things use

thing1..thing2 

instead of

thing1..""..thing2 

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