Jump to content

Setar mascara Por Id


Recommended Posts

Olá, eu tenho esse sistema de mascaras! mas ele está por painel gui alguem poderia me ajudar a fazer o player setar a mascara por id? exemplo "/mask 1" Obrigado :D❤️

 

 

maskTable = {}
yelekTable = {}

yelekTable["yelek1"] = {1922, 3, 90}
yelekTable["yelek2"] = {1923, 3, 90}
yelekTable["yelek3"] = {1924, 3, 90}

maskTable["devil"] = {1512, 1, 90}
maskTable["vendetta"] = {1455, 1, 90}
maskTable["darth"] = {1484, 1, 90}
maskTable["horse"] = {1485, 1, 90}
maskTable["gasmask"] = {1487, 1, 90}
maskTable["kovboy"] = {1543, 1, 90}
maskTable["zombie"] = {1544, 1, 90}
maskTable["vampire"] = {1666, 1, 90}
maskTable["skull"] = {1667, 1, 90}
maskTable["raccoon"] = {1668, 1, 180}
maskTable["owl"] = {1950, 1, 180}
maskTable["cat"] = {1951, 1, 180}
maskTable["bag"] = {1551, 1, 90}
maskTable["dog"] = {1546, 1, 90}
maskTable["baby"] = {1669, 1, 90}
maskTable["monster"] = {1853, 1, 90}
maskTable["tilki"] = {1854, 1, 90}
maskTable["admin"] = {1855, 1, 180}
obje = {}
yelek = {}

function maske_kaldir()
		if obje[source] then
		destroyElement(obje[source])

		end
end
addEvent("removemask",true)
addEventHandler("removemask", root, maske_kaldir)

function maske_ekle(name)
if name == "admin" then
if ( hasObjectPermissionTo ( source, "function.kickPlayer" ) ) then
		if obje[source] then
		destroyElement(obje[source])
		end
local objeid = maskTable[name][1]
local bodyattach = maskTable[name][2]
local zROT = maskTable[name][3]
obje[source] = createObject ( objeid, 0, 0, 0, 0, 0, 0 )
exports.bone_attach:attachElementToBone(obje[source],source,bodyattach,0,0.02,-0.61,0,0,zROT)
else
outputChatBox("Bu maskeyi sadece adminler kullanabilir", source, 255, 0, 0)
end
elseif name == "horse" then
		if obje[source] then
		destroyElement(obje[source])
		end
local objeid = maskTable[name][1]
local bodyattach = maskTable[name][2]
local zROT = maskTable[name][3]
obje[source] = createObject ( objeid, 0, 0, 0, 0, 0, 0 )
exports.bone_attach:attachElementToBone(obje[source],source,bodyattach,-0.04,0,-0.55,0,0,zROT)
else
		if obje[source] then
		destroyElement(obje[source])
		end
local objeid = maskTable[name][1]
local bodyattach = maskTable[name][2]
local zROT = maskTable[name][3]
obje[source] = createObject ( objeid, 0, 0, 0, 0, 0, 0 )
exports.bone_attach:attachElementToBone(obje[source],source,bodyattach,0,0,-0.61,0,0,zROT)
end
end
addEvent("setmask",true)
addCommandHandler("mask", maske_ekle, objeid)
addEventHandler("setmask", root, maske_ekle)


function quitPlayer (  )
			if obje[source] then
		destroyElement(obje[source])
		end
		if yelek[source] then
		destroyElement(yelek[source])
		end
end
addEventHandler ( "onPlayerQuit", getRootElement(), quitPlayer )

 

Link to comment
  • Moderators

De onde você pegou esse código?

Edit: O resource é este: https://community.multitheftauto.com/index.php?p=resources&s=details&id=14125

Neste caso não há nenhum problema.

Quanto à sua pergunta, você pode usar tabela com os nomes das máscaras e obtê-las com o índice da tabela. Exemplo:
 

