Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. My server also uses OVH, we have no problems so far.
  2. Obvio, si no definiste la posicion en el server side... triggerClientEvent ( player, "beepbeep", player, getElementPosition ( vehicle ) )
  3. triggerClientEvent ( player, "beepbeep", player, x, y, z )
  4. Los unicos trucos que se pueden activar con una funcion son los de volar, conducir por el agua, saltar mas alto con la bicicleta y saltar mas alto como jugador.
  5. Castillo

    ¡Duda!

    fileRead lo unico que leera es el codigo compilado.
  6. That's because it doesn't make any sense, what are you trying to do?
  7. function DrawTableString ( ) local x,y = guiGetScreenSize ( ) for _, v in ipairs ( DrawStringTable ) do local vals = { } for _, value in ipairs ( string.split ( v, "," ) ) do table.insert ( vals, tonumber ( value ) ) end dxDrawRectangle ( unpack ( vals ) ) end end addEventHandler ( "onClientRender", getRootElement(), DrawTableString ) P.S: Why are you using a custom function to split it? MTA has "split" function which does the same.
  8. Well, the thing is, they'll be strings now, not numbers.
  9. Please.Don't lie. You've stoled it from Server named Grafuroam. I don't think that's the case, if I'm correct, he took it from this topic: viewtopic.php?f=91&t=71604
  10. local minutes = 5 --here change how many u want setTimer ( function ( ) local vehicles = getElementsByType ( "vehicle" ) if ( #vehicles > 0 ) then for _, vehicle in ipairs ( vehicles ) do if isVehicleEmpty ( vehicle ) then destroyElement ( vehicle ) end end end end , minutes * 60000, 0) function isVehicleEmpty( vehicle ) if not isElement( vehicle ) or getElementType( vehicle ) ~= "vehicle" then return true end local passengers = getVehicleMaxPassengers( vehicle ) if type( passengers ) == 'number' then for seat = 0, passengers do if getVehicleOccupant( vehicle, seat ) then return false end end end return true end
  11. Castillo

    Jobs

    You're welcome.
  12. getPedOccupiedVehicle is used to get the vehicle out of a PLAYER/PED. To see if it's empty or not, use getVehicleOccupants. Or you can simply use this function: https://wiki.multitheftauto.com/wiki/IsVehicleEmpty
  13. Castillo

    Jobs

    local job = {} local markers = { } createTheJobs = function() for a,b in ipairs(jobs) do marker = createMarker(b.markerX, b.markerY, b.markerZ, "cylinder", markerSize or 2, b.markerColorR, b.markerColorG, b.markerColorB) markers [ b.jobTitle ] = marker blip = createBlipAttachedTo(marker,b.blip) setElementVisibleTo (blip, root, b.alpha) setBlipVisibleDistance(blip, 500) setElementData(marker, "title", b.jobTitle) setElementData(marker, "group", b.group) setElementData(marker, "team", b.team) job[marker] = b.group setElementData(marker, "info", b.information) setElementData(marker, "skins", b.skins) addEventHandler("onMarkerHit", marker, handleJobMarkerHit) end end addEventHandler("onResourceStart", resourceRoot, createTheJobs) handleJobMarkerHit = function(player) local role = getElementData(source,"group") if (getElementType(player) == "player") then if (getElementData(player, dataToFindPlayersJob) == role or role == "ALL") then if isPedInVehicle(player) then return end local info= getElementData(source, "info") local skin= getElementData(source, "skins") triggerClientEvent(player, "jobsystem.showJobGUI", root, getElementData(source, "title"), skin, info) else exports["TopBarChat"]:sendClientMessage("This marker is allowed for only "..role.." group.", player, 255, 0, 0) end end end onPlayerAcceptJob = function(job, skin) setElementModel(client, skin) setElementData(client, "Occupation", job) exports["TopBarChat"]:sendClientMessage("You're working as "..job, client, 0, 255, 0) local marker = markers [ job ] if ( marker ) then setPlayerNametagColor ( client, getMarkerColor(marker)) local team = getElementData(marker, "team") local team = getTeamFromName ( team ) if ( team ) then setPlayerTeam(client, team) end end addEvent("onPlayerAcceptJob", true) addEventHandler("onPlayerAcceptJob", root, onPlayerAcceptJob)
  14. Castillo

    Jobs

    What does "team" element data contain? Edit: You do understand that the "marker" variable is being overwritten everytime? you should store the job marker using the job name in a table.
  15. addEventHandler ( "onClientResourceStart", resourceRoot, function ( ) setPedCanBeKnockedOffBike ( localPlayer, false ) end )
  16. Are you sure the problem is in that code? if your check to see if attempts are 0 or lower returns true, it means that the problem is where you decrease attempts variable.
  17. dxDrawText doesn't return an element, it returns a boolean ( true/false ). To "destroy" it, just stop rendering it.
  18. That doesn't make any sense.
×
×
  • Create New...