ViniG Posted September 3, 2017 Share Posted September 3, 2017 Hi, I'm trying to get the player to push on a button and set a clothes for him, but of the error on line 3, can someone help me? tks function roupat () takePlayerMoney(root, 10) setPedClothes(player, 0, 11) end addEvent("roupa1", true) addEventHandler("roupa1", root, roupat) Link to comment
Gordon_G Posted September 3, 2017 Share Posted September 3, 2017 (edited) Huh, you can't use the takePlayerMoney with root as arg 1 This function is serversided ? Could you provide the entire code ? EDIT : setPedClothes is a useful function, have you added it ? Edited September 3, 2017 by Gordon_G 1 Link to comment
MrDante Posted September 3, 2017 Share Posted September 3, 2017 10 hours ago, ViniG said: Hi, I'm trying to get the player to push on a button and set a clothes for him, but of the error on line 3, can someone help me? tks function roupat () takePlayerMoney(root, 10) setPedClothes(player, 0, 11) end addEvent("roupa1", true) addEventHandler("roupa1", root, roupat) function setPedClothes(thePed, clothingSlot, clothingID) if not isElement(thePed) or type(clothingSlot) ~= "number" then error("Invalid arguments to setPedClothes()!", 2) end if not clothingID then return removePedClothes(thePed, clothingSlot) end local hasClothes = getPedClothes(thePed, clothingSlot) if hasClothes then removePedClothes(thePed, clothingSlot) end local texture, model = getClothesByTypeIndex(clothingSlot, clothingID) return addPedClothes(thePed, texture, model, clothingSlot) end function roupat () if (getPlayerMoney(source) >= 10) then takePlayerMoney(source, 10) setPedClothes(source, 0, 11) end end addEvent("roupa1", true) addEventHandler("roupa1", root, roupat) 1 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