[M]ister Posted December 18, 2013 Posted December 18, 2013 Does anyone have a table with all the clothes cj?, I'll do a math random, and I'm too lazy to be adding all clothes in table, because there are many
myonlake Posted December 19, 2013 Posted December 19, 2013 You can use the getValidPedModels function to get all the valid ones.
TAPL Posted December 19, 2013 Posted December 19, 2013 You can use the getValidPedModels function to get all the valid ones. Did you realize that he ask for CJ clothes and not valid skins ids?
myonlake Posted December 19, 2013 Posted December 19, 2013 In that case this could do the trick. local clothesCJ = {[0]= 67,[1]=32,[2]=44,[3]=37,[4]=2,[5]=3,[6]=3,[7]=3,[8]=6,[9]=5,[10]=6,[11]=6,[12]=5,[13]=11,[14]=11,[15]=16,[16]=56,[17]=8} function getRandomClothes(clothesType) if (not clothesType) or (type(clothesType) ~= "number") or (not clothesCJ[clothesType]) then outputDebugString("Error in syntax!", 2) return false end math.randomseed(getTickCount()) return math.random(0, clothesCJ[clothesType]) end
Moderators IIYAMA Posted December 19, 2013 Moderators Posted December 19, 2013 You can try something like this. local myTable = {} for clothesType=0, 17 do local newTable = {} for clothesIndex=0,1000 do -- in case if there are 1001… local clothesTexture,model = getClothesByTypeIndex (clothesType, clothesIndex ) if clothesTexture and model then newTable[clothesIndex]={["clothesTexture"]=clothesTexture,["model"]=model} else break end end myTable[clothesType]= newTable end local clothesTexture = myTable[0][0]["clothesTexture"] local model = myTable[0][0]["model"] It is better to buffer the table first, but I am to lazy to do that.
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