Jump to content

setSkin command, need help creating it.


CSMajor

Recommended Posts

This should work

addCommandHandler( "setskin", 
    function( skin ) 
        skin = tonumber( skin ) 
        local oldSkin = getElementModel( source ) 
        if oldSkin == skin then 
            outputChatBox( name .. " is already using that skin.", source, 255, 255, 0 ) 
        elseif setElementModel( source, skin ) then 
            outputChatBox( "Set " .. name .. "'s skin to " .. skin, source, 0, 255, 153 ) 
        else 
            outputChatBox( "Skin " .. skin .. " is invalid.", source, 255, 0, 0 ) 
        end 
    end 
) 

Let me know if you have any problems.

Link to comment

I don't know where you got that from xUltimate, because it has many mistakes on it.

addCommandHandler( "setskin", 
    function(  player, cmd, skin ) 
        skin = tonumber( skin ) 
        local oldSkin = getElementModel( player ) 
        if oldSkin == skin then 
            outputChatBox( "You already using that skin.",  player, 255, 255, 0 ) 
        elseif setElementModel(  player, skin ) then 
            outputChatBox( "Skin changed to " .. skin,  player, 0, 255, 153 ) 
        else 
            outputChatBox( "Skin " .. skin .. " is invalid.",  player, 255, 0, 0 ) 
        end 
    end 
) 

this one works fine.

Edit: Oh, i see where you got that code from, mta paradise.

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