Jump to content

SegSnigel

Members
  • Posts

    9
  • Joined

  • Last visited

Details

  • Gang
    heroes

SegSnigel's Achievements

Newbie

Newbie (4/54)

0

Reputation

  1. No but virus, i dont click on links that i have no idea what it is. Everything is in the correct place so nothing wrong there. I wrote above exactly how i want the script to work. Your code works exactly like mine i posted in my first post, the only problem is that other users can use the command to create a new vehicle when im inside of the vehicle.
  2. Thank you so much for the help mate but sadly not how i want it to work. This will create a vehicle and if im not in the vehicle then me or anyone else is not able to create a new one which is in the same model, only if the model id is not the same but then there will be 2 existing vehicles thats not what i want, i only want 1 vehicle to exist. This is how i want it: Lets say i creating a vehicle, now i need to exit the vehicle to be able to create a new one, or anyone else in the server. When i creating another vehicle the first one will get destroyed, so there will only be 1 existing vehicle.. My english isnt the best but hope you understood. Sorry but im not gonna click any links check what i wrote above thats how i want it
  3. Weird because im using the code you gav me last time. This one: Same problem, my friend created a vehicle then i used the command, his vehicle got destroyed and i created a new. I should not be allowed to use the command if hes using the vehicle
  4. I tested it too with both local and without local, when im in the vehicle my friend can still create a new vehicle and the vehicle i created got destroyed local have only with the scope to do if im right, the table is only visible inside this script, and access to local variables is faster what i heard ( i can be wrong ) But yes the same problem occurs
  5. I found out the error with ''debugscript 3'' at the first code you gave me so added this line ''local creados = {}'' but the code is still not working
  6. Im pretty new to Lua scripting but yes i know how tables(array) works in Lua. Maybe you could give me a little hint how i could solve my problem? Still the same problem, when im inside of the vehicle others can still create a new vehicle, they should only be allowed to use the command when noone is inside. But thanks anyways, i appreciate the help
  7. Hai So, this will make it able for a player to create a vehicle by command for example /vh 445. It works fine when i creating a vehicle, and if i try to create a new one when im inside of the vehicle it will output the text ''The vehicle is already in use..'', and if i exit the first vehicle and creating a new vehicle the first one will get destroyed and i will get my new vehicle i created. The problem is, when im inside of the vehicle and anyone else is using the command he will be able to use the command.. I just want the command to work for one person, i only wanna allow someone to create a vehicle when noone is in it. Thanks in advance! Here is my code: function createVehicleForPlayer(thePlayer, command, model) local x,y,z = getElementPosition(thePlayer) local rx,ry,rz = getElementRotation(thePlayer) local theVehicle = getPedOccupiedVehicle(thePlayer) if not theVehicle then if isElement(createdVehicle) then destroyElement(createdVehicle) end createdVehicle = createVehicle(model, x,y,z, rx,ry,rz) warpPedIntoVehicle (thePlayer, createdVehicle) else outputChatBox("The vehicle is already in use..", thePlayer, 0, 255, 0) end end addCommandHandler("vh", createVehicleForPlayer)
×
×
  • Create New...