Jump to content

Replacing a skin with a command!


Chris!i!

Recommended Posts

Server Side

addEvent('militarySkin',true) 
addCommandHandler("boulaskin", root, 
function() 
  txd = engineLoadTXD("wmyclot.txd", 204) 
  engineImportTXD(txd, 204) 
  dff = engineLoadDFF("wmyclot.dff", 204 ) 
  engineReplaceModel(dff, 204) 
    local account = getAccountName(getPlayerAccount(source)) 
    if isObjectInACLGroup("user." .. account, aclGetGroup("Boula")) then 
        setElementModel(player, 204) 
        outputChatBox("HOTTAT SKINTAK YA charbel ya noob ya djeje ya tekkeye", player, 0, 255, 0, false) 
            else 
        outputChatBox("It must be your skin to use this command!", player, 255, 0, 0, false) 
      end 
end 
) 

function replaceModel()  
  txd = engineLoadTXD("a.txd", 9) 
  engineImportTXD(txd, 9) 
  dff = engineLoadDFF("a.dff", 9 ) 
  engineReplaceModel(dff, 9) 
end 
addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceModel) 
  
function replaceModel2()  
  txd = engineLoadTXD("a2.txd", 10) 
  engineImportTXD(txd, 10) 
  dff = engineLoadDFF("a2.dff", 10 ) 
  engineReplaceModel(dff, 10) 
end 
addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceModel2) 
  
function replaceModel3()  
  txd = engineLoadTXD("a3.txd", 12) 
  engineImportTXD(txd, 12) 
  dff = engineLoadDFF("a3.dff", 12 ) 
  engineReplaceModel(dff, 12) 
end 
addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceModel3) 
  
function replaceModel4()  
  txd = engineLoadTXD("prokiller.txd", 31) 
  engineImportTXD(txd, 31) 
  dff = engineLoadDFF("prokiller.dff", 31 ) 
  engineReplaceModel(dff, 31) 
end 
addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceModel4) 
  
triggerServerEvent('militarySkin',localPlayer) 

I know it's over false, but atleast i tried and more than 3 ways i tried, i only need when using this command boulaskin, to change his skin to 204, and then apply the Dff and TXD please help tried 3+ ways no shit worked 1%

Link to comment

Try this:

-- server-side 
addCommandHandler( "boulaskin", 
function ( sourcePlayer ) 
    local account = getAccountName(getPlayerAccount(sourcePlayer)) 
    if isObjectInACLGroup("user." .. account, aclGetGroup("Boula")) then 
        setElementModel(sourcePlayer, 204) 
        setTimer(triggerClientEvent, 50, 1, sourcePlayer, "onRequestChangeTexture", sourcePlayer) 
        outputChatBox("HOTTAT SKINTAK YA charbel ya noob ya djeje ya tekkeye", sourcePlayer, 0, 255, 0, false) 
    else 
        outputChatBox("It must be your skin to use this command!", sourcePlayer, 255, 0, 0, false) 
    end 
end 
) 

-- client-side 
addEvent("onRequestChangeTexture", true) 
addEventHandler( "onRequestChangeTexture", root, 
    function() 
        engineImportTXD( engineLoadTXD("wmyclot.txd"), 204 ) 
        engineReplaceModel( engineLoadDFF("wmyclot.dff"), 204 ) 
    end 
) 

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