Jump to content

Help


s1mple

Recommended Posts

local avaible_skin = { [280]=true, [281]=true, [282]=true, [283]=true, [284]=true } 
  
function blahblah(thePlayer,_,id) 
    if ( avaible_skin[tonumber(id)] ) then 
        setElementModel(thePlayer,id); 
        return true; 
    end 
    return false; 
end 
addCommandHandler("duty",blahblah) 

here is script, and i need help, anyone can make this script like this, if i wite duty, then i get duty skin, and i i write offduty then i get my old skin back? :) THANKS

Link to comment

Could always try to do it yourself ;)

Since you want it to revert to the old skin ID when you go off-duty, you'll need to define a variable where you would store this ID. getElementModel should return the current skin ID.

So when someone goes on-duty, you would store their current skin before setting the new one. And when they later go off-duty, you set their skin ID to their old one again - which you have conveniently stored in a variable. :D

Link to comment
  
local avaible_skin = { [280]=true, [281]=true, [282]=true, [283]=true, [284]=true } 
  
function blahblah(thePlayer,_,id) 
    if ( avaible_skin[tonumber(id)] ) then 
        setElementData(thePlayer, "normalSkin",getElementModel(thePlayer)) 
        setElementModel(thePlayer,id); 
        return true; 
    end 
    return false; 
end 
addCommandHandler("duty",blahblah) 
  
function offduty(thePlayer) 
setElementModel(thePlayer,getElementData(thePlayer,"normalSkin")) 
end 
addCommandHandler("offduty",offduty) 

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