mascaras = { "devil" }

local id = 1

maskTable[ mascaras[id] ]

 

Edited by DNL291
Link to comment
3 hours ago, DNL291 said:

De onde você pegou esse código?

Edit: O resource é este: https://community.multitheftauto.com/index.php?p=resources&s=details&id=14125

Neste caso não há nenhum problema.

Quanto à sua pergunta, você pode usar usa tabela com os nomes das máscaras e obtê-las com o índice da tabela. Exemplo:
 


mascaras = { "devil" }local id = 1maskTable[ mascaras[id] ]

 

Sim mas eu digo por comando como poderia dar um comando para o scripts funcionar

 

Link to comment
  • Moderators

Tente isto (não testado) :

local mascaras = {
	"devil","vendetta","darth","horse","gasmask","kovboy","zombie","vampire",
	"skull","raccoon","owl", "cat","bag","dog","baby","monster","tilki","admin"
}

maskTable = {}
yelekTable = {}

yelekTable["yelek1"] = {1922, 3, 90}
yelekTable["yelek2"] = {1923, 3, 90}
yelekTable["yelek3"] = {1924, 3, 90}

maskTable["devil"] = {1512, 1, 90}
maskTable["vendetta"] = {1455, 1, 90}
maskTable["darth"] = {1484, 1, 90}
maskTable["horse"] = {1485, 1, 90}
maskTable["gasmask"] = {1487, 1, 90}
maskTable["kovboy"] = {1543, 1, 90}
maskTable["zombie"] = {1544, 1, 90}
maskTable["vampire"] = {1666, 1, 90}
maskTable["skull"] = {1667, 1, 90}
maskTable["raccoon"] = {1668, 1, 180}
maskTable["owl"] = {1950, 1, 180}
maskTable["cat"] = {1951, 1, 180}
maskTable["bag"] = {1551, 1, 90}
maskTable["dog"] = {1546, 1, 90}
maskTable["baby"] = {1669, 1, 90}
maskTable["monster"] = {1853, 1, 90}
maskTable["tilki"] = {1854, 1, 90}
maskTable["admin"] = {1855, 1, 180}
obje = {}
yelek = {}

addCommandHandler( "setmask",
	function ( player, cmd, id)
		local name
		if id and mascaras[tonumber(id)] then
      		id = tonumber(id)
			name = mascaras[id]
		else
			return outputChatBox("[setmask] Sintaxe: /setmask [id]", player, 255, 0, 0)
		end
		
		if id == #mascaras then
			if ( hasObjectPermissionTo ( player, "function.kickPlayer" ) ) then
				if obje[player] then
					destroyElement(obje[player])
				end
				local objeid = maskTable[name][1]
				local bodyattach = maskTable[name][2]
				local zROT = maskTable[name][3]
				obje[player] = createObject ( objeid, 0, 0, 0, 0, 0, 0 )
				exports.bone_attach:attachElementToBone(obje[player],player,bodyattach,0,0.02,-0.61,0,0,zROT)
			else
				outputChatBox("Bu maskeyi sadece adminler kullanabilir", player, 255, 0, 0)
			end
		elseif id == 4 then
			if obje[player] then
				destroyElement(obje[player])
			end
			local objeid = maskTable[name][1]
			local bodyattach = maskTable[name][2]
			local zROT = maskTable[name][3]
			obje[player] = createObject ( objeid, 0, 0, 0, 0, 0, 0 )
			exports.bone_attach:attachElementToBone(obje[player],player,bodyattach,-0.04,0,-0.55,0,0,zROT)
		else
			if obje[player] then
				destroyElement(obje[player])
			end
			local objeid = maskTable[name][1]
			local bodyattach = maskTable[name][2]
			local zROT = maskTable[name][3]
			obje[player] = createObject ( objeid, 0, 0, 0, 0, 0, 0 )
			exports.bone_attach:attachElementToBone(obje[player],player,bodyattach,0,0,-0.61,0,0,zROT)
		end
	end, false, false
)

