Jump to content
  • 0

Help-Me


PoPaY_MTA

Question

 

I Need Help To Make A Script That Forbids Players From Downloading Give / Car To Pick Up A Vehicle!

 

 

I Did It, But It Did not Get It! Note: Script is in Portuguese

 

local Veiculos = {400} -- IDs dos Veículos.
Tulio = {}

function CreateVehicle (source)
if getElementData (source, "Pegou", true) then outputChatBox ('#00bfffAguarde #ffffff20 #00bfffsegundos para pegar novamente.',source,255,255,255,true) return end
if isElement(Tulio[source]) then destroyElement (Tulio[source]) 
Tulio[source] = nil
end
     local accName = getAccountName ( getPlayerAccount (Tulio) )
     if isObjectInACLGroup ("user."..accName, aclGetGroup ( "JOGADOR" ) ) then
local x,y,z = getElementPosition (source)
local Cars = Veiculos[math.random(#Veiculos)]
Tulio[source] = createVehicle (Cars,x,y,z)
warpPedIntoVehicle (source,Tulio[source])
outputChatBox ('#888888[#FF8800SERVIDOR#888888]'..getPlayerName(source)..' #FFFFFFPegou um veiculo digitando #FF8800/veh', root, 255, 255, 255, true)
setElementData (source, "Pegou",true)
setTimer (setElementData, 20000, 1, source, "Pegou", false)
end
addCommandHandler ("veh", CreateVehicle)

function DestroyVeiculo ()
destroyElement (Tulio[source])
end
addEventHandler ("onPlayerLogout", root, DestroyVeiculo)
addEventHandler ("onPlayerQuit", root, DestroyVeiculo)
addEventHandler ("onPlayerWasted", root, DestroyVeiculo)

 

Link to comment

1 answer to this question

Recommended Posts

  • 0

Hello my friend!

I think I've found your problem!

Notice that where it's marked in print, do we have different arguments?

Maybe this is it.

 

6kOnDGE.png,

 

Try this code:
 


 
  1. local Veiculos = {400} -- IDs dos Veículos.
  2. Tulio = {}
  3.  
  4. function CreateVehicle (source)
  5. if getElementData (source, "Pegou", true) then outputChatBox ('#00bfffAguarde #ffffff20 #00bfffsegundos para pegar novamente.',source,255,255,255,true) return end
  6. if isElement(Tulio[source]) then destroyElement (Tulio[source])
  7. Tulio[source] = nil
  8. end
  9. local accName = getAccountName ( getPlayerAccount (Tulio) )
  10. if isObjectInACLGroup ("user."..accName, aclGetGroup ( "JOGADOR" ) ) then
  11. local x,y,z = getElementPosition (source)
  12. local Cars = Veiculos[math.random(#Veiculos)]
  13. Tulio[source] = createVehicle (Veiculos,x,y,z)
  14. warpPedIntoVehicle (source,Tulio[source])
  15. outputChatBox ('#888888[#FF8800SERVIDOR#888888]'..getPlayerName(source)..' #FFFFFFPegou um veiculo digitando #FF8800/veh', root, 255, 255, 255, true)
  16. setElementData (source, "Pegou",true)
  17. setTimer (setElementData, 20000, 1, source, "Pegou", false)
  18. end
  19. addCommandHandler ("veh", CreateVehicle)
  20.  
  21. function DestroyVeiculo ()
  22. destroyElement (Tulio[source])
  23. end
  24. addEventHandler ("onPlayerLogout", root, DestroyVeiculo)
  25. addEventHandler ("onPlayerQuit", root, DestroyVeiculo)
  26. addEventHandler ("onPlayerWasted", root, DestroyVeiculo)
Edited by _Pattif_
I don't edited
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...