Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. This is what I do to prevent explosion: function vehicleDamage ( loss ) local vehHealth = getElementHealth ( source ) if ( vehHealth < 300 ) then setElementHealth ( source, 300 ) setVehicleDamageProof ( source, true ) end end addEventHandler ( "onVehicleDamage", root, vehicleDamage ) Of course, if it's hit by a rocket it may not reach to prevent it.
  2. Weapons mod: https://community.multitheftauto.com/ind ... ls&id=5388 DONE
  3. First, we make the table with many coordinates: local coordinates = { { 0, 0, 5 }, { 0, 0, 10 } } second, we make a function to get random from it: function getRandomCoordinates ( ) return unpack ( coordinates [ math.random ( #coordinates ) ] ) end And third, we use our function: x, y, z = getRandomCoordinates ( ) About the vehicle, you can use getPedOccupiedVehicle.
  4. Each function does the same but with different coordinates? if so, then you should make a coordinates table and just one function.
  5. The event: onPlayerJoin is server side, you should use: onClientResourceStart.
  6. Si, es client side. Todas las funciones de DirectX ( DX ) o GUI son client side.
  7. local optimize = true -- Should the script be optimized? (if optimized, cannot be used client-side) local ids = {} function assignID() for i=1,getMaxPlayers() do if not ids[i] then ids[i] = source setElementData(source,"id",i,not optimize) break end end end addEventHandler("onPlayerJoin",root,assignID) function startup() exports [ "scoreboard" ]:scoreboardAddColumn( "id" ) for k, v in ipairs(getElementsByType("player")) do local id = getElementData(v,"id") if id then ids[id] = v end end end addEventHandler("onResourceStart",resourceRoot,startup) function getPlayerID(player) for k, v in ipairs(ids) do if v == player then return k end end end function freeID() local id = getElementData(source,"id") if not id then return end ids[id] = nil end addEventHandler("onPlayerQuit",root,freeID) function getPlayerByID(id) local player = ids[id] return player or false end That'll add a column called "id" to the scoreboard.
  8. It may be on some servers, but I don't think it's released to public, so you need to make your own.
  9. That's because you didn't even add it, also, your leave script should be server side as account and isObjectInACLGroup are server side functions.
  10. El dijo un grupo de ACL, no un team. aclCreateGroup
  11. Castillo

    Musica

    Para vos cambiar: resourceRoot por getResourceRootElement(getThisResource()) Es arreglarlo? no, es lo mismo. @pekio: El script no tiene ningun problema.
  12. https://community.multitheftauto.com/ind ... ls&id=5383 https://community.multitheftauto.com/ind ... ls&id=5382 Both same resource as "realdriveby". Vehicle mods: https://community.multitheftauto.com/ind ... ls&id=5380 https://community.multitheftauto.com/ind ... ls&id=5381 DONE
  13. Castillo

    playsong3d

    Nothing is wrong, it should work just fine.
  14. Instead of: addEventHandler You must use: addCommandHandler
  15. I already posted it here: viewtopic.php?f=91&t=25460
  16. Castillo

    little favor pls

    You can download it from here: viewtopic.php?f=108&t=39916
  17. Oh, my bad, I forgot about that part.
  18. There's no command to play a stream URL, you have to make it.
  19. You're welcome. P.S: We all learn from trial & error.
  20. Ya encontre el error, lo que pasa es que vos estabas comparando si el nivel era: mayor o igual que 1, pero como 2 es mayor que 1, entonces iva a seguir poniendo "110", asi que tenias que comparar si era igual a 1, 2, 3, 4, etc... Copia el ultimo codigo.
  21. No es de este script, ya que lo probe antes de postearlo.
  22. function dxsetText ( ) local text = "" local UP = tonumber ( getElementData ( localPlayer, "level" ) ) or 0 if ( UP == 1 ) then text = "110" elseif ( UP == 2 ) then text = "160" elseif ( UP == 3 ) then text = "240" elseif ( UP == 4 ) then text = "500" elseif ( UP == 5 ) then text = "2000" elseif ( UP == 6 ) then text = "4000" elseif ( UP == 7 ) then text = "8000" elseif ( UP == 8 ) then text = "12000" elseif ( UP == 9 ) then text = "16000" elseif ( UP == 10 ) then text = "20000" end dxDrawText ( text, 676, 193, 721, 203, tocolor ( 255, 255, 255, 255 ), 1.0, "default", "left", "top", false, false, false ) end addEventHandler ( "onClientRender", root, dxsetText ) Eso funciona.
  23. It has many errors. local VehMarker createMarker ( 2158, 2449, 11, "cylinder", 2, 0, 0, 255, 153 ) function spawnveh ( hitElement, matchingDimension ) local elementType = getElementType ( hitElement ) if ( elementType == "player" ) then local pteam = getPlayerTeam ( hitElement ) local pTeamName = ( pteam and getTeamName ( pteam ) or "" ) if ( pTeamName = "Police" ) then local x, y, z = getElementPosition ( hitElement ) local vehicle = createVehicle ( 597, x, y, z ) end end end addEventHandler ( "onMarkerHit", VehMarker, spawnveh ) That should work.
×
×
  • Create New...