function maske_kaldir()
	if obje[source] then
		destroyElement(obje[source])
	end
end
addEvent("removemask",true)
addEventHandler("removemask", root, maske_kaldir)

function quitPlayer (  )
	if obje[source] then
		destroyElement(obje[source])
		obje[source] = nil
	end
	if yelek[source] then
		destroyElement(yelek[source])
		yelek[source] = nil
	end
end
addEventHandler ( "onPlayerQuit", getRootElement(), quitPlayer )

 

Edited by DNL291
Link to comment
3 hours ago, DNL291 said:

Tente isto (não testado) :


local mascaras = {
	"devil","vendetta","darth","horse","gasmask","kovboy","zombie","vampire",
	"skull","raccoon","owl", "cat","bag","dog","baby","monster","tilki","admin"
}

maskTable = {}
yelekTable = {}

yelekTable["yelek1"] = {1922, 3, 90}
yelekTable["yelek2"] = {1923, 3, 90}
yelekTable["yelek3"] = {1924, 3, 90}

maskTable["devil"] = {1512, 1, 90}
maskTable["vendetta"] = {1455, 1, 90}
maskTable["darth"] = {1484, 1, 90}
maskTable["horse"] = {1485, 1, 90}
maskTable["gasmask"] = {1487, 1, 90}
maskTable["kovboy"] = {1543, 1, 90}
maskTable["zombie"] = {1544, 1, 90}
maskTable["vampire"] = {1666, 1, 90}
maskTable["skull"] = {1667, 1, 90}
maskTable["raccoon"] = {1668, 1, 180}
maskTable["owl"] = {1950, 1, 180}
maskTable["cat"] = {1951, 1, 180}
maskTable["bag"] = {1551, 1, 90}
maskTable["dog"] = {1546, 1, 90}
maskTable["baby"] = {1669, 1, 90}
maskTable["monster"] = {1853, 1, 90}
maskTable["tilki"] = {1854, 1, 90}
maskTable["admin"] = {1855, 1, 180}
obje = {}
yelek = {}

addCommandHandler( "setmask",
	function ( player, cmd, id)
		local name
		if id and mascaras[tonumber(id)] then
      		id = tonumber(id)
			name = mascaras[id]
		else
			return outputChatBox("[setmask] Sintaxe: /setmask [id]", player, 255, 0, 0)
		end
		
		if id == #mascaras then
			if ( hasObjectPermissionTo ( player, "function.kickPlayer" ) ) then
				if obje[player] then
					destroyElement(obje[player])
				end
				local objeid = maskTable[name][1]
				local bodyattach = maskTable[name][2]
				local zROT = maskTable[name][3]
				obje[player] = createObject ( objeid, 0, 0, 0, 0, 0, 0 )
				exports.bone_attach:attachElementToBone(obje[player],player,bodyattach,0,0.02,-0.61,0,0,zROT)
			else
				outputChatBox("Bu maskeyi sadece adminler kullanabilir", player, 255, 0, 0)
			end
		elseif id == 4 then
			if obje[player] then
				destroyElement(obje[player])
			end
			local objeid = maskTable[name][1]
			local bodyattach = maskTable[name][2]
			local zROT = maskTable[name][3]
			obje[player] = createObject ( objeid, 0, 0, 0, 0, 0, 0 )
			exports.bone_attach:attachElementToBone(obje[player],player,bodyattach,-0.04,0,-0.55,0,0,zROT)
		else
			if obje[player] then
				destroyElement(obje[player])
			end
			local objeid = maskTable[name][1]
			local bodyattach = maskTable[name][2]
			local zROT = maskTable[name][3]
			obje[player] = createObject ( objeid, 0, 0, 0, 0, 0, 0 )
			exports.bone_attach:attachElementToBone(obje[player],player,bodyattach,0,0,-0.61,0,0,zROT)
		end
	end, false, false
)

