shaio

Members
  • Content Count

    117
  • Joined

  • Last visited

Everything posted by shaio

  1. shaio

    Lock System

    How would I make the tables save to vehicle?
  2. shaio

    Tuning Garage Help

    I've done this, cuz it wont call the function globally.. It works, without any errors. I've debugged the script as well, still no errors. Thanks for the help guys.. garages = { {x = 14795,4105.1455078125,y = -1620.6474609375,z = 226.63835144043,rx = 180,ry = 0,rz = 0}, {x = 14795,4105.1455078125,y = -1620.6474609375,z = 216.1208190918,rx = 0,ry = 0,rz = 0} } markers = { {x = 2066.962890625,y = -1831.306640625,z = 13.546875}, {x = 1848.5556640625,y = -1856.2978515625,z = 13.3828125}, {x = 1024.705078125,y = -1025.365234375,z = 32.1015625}, {x = -1936.2119140625,y = 243.2685546875,z = 34.4609375}, {x = -1904.5869140625,y = 282.06640625,z = 41.046875}, {x = -2426.064453125,y = 1023.9189453125,z = 50.397659301758}, {x = -1786.8173828125,y = 1212.4912109375,z = 25.125}, {x = -1420.451171875,y = 2587.189453125,z = 55.84326171875} } for _,g in ipairs(garages) do garage = createObject(g.x,g.y,g.z,g.rx,g.ry,g.rz) end for _,t in pairs(markers) do marker = createMarker(t.x,t.y,t.z-1,"cylinder",3,255,255,255,255) addEventHandler("onMarkerHit",marker, function (element,dimension) if (getElementType(element) == "vehicle") then setElementPosition(element,4104.921875,-1621.7041015625,211.47169494629) setElementFrozen(element,true) end end) end
  3. shaio

    Tuning Garage Help

    So it should look something like this? garages = { {x = 14795,4105.1455078125,y = -1620.6474609375,z = 226.63835144043,rx = 180,ry = 0,rz = 0}, {x = 14795,4105.1455078125,y = -1620.6474609375,z = 216.1208190918,rx = 0,ry = 0,rz = 0} } markers = { {x = 2066.962890625,y = -1831.306640625,z = 13.546875}, {x = 1848.5556640625,y = -1856.2978515625,z = 13.3828125}, {x = 1024.705078125,y = -1025.365234375,z = 32.1015625}, {x = -1936.2119140625,y = 243.2685546875,z = 34.4609375}, {x = -1904.5869140625,y = 282.06640625,z = 41.046875}, {x = -2426.064453125,y = 1023.9189453125,z = 50.397659301758}, {x = -1786.8173828125,y = 1212.4912109375,z = 25.125}, {x = -1420.451171875,y = 2587.189453125,z = 55.84326171875} } for _,g in ipairs(garages) do garage = createObject(g.x,g.y,g.z,g.rx,g.ry,g.rz) end for _,t in pairs(markers) do marker = createMarker(t.x,t.y,t.z-1,"cylinder",3,255,255,255,255) addEventHandler("onMarkerHit",marker,onHit) end function onHit(element,dimension) if (getElementType(element) == "vehicle") then setElementPosition(element,4104.921875,-1621.7041015625,211.47169494629) setElementFrozen(element,true) end end
  4. shaio

    time random

    Wrong luka, with a timer 5000 = 5 seconds. 5 minutes = 300000. money = 0 setTimer(function() money = money + 50 givePlayerMoney(getRandomPlayer(), money) end, 300000, 0)
  5. shaio

    Tuning Garage Help

    Actually no I don't. It makes a marker for each location.. There is no destroyElement, or destroyMarker. I've tested this, all the markers get created and I've created the garages. I've debugged the script and found that the event handler has a bad argument. It cannot find the marker. Even tho I made the variable global. I still need help..
  6. shaio

    Lock System

    Honestly, I have no fucking clue how to add this shit to my script .
  7. Could someone tell me what is wrong with this script? garages = { {x = 14795,4105.1455078125,y = -1620.6474609375,z = 226.63835144043,rx = 180,ry = 0,rz = 0}, {x = 14795,4105.1455078125,y = -1620.6474609375,z = 216.1208190918,rx = 0,ry = 0,rz = 0} } markers = { {x = 2066.962890625,y = -1831.306640625,z = 13.546875}, {x = 1848.5556640625,y = -1856.2978515625,z = 13.3828125}, {x = 1024.705078125,y = -1025.365234375,z = 32.1015625}, {x = -1936.2119140625,y = 243.2685546875,z = 34.4609375}, {x = -1904.5869140625,y = 282.06640625,z = 41.046875}, {x = -2426.064453125,y = 1023.9189453125,z = 50.397659301758}, {x = -1786.8173828125,y = 1212.4912109375,z = 25.125}, {x = -1420.451171875,y = 2587.189453125,z = 55.84326171875} } for _,g in pairs(garages) do garage = createObject(g.x,g.y,g.z,g.rx,g.ry,g.rz) end for _,t in pairs(markers) do marker = createMarker(t.x,t.y,t.z,"cylinder",3,0,0,0,0) end function onHit(element,dimension) if isPlayerInVehicle(source) then local vehicle = getPedOccupiedVehile(source) setElementPosition(vehicle,4104.921875,-1621.7041015625,211.47169494629) setElementFrozen(vehicle,true) end end addEventHandler("onPlayerMarkerHit",marker,onHit)
  8. shaio

    Lock System

    ill just check if the player is 'shared' with the same function, and if so, unshare them But how would i save the players serial to the tables..?
  9. shaio

    Lock System

    first question (yes) second question (freeroam) I run my own freeroam/drift/rp/zombies gamemode server, its kinda just a bunch of shit piled on , but it did turn out pretty decent. This lock script to me just seems like a piece of mumbo jumbo. How would i make /share so u could share with a specific person, enable and disable it for that person and what not.. I also dont like how everytime a person enters a car, the data changes to their serial..
  10. shaio

    Lock System

    I've been working on this for a while now, but I think I'm a script kiddie, this works like shit was just thrown together :L Idk how to go any further with it. Is there anyway to enhance this?? function lock(player,cmd) if isPedInVehicle(player) then if getPedOccupiedVehicleSeat(player) == 0 then if (getElementData(getPedOccupiedVehicle(player),"locks") == true) then setElementData(getPedOccupiedVehicle(player),"lock",false) setElementData(getPedOccupiedVehicle(player),"locks",false) setVehicleLocked(getPedOccupiedVehicle(player),false) outputChatBox("Unlocked!",player,0,255,255) else setElementData(getPedOccupiedVehicle(player),"lock",getPlayerSerial(player)) setElementData(getPedOccupiedVehicle(player),"locks",true) outputChatBox("Locked!",player,0,255,255) end else outputChatBox("You are not the driver!",player,0,255,255) end end end addCommandHandler("lock",lock) addEventHandler ("onPlayerJoin", getRootElement(), function() bindKey (source, "k", "down", lock) end) addEventHandler ("onResourceStart", getResourceRootElement(getThisResource()), function() local players = getElementsByType ("player") for k, player in ipairs (players) do bindKey (player, "k", "down", lock) end end) function inveh(player,seat,jacked) local accountName = getAccountName(getPlayerAccount(player)) if isObjectInACLGroup("user."..accountName,aclGetGroup("Admin")) or isObjectInACLGroup("user."..accountName,aclGetGroup("SuperModerator")) or isObjectInACLGroup("user."..accountName,aclGetGroup("Moderator"))then return else if not (getElementData(source,"locked") == getPlayerSerial(player)) then if (getElementData(source,"lockeds") == false) then return else if (seat == 0) then cancelEvent() outputChatBox("This is not your vehicle!",player,0,255,255) end end end end end addEventHandler("onVehicleStartEnter",getRootElement(),inveh) function share(player,cmd) if (getVehicleOccupant(getPedOccupiedVehicle(player),0) == player) then setElementData(getPedOccupiedVehicle(player),"lockeds",false) setElementData(getPedOccupiedVehicle(player),"lock",false) outputChatBox("Vehicle is now shared with everyone!",player,0,255,255) else outputChatBox("You need to be the driver!",player,0,255,255) end end addCommandHandler("share",share) function ejectPlayer(player,cmd,eject) if (getVehicleOccupant(getPedOccupiedVehicle(player),0) == player) then removePlayerFromVehicle(getPlayerFromPartialName(eject)) outputChatBox(getPlayerName(player).." has removed you from the vehicle!",getPlayerFromPartialName(eject),0,255,255) else outputChatBox("You need to be the driver!",player,0,255,255) end end addCommandHandler("eject",ejectPlayer) function getPlayerFromPartialName(name) local name = name and name:gsub("#%x%x%x%x%x%x", ""):lower() or nil if name then for _, player in ipairs(getElementsByType("player")) do local name_ = getPlayerName(player):gsub("#%x%x%x%x%x%x", ""):lower() if name_:find(name, 1, true) then return player end end end end
  11. shaio

    Rainbow Colored Car

    but now it only displays hot colors, not the full spectrum.
  12. shaio

    Pedmaker

    so like this? function makePed(player,cmd,id,animGroup,anim,frozen,times) local x,y,z = getElementPosition(player) local rx,ry,rz = getElementRotation(player) local dim = getElementDimension(player) local int = getElementInterior(player) if not id then outputChatBox("Syntax: /ped (id) (animationGroup) (animation) (frozen=true/false) (time)",player,0,255,255) else ped = createPed(tonumber(id),x,y,z) setElementDimension(ped,dim) setElementInterior(ped,int) end if not frozen then setElementFrozen(ped,true) else if frozen == "false" then setElementFrozen(ped,false) elseif frozen == "true" then setElementFrozen(ped,true) end end setElementRotation(ped,rx,ry,rz) if animGroup then if anim then if times then setTimer(function() setPedAnimation(ped,animGroup,anim) end,times,0) end end for _,s in ipairs(getElementsByType("player")) do outputChatBox(getPlayerName(player).." has created a ped at X:"..x.." Y:"..y.." Z:"..z,s,0,255,255) outputChatBox("Ped Info: ID: "..id.." Animation: "..animGroup.."/"..anim,s,0,255,255) end end addCommandHandler("ped",makePed) function clearPed(player,cmd) for _,v in ipairs(getElementsByType("player")) do outputChatBox(getPlayerName(player).." has cleared all peds!",v,0,255,255) end for _,ped in ipairs(getElementsByType("ped")) do destroyElement(ped) end end addCommandHandler("clearpeds",clearPed)
  13. shaio

    Pedmaker

    Look below I fucked up this post..
  14. shaio

    Pedmaker

    alright thank you.
  15. shaio

    Commands

    Server.lua - function functionA(player,cmd) end function functionB(player,cmd) end addCommandHandler("testa",functionA) addCommandHandler("testb",functionB) addCommandHandler("testc",{functionA,functionB}) Like Cody said, but you need the player,cmd inside of () on function - IF SERVERSIDE, if its clientside then just cmd inside () Client.lua - function functionA(cmd) end function functionB(cmd) end addCommandHandler("testa",functionA) addCommandHandler("testb",functionB) addCommandHandler("testc",{functionA,functionB})
  16. shaio

    Pedmaker

    I made this script not to long ago, cuz I wanted to make strippers in the strip club. My original plan was just to make a function with two values. player and cmd, but then I wanted to make it more expendable. So I added more options Now honestly I have no idea what is wrong with this script, but it's givin the console errors like there's no tomorrow.. So, help meh out doods. function makePed(player,cmd,id,animGroup,anim,frozen,times) local x,y,z = getElementPosition(player) local rx,ry,rz = getElementRotation(player) local dim = getElementDimension(player) local int = getElementInterior(player) ped = createPed(id,x,y,z) setElementDimension(ped,dim) setElementInterior(ped,int) if not frozen then setElementFrozen(ped,true) else if frozen == "false" then setElementFrozen(ped,false) elseif frozen == "true" then setElementFrozen(ped,true) end end setElementRotation(ped,rx,ry,rz) setTimer(function() setPedAnimation(ped,animGroup,anim) end,times,0) for _,s in ipairs(getElementsByType("player")) do outputChatBox(getPlayerName(player).." has created a ped at X:"..x.." Y:"..y.." Z:"..z,s,0,255,255) outputChatBox("Ped Info: ID: "..id.." Animation: "..animGroup.."/"..anim,s,0,255,255) end end addCommandHandler("ped",makePed) function clearPed(player,cmd) for _,v in ipairs(getElementsByType("player")) do outputChatBox(getPlayerName(player).." has cleared all peds!",v,0,255,255) end for _,ped in ipairs(getElementsByType("ped")) do destroyElement(ped) end end addCommandHandler("clearpeds",clearPed)
  17. shaio

    Rainbow Colored Car

    Yes that code makes it go as slow as I want it to, but it only does hot colors, not cold colors, like blue..
  18. shaio

    Sound with links

    right but what variables do i need in the function to trigger the event properly?
  19. shaio

    Log

    u can gather data from local files as well
  20. shaio

    Sound with links

    for real bro its not leaked..
  21. shaio

    Simple Pay Script

    Oh I see what u did, thx bro. I feel retarded now I couldn't figure that out..
  22. shaio

    Rainbow Colored Car

    ill prob just record it and show u that way..
  23. shaio

    Sound with links

    this is not a leaked script, this is custom built by a scripter that i know, but the scripter wont help me so i'm asking for help here. The script works, I just don't have the serverside for it..