Jump to content

Permição ACL


Recommended Posts

Quem So Pode entrar Nesse MarkerEntrada = criarMarker Quem ta na ACL "Premium"

Alguem me ajuda prfv

--[[
===========================================================
# Minha página: https://www.facebook.com/TioSteinScripter/#
#      ╔════╗╔══╗╔═══╗     ╔═══╗╔════╗╔═══╗╔══╗╔═╗─╔╗     #
#      ║╔╗╔╗║╚╣─╝║╔═╗║     ║╔═╗║║╔╗╔╗║║╔══╝╚╣─╝║║╚╗║║     #
#      ╚╝║║╚╝─║║─║║─║║     ║╚══╗╚╝║║╚╝║╚══╗─║║─║╔╗╚╝║     #
#      ──║║───║║─║║─║║     ╚══╗║──║║──║╔══╝─║║─║║╚╗║║     #
#      ──║║──╔╣─╗║╚═╝║     ║╚═╝║──║║──║╚══╗╔╣─╗║║─║║║     #
#      ──╚╝──╚══╝╚═══╝     ╚═══╝──╚╝──╚═══╝╚══╝╚╝─╚═╝     #
===========================================================
--]]

Markers = 
 {
    ID = {},
    {2558.76709, -1295.85486, 1044.12500 -1, 2},
    {2551.13525, -1300.09497, 1044.12500 -1, 2},
    {2542.92041, -1300.09375, 1044.12500 -1, 2},
    {2543.17505, -1287.22681, 1044.12500 -1, 2},
    {2551.29663, -1287.22803, 1044.12500 -1, 2},
    {2559.26025, -1287.21887, 1044.12500 -1, 2},
    {2555.82959, -1291.00562, 1044.12500 -1, 2},
 }
 
for i=1, #Markers do
    local x, y, z, int = Markers[i][1], Markers[i][2], Markers[i][3], Markers[i][4]

    Markers[i] = createMarker( x, y, z, "cylinder", 1.5, 16, 111, 231, 50)
    Markers.ID[Markers[i]] = i

    setElementInterior(Markers[i], int)
end

function hit (element)
    if Markers.ID[source] then
        if getElementType(element) == "player" then
           triggerClientEvent(element, "TS:AbrirFArmas", element)
        end
    end
end
addEventHandler("onMarkerHit", resourceRoot, hit)

local BlipTrafico1 = createBlip( 2333.27979, -1883.56091, 15.00000, BlipTrafico)
setBlipVisibleDistance(BlipTrafico1, 300)

local MarkerEntrada = createMarker ( 2333.27979, -1883.56091, 15.00000 -1, "cylinder", 1.5, 16, 111, 231, 50) 
local MarkerSaida = createMarker ( 2570.46021, -1301.82617, 1044.12500 -1, "cylinder", 1.5, 16, 111, 231, 50) 
setElementInterior(MarkerSaida, 2)

-------------------------------- Funções Iniciais




function Entrar (source)
	setElementPosition (source, 2565.54688, -1302.34216, 1044.12500)
	setElementInterior(source, 2)
	setElementDimension(source, 0)
end
addEventHandler("onMarkerHit", MarkerEntrada, Entrar)

function Sair (source)
	setElementPosition(source, 2327.48071, -1882.54944, 13.61931)
	setElementInterior(source, 0)
	setElementDimension(source, 0)
end
addEventHandler("onMarkerHit", MarkerSaida, Sair)