function maske_kaldir()
	if obje[source] then
		destroyElement(obje[source])
	end
end
addEvent("removemask",true)
addEventHandler("removemask", root, maske_kaldir)

function quitPlayer (  )
	if obje[source] then
		destroyElement(obje[source])
		obje[source] = nil
	end
	if yelek[source] then
		destroyElement(yelek[source])
		yelek[source] = nil
	end
end
addEventHandler ( "onPlayerQuit", getRootElement(), quitPlayer )

 

Ok, agora no debugscript ele me retorna "=" expected near ' na linha 9

3 hours ago, DNL291 said:

Tente isto (não testado) :


local mascaras = {
	"devil","vendetta","darth","horse","gasmask","kovboy","zombie","vampire",
	"skull","raccoon","owl", "cat","bag","dog","baby","monster","tilki","admin"
}

maskTable = {}
yelekTable = {}

yelekTable["yelek1"] = {1922, 3, 90}
yelekTable["yelek2"] = {1923, 3, 90}
yelekTable["yelek3"] = {1924, 3, 90}

maskTable["devil"] = {1512, 1, 90}
maskTable["vendetta"] = {1455, 1, 90}
maskTable["darth"] = {1484, 1, 90}
maskTable["horse"] = {1485, 1, 90}
maskTable["gasmask"] = {1487, 1, 90}
maskTable["kovboy"] = {1543, 1, 90}
maskTable["zombie"] = {1544, 1, 90}
maskTable["vampire"] = {1666, 1, 90}
maskTable["skull"] = {1667, 1, 90}
maskTable["raccoon"] = {1668, 1, 180}
maskTable["owl"] = {1950, 1, 180}
maskTable["cat"] = {1951, 1, 180}
maskTable["bag"] = {1551, 1, 90}
maskTable["dog"] = {1546, 1, 90}
maskTable["baby"] = {1669, 1, 90}
maskTable["monster"] = {1853, 1, 90}
maskTable["tilki"] = {1854, 1, 90}
maskTable["admin"] = {1855, 1, 180}
obje = {}
yelek = {}

addCommandHandler( "setmask",
	function ( player, cmd, id)
		local name
		if id and mascaras[tonumber(id)] then
      		id = tonumber(id)
			name = mascaras[id]
		else
			return outputChatBox("[setmask] Sintaxe: /setmask [id]", player, 255, 0, 0)
		end
		
		if id == #mascaras then
			if ( hasObjectPermissionTo ( player, "function.kickPlayer" ) ) then
				if obje[player] then
					destroyElement(obje[player])
				end
				local objeid = maskTable[name][1]
				local bodyattach = maskTable[name][2]
				local zROT = maskTable[name][3]
				obje[player] = createObject ( objeid, 0, 0, 0, 0, 0, 0 )
				exports.bone_attach:attachElementToBone(obje[player],player,bodyattach,0,0.02,-0.61,0,0,zROT)
			else
				outputChatBox("Bu maskeyi sadece adminler kullanabilir", player, 255, 0, 0)
			end
		elseif id == 4 then
			if obje[player] then
				destroyElement(obje[player])
			end
			local objeid = maskTable[name][1]
			local bodyattach = maskTable[name][2]
			local zROT = maskTable[name][3]
			obje[player] = createObject ( objeid, 0, 0, 0, 0, 0, 0 )
			exports.bone_attach:attachElementToBone(obje[player],player,bodyattach,-0.04,0,-0.55,0,0,zROT)
		else
			if obje[player] then
				destroyElement(obje[player])
			end
			local objeid = maskTable[name][1]
			local bodyattach = maskTable[name][2]
			local zROT = maskTable[name][3]
			obje[player] = createObject ( objeid, 0, 0, 0, 0, 0, 0 )
			exports.bone_attach:attachElementToBone(obje[player],player,bodyattach,0,0,-0.61,0,0,zROT)
		end
	end, false, false
)

