Jump to content

[HELP] Clothes


ViniG

Recommended Posts

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

 

  • Thanks 1
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...