Jump to content

I need help with a script


Maicol

Recommended Posts

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)

 

 

Edited by Tut
Link to comment

Hello Maicol, nice to meet you!

MTA has built-in functionality to limit command-access to server accounts. In a default MTA server, players can register an account using the "/register" command. Then you can give access to special commands to this registered account inside of the ACL.xml file. You can find documentation on how to edit the file here:

Acl - Multi Theft Auto: Wiki

You can locate the file inside of the "deathmatch" folder of your MTA server.

Example nodes:

<acl name="admin">
  ...
  <right name="command.auto" access="true" />
  <right name="command.moto" access="true" />
</acl>

<acl name="default">
  ...
  <right name="command.auto" access="false" />
  <right name="command.moto" access="false" />
</acl>

 

Edited by The_GTA
Link to comment
  • Tut changed the title to I need help with a script
On 28/9/2021 at 8:22, The_GTA said:

Hola Maicol, ¡encantado de conocerte!

MTA tiene una funcionalidad incorporada para limitar el acceso de comandos a las cuentas del servidor. En un servidor MTA predeterminado, los jugadores pueden registrar una cuenta usando el comando "/ register". Luego, puede dar acceso a comandos especiales a esta cuenta registrada dentro del archivo ACL.xml. Puede encontrar documentación sobre cómo editar el archivo aquí:

Acl - Multi Theft Auto: Wiki

Puede ubicar el archivo dentro de la carpeta "deathmatch" de su servidor MTA.

Nodos de ejemplo:

 
     
     


 
     
     

 

Una pregunta entonces dónde están las rayitas pongo los scripts para que fubcione

Link to comment
On 28/09/2021 at 17:54, Tut said:

I've translated your thread title into English, as it looks like you're not targeting this towards the Spanish audience.

The_GTA left you some good advice above. Alternatively you may want to use the Spanish subforums.

Hey, you have a really good instinct when it comes to foreign language support. It does not look like it is targeted for the Spanish subforums but the user has now replied in Spanish. To me it looks like automatic translation with the user being unaware that it was translated? He has even contacted me in Spanish using private messaging... I feel really sorry that I cannot speak his language though.

5 hours ago, Maicol said:

Una pregunta entonces dónde están las rayitas pongo los scripts para que fubcione

Maicol, I am really sorry but I don't understand Spanish properly enough to assist you with scripting in general if you are just speaking Spanish. But I swear that I would have liked to help you if I were fluent in Spanish. If you can limit your problem description to English then maybe. Otherwise this conversation should be held with native Spanish speakers.

Edited by The_GTA
Link to comment
  • Tut locked this topic
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...