function FabricarArma (source, Arma, Valor, Tempo)
local Preco = tonumber(Valor)
local Time = tonumber(Tempo)
local Peca = getElementData(source, "TS:Peças "..Arma.."") or 0
local Quantidade = getElementData(source, "TS:Quanti"..Arma.."") or 0
local ID = getWeaponIDFromName ( Arma )
if getPlayerMoney(source) >= Preco then
setElementData(source, "TS:Peças "..Arma.."", Peca - 1)
setElementFrozen(source, true)
setElementData(source, "TS:TempoArma", Time)
setElementData(source, "TS:Parte", "Fabricando Peças")
takePlayerMoney(source, Preco)
triggerClientEvent(source, "TS:FecharArmas2", source)
triggerClientEvent(source, "TS:AbrirArmas2", source)
triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffVocê começou a fabricar uma "..Arma.." !", "info")
setPedAnimation( source, "WEAPONS", "SHP_Ar_Lift", true)
setElementData(source, "TS:PermissaoPegarArma", "Sim")
setPlayerWantedLevel(source, 6)
setTimer(function()
setElementData(source, "TS:Parte", "Lubrificando Peças")
setPedAnimation( source, "SHOTGUN", "shotgun_fire", true)
end, Time/3*60000, 1)
setTimer(function()
setElementData(source, "TS:Parte", "Montando Arma")
setPedAnimation( source, "WEAPONS","SHP_2H_LIFT", true)
end, Time/2*60000, 1)
setTimer(function()
local Perm = getElementData(source, "TS:PermissaoPegarArma") or "Não"
if Perm == "Sim" then
triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffVocê fabricou uma "..Arma.." com sucesso!", "info")
setElementFrozen(source, false)
setElementData(source, "TS:Parte", nil)
setElementData(source, "TS:TempoArma", nil)
setPedAnimation( source, nil)
giveWeapon(source, ID, 500)
triggerClientEvent(source, "TS:FecharArmas4", source)
end
end, Time*60000, 1)
else
triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffVocê não tem dinheiro suficiente!", "info")
end
end
addEvent ("TS:FabricarArma", true)
addEventHandler ("TS:FabricarArma", root, FabricarArma)

 

Link to comment

Olá, substituia isso em ser script, isso ira verificar se a Conta da pessoa que passar no marker ira estar na AclPermitida(Apenas alterar para o nome que deseja)

function hit (element)
    if isObjectInACLGroup ( "user." ..getAccountName(getPlayerAccount(thePlayer)), aclGetGroup ("AclPermitida")) then
        if Markers.ID[source] then
            if getElementType(element) == "player" then
                triggerClientEvent(element, "TS:AbrirFArmas", element)
            end
        end
    end
end
addEventHandler("onMarkerHit", resourceRoot, hit)

Espero ter ajudado, caso tenha duvidas so falar

  • Thanks 1
Link to comment
On 31/03/2021 at 16:09, Kahinan said:

Olá, substituia isso em ser script, isso ira verificar se a Conta da pessoa que passar no marker ira estar na AclPermitida(Apenas alterar para o nome que deseja)


--[[
===========================================================
# Minha página: https://www.facebook.com/TioSteinScripter/#
#      ╔════╗╔══╗╔═══╗     ╔═══╗╔════╗╔═══╗╔══╗╔═╗─╔╗     #
#      ║╔╗╔╗║╚╣─╝║╔═╗║     ║╔═╗║║╔╗╔╗║║╔══╝╚╣─╝║║╚╗║║     #
#      ╚╝║║╚╝─║║─║║─║║     ║╚══╗╚╝║║╚╝║╚══╗─║║─║╔╗╚╝║     #
#      ──║║───║║─║║─║║     ╚══╗║──║║──║╔══╝─║║─║║╚╗║║     #
#      ──║║──╔╣─╗║╚═╝║     ║╚═╝║──║║──║╚══╗╔╣─╗║║─║║║     #
#      ──╚╝──╚══╝╚═══╝     ╚═══╝──╚╝──╚═══╝╚══╝╚╝─╚═╝     #
===========================================================
--]]

Markers = 
 {
    ID = {},
    {2558.76709, -1295.85486, 1044.12500 -1, 2},
    {2551.13525, -1300.09497, 1044.12500 -1, 2},
    {2542.92041, -1300.09375, 1044.12500 -1, 2},
    {2543.17505, -1287.22681, 1044.12500 -1, 2},
    {2551.29663, -1287.22803, 1044.12500 -1, 2},
    {2559.26025, -1287.21887, 1044.12500 -1, 2},
    {2555.82959, -1291.00562, 1044.12500 -1, 2},
 }
 
for i=1, #Markers do
    local x, y, z, int = Markers[i][1], Markers[i][2], Markers[i][3], Markers[i][4]

    Markers[i] = createMarker( x, y, z, "cylinder", 1.5, 16, 111, 231, 50)
    Markers.ID[Markers[i]] = i

    setElementInterior(Markers[i], int)
end

function hit (element)
    if isObjectInACLGroup ( "user." ..getAccountName(getPlayerAccount(thePlayer)), aclGetGroup ("Premium")) then
        if Markers.ID[source] then
            if getElementType(element) == "player" then
                triggerClientEvent(element, "TS:AbrirFArmas", element)
            end
        end
    end
