Hello everyone, God bless you greatly, I want to know if you can help me with a script, I would appreciate it very much. I have the following script, I want those commands to work private for acl, or if there is a separate script to put that only those of that acl can execute it better to make a list of the private commands.
local Veiculos = {581, 462, 521, 461, 468, 586} -- IDs das Motos.
Gorilla = {}
function CreateVehicle (source)
if getElementData (source, "xx", true) then outputChatBox ('#8B0000Espere 1 minuto Para Pedir Una Moto ...',source,255,255,255,true) return end
if isElement(Gorilla[source]) then destroyElement (Gorilla[source])
Gorilla[source] = nil
end
local x,y,z = getElementPosition (source)
local Cars = Veiculos[math.random(#Veiculos)]
Gorilla[source] = createVehicle (Cars,x,y,z)
warpPedIntoVehicle (source,Gorilla[source])
outputChatBox ('#40FF00[SERVER] #FFFFFF'..getPlayerName(source)..' #FFFFFFSaco Una Moto con El Comando #FFFFFF[ #FFFF00/moto #FFFFFF]', root, 255, 255, 255, true)
setElementData (source, "xx",true)
setTimer (setElementData, 1000, 1, source, "xx", false)
end
addCommandHandler ("moto", CreateVehicle)
function DestroyVeiculo ()
destroyElement (Gorilla[source])
end
addEventHandler ("onPlayerLogout", root, DestroyVeiculo)
addEventHandler ("onPlayerQuit", root, DestroyVeiculo)
addEventHandler ("onPlayerWasted", root, DestroyVeiculo)
--Carro
local Veiculos = {402, 562, 560, 477, 602} -- IDs das carros.
Gorilla = {}
function CreateVehicle (source)
if getElementData (source, "xxx", true) then outputChatBox ('#8B0000Espere 1 minuto...',source,255,255,255,true) return end
if isElement(Gorilla[source]) then destroyElement (Gorilla[source])
Gorilla[source] = nil
end
local x,y,z = getElementPosition (source)
local Cars = Veiculos[math.random(#Veiculos)]
Gorilla[source] = createVehicle (Cars,x,y,z)
warpPedIntoVehicle (source,Gorilla[source])
outputChatBox ('#40FF00[SERVER] #FFFFFF'..getPlayerName(source)..' #FFFFFFSaco Un Auto Con El Comando #FFFFFF[ #FFFF00/auto #FFFFFF]', root, 255, 255, 255, true)
setElementData (source, "xxx",true)
setTimer (setElementData, 1000, 1, source, "xxx", false)
end
addCommandHandler ("auto", CreateVehicle)
function DestroyVeiculo ()
destroyElement (Gorilla[source])
end
addEventHandler ("onPlayerLogout", root, DestroyVeiculo)
addEventHandler ("onPlayerQuit", root, DestroyVeiculo)
addEventHandler ("onPlayerWasted", root, DestroyVeiculo)