Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. Do you mean with a scripting function? if so, you can't.
  2. getPlayerWantedLevel only returns the wanted level of the local player if you use it client side.
  3. Are you sure that the mod is being loaded?
  4. Supongo que decis que se pone en negro y luego vuelve, eso lo editas en el script.
  5. @SHADOW, @MADE: He's not talking about GUI, he's talking about DX rectangles. @Msypon: You must change the width as pNine said.
  6. If you say that, and you don't want to try, then I suggest you to don't even come to this section, because here we help you with your problems, we don't make it for you because you don't want to try to do it.
  7. That's why you need to use: onElementModelChange.
  8. function engineOffOn(source) if isPedInVehicle(source) then local sourceVehicle = getPedOccupiedVehicle( source ) if getVehicleEngineState ( sourceVehicle ) then setVehicleEngineState ( sourceVehicle, false ) else setVehicleEngineState ( sourceVehicle, true ) end end end addCommandHandler ( "engine", engineOffOn ) function changeLightsState(source) if isPedInVehicle(source) then local sourceVehicle = getPedOccupiedVehicle( player ) if getVehicleOverrideLights ( sourceVehicle ) ~= 2 then setVehicleOverrideLights( sourceVehicle, 2 ) else setVehicleOverrideLights( sourceVehicle, 1 ) end end end addEventHandler ( "onPlayerVehicleEnter",root,function( theVehicle, driver, jackerPlayer ) -- if it's the driver who got out, and he was not jacked, if driver == 0 and not jackerPlayer then -- turn on the engine setVehicleEngineState ( theVehicle, true ) end end) addEventHandler ( "onPlayerVehicleExit",root,function( theVehicle, driver, jackerPlayer ) -- if it's the driver who got out, and he was not jacked, if driver == 0 and not jackerPlayer then -- turn off the engine setVehicleEngineState ( theVehicle, false ) setVehicleOverrideLights ( theVehicle, 1 ) end end) addEventHandler ( "onResourceStart",resourceRoot,function() if res~= getThisResource() then return end local lightsKey = get("@jengine.lightsKey") for _, player in ipairs(getElementsByType("player")) do bindKey(player,lightsKey, "down", changeLightsState ) end end) addEventHandler("onResourceStop",resourceRoot,function(res) if res~= getThisResource() then return end for _, player in ipairs(getElementsByType("player")) do unbindKey(player,lightsKey, "down", changeLightsState ) end end) addEventHandler ( "onPlayerJoin",root,function() bindKey(source,lightsKey, "down", changeLightsState) end) addEventHandler ( "onPlayerQuit",root,function() unbindKey(source,lightsKey, "down", changeLightsState) end)
  9. No, setElementModel has two arguments only: the element, the model.
  10. Castillo

    Help.

    You are making it vice versa, you are checking if the wanted level is higher than 0, then give him the job. if ( wantedl > 0 ) then Should be: if ( wantedl == 0 ) then
  11. Castillo

    Imagen

    Fijate que esta devolviendo "health".
  12. You can try to make it, then you can post here what you tried and we can help you.
  13. You must have a script messing around.
  14. What do you mean by "script them to link"? You can get a marker made with map using getElementByID.
  15. You can also use the event: onElementModelChange to set back to his old skin if he get's one of these restricted skins.
  16. Castillo

    Hud messages

    local x, y = guiGetScreenSize() local boxes = {} local timers = {} local texts = { } local id = 1 function showBox(text, r, g, b, t) if not r or not g or not b then r, g, b = 255, 255, 255 end if not t then return end if ( texts [ text ] ) then return end local color = tocolor(r, g, b, 255) or -1 if t > 100 then playSoundFrontEnd ( 13 ) boxes[id] = {text, color} timers[id] = setTimer(destroyBox,t,1,id) texts [ text ] = true id = id + 1 end end function destroyBox(ids) local text = boxes[ids] [ 1 ] boxes[ids] = nil texts [ text ] = nil end function drawBoxes() local nextx = 0 local nexty = 0 for i,tab in pairs(boxes) do nextx = x/2 - string.len(tab[1])*7.5/2 dxDrawRectangle(nextx, nexty,string.len(tab[1])*8.5, 17, tocolor(0, 0, 0, 85)) dxDrawText(tab[1], nextx + 5, nexty, nextx - 10, nexty, tab[2], 1.0, "sans", "left", "top") nextx = nextx nexty = nexty + 17 end end addEvent("showBox", true) addEventHandler("showBox", root, showBox) addEventHandler("onClientRender", root, drawBoxes)
  17. Castillo

    [WIP]MTAM

    I haven't found a way to do it.
  18. My code worked? P.S: I corrected a typo at getElementPosition.
  19. function warphigh ( checkpoint, time ) local vehicle = getPedOccupiedVehicle ( source ) local x, y, z = getElementPosition ( vehicle ) local rx, ry, rz = getElementRotation ( vehicle ) setElementPosition ( vehicle, x, y, z + 20 ) setElementRotation ( vehicle, rx, ry, rz ) end addEvent ( 'onPlayerReachCheckpoint' ) addEventHandler ( 'onPlayerReachCheckpoint', getRootElement(), warphigh )
×
×
  • Create New...