end
addEventHandler("onMarkerHit", resourceRoot, hit)



local BlipTrafico1 = createBlip( 2333.27979, -1883.56091, 15.00000, BlipTrafico)
setBlipVisibleDistance(BlipTrafico1, 300)

local MarkerEntrada = createMarker ( 2333.27979, -1883.56091, 15.00000 -1, "cylinder", 1.5, 16, 111, 231, 50) 
local MarkerSaida = createMarker ( 2570.46021, -1301.82617, 1044.12500 -1, "cylinder", 1.5, 16, 111, 231, 50) 
setElementInterior(MarkerSaida, 2)

-------------------------------- Funções Iniciais




function Entrar (source)
	setElementPosition (source, 2565.54688, -1302.34216, 1044.12500)
	setElementInterior(source, 2)
	setElementDimension(source, 0)
end
addEventHandler("onMarkerHit", MarkerEntrada, Entrar)

function Sair (source)
	setElementPosition(source, 2327.48071, -1882.54944, 13.61931)
	setElementInterior(source, 0)
	setElementDimension(source, 0)
end
addEventHandler("onMarkerHit", MarkerSaida, Sair)

function FabricarArma (source, Arma, Valor, Tempo)
local Preco = tonumber(Valor)
local Time = tonumber(Tempo)
local Peca = getElementData(source, "TS:Peças "..Arma.."") or 0
local Quantidade = getElementData(source, "TS:Quanti"..Arma.."") or 0
local ID = getWeaponIDFromName ( Arma )
if getPlayerMoney(source) >= Preco then
setElementData(source, "TS:Peças "..Arma.."", Peca - 1)
setElementFrozen(source, true)
setElementData(source, "TS:TempoArma", Time)
setElementData(source, "TS:Parte", "Fabricando Peças")
takePlayerMoney(source, Preco)
triggerClientEvent(source, "TS:FecharArmas2", source)
triggerClientEvent(source, "TS:AbrirArmas2", source)
triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffVocê começou a fabricar uma "..Arma.." !", "info")
setPedAnimation( source, "WEAPONS", "SHP_Ar_Lift", true)
setElementData(source, "TS:PermissaoPegarArma", "Sim")
setPlayerWantedLevel(source, 6)
setTimer(function()
setElementData(source, "TS:Parte", "Lubrificando Peças")
setPedAnimation( source, "SHOTGUN", "shotgun_fire", true)
end, Time/3*60000, 1)
setTimer(function()
setElementData(source, "TS:Parte", "Montando Arma")
setPedAnimation( source, "WEAPONS","SHP_2H_LIFT", true)
end, Time/2*60000, 1)
setTimer(function()
local Perm = getElementData(source, "TS:PermissaoPegarArma") or "Não"
if Perm == "Sim" then
triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffVocê fabricou uma "..Arma.." com sucesso!", "info")
setElementFrozen(source, false)
setElementData(source, "TS:Parte", nil)
setElementData(source, "TS:TempoArma", nil)
setPedAnimation( source, nil)
giveWeapon(source, ID, 500)
triggerClientEvent(source, "TS:FecharArmas4", source)
end
end, Time*60000, 1)
else
triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffVocê não tem dinheiro suficiente!", "info")
end
end
addEvent ("TS:FabricarArma", true)
addEventHandler ("TS:FabricarArma", root, FabricarArma)

Espero ter ajudado, caso tenha duvidas so falar

Opá Amigo, Desculpa Desculpa desculpa incomodar ai, Mas eu Coloquei Aki e Não Foi, Tipo nem Abre, Eu Coloquei Assim olha, Ta certo?

Link to comment
function hit(element)
    if Markers.ID[source] then
        if getElementType(element) == "player" then
            if isObjectInACLGroup("user." ..getAccountName(getPlayerAccount(element)), aclGetGroup("AclPermitida")) then -- No lugar de "AclPermitida" troque para ACL que você deseja.
                triggerClientEvent(element, "TS:AbrirFArmas", element)
            end
        end
    end
end
addEventHandler("onMarkerHit", resourceRoot, hit)

 

Edited by CarlosAprendiz
Tinha colocado a parada errada.
  • 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...