Pedro Colto Posted April 2, 2015 Share Posted April 2, 2015 tipo eu quero criar o sistema de comprar garagem por enquanto só fis a base de teleportar: marker = createMarker(x,y,z, "corona", 2, 108,159,95,108) function teleport(player) if getElementType(player)=="player" then local vehicle=getPedOccupiedVehicle(player) if source == marker then setElementPosition(vehicle,x,y,z) -- onde ele ira entrar setElementFrozen(vehicle, true) setTimer(setElementFrozen, 1000, 1, vehicle, false) setElementPosition (player, x,y,z) end end end addEventHandler("onClientMarkerHit", getRootElement(), teleport) ----------------------------------------------- markera = createMarker(x,y,z, "corona", 2, 108,159,95,108) function teleport(player) if getElementType(player)=="player" then local vehicle=getPedOccupiedVehicle(player) if source == markera then setElementPosition(vehicle,x,y,z) setElementFrozen(vehicle, true) setTimer(setElementFrozen, 1000, 1, vehicle, false) setElementPosition (player,x,y,z) end end end addEventHandler("onClientMarkerHit", getRootElement(), teleport) então, alguém pode me ajudar para quando o player entrar no "marker" apareça um Window com um botão, e quando o player clicasse no botão retirava um tanto de grana do player e ele entraria na garagem, e sempre que ele fosse para garagem ele entrasse dboa sem pagar nada (no caso ele compraria a garagem), mais apenas quem comprou a garagem poderia entrar na garagem. Não necessita colocar o Window em uma posição, porque irei editar dps ^^ Link to comment
n3wage Posted April 3, 2015 Share Posted April 3, 2015 Base: -- Tente entender o codigo, sou ruim com explicações ;-; --------- Client side: preço = 30000 -- Preço da garagem (30 mil) -- Codigo para criar a gui... function criargui () botao = guiCreateButton( 0, 0, 100, 100, "Comprar!", true ); end addEventHandler ( "onClientGUIClick", root, function (x) if botao and isElement ( botao ) and source == botao then if ( getPlayerMoney ( ) >= preço ) then triggerServerEvent ( "garage:onBuy", localPlayer, preço ); destroyElement ( botao ); else outputChatBox ( "Você não tem dinheiro para comprar isso ($"..preço..")", 255, 0, 0 ); end end end ) function teleport(player) -- Peguei essa função do seu post.. if getElementType(player)=="player" then if source == marker then if getElementData ( localPlayer, "comprouGaragem" ) then -- se o jogador tiver a garagem comprada local vehicle = getPedOccupiedVehicle(player) setElementPosition(vehicle,x,y,z) -- onde ele ira entrar setElementFrozen(vehicle, true) setTimer(setElementFrozen, 1000, 1, vehicle, false) setElementPosition (player, x,y,z) else -- caso contrario criar a janela pedindo para comprar.. outputChatBox ( "Você Precisa Comprar essa garagem para entrar nela !", 255, 0, 0 ) criargui() end end end end addEventHandler("onClientMarkerHit", getRootElement(), teleport) --------- Server side: function onBuyGarage ( preço ) if not isGuestAccount ( getPlayerAccount ( client ) ) then -- checar se o jogador esta logado takePlayerMoney ( client, preço ); setAccountData ( getPlayerAccount ( client ), "comprouGaragem", true ); setElementData ( client, "comprouGaragem", true ); else outputChatBox ( "Voce precisa estar logado para comprar uma garagem !", client, 255, 0, 0 ); end end addEvent ( "garage:onBuy", true ) addEventHandler ( "garage:onBuy", root, onBuyGarage ) addEventHandler ( "onPlayerLogin", root, function ( x ) if getAccountData ( source, "comprouGaragem" ) == true then setElementData ( client, "comprouGaragem", true ); end end ) Link to comment
Pedro Colto Posted April 4, 2015 Author Share Posted April 4, 2015 Base: -- Tente entender o codigo, sou ruim com explicações ;-; --------- Client side: preço = 30000 -- Preço da garagem (30 mil) -- Codigo para criar a gui... function criargui () botao = guiCreateButton( 0, 0, 100, 100, "Comprar!", true ); end addEventHandler ( "onClientGUIClick", root, function (x) if botao and isElement ( botao ) and source == botao then if ( getPlayerMoney ( ) >= preço ) then triggerServerEvent ( "garage:onBuy", localPlayer, preço ); destroyElement ( botao ); else outputChatBox ( "Você não tem dinheiro para comprar isso ($"..preço..")", 255, 0, 0 ); end end end ) function teleport(player) -- Peguei essa função do seu post.. if getElementType(player)=="player" then if source == marker then if getElementData ( localPlayer, "comprouGaragem" ) then -- se o jogador tiver a garagem comprada local vehicle = getPedOccupiedVehicle(player) setElementPosition(vehicle,x,y,z) -- onde ele ira entrar setElementFrozen(vehicle, true) setTimer(setElementFrozen, 1000, 1, vehicle, false) setElementPosition (player, x,y,z) else -- caso contrario criar a janela pedindo para comprar.. outputChatBox ( "Você Precisa Comprar essa garagem para entrar nela !", 255, 0, 0 ) criargui() end end end end addEventHandler("onClientMarkerHit", getRootElement(), teleport) --------- Server side: function onBuyGarage ( preço ) if not isGuestAccount ( getPlayerAccount ( client ) ) then -- checar se o jogador esta logado takePlayerMoney ( client, preço ); setAccountData ( getPlayerAccount ( client ), "comprouGaragem", true ); setElementData ( client, "comprouGaragem", true ); else outputChatBox ( "Voce precisa estar logado para comprar uma garagem !", client, 255, 0, 0 ); end end addEvent ( "garage:onBuy", true ) addEventHandler ( "garage:onBuy", root, onBuyGarage ) addEventHandler ( "onPlayerLogin", root, function ( x ) if getAccountData ( source, "comprouGaragem" ) == true then setElementData ( client, "comprouGaragem", true ); end end ) cara esta com bastantes erros, e falta a parte do player teleportar para dentro da garagem e criar o marker. Link to comment
Pedro Colto Posted April 4, 2015 Author Share Posted April 4, 2015 Consegui arrumar mais, a unicas coisas que falta e o player não poder entrar na garagem sem ele comprar ela -- Tente entender o codigo, sou ruim com explicações ;-; --------- Client side: peco = 30000 -- peco da garagem (30 mil) -- Codigo para criar a gui... function criargui () botao = guiCreateButton(0.43, 0.47, 0.06, 0.05, "comprar", true) end addEventHandler ( "onClientGUIClick", root, function (x) if botao and isElement ( botao ) and source == botao then if ( getPlayerMoney ( ) >= peco ) then triggerServerEvent ( "garage:onBuy", localPlayer, peco ); destroyElement ( botao ); else outputChatBox ( "Você não tem dinheiro para comprar isso ($"..peco..")", 255, 0, 0 ); end end end ) marker = createMarker(2505.5,-1690,13.60000038147, "corona", 2, 108,159,95,108) --- marker entrar function teleport(player) if getElementType(player)=="player" then local vehicle=getPedOccupiedVehicle(player) if source == marker then setElementPosition(vehicle,2496.6999511719,-1667.9000244141,7566.5) -- onde ele ira entrar setElementFrozen(vehicle, true) setTimer(setElementFrozen, 1000, 1, vehicle, false) setElementPosition (player, 2496.6999511719,-1667.9000244141,7566.5) -- onde ele ira entrar else -- caso contrario criar a janela pedindo para comprar.. outputChatBox ( "Você Precisa Comprar essa garagem para entrar nela !", 255, 0, 0 ) criargui() end end end addEventHandler("onClientMarkerHit", getRootElement(), teleport) ----------------------------------------------- markera = createMarker(2493.3000488281,-1667.5999755859,7566.5, "corona", 2, 108,159,95,255) function teleport(player) if getElementType(player)=="player" then local vehicle=getPedOccupiedVehicle(player) if source == markera then setElementPosition(vehicle,2504.8000488281,-1685.6999511719,13.5) setElementFrozen(vehicle, true) setTimer(setElementFrozen, 1000, 1, vehicle, false) setElementPosition (player, 2504.8000488281,-1685.6999511719,13.5) else -- caso contrario criar a janela pedindo para comprar.. outputChatBox ( "Você Precisa Comprar essa garagem para entrar nela !", 255, 0, 0 ) criargui() end end end addEventHandler("onClientMarkerHit", getRootElement(), teleport) Link to comment
n3wage Posted April 4, 2015 Share Posted April 4, 2015 (edited) cara esta com bastantes erros, e falta a parte do player teleportar para dentro da garagem e criar o marker. O objetivo não era funcionar (ficar sem erros), Te dei uma base para vc entender como fazer o script, adapte o codigo para suas necessidades, Veja as funções que eu usei e suas respectivas paginas na wiki. @edit Apenas adicione um if nessa parte: function teleport(player) if getElementType(player)=="player" then local vehicle=getPedOccupiedVehicle(player) if source == marker then setElementPosition(vehicle,2496.6999511719,-1667.9000244141,7566.5) -- onde ele ira entrar setElementFrozen(vehicle, true) setTimer(setElementFrozen, 1000, 1, vehicle, false) setElementPosition (player, 2496.6999511719,-1667.9000244141,7566.5) -- onde ele ira entrar else -- caso contrario criar a janela pedindo para comprar.. outputChatBox ( "Você Precisa Comprar essa garagem para entrar nela !", 255, 0, 0 ) criargui() end end end addEventHandler("onClientMarkerHit", getRootElement(), teleport) Dessa forma: if getElementData ( localPlayer, "comprouGaragem" ) then No lugar de: if source == marker then Edited April 4, 2015 by Guest Link to comment
Pedro Colto Posted April 4, 2015 Author Share Posted April 4, 2015 cara esta com bastantes erros, e falta a parte do player teleportar para dentro da garagem e criar o marker. O objetivo não era funcionar (ficar sem erros), Te dei uma base para vc entender como fazer o script, adapte o codigo para suas necessidades, Veja as funções que eu usei e suas respectivas paginas na wiki. @edit Apenas adicione um if nessa parte: function teleport(player) if getElementType(player)=="player" then local vehicle=getPedOccupiedVehicle(player) if source == marker then setElementPosition(vehicle,2496.6999511719,-1667.9000244141,7566.5) -- onde ele ira entrar setElementFrozen(vehicle, true) setTimer(setElementFrozen, 1000, 1, vehicle, false) setElementPosition (player, 2496.6999511719,-1667.9000244141,7566.5) -- onde ele ira entrar else -- caso contrario criar a janela pedindo para comprar.. outputChatBox ( "Você Precisa Comprar essa garagem para entrar nela !", 255, 0, 0 ) criargui() end end end addEventHandler("onClientMarkerHit", getRootElement(), teleport) Dessa forma: if getElementData ( localPlayer, "comprouGaragem" ) then sim ja entendi, ja tirei o bug vou tentar arrumar agr para o player n entrar enquanto não comprar, muito obrigado cara (y) Link to comment
Pedro Colto Posted April 4, 2015 Author Share Posted April 4, 2015 cara esta com bastantes erros, e falta a parte do player teleportar para dentro da garagem e criar o marker. O objetivo não era funcionar (ficar sem erros), Te dei uma base para vc entender como fazer o script, adapte o codigo para suas necessidades, Veja as funções que eu usei e suas respectivas paginas na wiki. @edit Apenas adicione um if nessa parte: function teleport(player) if getElementType(player)=="player" then local vehicle=getPedOccupiedVehicle(player) if source == marker then setElementPosition(vehicle,2496.6999511719,-1667.9000244141,7566.5) -- onde ele ira entrar setElementFrozen(vehicle, true) setTimer(setElementFrozen, 1000, 1, vehicle, false) setElementPosition (player, 2496.6999511719,-1667.9000244141,7566.5) -- onde ele ira entrar else -- caso contrario criar a janela pedindo para comprar.. outputChatBox ( "Você Precisa Comprar essa garagem para entrar nela !", 255, 0, 0 ) criargui() end end end addEventHandler("onClientMarkerHit", getRootElement(), teleport) Dessa forma: if getElementData ( localPlayer, "comprouGaragem" ) then No lugar de: if source == marker then coloquei desta forma: -- Tente entender o codigo, sou ruim com explicações ;-; --------- Client side: peco = 30000 -- peco da garagem (30 mil) -- Codigo para criar a gui... function criargui () botao = guiCreateButton(0.43, 0.47, 0.06, 0.05, "comprar", true) end addEventHandler ( "onClientGUIClick", root, function (localPlayer) if botao and isElement ( botao ) and source == botao then if ( getPlayerMoney ( ) >= peco ) then triggerServerEvent ( "garage:onBuy", localPlayer, peco ); destroyElement ( botao ); else outputChatBox ( "Você não tem dinheiro para comprar isso ($"..peco..")", 255, 0, 0 ); end end end ) marker = createMarker(2505.5,-1690,13.60000038147, "corona", 2, 108,159,95,108) --- marker entrar function teleport(player) -- Peguei essa função do seu post.. if getElementType(player)=="player" then --if source == marker then if getElementData ( localPlayer, "comprouGaragem" ) then setElementPosition(vehicle,2496.6999511719,-1667.9000244141,7566.5) -- onde ele ira entrar setElementFrozen(vehicle, true) setTimer(setElementFrozen, 1000, 1, vehicle, false) setElementPosition (player, 2496.6999511719,-1667.9000244141,7566.5) -- onde ele ira entrar else -- caso contrario criar a janela pedindo para comprar.. outputChatBox ( "Você Precisa Comprar essa garagem para entrar nela !", 255, 0, 0 ) criargui() end end end end addEventHandler("onClientMarkerHit", getRootElement(), teleport) ----------------------------------------------- markera = createMarker(2493.3000488281,-1667.5999755859,7566.5, "corona", 2, 108,159,95,255) function teleport(player) if getElementType(player)=="player" then local vehicle=getPedOccupiedVehicle(player) if source == markera then setElementPosition(vehicle,2504.8000488281,-1685.6999511719,13.5) setElementFrozen(vehicle, true) setTimer(setElementFrozen, 1000, 1, vehicle, false) setElementPosition (player, 2504.8000488281,-1685.6999511719,13.5) else -- caso contrario criar a janela pedindo para comprar.. outputChatBox ( "Você Precisa Comprar essa garagem para entrar nela !", 255, 0, 0 ) criargui() end end end addEventHandler("onClientMarkerHit", getRootElement(), teleport) más o player mesmo assim consegue entrar Link to comment
n3wage Posted April 4, 2015 Share Posted April 4, 2015 tente: peco = 30000 -- peco da garagem (30 mil) -- Codigo para criar a gui... function criargui () botao = guiCreateButton(0.43, 0.47, 0.06, 0.05, "comprar", true) end addEventHandler ( "onClientGUIClick", root, function () if botao and isElement ( botao ) and source == botao then if ( getPlayerMoney ( ) >= peco ) then triggerServerEvent ( "garage:onBuy", localPlayer, peco ); destroyElement ( botao ); else outputChatBox ( "Você não tem dinheiro para comprar isso ($"..peco..")", 255, 0, 0 ); end end end ) marker = createMarker(2505.5,-1690,13.60000038147, "corona", 2, 108,159,95,108) --- marker entrar function teleport(player) -- Peguei essa função do seu post.. if getElementType(player)=="player" then if getElementData ( localPlayer, "comprouGaragem" ) then if isPedInVehicle ( player ) then local vehicle = getPedOccupiedVehicle ( player ) setElementPosition(vehicle,2496.6999511719,-1667.9000244141,7566.5) -- onde ele ira entrar setElementFrozen(vehicle, true) setTimer(setElementFrozen, 1000, 1, vehicle, false) end setElementPosition (player, 2496.6999511719,-1667.9000244141,7566.5) -- onde ele ira entrar else -- caso contrario criar a janela pedindo para comprar.. outputChatBox ( "Você Precisa Comprar essa garagem para entrar nela !", 255, 0, 0 ) criargui() end end end addEventHandler("onClientMarkerHit", marker, teleport) ----------------------------------------------- markera = createMarker(2493.3000488281,-1667.5999755859,7566.5, "corona", 2, 108,159,95,255) function teleport2(player) if getElementType(player)=="player" then if getElementData ( localPlayer, "comprouGaragem" ) then if isPedInVehicle ( player ) then local vehicle = getPedOccupiedVehicle ( player ) setElementPosition(vehicle,2504.8000488281,-1685.6999511719,13.5) setElementFrozen(vehicle, true) setTimer(setElementFrozen, 1000, 1, vehicle, false) end setElementPosition (player, 2504.8000488281,-1685.6999511719,13.5) else -- caso contrario criar a janela pedindo para comprar.. outputChatBox ( "Você Precisa Comprar essa garagem para entrar nela !", 255, 0, 0 ) criargui() end end end addEventHandler("onClientMarkerHit", markera, teleport2) Link to comment
Pedro Colto Posted April 6, 2015 Author Share Posted April 6, 2015 tente: peco = 30000 -- peco da garagem (30 mil) -- Codigo para criar a gui... function criargui () botao = guiCreateButton(0.43, 0.47, 0.06, 0.05, "comprar", true) end addEventHandler ( "onClientGUIClick", root, function () if botao and isElement ( botao ) and source == botao then if ( getPlayerMoney ( ) >= peco ) then triggerServerEvent ( "garage:onBuy", localPlayer, peco ); destroyElement ( botao ); else outputChatBox ( "Você não tem dinheiro para comprar isso ($"..peco..")", 255, 0, 0 ); end end end ) marker = createMarker(2505.5,-1690,13.60000038147, "corona", 2, 108,159,95,108) --- marker entrar function teleport(player) -- Peguei essa função do seu post.. if getElementType(player)=="player" then if getElementData ( localPlayer, "comprouGaragem" ) then if isPedInVehicle ( player ) then local vehicle = getPedOccupiedVehicle ( player ) setElementPosition(vehicle,2496.6999511719,-1667.9000244141,7566.5) -- onde ele ira entrar setElementFrozen(vehicle, true) setTimer(setElementFrozen, 1000, 1, vehicle, false) end setElementPosition (player, 2496.6999511719,-1667.9000244141,7566.5) -- onde ele ira entrar else -- caso contrario criar a janela pedindo para comprar.. outputChatBox ( "Você Precisa Comprar essa garagem para entrar nela !", 255, 0, 0 ) criargui() end end end addEventHandler("onClientMarkerHit", marker, teleport) ----------------------------------------------- markera = createMarker(2493.3000488281,-1667.5999755859,7566.5, "corona", 2, 108,159,95,255) function teleport2(player) if getElementType(player)=="player" then if getElementData ( localPlayer, "comprouGaragem" ) then if isPedInVehicle ( player ) then local vehicle = getPedOccupiedVehicle ( player ) setElementPosition(vehicle,2504.8000488281,-1685.6999511719,13.5) setElementFrozen(vehicle, true) setTimer(setElementFrozen, 1000, 1, vehicle, false) end setElementPosition (player, 2504.8000488281,-1685.6999511719,13.5) else -- caso contrario criar a janela pedindo para comprar.. outputChatBox ( "Você Precisa Comprar essa garagem para entrar nela !", 255, 0, 0 ) criargui() end end end addEventHandler("onClientMarkerHit", markera, teleport2) vllw cara ajudou mais agr quando o player reloga a garagem é vendida novamente, tipo eu comprei e ta ai se eu relogar pede para eu comprar novamente Link to comment
Pedro Colto Posted April 7, 2015 Author Share Posted April 7, 2015 agr quando o player reloga a garagem é vendida novamente, tipo eu comprei e ta ai se eu relogar pede para eu comprar novamente Link to comment
Banex Posted April 7, 2015 Share Posted April 7, 2015 Server local marker = {} local markers = { {["markerPos"] = {2505.5,-1690,13.6},["price"] = {30000}, ["teleportPos"] = {2496.699,-1667.9,7566.5}}, {["markerPos"] = {2493.3,-1667.59,7566.5},["price"] = {30000}, ["teleportPos"] = {2504.8,-1685.69,13.5}} } function onResourceStart() for k=1, #markers do marker[k] = createMarker(markers[k]["markerPos"][1], markers[k]["markerPos"][2], markers[k]["markerPos"][3], "cylinder", 2, 255, 0, 0, 255) setElementData(marker[k], "owner", false) setElementData(marker[k], "price", markers[k]["price"][1]) setElementData(marker[k], "teleportPos", {markers[k]["teleportPos"][1],markers[k]["teleportPos"][2],markers[k]["teleportPos"][3]}) addEventHandler("onPlayerMarkerHit", marker[k], onPlayerMarkerHit) end end addEventHandler("onResourceStart",resourceRoot, onResourceStart) function onPlayerMarkerHit(marker,matchingDimension) if (matchingDimension) and not isGuestAccount(getPlayerAccount(source)) then if getElementData(marker,"owner") ~= getAccountName(getPlayerAccount(source)) then outputChatBox("Você Precisa Comprar essa garagem para entrar nela!",source, 255, 0, 0) if getPlayerMoney(source) < getElementData(marker,"price") then return outputChatBox("Você não possui dinheiro o suficiente! ($"..getElementData(marker,"price")..")",source, 255, 0, 0 ) end triggerClientEvent(source,"onPlayerRequestGUI",source,marker) return end local element = getPedOccupiedVehicle(source) or source local x, y, z = unpack(getElementData(marker,"teleportPos")) setElementPosition(element,x,y,z) setElementFrozen(element, true) setTimer(setElementFrozen, 1000, 1, element,false) end end addEvent("onPlayerBuyGarage",true) function onPlayerBuyGarage(marker) setElementData(marker,"owner", getAccountName(getPlayerAccount(source))) end addEventHandler("onPlayerBuyGarage",root,onPlayerBuyGarage) Client function onClientResourceStart() botao = guiCreateButton(0.43, 0.47, 0.06, 0.05, "comprar", true) guiSetVisible(botao,false) end addEventHandler("onClientResourceStart", resourceRoot,onClientResourceStart) addEvent("onPlayerRequestGUI",true) function onPlayerRequestGUI(m) guiSetVisible(botao,true) showCursor(true) marker = m end addEventHandler("onPlayerRequestGUI",root,onPlayerRequestGUI) function onClientGUIClick() if source == botao then triggerServerEvent("onPlayerBuyGarage",localPlayer,marker) guiSetVisible(botao,false) showCursor(false) end end addEventHandler("onClientGUIClick", resourceRoot,onClientGUIClick) Link to comment
Pedro Colto Posted April 7, 2015 Author Share Posted April 7, 2015 Server local marker = {} local markers = { {["markerPos"] = {2505.5,-1690,13.6},["price"] = {30000}, ["teleportPos"] = {2496.699,-1667.9,7566.5}}, {["markerPos"] = {2493.3,-1667.59,7566.5},["price"] = {30000}, ["teleportPos"] = {2504.8,-1685.69,13.5}} } function onResourceStart() for k=1, #markers do marker[k] = createMarker(markers[k]["markerPos"][1], markers[k]["markerPos"][2], markers[k]["markerPos"][3], "cylinder", 2, 255, 0, 0, 255) setElementData(marker[k], "owner", false) setElementData(marker[k], "price", markers[k]["price"][1]) setElementData(marker[k], "teleportPos", {markers[k]["teleportPos"][1],markers[k]["teleportPos"][2],markers[k]["teleportPos"][3]}) addEventHandler("onPlayerMarkerHit", marker[k], onPlayerMarkerHit) end end addEventHandler("onResourceStart",resourceRoot, onResourceStart) function onPlayerMarkerHit(marker,matchingDimension) if (matchingDimension) and not isGuestAccount(getPlayerAccount(source)) then if getElementData(marker,"owner") ~= getAccountName(getPlayerAccount(source)) then outputChatBox("Você Precisa Comprar essa garagem para entrar nela!",source, 255, 0, 0) if getPlayerMoney(source) < getElementData(marker,"price") then return outputChatBox("Você não possui dinheiro o suficiente! ($"..getElementData(marker,"price")..")",source, 255, 0, 0 ) end triggerClientEvent(source,"onPlayerRequestGUI",source,marker) return end local element = getPedOccupiedVehicle(source) or source local x, y, z = unpack(getElementData(marker,"teleportPos")) setElementPosition(element,x,y,z) setElementFrozen(element, true) setTimer(setElementFrozen, 1000, 1, element,false) end end addEvent("onPlayerBuyGarage",true) function onPlayerBuyGarage(marker) setElementData(marker,"owner", getAccountName(getPlayerAccount(source))) end addEventHandler("onPlayerBuyGarage",root,onPlayerBuyGarage) Client function onClientResourceStart() botao = guiCreateButton(0.43, 0.47, 0.06, 0.05, "comprar", true) guiSetVisible(botao,false) end addEventHandler("onClientResourceStart", resourceRoot,onClientResourceStart) addEvent("onPlayerRequestGUI",true) function onPlayerRequestGUI(m) guiSetVisible(botao,true) showCursor(true) marker = m end addEventHandler("onPlayerRequestGUI",root,onPlayerRequestGUI) function onClientGUIClick() if source == botao then triggerServerEvent("onPlayerBuyGarage",localPlayer,marker) guiSetVisible(botao,false) showCursor(false) end end addEventHandler("onClientGUIClick", resourceRoot,onClientGUIClick) não funcionou, eu entro no marker não aparece nada Link to comment
Banex Posted April 7, 2015 Share Posted April 7, 2015 Você estava logado quando entrou na marker? e tem algum erro no debugscript? Link to comment
Pedro Colto Posted April 7, 2015 Author Share Posted April 7, 2015 Você estava logado quando entrou na marker? e tem algum erro no debugscript? sim estava logado não apareceu nem um erro nem um warnning no debugscript nem no console Link to comment
Banex Posted April 7, 2015 Share Posted April 7, 2015 tente isso local marker = {} local markers = { {["markerPos"] = {2505.5,-1690,13.6},["price"] = {30000}, ["teleportPos"] = {2496.699,-1667.9,7566.5}}, {["markerPos"] = {2493.3,-1667.59,7566.5},["price"] = {30000}, ["teleportPos"] = {2504.8,-1685.69,13.5}} } function onResourceStart() for k=1, #markers do marker[k] = createMarker(markers[k]["markerPos"][1], markers[k]["markerPos"][2], markers[k]["markerPos"][3], "cylinder", 2, 255, 0, 0, 255) setElementData(marker[k], "owner", false) setElementData(marker[k], "price", markers[k]["price"][1]) setElementData(marker[k], "teleportPos", {markers[k]["teleportPos"][1],markers[k]["teleportPos"][2],markers[k]["teleportPos"][3]}) end end addEventHandler("onResourceStart",resourceRoot, onResourceStart) function onPlayerMarkerHit(marker_,matchingDimension) if (matchingDimension) and not isGuestAccount(getPlayerAccount(source)) then for k, v in ipairs(marker) do if marker_ == v then if getElementData(marker_,"owner") ~= getAccountName(getPlayerAccount(source)) then outputChatBox("Você Precisa Comprar essa garagem para entrar nela!",source, 255, 0, 0) if getPlayerMoney(source) < getElementData(marker_,"price") then return outputChatBox("Você não possui dinheiro o suficiente! ($"..getElementData(marker_,"price")..")",source, 255, 0, 0 ) end triggerClientEvent(source,"onPlayerRequestGUI",source,marker_) return end local element = getPedOccupiedVehicle(source) or source local x, y, z = unpack(getElementData(marker_,"teleportPos")) setElementPosition(element,x,y,z) setElementFrozen(element, true) setTimer(setElementFrozen, 1000, 1, element,false) break end end end end addEventHandler("onPlayerMarkerHit",root, onPlayerMarkerHit) addEvent("onPlayerBuyGarage",true) function onPlayerBuyGarage(marker) setElementData(marker,"owner", getAccountName(getPlayerAccount(source))) end addEventHandler("onPlayerBuyGarage",root,onPlayerBuyGarage) Link to comment
#RooTs Posted April 8, 2015 Share Posted April 8, 2015 Pedro e Banex, foi testado aqui e não tinha erro algum, deve ser um dos bugs do MTA que tem que fecha-lo e abrir de novo está trabalhando perfeito... Link to comment
#RooTs Posted April 8, 2015 Share Posted April 8, 2015 Server local marker = {} local markers = { {["markerPos"] = {2505.5,-1690,13.6},["price"] = {30000}, ["teleportPos"] = {2496.699,-1667.9,7566.5}}, {["markerPos"] = {2493.3,-1667.59,7566.5},["price"] = {30000}, ["teleportPos"] = {2504.8,-1685.69,13.5}} } function onResourceStart() for k=1, #markers do marker[k] = createMarker(markers[k]["markerPos"][1], markers[k]["markerPos"][2], markers[k]["markerPos"][3], "cylinder", 2, 255, 0, 0, 255) setElementData(marker[k], "owner", false) setElementData(marker[k], "price", markers[k]["price"][1]) setElementData(marker[k], "teleportPos", {markers[k]["teleportPos"][1],markers[k]["teleportPos"][2],markers[k]["teleportPos"][3]}) end end addEventHandler("onResourceStart",resourceRoot, onResourceStart) function onPlayerMarkerHit(marker_,matchingDimension) if (matchingDimension) and not isGuestAccount(getPlayerAccount(source)) then outputChatBox("a") for k, v in ipairs(marker) do if marker_ == v then if getElementData(marker_,"owner") ~= getAccountName(getPlayerAccount(source)) then outputChatBox("Você Precisa Comprar essa garagem para entrar nela!",source, 255, 0, 0) if getPlayerMoney(source) < getElementData(marker_,"price") then return outputChatBox("Você não possui dinheiro o suficiente! ($"..getElementData(marker_,"price")..")",source, 255, 0, 0 ) end triggerClientEvent(source,"onPlayerRequestGUI",source,marker_) return end local element = getPedOccupiedVehicle(source) or source local x, y, z = unpack(getElementData(marker_,"teleportPos")) setElementPosition(element,x,y,z) setElementFrozen(element, true) setTimer(setElementFrozen, 1000, 1, element,false) break end end end end addEventHandler("onPlayerMarkerHit",root, onPlayerMarkerHit) addEvent("onPlayerBuyGarage",true) function onPlayerBuyGarage(marker) setElementData(marker,"owner", getAccountName(getPlayerAccount(source))) end addEventHandler("onPlayerBuyGarage",root,onPlayerBuyGarage) client function onClientResourceStart() botao = guiCreateButton(0.43, 0.47, 0.06, 0.05, "comprar", true) guiSetVisible(botao,false) end addEventHandler("onClientResourceStart", resourceRoot,onClientResourceStart) addEvent("onPlayerRequestGUI",true) function onPlayerRequestGUI(m) guiSetVisible(botao,true) showCursor(true) marker = m end addEventHandler("onPlayerRequestGUI",root,onPlayerRequestGUI) function onClientGUIClick() if source == botao then triggerServerEvent("onPlayerBuyGarage",localPlayer,marker) guiSetVisible(botao,false) showCursor(false) end end addEventHandler("onClientGUIClick", resourceRoot,onClientGUIClick) Link to comment
MrBugsFive Posted April 8, 2015 Share Posted April 8, 2015 Sistema de Comprar Garagem: freeGUI.lua: ------------------------------------------------------------------- ------------------------||Script by Karti||------------------------ --------------------------||Open Source||-------------------------- ------------------------------------------------------------------- function createfreeGUI() local X = 0.35 local Y = 0.8 local Width = 0.3 local Height = 0.12 freeGUI = guiCreateWindow(X, Y, Width, Height,"Comprar Garagem", true) X = 0.01 Y = 0.5 Width = 0.1 Height = 0.4 btnleft = guiCreateButton(X, Y, Width, Height, "<", true, freeGUI) X = 0.15 Y = 0.5 Width = 0.1 Height = 0.4 btnright = guiCreateButton(X, Y, Width, Height, ">", true, freeGUI) X = 0.33 Y = 0.5 Width = 0.4 Height = 0.4 btnbuy = guiCreateButton(X, Y, Width, Height, "Comprar", true, freeGUI) X = 0.79 Y = 0.5 Width = 0.2 Height = 0.4 btnclose = guiCreateButton(X, Y, Width, Height, "Exit", true, freeGUI) addEventHandler("onClientGUIClick", btnclose, clientfreeclose, false) addEventHandler("onClientGUIClick", btnbuy, clientbuy, false) addEventHandler("onClientGUIClick", btnleft, clientfreeleft, false) addEventHandler("onClientGUIClick", btnright, clientfreeright, false) end function getfreeDatas ( gfreeGarages,gIndex ) freeGarages = gfreeGarages freeIndex = gIndex Garage = freeGarages[1] x, y, z = getElementPosition(Garage) rx,ry,rz = getElementRotation ( Garage ) X = 0.25 Y = 0.5 Width = 0.5 Height = 0.1 lblprice1 = guiCreateLabel(X, Y, Width, Height, "1000$", true) guiLabelSetHorizontalAlign ( lblprice1, "center") guiLabelSetColor ( lblprice1, 0, 255, 0 ) Y = 0.43 lblprice2 = guiCreateLabel(X, Y, Width, Height, "3000$", true) guiLabelSetHorizontalAlign ( lblprice2, "center") guiLabelSetColor ( lblprice2, 0, 255, 0 ) if(rz == 90)then if(getElementModel(Garage) == 11313)then setCameraMatrix(x, y-20, z+10, x, y, z) guiSetVisible(lblprice1, true) guiSetVisible(lblprice2, false) else setCameraMatrix(x+15, y, z+7, x, y, z) guiSetVisible(lblprice1, false) guiSetVisible(lblprice2, true) end else setCameraMatrix(x, y+20, z+10, x, y, z) guiSetVisible(lblprice1, true) guiSetVisible(lblprice2, false) end cam = 1 createfreeGUI() end addEvent( "onfreeGUIcreate", true ) addEventHandler( "onfreeGUIcreate", getRootElement(), getfreeDatas ) function clientfreeclose() guiSetVisible(freeGUI, false) guiSetVisible(lblprice1, false) guiSetVisible(lblprice2, false) setCameraTarget ( localPlayer ) setElementFrozen ( localPlayer, false ) setPlayerHudComponentVisible ( "radar", true ) end function clientfreeleft() cam = cam + 1 if(cam == freeIndex+1)then cam = 1 end setfreeCam() end function clientfreeright() cam = cam - 1 if(cam == 0)then cam = freeIndex end setfreeCam() end function setfreeCam() Garage = freeGarages[cam] x, y, z = getElementPosition(Garage) rx,ry,rz = getElementRotation ( Garage ) fadeCamera ( false, 1, 255, 255,255 ) setTimer ( function() if(rz == 90)then if(getElementModel(Garage) == 11313)then setCameraMatrix(x, y-20, z+10, x, y, z) guiSetVisible(lblprice1, true) guiSetVisible(lblprice2, false) else setCameraMatrix(x+15, y, z+7, x, y, z) guiSetVisible(lblprice1, false) guiSetVisible(lblprice2, true) end else setCameraMatrix(x, y+20, z+10, x, y, z) guiSetVisible(lblprice1, true) guiSetVisible(lblprice2, false) end fadeCamera ( true, 1, 255, 255,255 ) end, 1000, 1 ) end function clientbuy() Garage = freeGarages[cam] clientfreeclose() triggerServerEvent ( "buy",localPlayer, Garage ) end HauptGUI.lua: ------------------------------------------------------------------- ------------------------||Script by Karti||------------------------ --------------------------||Open Source||-------------------------- ------------------------------------------------------------------- function createHauptGUI() local X = 0.3 local Y = 0.7 local Width = 0.4 local Height = 0.17 HauptGUI = guiCreateWindow(X, Y, Width, Height,"Garagem Shop/Loja", true) X = 0.5 Y = 0.5 Width = 0.45 Height = 0.4 btnmyGarages = guiCreateButton(X, Y, Width, Height, "My Garage", true, HauptGUI) X = 0.03 Y = 0.5 Width = 0.45 Height = 0.4 btnfreeGarages = guiCreateButton(X, Y, Width, Height, "Garagens", true, HauptGUI) X = 0.9 Y = 0.3 Width = 0.05 Height = 0.15 btnclose = guiCreateButton(X, Y, Width, Height, "X", true, HauptGUI) addEventHandler("onClientGUIClick", btnmyGarages, cmyGUI, false) addEventHandler("onClientGUIClick", btnfreeGarages, cfreeGUI, false) addEventHandler("onClientGUIClick", btnclose, clientHauptclose, false) end function cmyGUI() guiSetVisible(HauptGUI, false) triggerServerEvent ( "onmyGUI", localPlayer) end function cfreeGUI() guiSetVisible(HauptGUI, false) triggerServerEvent ( "onfreeGUI", localPlayer) end function clientHauptclose() guiSetVisible(HauptGUI, false) setCameraTarget ( localPlayer ) setElementFrozen ( localPlayer, false ) setPlayerHudComponentVisible ( "radar", true ) end function clientbuy(thePlayer) Index, b =guiGridListGetSelectedItem ( Garagenliste ) triggerServerEvent ( "buy",localPlayer, Index ) end function cHauptGUI() createHauptGUI() setCameraMatrix(1631.8000488281, -1070.9000244141, 41, 1593, -1026, 30) setElementFrozen ( localPlayer, true ) setPlayerHudComponentVisible ( "radar", false ) end addEvent( "onMarkerHit", true ) addEventHandler( "onMarkerHit" ,getRootElement(), cHauptGUI) myGUI.lua: ------------------------------------------------------------------- ------------------------||Script by Karti||------------------------ --------------------------||Open Source||-------------------------- ------------------------------------------------------------------- function createmyGUI() local X = 0.35 local Y = 0.8 local Width = 0.3 local Height = 0.12 myGUI = guiCreateWindow(X, Y, Width, Height,"myGarage-Panel", true) X = 0.01 Y = 0.5 Width = 0.1 Height = 0.4 btnleft = guiCreateButton(X, Y, Width, Height, "<", true, myGUI) X = 0.15 Y = 0.5 Width = 0.1 Height = 0.4 btnright = guiCreateButton(X, Y, Width, Height, ">", true, myGUI) X = 0.33 Y = 0.5 Width = 0.4 Height = 0.4 btnsell = guiCreateButton(X, Y, Width, Height, "Vender", true, myGUI) X = 0.79 Y = 0.5 Width = 0.2 Height = 0.4 btnclose = guiCreateButton(X, Y, Width, Height, "Exit", true, myGUI) addEventHandler("onClientGUIClick", btnclose, clientmyclose, false) addEventHandler("onClientGUIClick", btnsell, clientsell, false) addEventHandler("onClientGUIClick", btnleft, clientleft, false) addEventHandler("onClientGUIClick", btnright, clientright, false) end function getDatas ( gclientGarages,gIndex ) if(gclientGarages[1])then clientmyGarages = gclientGarages myIndex = gIndex Garage = clientmyGarages[1] x, y, z = getElementPosition(Garage) rx,ry,rz = getElementRotation ( Garage ) X = 0.25 Y = 0.5 Width = 0.5 Height = 0.1 lblprice1 = guiCreateLabel(X, Y, Width, Height, "1000$", true) guiLabelSetHorizontalAlign ( lblprice1, "center") guiLabelSetColor ( lblprice1, 0, 255, 0 ) Y = 0.43 lblprice2 = guiCreateLabel(X, Y, Width, Height, "3000$", true) guiLabelSetHorizontalAlign ( lblprice2, "center") guiLabelSetColor ( lblprice2, 0, 255, 0 ) if(rz == 90)then if(getElementModel(Garage) == 11313)then setCameraMatrix(x, y-20, z+10, x, y, z) guiSetVisible(lblprice1, true) guiSetVisible(lblprice2, false) else setCameraMatrix(x+15, y, z+7, x, y, z) guiSetVisible(lblprice1, false) guiSetVisible(lblprice2, true) end else setCameraMatrix(x, y+20, z+10, x, y, z) guiSetVisible(lblprice1, true) guiSetVisible(lblprice2, false) end cam = 1 createmyGUI() else outputChatBox ( "Você não tem garagem!",231,50,50, true ) createHauptGUI() end end addEvent( "onmyGUIcreate", true ) addEventHandler( "onmyGUIcreate", getRootElement(), getDatas ) function clientmyclose() guiSetVisible(myGUI, false) guiSetVisible(lblprice1, false) guiSetVisible(lblprice2, false) setCameraTarget ( localPlayer ) setElementFrozen ( localPlayer, false ) setPlayerHudComponentVisible ( "radar", true ) end function clientleft() cam = cam + 1 if(cam == myIndex+1)then cam = 1 end setmyCam() end function clientright() cam = cam - 1 if(cam == 0)then cam = myIndex end setmyCam() end function setmyCam() Garage = clientmyGarages[cam] x, y, z = getElementPosition(Garage) rx,ry,rz = getElementRotation ( Garage ) fadeCamera ( false, 1, 255, 255,255 ) setTimer ( function() if(rz == 90)then if(getElementModel(Garage) == 11313)then setCameraMatrix(x, y-20, z+10, x, y, z) guiSetVisible(lblprice1, true) guiSetVisible(lblprice2, false) else setCameraMatrix(x+15, y, z+7, x, y, z) guiSetVisible(lblprice1, false) guiSetVisible(lblprice2, true) end else setCameraMatrix(x, y+20, z+10, x, y, z) guiSetVisible(lblprice1, true) guiSetVisible(lblprice2, false) end fadeCamera ( true, 1, 255, 255,255 ) end, 1000, 1 ) end function clientsell() Garage = clientmyGarages[cam] clientmyclose() triggerServerEvent ( "sell",localPlayer, Garage ) end Script.lua: ------------------------------------------------------------------- ------------------------||Script by Karti||------------------------ --------------------------||Open Source||-------------------------- ------------------------------------------------------------------- Marker = createMarker(1604.5,-1057.4000244141,22.9, "cylinder", 2, 255, 0, 0) Ped = createPed(120,0,0,-10) Gate1 = createObject ( 11313, 1598.099609375, -1014.099609375, 31, 0, 0, 90 ) Gate2 = createObject ( 11313, 1590.8994140625, -1014.099609375, 31, 0, 0, 90 ) Gate3 = createObject ( 11313, 1583.69921875, -1014.099609375, 31, 0, 0, 90 ) Gate4 = createObject ( 11313, 1576.5, -1014.099609375, 31, 0, 0, 90 ) Gate5 = createObject ( 11313, 1569.2998046875, -1014.099609375, 31, 0, 0, 90 ) Gate6 = createObject ( 11313, 1562.099609375, -1014.099609375, 31, 0, 0, 90 ) Gate7 = createObject ( 11313, 1556.5, -1025.599609375, 31, 0, 0, -90 ) Gate8 = createObject ( 11313, 1563.69921875, -1025.599609375, 31, 0, 0, -90 ) Gate9 = createObject ( 11313, 1570.8994140625, -1025.599609375, 31, 0, 0, -90 ) Gate10 = createObject ( 11313, 1578.099609375, -1025.599609375, 31, 0, 0, -90 ) Gate11 = createObject ( 3055, 1601.3994140625, -1012.8994140625, 23.7, 0, 0, 90 ) Gate12 = createObject ( 3055, 1601.3994140625, -1027.19921875, 23.7, 0, 0, 90 ) Gates = {Gate1, Gate2, Gate3, Gate4, Gate5, Gate6, Gate7, Gate8, Gate9, Gate10, Gate11, Gate12} i = 1 while i <= 12 do Gate = Gates[i] setElementData(Gate, "gekauft", false) i = i +1 end i = 1 while i <= 12 do Gate = Gates[i] setElementData(Gate, "moving", false) i = i +1 end i = 1 while i <= 12 do Gate = Gates[i] setElementData(Gate, "open", false) i = i +1 end i = 1 while i <= 12 do Gate = Gates[i] setElementData(Gate, "Besitzer", Ped) i = i +1 end function buygarage(Garage) if(Garage == Gate11 or Garage == Gate12)then if(getPlayerMoney(client)-3000 >= 0)then takePlayerMoney( client, 3000) outputChatBox ( "#00ff00Você comprou a garagem!",client,255,0,0, true ) setElementData(Garage, "Besitzer", client) setElementData(Garage , "gekauft", true) else outputChatBox ( "Você não tem dinheiro suficiente!",client,231,50,50, true ) end else if(getPlayerMoney(client)-1000 >= 0)then takePlayerMoney( client, 1000) outputChatBox ( "#00ff00Você comprou a garagem!",client,255,0,0, true ) setElementData(Garage, "Besitzer", client) setElementData(Garage , "gekauft", true) else outputChatBox ( "Você não tem dinheiro suficiente!",client,231,50,50, true ) end end end addEvent( "buy", true ) addEventHandler( "buy", root, buygarage) function sellgarage(Garage) setElementData(Garage , "gekauft", false) outputChatBox ( "Você vendeu a garagem!",client,231,50,50, true ) setElementData(Garage, "Besitzer", Ped) if(Garage == Gate11 or Garage == Gate12)then givePlayerMoney( client, 3000) else givePlayerMoney(client, 1000) end end addEvent( "sell", true ) addEventHandler( "sell", root, sellgarage) local myMarker = createMarker(-2596.625, 579.358, 15.626, 'cylinder', 2.0, 255, 0, 0, 150) -- create myMarker function MarkerHit( Element, matchingDimension) triggerClientEvent ( "onMarkerHit", getRootElement()) end addEventHandler( "onMarkerHit", Marker, MarkerHit ) Col1 = createColSphere ( 1598.099609375, -1014.099609375, 31, 7.0 ) Col2 = createColSphere ( 1590.8994140625, -1014.099609375, 31, 7.0 ) Col3 = createColSphere ( 1583.69921875, -1014.099609375, 31, 7.0 ) Col4 = createColSphere ( 1576.5, -1014.099609375, 31, 7.0 ) Col5 = createColSphere ( 1569.2998046875, -1014.099609375, 31, 7.0 ) Col6 = createColSphere ( 1562.099609375, -1014.099609375, 31, 7.0 ) Col7 = createColSphere ( 1556.5, -1025.599609375, 31, 5.0 ) Col8 = createColSphere ( 1563.69921875, -1025.599609375, 31, 7.0 ) Col9 = createColSphere ( 1570.8994140625, -1025.599609375, 31, 7.0 ) Col10 = createColSphere ( 1578.099609375, -1025.599609375, 31, 7.0 ) Col11 = createColSphere ( 1601.3994140625, -1012.8994140625, 23.7, 7.0 ) Col12 = createColSphere ( 1601.3994140625, -1027.19921875, 23.7, 7.0 ) Cols = {Col1,Col2,Col3,Col4,Col5,Col6,Col7,Col8,Col9,Col10,Col11,Col12} function hill_Enter(player) i=1 while i <= 10 do Col = Cols[i] if(source == Col)then GateElement = Gates[i] i=10 end i = i +1 end if(source == Col11)then if(getElementData(Gate11, "Besitzer") == player)then x, y, z = getElementPosition ( Gate11 ) moveObject ( Gate11, 3000, x, y, z-4) GateElement = 0 end elseif(source == Col12)then if(getElementData(Gate12, "Besitzer") == player)then x, y, z = getElementPosition ( Gate12 ) moveObject ( Gate12, 3000, x, y, z-4) GateElement = 0 end end if(GateElement == 0)then elseif(GateElement == Gate7 or GateElement == Gate8 or GateElement == Gate9 or GateElement == Gate10)then if(getElementData(GateElement, "Besitzer") == player)then if(getElementData(GateElement, "open") == false)then if(getElementData(GateElement, "moving") == false)then x, y, z = getElementPosition ( GateElement ) moveObject ( GateElement, 3000, x, y-1.5, z+1.5,0,-90,0 ) setElementData(GateElement, "moving", true) setTimer ( setElementData, 3000, 1,GateElement, "open", true) setTimer ( setElementData, 3000, 1,GateElement, "moving",false) end end end else if(getElementData(GateElement, "Besitzer") == player)then if(getElementData(GateElement, "open") == false)then if(getElementData(GateElement, "moving") == false)then x, y, z = getElementPosition ( GateElement ) moveObject ( GateElement, 3000, x, y+1.5, z+1.5,0,90,0 ) setElementData(GateElement, "moving", true) setTimer ( setElementData, 3000, 1,GateElement, "open", true) setTimer ( setElementData, 3000, 1,GateElement, "moving",false) end end end end end addEventHandler ( "onColShapeHit", getRootElement() ,hill_Enter ) function hill_Leave(player) i=1 while i <= 10 do Col = Cols[i] if(source == Col)then GateElement = Gates[i] i=11 end i = i +1 end if(source == Col11)then GateElement = 0 if(getElementData(Gate11, "Besitzer") == player)then x, y, z = getElementPosition ( Gate11 ) moveObject ( Gate11, 3000, x, y, z+4) end elseif(source == Col12)then GateElement = 0 if(getElementData(Gate12, "Besitzer") == player)then x, y, z = getElementPosition ( Gate12 ) moveObject ( Gate12, 3000, x, y, z+4) end end if(GateElement == 0)then elseif(GateElement == Gate7 or GateElement == Gate8 or GateElement == Gate9 or GateElement == Gate10)then if(getElementData(GateElement, "Besitzer") == player)then if(getElementData(GateElement, "open") == true)then if(getElementData(GateElement, "moving") == false)then x, y, z = getElementPosition ( GateElement ) moveObject ( GateElement, 3000, x, y+1.5, z-1.5,0,90,0 ) setElementData(GateElement, "moving",true) setTimer ( setElementData, 3000, 1,GateElement, "open", false) setTimer ( setElementData, 3000, 1,GateElement, "moving", false) end end end else if(getElementData(GateElement, "Besitzer") == player)then if(getElementData(GateElement, "open") == true)then if(getElementData(GateElement, "moving") == false)then x, y, z = getElementPosition ( GateElement ) moveObject ( GateElement, 3000, x, y-1.5, z-1.5,0,-90,0 ) setElementData(GateElement, "moving",true) setTimer ( setElementData, 3000, 1,GateElement, "open", false) setTimer ( setElementData, 3000, 1,GateElement, "moving", false) end end end end end addEventHandler ( "onColShapeLeave", getRootElement() ,hill_Leave ) function myGuiOpen () clientGarages = {} i = 1 Index = 0 while i <= 12 do Gate = Gates[i] if(getElementData(Gate, "Besitzer") == client)then Index = Index +1 clientGarages[Index]=Gate end i = i +1 end triggerClientEvent ( "onmyGUIcreate", getRootElement(), clientGarages, Index ) end addEvent( "onmyGUI", true ) addEventHandler( "onmyGUI", root, myGuiOpen ) function freeGuiOpen () freeGarages = {} i = 1 Index = 0 while i <= 12 do Gate = Gates[i] if(getElementData(Gate, "gekauft")==false)then Index = Index +1 freeGarages[Index]=Gate end i = i +1 end triggerClientEvent ( "onfreeGUIcreate", getRootElement(), freeGarages, Index ) end addEvent( "onfreeGUI", true ) addEventHandler( "onfreeGUI", root, freeGuiOpen ) Garagensystem_Script_LS.map: "editor_main"> "object (vgElkup) (1)" interior="0" collisions="true" alpha="255" doublesided="false" model="8947" scale="1" dimension="0" posX="1564.89941" posY="-1013.59961" posZ="20" rotX="0" rotY="0" rotZ="90"> "object (vgElkup) (2)" interior="0" collisions="true" alpha="255" doublesided="false" model="8947" scale="1" dimension="0" posX="1564.90002" posY="-1028.09998" posZ="20" rotX="0" rotY="0" rotZ="90"> "object (vgElkup) (3)" interior="0" collisions="true" alpha="255" doublesided="false" model="8947" scale="1" dimension="0" posX="1575.2998" posY="-1038.39941" posZ="20" rotX="0" rotY="0" rotZ="90"> "object (vgElkup) (4)" interior="0" collisions="true" alpha="255" doublesided="false" model="8947" scale="1" dimension="0" posX="1589.40002" posY="-1024.80005" posZ="20" rotX="0" rotY="0" rotZ="90"> "object (vgElkup) (5)" interior="0" collisions="true" alpha="255" doublesided="false" model="8947" scale="1" dimension="0" posX="1589.40002" posY="-1011.59998" posZ="20" rotX="0" rotY="0" rotZ="90"> "object (vgElkup) (6)" interior="0" collisions="true" alpha="255" doublesided="false" model="8947" scale="1" dimension="0" posX="1589.39941" posY="-1012.7998" posZ="26" rotX="0" rotY="0" rotZ="90"> "object (vgElkup) (7)" interior="0" collisions="true" alpha="255" doublesided="false" model="8947" scale="1" dimension="0" posX="1589.39941" posY="-1027.09961" posZ="26" rotX="0" rotY="0" rotZ="90"> "object (vgElkup) (8)" interior="0" collisions="true" alpha="255" doublesided="false" model="8947" scale="1" dimension="0" posX="1589.40002" posY="-1027.09998" posZ="20" rotX="0" rotY="0" rotZ="90"> "object (vgElkup) (9)" interior="0" collisions="true" alpha="255" doublesided="false" model="8947" scale="1" dimension="0" posX="1565" posY="-1012.7998" posZ="26" rotX="0" rotY="0" rotZ="90"> "object (vgElkup) (10)" interior="0" collisions="true" alpha="255" doublesided="false" model="8947" scale="1" dimension="0" posX="1565" posY="-1025.69995" posZ="26" rotX="0" rotY="0" rotZ="90"> "object (vgElkup) (11)" interior="0" collisions="true" alpha="255" doublesided="false" model="8947" scale="1" dimension="0" posX="1594.2998" posY="-1046" posZ="23.9" rotX="10" rotY="0" rotZ="0"> "object (vgElkup) (13)" interior="0" collisions="true" alpha="255" doublesided="false" model="8947" scale="1" dimension="0" posX="1565" posY="-1027.09998" posZ="26" rotX="0" rotY="0" rotZ="90"> "object (roofstuff15) (1)" interior="0" collisions="true" alpha="255" doublesided="false" model="1696" scale="1" dimension="0" posX="1595.59998" posY="-1061" posZ="23.8" rotX="0" rotY="0" rotZ="0"> "object (roofstuff15) (2)" interior="0" collisions="true" alpha="255" doublesided="false" model="1696" scale="1" dimension="0" posX="1593.19995" posY="-1061" posZ="23.8" rotX="0" rotY="0" rotZ="0"> "object (cjsaveg) (1)" interior="0" collisions="true" alpha="255" doublesided="false" model="17950" scale="1" dimension="0" posX="1598.09961" posY="-1009.89941" posZ="31.3" rotX="0" rotY="0" rotZ="179.995"> "object (cjsaveg) (2)" interior="0" collisions="true" alpha="255" doublesided="false" model="17950" scale="1" dimension="0" posX="1590.89941" posY="-1009.89941" posZ="31.3" rotX="0" rotY="0" rotZ="179.995"> "object (cjsaveg) (3)" interior="0" collisions="true" alpha="255" doublesided="false" model="17950" scale="1" dimension="0" posX="1583.69922" posY="-1010" posZ="31.3" rotX="0" rotY="0" rotZ="179.995"> "object (cjsaveg) (4)" interior="0" collisions="true" alpha="255" doublesided="false" model="17950" scale="1" dimension="0" posX="1576.5" posY="-1010" posZ="31.3" rotX="0" rotY="0" rotZ="179.995"> "object (cjsaveg) (5)" interior="0" collisions="true" alpha="255" doublesided="false" model="17950" scale="1" dimension="0" posX="1569.2998" posY="-1010.09961" posZ="31.3" rotX="0" rotY="0" rotZ="179.995"> "object (cjsaveg) (6)" interior="0" collisions="true" alpha="255" doublesided="false" model="17950" scale="1" dimension="0" posX="1562.09961" posY="-1010.09961" posZ="31.3" rotX="0" rotY="0" rotZ="179.995"> "object (cjsaveg) (7)" interior="0" collisions="true" alpha="255" doublesided="false" model="17950" scale="1" dimension="0" posX="1556.5" posY="-1029.7998" posZ="31.3" rotX="0" rotY="0" rotZ="359.995"> "object (cjsaveg) (8)" interior="0" collisions="true" alpha="255" doublesided="false" model="17950" scale="1" dimension="0" posX="1563.69922" posY="-1029.69922" posZ="31.3" rotX="0" rotY="0" rotZ="359.984"> "object (cjsaveg) (9)" interior="0" collisions="true" alpha="255" doublesided="false" model="17950" scale="1" dimension="0" posX="1570.89941" posY="-1029.69922" posZ="31.3" rotX="0" rotY="0" rotZ="359.984"> "object (cjsaveg) (10)" interior="0" collisions="true" alpha="255" doublesided="false" model="17950" scale="1" dimension="0" posX="1578.09961" posY="-1029.69922" posZ="31.3" rotX="0" rotY="0" rotZ="359.984"> "object (bollardlight) (1)" interior="0" collisions="true" alpha="255" doublesided="false" model="1215" scale="1" dimension="0" posX="1581.09998" posY="-1033.30005" posZ="29.6" rotX="0" rotY="0" rotZ="0"> "object (bollardlight) (2)" interior="0" collisions="true" alpha="255" doublesided="false" model="1215" scale="1" dimension="0" posX="1575.09998" posY="-1033.30005" posZ="29.6" rotX="0" rotY="0" rotZ="0"> "object (bollardlight) (3)" interior="0" collisions="true" alpha="255" doublesided="false" model="1215" scale="1" dimension="0" posX="1574" posY="-1033.30005" posZ="29.6" rotX="0" rotY="0" rotZ="0"> "object (bollardlight) (4)" interior="0" collisions="true" alpha="255" doublesided="false" model="1215" scale="1" dimension="0" posX="1567.90002" posY="-1033.30005" posZ="29.6" rotX="0" rotY="0" rotZ="0"> "object (bollardlight) (5)" interior="0" collisions="true" alpha="255" doublesided="false" model="1215" scale="1" dimension="0" posX="1566.80005" posY="-1033.30005" posZ="29.6" rotX="0" rotY="0" rotZ="0"> "object (bollardlight) (6)" interior="0" collisions="true" alpha="255" doublesided="false" model="1215" scale="1" dimension="0" posX="1560.69995" posY="-1033.30005" posZ="29.6" rotX="0" rotY="0" rotZ="0"> "object (bollardlight) (7)" interior="0" collisions="true" alpha="255" doublesided="false" model="1215" scale="1" dimension="0" posX="1559.59998" posY="-1033.30005" posZ="29.6" rotX="0" rotY="0" rotZ="0"> "object (bollardlight) (8)" interior="0" collisions="true" alpha="255" doublesided="false" model="1215" scale="1" dimension="0" posX="1553.5" posY="-1033.30005" posZ="29.6" rotX="0" rotY="0" rotZ="0"> "object (bollardlight) (9)" interior="0" collisions="true" alpha="255" doublesided="false" model="1215" scale="1" dimension="0" posX="1559" posY="-1006.5" posZ="29.6" rotX="0" rotY="0" rotZ="0"> "object (bollardlight) (10)" interior="0" collisions="true" alpha="255" doublesided="false" model="1215" scale="1" dimension="0" posX="1565" posY="-1006.5" posZ="29.6" rotX="0" rotY="0" rotZ="0"> "object (bollardlight) (11)" interior="0" collisions="true" alpha="255" doublesided="false" model="1215" scale="1" dimension="0" posX="1566.30005" posY="-1006.59998" posZ="29.6" rotX="0" rotY="0" rotZ="0"> "object (bollardlight) (12)" interior="0" collisions="true" alpha="255" doublesided="false" model="1215" scale="1" dimension="0" posX="1572.30005" posY="-1006.70001" posZ="29.6" rotX="0" rotY="0" rotZ="0"> "object (bollardlight) (13)" interior="0" collisions="true" alpha="255" doublesided="false" model="1215" scale="1" dimension="0" posX="1573.40002" posY="-1006.5" posZ="29.6" rotX="0" rotY="0" rotZ="0"> "object (bollardlight) (14)" interior="0" collisions="true" alpha="255" doublesided="false" model="1215" scale="1" dimension="0" posX="1579.40002" posY="-1006.40002" posZ="29.6" rotX="0" rotY="0" rotZ="0"> "object (bollardlight) (15)" interior="0" collisions="true" alpha="255" doublesided="false" model="1215" scale="1" dimension="0" posX="1580.69995" posY="-1006.5" posZ="29.6" rotX="0" rotY="0" rotZ="0"> "object (bollardlight) (16)" interior="0" collisions="true" alpha="255" doublesided="false" model="1215" scale="1" dimension="0" posX="1586.5" posY="-1006.5" posZ="29.6" rotX="0" rotY="0" rotZ="0"> "object (bollardlight) (17)" interior="0" collisions="true" alpha="255" doublesided="false" model="1215" scale="1" dimension="0" posX="1587.90002" posY="-1006.5" posZ="29.6" rotX="0" rotY="0" rotZ="0"> "object (bollardlight) (18)" interior="0" collisions="true" alpha="255" doublesided="false" model="1215" scale="1" dimension="0" posX="1593.80005" posY="-1006.59998" posZ="29.6" rotX="0" rotY="0" rotZ="0"> "object (bollardlight) (19)" interior="0" collisions="true" alpha="255" doublesided="false" model="1215" scale="1" dimension="0" posX="1595.09998" posY="-1006.29999" posZ="29.6" rotX="0" rotY="0" rotZ="0"> "object (bollardlight) (20)" interior="0" collisions="true" alpha="255" doublesided="false" model="1215" scale="1" dimension="0" posX="1601" posY="-1006.40002" posZ="29.6" rotX="0" rotY="0" rotZ="0"> "object (Streetlamp1) (1)" interior="0" collisions="true" alpha="255" doublesided="false" model="1232" scale="1" dimension="0" posX="1582.5" posY="-1025" posZ="31.7" rotX="0" rotY="0" rotZ="0"> "object (Streetlamp1) (2)" interior="0" collisions="true" alpha="255" doublesided="false" model="1232" scale="1" dimension="0" posX="1567.40002" posY="-1024.80005" posZ="31.7" rotX="0" rotY="0" rotZ="0"> "object (Streetlamp1) (3)" interior="0" collisions="true" alpha="255" doublesided="false" model="1232" scale="1" dimension="0" posX="1553" posY="-1024.40002" posZ="31.7" rotX="0" rotY="0" rotZ="0"> "object (Streetlamp1) (4)" interior="0" collisions="true" alpha="255" doublesided="false" model="1232" scale="1" dimension="0" posX="1558.19995" posY="-1015.20001" posZ="31.7" rotX="0" rotY="0" rotZ="0"> "object (Streetlamp1) (5)" interior="0" collisions="true" alpha="255" doublesided="false" model="1232" scale="1" dimension="0" posX="1600.69995" posY="-1033.5" posZ="31.7" rotX="0" rotY="0" rotZ="0"> "object (Streetlamp1) (6)" interior="0" collisions="true" alpha="255" doublesided="false" model="1232" scale="1" dimension="0" posX="1572.7998" posY="-1014.89941" posZ="31.7" rotX="0" rotY="0" rotZ="0"> "object (Streetlamp1) (7)" interior="0" collisions="true" alpha="255" doublesided="false" model="1232" scale="1" dimension="0" posX="1594.5" posY="-1014.7998" posZ="31.7" rotX="0" rotY="0" rotZ="0"> "object (Streetlamp1) (8)" interior="0" collisions="true" alpha="255" doublesided="false" model="1232" scale="1" dimension="0" posX="1602.09998" posY="-1004.70001" posZ="25.6" rotX="0" rotY="0" rotZ="0"> "object (Streetlamp1) (9)" interior="0" collisions="true" alpha="255" doublesided="false" model="1232" scale="1" dimension="0" posX="1586.89941" posY="-1033.39941" posZ="31.7" rotX="0" rotY="0" rotZ="0"> "object (Streetlamp1) (10)" interior="0" collisions="true" alpha="255" doublesided="false" model="1232" scale="1" dimension="0" posX="1602.19922" posY="-1031.59961" posZ="25.5" rotX="0" rotY="0" rotZ="0"> "object (Streetlamp1) (11)" interior="0" collisions="true" alpha="255" doublesided="false" model="1232" scale="1" dimension="0" posX="1602.19922" posY="-1020.2998" posZ="25.5" rotX="0" rotY="0" rotZ="0"> "object (lhouse_barrier1) (1)" interior="0" collisions="true" alpha="255" doublesided="false" model="996" scale="1" dimension="0" posX="1601.5" posY="-1021.40002" posZ="29.8" rotX="0" rotY="0" rotZ="90"> "object (lhouse_barrier1) (2)" interior="0" collisions="true" alpha="255" doublesided="false" model="996" scale="1" dimension="0" posX="1601.5" posY="-1033.59998" posZ="29.8" rotX="0" rotY="0" rotZ="90"> "object (lhouse_barrier1) (3)" interior="0" collisions="true" alpha="255" doublesided="false" model="996" scale="1" dimension="0" posX="1601.5" posY="-1029.5" posZ="29.8" rotX="0" rotY="0" rotZ="90"> "object (lhouse_barrier1) (5)" interior="0" collisions="true" alpha="255" doublesided="false" model="996" scale="1" dimension="0" posX="1601.5" posY="-1035.59998" posZ="29.6" rotX="0" rotY="10" rotZ="269.995"> "object (lhouse_barrier1) (6)" interior="0" collisions="true" alpha="255" doublesided="false" model="996" scale="1" dimension="0" posX="1587" posY="-1043.69995" posZ="28.1" rotX="0" rotY="9.998" rotZ="269.989"> "object (lhouse_barrier1) (7)" interior="0" collisions="true" alpha="255" doublesided="false" model="996" scale="1" dimension="0" posX="1587.30005" posY="-1051.69995" posZ="26.7" rotX="0" rotY="9.998" rotZ="293.989"> "object (lhouse_barrier1) (8)" interior="0" collisions="true" alpha="255" doublesided="false" model="996" scale="1" dimension="0" posX="1601.19995" posY="-1051.69995" posZ="26.7" rotX="0" rotY="9.998" rotZ="247.989"> "object (lhouse_barrier1) (9)" interior="0" collisions="true" alpha="255" doublesided="false" model="996" scale="1" dimension="0" posX="1601.5" posY="-1043.69995" posZ="28.2" rotX="0" rotY="9.998" rotZ="269.989"> "object (lhouse_barrier1) (10)" interior="0" collisions="true" alpha="255" doublesided="false" model="996" scale="1" dimension="0" posX="1587" posY="-1035.39941" posZ="29.6" rotX="0" rotY="9.998" rotZ="269.989"> "object (lhouse_barrier1) (11)" interior="0" collisions="true" alpha="255" doublesided="false" model="996" scale="1" dimension="0" posX="1586.19922" posY="-1034" posZ="29.8" rotX="0" rotY="0" rotZ="179.995"> "object (strtbarrier01) (1)" interior="0" collisions="true" alpha="255" doublesided="false" model="1237" scale="1" dimension="0" posX="1603.40002" posY="-1073.19995" posZ="22.9" rotX="0" rotY="0" rotZ="0"> "object (strtbarrier01) (2)" interior="0" collisions="true" alpha="255" doublesided="false" model="1237" scale="1" dimension="0" posX="1606.59998" posY="-1065.5" posZ="22.9" rotX="0" rotY="0" rotZ="0"> "object (strtbarrier01) (3)" interior="0" collisions="true" alpha="255" doublesided="false" model="1237" scale="1" dimension="0" posX="1598" posY="-1058.5" posZ="24.8" rotX="0" rotY="0" rotZ="0"> "object (strtbarrier01) (4)" interior="0" collisions="true" alpha="255" doublesided="false" model="1237" scale="1" dimension="0" posX="1598" posY="-1058.5" posZ="24.8" rotX="0" rotY="0" rotZ="0"> "object (strtbarrier01) (5)" interior="0" collisions="true" alpha="255" doublesided="false" model="1237" scale="1" dimension="0" posX="1590.80005" posY="-1058.40002" posZ="24.8" rotX="0" rotY="0" rotZ="0"> "object (strtbarrier01) (6)" interior="0" collisions="true" alpha="255" doublesided="false" model="1237" scale="1" dimension="0" posX="1557.59998" posY="-1014.59998" posZ="29.1" rotX="0" rotY="0" rotZ="0"> "object (strtbarrier01) (7)" interior="0" collisions="true" alpha="255" doublesided="false" model="1237" scale="1" dimension="0" posX="1555.5" posY="-1015.20001" posZ="29.1" rotX="0" rotY="0" rotZ="0"> "object (strtbarrier01) (8)" interior="0" collisions="true" alpha="255" doublesided="false" model="1237" scale="1" dimension="0" posX="1553.5" posY="-1016" posZ="29.1" rotX="0" rotY="0" rotZ="0"> "object (lhouse_barrier1) (14)" interior="0" collisions="true" alpha="255" doublesided="false" model="996" scale="1" dimension="0" posX="1552.80005" posY="-1023.40002" posZ="29.8" rotX="0" rotY="0" rotZ="90"> "object (lhouse_barrier1) (15)" interior="0" collisions="true" alpha="255" doublesided="false" model="996" scale="1" dimension="0" posX="1553.5" posY="-1005.59998" posZ="29.8" rotX="0" rotY="0" rotZ="355"> "object (bollardlight) (21)" interior="0" collisions="true" alpha="255" doublesided="false" model="1215" scale="1" dimension="0" posX="1588.30005" posY="-1006.40002" posZ="23.6" rotX="0" rotY="0" rotZ="0"> "object (bollardlight) (22)" interior="0" collisions="true" alpha="255" doublesided="false" model="1215" scale="1" dimension="0" posX="1600.30005" posY="-1006.40002" posZ="23.6" rotX="0" rotY="0" rotZ="0"> "object (bollardlight) (23)" interior="0" collisions="true" alpha="255" doublesided="false" model="1215" scale="1" dimension="0" posX="1577.80005" posY="-1006.29999" posZ="23.6" rotX="0" rotY="0" rotZ="0"> "object (bollardlight) (24)" interior="0" collisions="true" alpha="255" doublesided="false" model="1215" scale="1" dimension="0" posX="1577.69995" posY="-1019.5" posZ="23.6" rotX="0" rotY="0" rotZ="0"> "object (bollardlight) (25)" interior="0" collisions="true" alpha="255" doublesided="false" model="1215" scale="1" dimension="0" posX="1588.19995" posY="-1019.5" posZ="23.6" rotX="0" rotY="0" rotZ="0"> "object (bollardlight) (26)" interior="0" collisions="true" alpha="255" doublesided="false" model="1215" scale="1" dimension="0" posX="1600.19995" posY="-1019.29999" posZ="23.6" rotX="0" rotY="0" rotZ="0"> "object (bollardlight) (27)" interior="0" collisions="true" alpha="255" doublesided="false" model="1215" scale="1" dimension="0" posX="1600.59998" posY="-1020.40002" posZ="23.6" rotX="0" rotY="0" rotZ="0"> "object (bollardlight) (28)" interior="0" collisions="true" alpha="255" doublesided="false" model="1215" scale="1" dimension="0" posX="1592" posY="-1020.40002" posZ="23.6" rotX="0" rotY="0" rotZ="0"> "object (bollardlight) (29)" interior="0" collisions="true" alpha="255" doublesided="false" model="1215" scale="1" dimension="0" posX="1577.90002" posY="-1020.40002" posZ="23.6" rotX="0" rotY="0" rotZ="0"> "object (bollardlight) (30)" interior="0" collisions="true" alpha="255" doublesided="false" model="1215" scale="1" dimension="0" posX="1577.90002" posY="-1033.69995" posZ="23.6" rotX="0" rotY="0" rotZ="0"> "object (bollardlight) (31)" interior="0" collisions="true" alpha="255" doublesided="false" model="1215" scale="1" dimension="0" posX="1586.80005" posY="-1033.59998" posZ="23.6" rotX="0" rotY="0" rotZ="0"> "object (bollardlight) (32)" interior="0" collisions="true" alpha="255" doublesided="false" model="1215" scale="1" dimension="0" posX="1600.40002" posY="-1033" posZ="23.6" rotX="0" rotY="0" rotZ="0"> "object (vgElkup) (1)" interior="0" collisions="true" alpha="255" doublesided="false" model="8947" scale="1" dimension="0" posX="1549.5" posY="-1026.40002" posZ="20" rotX="0" rotY="0" rotZ="270"> "object (vgElkup) (1)" interior="0" collisions="true" alpha="255" doublesided="false" model="8947" scale="1" dimension="0" posX="1553.59998" posY="-1011.70001" posZ="20" rotX="0" rotY="0" rotZ="270"> "object (vrockstairs) (1)" interior="0" collisions="true" alpha="255" doublesided="false" model="7096" scale="1" dimension="0" posX="1549.09998" posY="-1009.70001" posZ="27.2" rotX="0" rotY="0" rotZ="0"> "object (lhouse_barrier2) (1)" interior="0" collisions="true" alpha="255" doublesided="false" model="994" scale="1" dimension="0" posX="1552.80005" posY="-1005.5" posZ="29.1" rotX="0" rotY="0" rotZ="270"> "object (DYN_F_WOOD_2) (1)" interior="0" collisions="true" alpha="255" doublesided="false" model="1408" scale="1" dimension="0" posX="1521.80005" posY="-1026.90002" posZ="23.4" rotX="0" rotY="0" rotZ="354"> "object (DYN_F_WOOD_2) (2)" interior="0" collisions="true" alpha="255" doublesided="false" model="1408" scale="1" dimension="0" posX="1527.30005" posY="-1027.5" posZ="23.4" rotX="0" rotY="0" rotZ="353.996"> "object (DYN_F_WOOD_2) (3)" interior="0" collisions="true" alpha="255" doublesided="false" model="1408" scale="1" dimension="0" posX="1541.40002" posY="-1005.09998" posZ="23.7" rotX="0" rotY="0" rotZ="263.996"> "object (DYN_F_WOOD_2) (4)" interior="0" collisions="true" alpha="255" doublesided="false" model="1408" scale="1" dimension="0" posX="1541.40002" posY="-1031.90002" posZ="23.7" rotX="0" rotY="0" rotZ="342.746"> "object (DYN_F_WOOD_2) (5)" interior="0" collisions="true" alpha="255" doublesided="false" model="1408" scale="1" dimension="0" posX="1546.59998" posY="-1033.5" posZ="23.7" rotX="0" rotY="0" rotZ="342.741"> "object (DYN_F_WOOD_2) (6)" interior="0" collisions="true" alpha="255" doublesided="false" model="1408" scale="1" dimension="0" posX="1551.90002" posY="-1035.09998" posZ="23.7" rotX="0" rotY="0" rotZ="342.74"> "object (parktable1) (1)" interior="0" collisions="true" alpha="255" doublesided="false" model="1281" scale="1" dimension="0" posX="1544.30005" posY="-1016.20001" posZ="23.9" rotX="0" rotY="0" rotZ="0"> "object (parktable1) (2)" interior="0" collisions="true" alpha="255" doublesided="false" model="1281" scale="1" dimension="0" posX="1542.5" posY="-1019.5" posZ="23.9" rotX="0" rotY="0" rotZ="0"> "object (parktable1) (3)" interior="0" collisions="true" alpha="255" doublesided="false" model="1281" scale="1" dimension="0" posX="1541.09998" posY="-1023.09998" posZ="23.9" rotX="0" rotY="0" rotZ="0"> "object (parktable1) (4)" interior="0" collisions="true" alpha="255" doublesided="false" model="1281" scale="1" dimension="0" posX="1539.19995" posY="-1027" posZ="23.9" rotX="0" rotY="0" rotZ="0"> "object (CJ_BLOCKER_BENCH) (1)" interior="0" collisions="true" alpha="255" doublesided="false" model="1368" scale="1" dimension="0" posX="1551.59998" posY="-1008.90002" posZ="23.7" rotX="0" rotY="0" rotZ="270"> "object (CJ_BLOCKER_BENCH) (2)" interior="0" collisions="true" alpha="255" doublesided="false" model="1368" scale="1" dimension="0" posX="1548.69995" posY="-1007.90002" posZ="23.7" rotX="0" rotY="0" rotZ="0"> "object (DYN_TABLE_2) (1)" interior="0" collisions="true" alpha="255" doublesided="false" model="1432" scale="1" dimension="0" posX="1546.5" posY="-1029.09998" posZ="23.1" rotX="0" rotY="0" rotZ="0"> "object (DYN_TABLE_2) (2)" interior="0" collisions="true" alpha="255" doublesided="false" model="1432" scale="1" dimension="0" posX="1543" posY="-1027.5" posZ="23.1" rotX="0" rotY="0" rotZ="0"> "object (DYN_TABLE_2) (3)" interior="0" collisions="true" alpha="255" doublesided="false" model="1432" scale="1" dimension="0" posX="1550.59998" posY="-1025.19995" posZ="23.1" rotX="0" rotY="0" rotZ="0"> "object (chillidogcart) (1)" interior="0" collisions="true" alpha="255" doublesided="false" model="1340" scale="1" dimension="0" posX="1550.5" posY="-1020.90002" posZ="24.2" rotX="0" rotY="0" rotZ="180"> "object (icescart_prop) (1)" interior="0" collisions="true" alpha="255" doublesided="false" model="1341" scale="1" dimension="0" posX="1550.40002" posY="-1017.29999" posZ="24.1" rotX="0" rotY="0" rotZ="0"> "object (noodlecart_prop) (1)" interior="0" collisions="true" alpha="255" doublesided="false" model="1342" scale="1" dimension="0" posX="1549.69995" posY="-1030.30005" posZ="24.1" rotX="0" rotY="0" rotZ="130"> "object (CJ_PHONE_KIOSK2) (1)" interior="0" collisions="true" alpha="255" doublesided="false" model="1346" scale="1" dimension="0" posX="1551.69995" posY="-1011.20001" posZ="24.4" rotX="0" rotY="0" rotZ="270"> "object (CJ_PHONE_KIOSK2) (2)" interior="0" collisions="true" alpha="255" doublesided="false" model="1346" scale="1" dimension="0" posX="1551.59998" posY="-1013.79999" posZ="24.4" rotX="0" rotY="0" rotZ="270"> "object (CJ_POSTBOX) (1)" interior="0" collisions="true" alpha="255" doublesided="false" model="1367" scale="1" dimension="0" posX="1551.80005" posY="-1027.69995" posZ="23.7" rotX="0" rotY="0" rotZ="240"> "object (CJ_POSTBOX) (2)" interior="0" collisions="true" alpha="255" doublesided="false" model="1367" scale="1" dimension="0" posX="1550.69922" posY="-1007.19922" posZ="23.7" rotX="0" rotY="0" rotZ="0"> "object (CJ_POSTBOX) (3)" interior="0" collisions="true" alpha="255" doublesided="false" model="1367" scale="1" dimension="0" posX="1550.69995" posY="-1019.09998" posZ="23.7" rotX="0" rotY="0" rotZ="269.996"> "object (chinalamp_sf) (1)" interior="0" collisions="true" alpha="255" doublesided="false" model="1568" scale="1" dimension="0" posX="1552.5" posY="-1008.70001" posZ="23.1" rotX="0" rotY="0" rotZ="0"> "object (chinalamp_sf) (2)" interior="0" collisions="true" alpha="255" doublesided="false" model="1568" scale="1" dimension="0" posX="1551.69995" posY="-1023.09998" posZ="23.1" rotX="0" rotY="0" rotZ="0"> "object (chinalamp_sf) (3)" interior="0" collisions="true" alpha="255" doublesided="false" model="1568" scale="1" dimension="0" posX="1550.90002" posY="-1033.59998" posZ="23.1" rotX="0" rotY="0" rotZ="0"> "object (chinalamp_sf) (4)" interior="0" collisions="true" alpha="255" doublesided="false" model="1568" scale="1" dimension="0" posX="1540.69995" posY="-1021.09998" posZ="23.1" rotX="0" rotY="0" rotZ="0"> "object (chinalamp_sf) (5)" interior="0" collisions="true" alpha="255" doublesided="false" model="1568" scale="1" dimension="0" posX="1541" posY="-1028.2998" posZ="23.1" rotX="0" rotY="0" rotZ="0"> "object (chinalamp_sf) (6)" interior="0" collisions="true" alpha="255" doublesided="false" model="1568" scale="1" dimension="0" posX="1541.69995" posY="-1011.59998" posZ="23.1" rotX="0" rotY="0" rotZ="0"> "object (DYN_F_WOOD_2) (8)" interior="0" collisions="true" alpha="255" doublesided="false" model="1408" scale="1" dimension="0" posX="1536.40002" posY="-1029.80005" posZ="23.7" rotX="0" rotY="0" rotZ="333.996"> "object (DYN_F_WOOD_2) (9)" interior="0" collisions="true" alpha="255" doublesided="false" model="1408" scale="1" dimension="0" posX="1540.90002" posY="-1010.59998" posZ="23.7" rotX="0" rotY="0" rotZ="263.99"> "object (DYN_F_WOOD_2) (10)" interior="0" collisions="true" alpha="255" doublesided="false" model="1408" scale="1" dimension="0" posX="1539.59998" posY="-1016" posZ="23.7" rotX="0" rotY="0" rotZ="245.99"> "object (DYN_F_WOOD_2) (11)" interior="0" collisions="true" alpha="255" doublesided="false" model="1408" scale="1" dimension="0" posX="1537.30005" posY="-1021.09998" posZ="23.7" rotX="0" rotY="0" rotZ="245.989"> "object (DYN_F_WOOD_2) (12)" interior="0" collisions="true" alpha="255" doublesided="false" model="1408" scale="1" dimension="0" posX="1535.09998" posY="-1026.09998" posZ="23.7" rotX="0" rotY="0" rotZ="245.989"> "object (aw_streettree2) (1)" interior="0" collisions="true" alpha="255" doublesided="false" model="738" scale="1" dimension="0" posX="1546.19995" posY="-1031.80005" posZ="23.3" rotX="0" rotY="0" rotZ="349"> "object (aw_streettree2) (2)" interior="0" collisions="true" alpha="255" doublesided="false" model="738" scale="1" dimension="0" posX="1535.59998" posY="-1027.40002" posZ="23.3" rotX="0" rotY="0" rotZ="340.997"> "object (aw_streettree2) (3)" interior="0" collisions="true" alpha="255" doublesided="false" model="738" scale="1" dimension="0" posX="1538.5" posY="-1021.5" posZ="23.3" rotX="0" rotY="0" rotZ="335.994"> "object (aw_streettree2) (4)" interior="0" collisions="true" alpha="255" doublesided="false" model="738" scale="1" dimension="0" posX="1541.80005" posY="-1014.40002" posZ="23.3" rotX="0" rotY="0" rotZ="335.989"> "object (aw_streettree2) (5)" interior="0" collisions="true" alpha="255" doublesided="false" model="738" scale="1" dimension="0" posX="1585.09998" posY="-1030.69995" posZ="29.1" rotX="0" rotY="0" rotZ="0.997"> "object (aw_streettree1) (1)" interior="0" collisions="true" alpha="255" doublesided="false" model="792" scale="1" dimension="0" posX="1585.19995" posY="-1027.19995" posZ="29.1" rotX="0" rotY="0" rotZ="0"> "object (kb_planter_bush) (1)" interior="0" collisions="true" alpha="255" doublesided="false" model="638" scale="1" dimension="0" posX="1582.80005" posY="-1029.19995" posZ="29.7" rotX="0" rotY="0" rotZ="270"> "object (kb_planter_bush) (2)" interior="0" collisions="true" alpha="255" doublesided="false" model="638" scale="1" dimension="0" posX="1582.59998" posY="-1032.69995" posZ="29.7" rotX="0" rotY="0" rotZ="270"> "object (kb_planter_bush) (3)" interior="0" collisions="true" alpha="255" doublesided="false" model="638" scale="1" dimension="0" posX="1582.90002" posY="-1026.19995" posZ="29.7" rotX="0" rotY="0" rotZ="270"> "object (CJ_BUSH_PROP3) (1)" interior="0" collisions="true" alpha="255" doublesided="false" model="1360" scale="1" dimension="0" posX="1602.30005" posY="-1007.29999" posZ="23.7" rotX="0" rotY="0" rotZ="0"> "object (CJ_BUSH_PROP3) (2)" interior="0" collisions="true" alpha="255" doublesided="false" model="1360" scale="1" dimension="0" posX="1602.30005" posY="-1018.20001" posZ="23.7" rotX="0" rotY="0" rotZ="0"> "object (CJ_BUSH_PROP3) (3)" interior="0" collisions="true" alpha="255" doublesided="false" model="1360" scale="1" dimension="0" posX="1602.30005" posY="-1022" posZ="23.7" rotX="0" rotY="0" rotZ="0"> "object (CJ_BUSH_PROP3) (4)" interior="0" collisions="true" alpha="255" doublesided="false" model="1360" scale="1" dimension="0" posX="1602.30005" posY="-1033.40002" posZ="23.7" rotX="0" rotY="0" rotZ="0"> "object (CJ_BUSH_PROP3) (5)" interior="0" collisions="true" alpha="255" doublesided="false" model="1360" scale="1" dimension="0" posX="1601.5" posY="-1072.80005" posZ="23.7" rotX="0" rotY="0" rotZ="70"> "object (CJ_BUSH_PROP3) (6)" interior="0" collisions="true" alpha="255" doublesided="false" model="1360" scale="1" dimension="0" posX="1598.90002" posY="-1072.19995" posZ="23.7" rotX="0" rotY="0" rotZ="85.999"> "object (CJ_BUSH_PROP3) (7)" interior="0" collisions="true" alpha="255" doublesided="false" model="1360" scale="1" dimension="0" posX="1596.09998" posY="-1071.5" posZ="23.7" rotX="0" rotY="0" rotZ="73.245"> "object (CJ_BUSH_PROP3) (8)" interior="0" collisions="true" alpha="255" doublesided="false" model="1360" scale="1" dimension="0" posX="1593.40002" posY="-1069.5" posZ="23.7" rotX="0" rotY="0" rotZ="31.24"> "object (CJ_BUSH_PROP3) (9)" interior="0" collisions="true" alpha="255" doublesided="false" model="1360" scale="1" dimension="0" posX="1591.59998" posY="-1066.40002" posZ="23.7" rotX="0" rotY="0" rotZ="31.24"> "object (CJ_BUSH_PROP3) (10)" interior="0" collisions="true" alpha="255" doublesided="false" model="1360" scale="1" dimension="0" posX="1600.69995" posY="-1064.40002" posZ="23.7" rotX="0" rotY="0" rotZ="78.249"> "object (CJ_BUSH_PROP3) (11)" interior="0" collisions="true" alpha="255" doublesided="false" model="1360" scale="1" dimension="0" posX="1604.19995" posY="-1065.19995" posZ="23.7" rotX="0" rotY="0" rotZ="78.245"> "object (CJ_BUSH_PROP) (1)" interior="0" collisions="true" alpha="255" doublesided="false" model="1364" scale="1" dimension="0" posX="1605.5" posY="-1062.80005" posZ="23.7" rotX="0" rotY="0" rotZ="120"> "object (cntrlrsac1) (1)" interior="0" collisions="true" alpha="255" doublesided="false" model="1597" scale="1" dimension="0" posX="1594" posY="-1040.19995" posZ="30.6" rotX="10" rotY="0" rotZ="0"> "object (strtbarrier01) (4)" interior="0" collisions="true" alpha="255" doublesided="false" model="1237" scale="1" dimension="0" posX="1594.69995" posY="-1034.5" posZ="29" rotX="0" rotY="0" rotZ="0"> "object (strtbarrier01) (4)" interior="0" collisions="true" alpha="255" doublesided="false" model="1237" scale="1" dimension="0" posX="1593.59961" posY="-1045.09961" posZ="27.2" rotX="0" rotY="0" rotZ="0"> "object (strtbarrier01) (4)" interior="0" collisions="true" alpha="255" doublesided="false" model="1237" scale="1" dimension="0" posX="1594.69922" posY="-1045.19922" posZ="27.2" rotX="0" rotY="0" rotZ="0"> "object (strtbarrier01) (4)" interior="0" collisions="true" alpha="255" doublesided="false" model="1237" scale="1" dimension="0" posX="1594.69922" posY="-1045.19922" posZ="27.2" rotX="0" rotY="0" rotZ="0"> "object (strtbarrier01) (4)" interior="0" collisions="true" alpha="255" doublesided="false" model="1237" scale="1" dimension="0" posX="1593.69995" posY="-1034.5" posZ="29" rotX="0" rotY="0" rotZ="0"> "object (vegstreetsign1) (1)" interior="0" collisions="true" alpha="255" doublesided="false" model="3467" scale="1" dimension="0" posX="1550.19995" posY="-1022.59998" posZ="23.8" rotX="0" rotY="0" rotZ="110"> meta.xml: E Pronto ou Ser Quiser Voce Pode Fazer Download: Clique Aqui Este Script/Resource foi Criador Por: Karti . Link to comment
Banex Posted April 8, 2015 Share Posted April 8, 2015 Sistema de Comprar Garagem:--- E Pronto ou Ser Quiser Voce Pode Fazer Download: Clique Aqui Este Script/Resource foi Criador Por: Karti . sdds spoiler Link to comment
Banex Posted April 8, 2015 Share Posted April 8, 2015 Server local marker = {} local markers = { {["markerPos"] = {2505.5,-1690,13.6},["price"] = {30000}, ["teleportPos"] = {2496.699,-1667.9,7566.5}}, {["markerPos"] = {2493.3,-1667.59,7566.5},["price"] = {30000}, ["teleportPos"] = {2504.8,-1685.69,13.5}} } function onResourceStart() for k=1, #markers do marker[k] = createMarker(markers[k]["markerPos"][1], markers[k]["markerPos"][2], markers[k]["markerPos"][3], "cylinder", 2, 255, 0, 0, 255) setElementData(marker[k], "owner", false) setElementData(marker[k], "price", markers[k]["price"][1]) setElementData(marker[k], "teleportPos", {markers[k]["teleportPos"][1],markers[k]["teleportPos"][2],markers[k]["teleportPos"][3]}) end end addEventHandler("onResourceStart",resourceRoot, onResourceStart) function onPlayerMarkerHit(marker_,matchingDimension) if (matchingDimension) and not isGuestAccount(getPlayerAccount(source)) then outputChatBox("a") for k, v in ipairs(marker) do if marker_ == v then if getElementData(marker_,"owner") ~= getAccountName(getPlayerAccount(source)) then outputChatBox("Você Precisa Comprar essa garagem para entrar nela!",source, 255, 0, 0) if getPlayerMoney(source) < getElementData(marker_,"price") then return outputChatBox("Você não possui dinheiro o suficiente! ($"..getElementData(marker_,"price")..")",source, 255, 0, 0 ) end triggerClientEvent(source,"onPlayerRequestGUI",source,marker_) return end local element = getPedOccupiedVehicle(source) or source local x, y, z = unpack(getElementData(marker_,"teleportPos")) setElementPosition(element,x,y,z) setElementFrozen(element, true) setTimer(setElementFrozen, 1000, 1, element,false) break end end end end addEventHandler("onPlayerMarkerHit",root, onPlayerMarkerHit) addEvent("onPlayerBuyGarage",true) function onPlayerBuyGarage(marker) setElementData(marker,"owner", getAccountName(getPlayerAccount(source))) end addEventHandler("onPlayerBuyGarage",root,onPlayerBuyGarage) client function onClientResourceStart() botao = guiCreateButton(0.43, 0.47, 0.06, 0.05, "comprar", true) guiSetVisible(botao,false) end addEventHandler("onClientResourceStart", resourceRoot,onClientResourceStart) addEvent("onPlayerRequestGUI",true) function onPlayerRequestGUI(m) guiSetVisible(botao,true) showCursor(true) marker = m end addEventHandler("onPlayerRequestGUI",root,onPlayerRequestGUI) function onClientGUIClick() if source == botao then triggerServerEvent("onPlayerBuyGarage",localPlayer,marker) guiSetVisible(botao,false) showCursor(false) end end addEventHandler("onClientGUIClick", resourceRoot,onClientGUIClick) Erhm... Este não é o meu código? Oque você fez foi adicionar " outputChatBox("a") " , e tenho certeza que ele não quer que isso apareça no chat... Link to comment
#RooTs Posted April 8, 2015 Share Posted April 8, 2015 Erhm... Este não é o meu código? Oque você fez foi adicionar " outputChatBox("a") " , e tenho certeza que ele não quer que isso apareça no chat... Bom... me desculpa se estou sendo grosso. Mais, apenas testei o seu código em meu servidor local e tirei uns erros de sintaxe e encode UTF-8 coisa que você deveria fazer, e não fez, e se ele quiser retirar o Output ai já é com ele e não comigo. para não sair do assundo que você adora fazer isso, retorno a falar novamente Pedro e Banex, foi testado aqui e não tinha erro algum, deve ser um dos bugs do MTA que tem que fecha-lo e abrir de novo Link to comment
Banex Posted April 8, 2015 Share Posted April 8, 2015 Porque eu deveria fazer? eu só postei o código aqui, a codificação você escolhe quando for criar o arquivo... Link to comment
MrBugsFive Posted April 8, 2015 Share Posted April 8, 2015 Voces gostao de brigar/discutir mesmo , puta merda ein... de vez de trabalhar junto para fazer um script foda , mais nao so ficao brigando/discutindo. 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