function maske_kaldir()
	if obje[source] then
		destroyElement(obje[source])
	end
end
addEvent("removemask",true)
addEventHandler("removemask", root, maske_kaldir)

function quitPlayer (  )
	if obje[source] then
		destroyElement(obje[source])
		obje[source] = nil
	end
	if yelek[source] then
		destroyElement(yelek[source])
		yelek[source] = nil
	end
end
addEventHandler ( "onPlayerQuit", getRootElement(), quitPlayer )

 

Eu resolvi o erro mas quando eu coloco /setmask e o id

 

o script retorna novamente o erro de sintaxie no chatbox

 

 

local mascaras = {
	"devil","vendetta","darth","horse","gasmask","kovboy","zombie","vampire",
	"skull","raccoon","owl", "cat","bag","dog","baby","monster","tilki","admin"
}

mascaras = {}
yelekTable = {}
mascaras["devil"] = {1512, 1, 90}
mascaras["vendetta"] = {1455, 1, 90}
mascaras["darth"] = {1484, 1, 90}
mascaras["horse"] = {1485, 1, 90}
mascaras["gasmask"] = {1487, 1, 90}
mascaras["kovboy"] = {1543, 1, 90}
mascaras["zombie"] = {1544, 1, 90}
mascaras["vampire"] = {1666, 1, 90}
mascaras["skull"] = {1667, 1, 90}
mascaras["raccoon"] = {1668, 1, 180}
mascaras["owl"] = {1950, 1, 180}
mascaras["cat"] = {1951, 1, 180}
mascaras["bag"] = {1551, 1, 90}
mascaras["dog"] = {1546, 1, 90}
mascaras["baby"] = {1669, 1, 90}
mascaras["monster"] = {1853, 1, 90}
mascaras["tilki"] = {1854, 1, 90}
mascaras["admin"] = {1855, 1, 180}
obje = {}
yelek = {}

addCommandHandler( "setmask",
	function ( player, cmd, id)
		local name
		if id and mascaras[tonumber(id)] then
      		id = tonumber(id)
			name = mascaras[id]
		else
			return outputChatBox("[setmask] Sintaxe: /setmask [id]", player, 255, 0, 0)
		end
		
		if id == #mascaras then
			if ( hasObjectPermissionTo ( player, "function.kickPlayer" ) ) then
				if obje[player] then
					destroyElement(obje[player])
				end
				local objeid = mascaras[name][1]
				local bodyattach = mascaras[name][2]
				local zROT = mascaras[name][3]
				obje[player] = createObject ( objeid, 0, 0, 0, 0, 0, 0 )
				exports.bone_attach:attachElementToBone(obje[player],player,bodyattach,0,0.02,-0.61,0,0,zROT)
			else
				outputChatBox("Bu maskeyi sadece adminler kullanabilir", player, 255, 0, 0)
			end
		elseif id == 4 then
			if obje[player] then
				destroyElement(obje[player])
			end
			local objeid = mascaras[name][1]
			local bodyattach = mascaras[name][2]
			local zROT = mascaras[name][3]
			obje[player] = createObject ( objeid, 0, 0, 0, 0, 0, 0 )
			exports.bone_attach:attachElementToBone(obje[player],player,bodyattach,-0.04,0,-0.55,0,0,zROT)
		else
			if obje[player] then
				destroyElement(obje[player])
			end
			local objeid = mascaras[name][1]
			local bodyattach = mascaras[name][2]
			local zROT = mascaras[name][3]
			obje[player] = createObject ( objeid, 0, 0, 0, 0, 0, 0 )
			exports.bone_attach:attachElementToBone(obje[player],player,bodyattach,0,0,-0.61,0,0,zROT)
		end
	end, false, false
)

