Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. Castillo

    Table

    I'm afraid I don't understand what do you mean, "2" is the index.
  2. Yes, you'll only need R, G, B for the vehicle color.
  3. Yes, you can use getRadarAreaColor to get the color of it.
  4. Castillo

    Bindkey

    Server side bindKey requires a player element, bind it when you join, and when resource starts for all players.
  5. Castillo

    Bindkey

    Just bind the key, instead of a command.
  6. Castillo

    Question

    You're welcome.
  7. You must check if the hit element is a player. function vender ( hitElement ) if ( isElement ( hitElement ) and getElementType ( hitElement ) == "player" ) then if isPedInVehicle ( hitElement ) then local amount = math.random ( 20000, 60000 ) local playercar = getPedOccupiedVehicle ( hitElement ) if ( getElementModel ( playercar ) == 520 or getElementModel ( playercar ) == 425 ) then givePlayerMoney ( hitElement, amount ) outputChatBox ( "*Voce vendeu seu carro por #ff0000R$ ".. amount .." #00ff00Reais.", hitElement, 0, 255, 0, true ) removePedFromVehicle ( playercar ) destroyElement ( playercar ) end else outputChatBox ("[ERRO]: é necessario voce esta em um carro para vender.",hitElement, 255,100,100 ) end end end addEventHandler ( "onMarkerHit", markertransfeder, vender )
  8. To change these things, go to "play/broph.map".
  9. You must enable the colorCoded argument too.
  10. dxDrawColorText isn't required, MTA supports HEX colors for the dxDrawText function.
  11. local screenW, screenH = guiGetScreenSize ( ) function Player_Render ( ) if isPedInVehicle ( localPlayer ) then local vehicle = getPedOccupiedVehicle ( localPlayer ) local driver = getVehicleOccupant ( vehicle, 0 ) if ( driver ) then dxDrawText ( getPlayerName ( driver ), screenW - 100 - 60, (screenH - 26) / 2 - 160, (screenW - 100 - 60) + 100, ( (screenH - 26) / 2 - 160) + 26, tocolor(153, 153, 153, 255), 0.80, "sans", "center", "center", false, false, true, false, false ) end end end --// Triggering //--- addEventHandler ( "onClientVehicleEnter", getRootElement(), function ( thePlayer ) if ( thePlayer == localPlayer ) then addEventHandler ( "onClientRender", getRootElement(), Player_Render ) end end ) addEventHandler ( "onClientVehicleExit", getRootElement(), function ( thePlayer ) if ( thePlayer == localPlayer ) then removeEventHandler ( "onClientRender", getRootElement(), Player_Render ) end end )
  12. No, it uses R, G, B. addEventHandler ( "onResourceStart", resourceRoot, function ( ) setWaterColor ( 255, 0, 0 ) end )
  13. addCommandHandler ( "downloadfile", function ( ) fetchRemote ( "http://localhost:8080/image.jpg", myCallback, "", false ) end ) function myCallback ( responseData, errno ) if ( errno == 0 ) then local file = fileCreate ( "image.jpg" ) if ( file ) then fileWrite ( file, responseData ) fileClose ( file ) outputChatBox ( "image.jpg successfully downloaded and created!" ) end end end NOTE: When you use fetchRemote client side, you can't use an external web server.
  14. I used fetchRemote for my server and it worked just wonderful.
  15. Decis borrar objetos del mapa original? entonces podes usar la funcion que yo cree, es el icono del mundo con una X roja, esta al lado del replicador de objetos del mapa original.
×
×
  • Create New...