s1mple Posted October 17, 2015 Share Posted October 17, 2015 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
Dealman Posted October 17, 2015 Share Posted October 17, 2015 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. Link to comment
s1mple Posted October 17, 2015 Author Share Posted October 17, 2015 its so fuking hard Link to comment
KariiiM Posted October 17, 2015 Share Posted October 17, 2015 its so fuking hard Store it in table , use insert.table on an empty table and loop the data by using ipairs or pairs Link to comment
HUNGRY:3 Posted October 17, 2015 Share Posted October 17, 2015 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
Aristates Posted October 17, 2015 Share Posted October 17, 2015 Just it Example Aristates = { "280", "281", "282", "283", "284" } function blahblah(player) setElementModel(player, math.random(#Aristates)) end addCommandHandler("duty",blahblah) Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now