function quitPlayer (  )
	if obje[source] then
		destroyElement(obje[source])
		obje[source] = nil
	end
	if yelek[source] then
		destroyElement(yelek[source])
		yelek[source] = nil
	end
end
addEventHandler ( "onPlayerQuit", getRootElement(), quitPlayer )

 

3 hours ago, DNL291 said:

Tente isto (não testado) :


local mascaras = {
	"devil","vendetta","darth","horse","gasmask","kovboy","zombie","vampire",
	"skull","raccoon","owl", "cat","bag","dog","baby","monster","tilki","admin"
}

maskTable = {}
yelekTable = {}

yelekTable["yelek1"] = {1922, 3, 90}
yelekTable["yelek2"] = {1923, 3, 90}
yelekTable["yelek3"] = {1924, 3, 90}

maskTable["devil"] = {1512, 1, 90}
maskTable["vendetta"] = {1455, 1, 90}
maskTable["darth"] = {1484, 1, 90}
maskTable["horse"] = {1485, 1, 90}
maskTable["gasmask"] = {1487, 1, 90}
maskTable["kovboy"] = {1543, 1, 90}
maskTable["zombie"] = {1544, 1, 90}
maskTable["vampire"] = {1666, 1, 90}
maskTable["skull"] = {1667, 1, 90}
maskTable["raccoon"] = {1668, 1, 180}
maskTable["owl"] = {1950, 1, 180}
maskTable["cat"] = {1951, 1, 180}
maskTable["bag"] = {1551, 1, 90}
maskTable["dog"] = {1546, 1, 90}
maskTable["baby"] = {1669, 1, 90}
maskTable["monster"] = {1853, 1, 90}
maskTable["tilki"] = {1854, 1, 90}
maskTable["admin"] = {1855, 1, 180}
obje = {}
yelek = {}

addCommandHandler( "setmask",
	function ( player, cmd, id)
		local name
		if id and mascaras[tonumber(id)] then
      		id = tonumber(id)
			name = mascaras[id]
		else
			return outputChatBox("[setmask] Sintaxe: /setmask [id]", player, 255, 0, 0)
		end
		
		if id == #mascaras then
			if ( hasObjectPermissionTo ( player, "function.kickPlayer" ) ) then
				if obje[player] then
					destroyElement(obje[player])
				end
				local objeid = maskTable[name][1]
				local bodyattach = maskTable[name][2]
				local zROT = maskTable[name][3]
				obje[player] = createObject ( objeid, 0, 0, 0, 0, 0, 0 )
				exports.bone_attach:attachElementToBone(obje[player],player,bodyattach,0,0.02,-0.61,0,0,zROT)
			else
				outputChatBox("Bu maskeyi sadece adminler kullanabilir", player, 255, 0, 0)
			end
		elseif id == 4 then
			if obje[player] then
				destroyElement(obje[player])
			end
			local objeid = maskTable[name][1]
			local bodyattach = maskTable[name][2]
			local zROT = maskTable[name][3]
			obje[player] = createObject ( objeid, 0, 0, 0, 0, 0, 0 )
			exports.bone_attach:attachElementToBone(obje[player],player,bodyattach,-0.04,0,-0.55,0,0,zROT)
		else
			if obje[player] then
				destroyElement(obje[player])
			end
			local objeid = maskTable[name][1]
			local bodyattach = maskTable[name][2]
			local zROT = maskTable[name][3]
			obje[player] = createObject ( objeid, 0, 0, 0, 0, 0, 0 )
			exports.bone_attach:attachElementToBone(obje[player],player,bodyattach,0,0,-0.61,0,0,zROT)
		end
	end, false, false
)

function maske_kaldir()
	if obje[source] then
		destroyElement(obje[source])
	end
end
addEvent("removemask",true)
addEventHandler("removemask", root, maske_kaldir)

function quitPlayer (  )
	if obje[source] then
		destroyElement(obje[source])
		obje[source] = nil
	end
	if yelek[source] then
		destroyElement(yelek[source])
		yelek[source] = nil
	end
