Jump to content

Private skin


kewiiNNN

Recommended Posts

I made private car script so only i can enter the car how to make about the skin?

lua for private car

function enterVehicle (player, seat, jacked) 
    local accName = getAccountName ( getPlayerAccount ( player ) ) 
    if not isObjectInACLGroup("user."..accName, aclGetGroup ( "Owner" )) and getElementModel(source) == 411 then 
    cancelEvent() 
        outputChatBox ( "[ERROR] *You're not a OWNER of this server!", player ) 
    end 
end 
addEventHandler ( "onVehicleStartEnter", getRootElement(), enterVehicle ) 

Link to comment

Skin for Car or Ped ?

You can use this:

CLIENT

local firewall = { 
    "SERIAL", 
    "SERIAL2" 
} 
  
addEventHandler("onClientResourceStart", resourceRoot, function() 
    local serial = getPlayerSerial(); 
    for _,v in ipairs(firewall) do 
        if (serial == v) then 
            --ApplyTheSkinNow 
        end 
    end 
end); 

Link to comment
Skin for Car or Ped ?

You can use this:

CLIENT

local firewall = { 
    "SERIAL", 
    "SERIAL2" 
} 
  
addEventHandler("onClientResourceStart", resourceRoot, function() 
    local serial = getPlayerSerial(); 
    for _,v in ipairs(firewall) do 
        if (serial == v) then 
            --ApplyTheSkinNow 
        end 
    end 
end); 

I think he should use usernames but not serials on this one

Link to comment
Skin for Car or Ped ?

You can use this:

CLIENT

local firewall = { 
    "SERIAL", 
    "SERIAL2" 
} 
  
addEventHandler("onClientResourceStart", resourceRoot, function() 
    local serial = getPlayerSerial(); 
    for _,v in ipairs(firewall) do 
        if (serial == v) then 
            --ApplyTheSkinNow 
        end 
    end 
end); 

I think he should use usernames but not serials on this one

Yes but username will be a bit harder.

  • Like 1
Link to comment
addEventHandler ( "onElementModelChange", root, 
    function ( oldModel ) 
        if getElementType ( source ) == "player" then 
            if not isObjectInACLGroup( "user."..getAccountName ( getPlayerAccount ( source ) ), aclGetGroup ( "Owner" ) ) then 
                if getElementModel ( source ) == SKIN_ID_HERE then 
                    outputChatBox ( "Only the server owners can use this skin", source, 255, 0, 0 ); 
                     
                    -- for some reason using setElementModel without a timer doesn't set the skin 
                    setTimer (  
                        function(p) 
                            setElementModel ( p, oldModel ); 
                        end 
                    , 100, 1, source ); 
                end 
            end 
        end 
    end 
); 

don't forget to change SKIN_ID_HERE.

Link to comment
Skin for Car or Ped ?

You can use this:

CLIENT

local firewall = { 
    "SERIAL", 
    "SERIAL2" 
} 
  
addEventHandler("onClientResourceStart", resourceRoot, function() 
    local serial = getPlayerSerial(); 
    for _,v in ipairs(firewall) do 
        if (serial == v) then 
            --ApplyTheSkinNow 
        end 
    end 
end); 

I think he should use usernames but not serials on this one

Yes but username will be a bit harder.

If he use serial instead of username the players will not be able to get in their car if they use a new computer

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