end
addEventHandler ( "onPlayerQuit", getRootElement(), quitPlayer )

 

ok eu reprogramei todo o codigo e funcionou agradeço a Ajuda ❤️

Edited by sadmen
Link to comment
On 13/02/2019 at 11:40, sadmen said:

Olá, eu tenho esse sistema de mascaras! mas ele está por painel gui alguem poderia me ajudar a fazer o player setar a mascara por id? exemplo "/mask 1" Obrigado :D❤️

 

 


maskTable = {}
yelekTable = {}

yelekTable["yelek1"] = {1922, 3, 90}
yelekTable["yelek2"] = {1923, 3, 90}
yelekTable["yelek3"] = {1924, 3, 90}

maskTable["devil"] = {1512, 1, 90}
maskTable["vendetta"] = {1455, 1, 90}
maskTable["darth"] = {1484, 1, 90}
maskTable["horse"] = {1485, 1, 90}
maskTable["gasmask"] = {1487, 1, 90}
maskTable["kovboy"] = {1543, 1, 90}
maskTable["zombie"] = {1544, 1, 90}
maskTable["vampire"] = {1666, 1, 90}
maskTable["skull"] = {1667, 1, 90}
maskTable["raccoon"] = {1668, 1, 180}
maskTable["owl"] = {1950, 1, 180}
maskTable["cat"] = {1951, 1, 180}
maskTable["bag"] = {1551, 1, 90}
maskTable["dog"] = {1546, 1, 90}
maskTable["baby"] = {1669, 1, 90}
maskTable["monster"] = {1853, 1, 90}
maskTable["tilki"] = {1854, 1, 90}
maskTable["admin"] = {1855, 1, 180}
obje = {}
yelek = {}

function maske_kaldir()
		if obje[source] then
		destroyElement(obje[source])

		end
end
addEvent("removemask",true)
addEventHandler("removemask", root, maske_kaldir)

function maske_ekle(name)
if name == "admin" then
if ( hasObjectPermissionTo ( source, "function.kickPlayer" ) ) then
		if obje[source] then
		destroyElement(obje[source])
		end
local objeid = maskTable[name][1]
local bodyattach = maskTable[name][2]
local zROT = maskTable[name][3]
obje[source] = createObject ( objeid, 0, 0, 0, 0, 0, 0 )
exports.bone_attach:attachElementToBone(obje[source],source,bodyattach,0,0.02,-0.61,0,0,zROT)
else
outputChatBox("Bu maskeyi sadece adminler kullanabilir", source, 255, 0, 0)
end
elseif name == "horse" then
		if obje[source] then
		destroyElement(obje[source])
		end
local objeid = maskTable[name][1]
local bodyattach = maskTable[name][2]
local zROT = maskTable[name][3]
obje[source] = createObject ( objeid, 0, 0, 0, 0, 0, 0 )
exports.bone_attach:attachElementToBone(obje[source],source,bodyattach,-0.04,0,-0.55,0,0,zROT)
else
		if obje[source] then
		destroyElement(obje[source])
		end
local objeid = maskTable[name][1]
local bodyattach = maskTable[name][2]
local zROT = maskTable[name][3]
obje[source] = createObject ( objeid, 0, 0, 0, 0, 0, 0 )
exports.bone_attach:attachElementToBone(obje[source],source,bodyattach,0,0,-0.61,0,0,zROT)
end
end
addEvent("setmask",true)
addCommandHandler("mask", maske_ekle, objeid)
addEventHandler("setmask", root, maske_ekle)


function quitPlayer (  )
			if obje[source] then
		destroyElement(obje[source])
		end
		if yelek[source] then
		destroyElement(yelek[source])
		end
end
addEventHandler ( "onPlayerQuit", getRootElement(), quitPlayer )

 

ok, simplifiquei! tente isso (eu testei e funcionou)

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