Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. addEvent ( "onZombieWasted", true ) addEventHandler( "onZombieWasted", root, function ( killer ) if ( killer and getElementType ( killer ) == "player" ) then local killerName = getPlayerName ( killer ) local weapon = getPedWeapon ( killer ) local wr, wg, wb = getPlayerNametagColor ( killer ) exports.killmessages:outputMessage ( { killerName, { "padding", width = 3 }, { "icon", id = weapon or 0 }, { "padding", width = 3}, { "color", r = 255, g = 0, b = 0 }, "Zombie" }, root, wr, wg, wb ) end end ) addEventHandler ( "onPlayerWasted", root, function ( ammo, killer ) if ( killer and killer ~= source and getElementType ( killer ) == "ped" ) then local weapon = getPedWeapon ( killer ) local wr, wg, wb = 255, 0, 0 exports.killmessages:outputMessage ( { "Zombie", { "padding", width = 3 }, { "icon", id = weapon or 0 }, { "padding", width = 3 }, { "color", r = 255, g = 0, b = 0 }, getPlayerName ( source ) }, root, wr, wg, wb ) end end )
  2. That's because the max health is about 100-200%. The extrahealth resource seems to be bugged, there was a topic related to the same.
  3. Sep, ami me paso lo mismo, podrias intentar crear los coches server side. Usa triggerServerEvent.
  4. addEventHandler ( "onClientVehicleEnter", root, function ( ) local markerjob = createMarker ( 246.55173, 1434.92371, 23.37029, "cylinder", 1.5, 0, 255, 255, 170 ) blip = createBlipAttachedTo ( markerjob, 51, 1 ) end )
  5. Sabes detectar errores en tus scripts? si no es asi, entonces pone: /debugscript 3 en el chat del juego y postea los errores que aparecen.
  6. https://wiki.multitheftauto.com/wiki/Ser ... _functions https://wiki.multitheftauto.com/wiki/Ser ... ape_events https://wiki.multitheftauto.com/wiki/Has ... rmissionTo https://wiki.multitheftauto.com/wiki/IsObjectInACLGroup
  7. Que autos? no te entiendo.
  8. Me parece que tenes que empezar a usar anteojos: onClientVehicleEnter no: onVehicleEnter.
  9. Usa onClientVehicleEnter + createMarker.
  10. local x = 1540.95654 local y = -1687.67078 local z = 5.89063 local market = createMarker ( 685.62610, -2692.39307, 7.5, "cylinder", 1.5, 0, 0, 255, 170 ) local market2 = createMarker ( 294.38306 + 2, -167.90103, 1.57813 - 1, "cylinder", 1.5, 0, 0, 255, 170 ) local market3 = createMarker ( 1526.51270, -1677.93237, 5, "cylinder", 1.5, 0, 0, 255, 170 ) local ped = createPed ( 286, 1525.26294, -1677.85596, 5.89063, 270 ) setElementFrozen(ped, true) GUIEditor_Grid = {} GUIEditor_Grid[1] = guiCreateGridList(258,160,294,357,false) guiSetVisible( GUIEditor_Grid[1], false ) guiGridListSetSelectionMode(GUIEditor_Grid[1],2) guiGridListAddColumn(GUIEditor_Grid[1],"Autos",0.50) for i = 1, 2 do guiGridListAddRow(GUIEditor_Grid[1]) end guiGridListSetItemText(GUIEditor_Grid[1],0,1,"Camion Polis",false,false) guiGridListSetItemText(GUIEditor_Grid[1],1,1,"Auto Polis",false,false) addEventHandler("onClientGUIDoubleClick", root, function ( ) if ( source == GUIEditor_Grid[1] ) then local row, col = guiGridListGetSelectedItem ( source ) if ( row and col and row ~= -1 and col ~= -1 ) then if ( row == 0 ) then v1 = createVehicle ( 427, x, y, z ) arrowMarker = createMarker ( 0, 0, 0, "arrow", .75, 255, 0, 0, 170 ) attachElements ( arrowMarker, v1, 0, 0, 2 ) elseif ( row == 1 ) then v2 = createVehicle ( 596, x, y, z ) arrowMarker = createMarker ( 0, 0, 0, "arrow", .75, 255, 0, 0, 170 ) attachElements ( arrowMarker, v2, 0, 0, 2 ) end guiSetVisible( GUIEditor_Grid[1], false ) end end end ) -- Te falto el parentesis. bindKey ( "enter", "down", function ( ) if ( isElementWithinMarker ( localPlayer, market3 ) ) then guiSetVisible ( GUIEditor_Grid[1], true ) end end ) addEventHandler ( 'onClientMarkerHit', root, function ( player ) if ( player == localPlayer and source == market ) then setTimer ( setElementPosition, 2000, 1, player, 294.38306, -167.90103, 1.57813 ); elseif ( player == localPlayer and source == market2 ) then setTimer ( setElementPosition, 2000, 1, player, 685.62610 + 2, -2692.39307 + 2, 7.5 + 2 ); elseif ( player == localPlayer and source == market3 ) then addEventHandler ( "onClientRender", root, drawText ) end end ) addEventHandler ( 'onClientMarkerLeave', root, function ( player ) if ( player == localPlayer and source == market3 ) then removeEventHandler ( "onClientRender", root, drawText ) end end ) function drawText ( ) dxDrawText("Press Enter for do the job",458.0,295.0,631.0,317.0,tocolor(255,0,0,170),1.2,"default","left","top",false,false,false) end Cambie como funciona, ahora pone la flecha arriva del vehiculo cuando lo spawneas.
  11. You forgot to specify the player argument on takePlayerMoney. function gives ( ) giveWeapon ( source, 34, 40, true ) takePlayerMoney ( source, 3000 ) end addEvent("gives",true) addEventHandler("gives",getRootElement(),gives)
  12. Lo estas usando con los vehiculos que creas con el script, verdad?
  13. @Cx.83: That's a decompiled script, stolen maybe?
  14. That's because you are using takePlayerMoney client side, use it server side when you give the weapon.
  15. local x = 1540.95654 local y = -1687.67078 local z = 5.89063 local market = createMarker ( 685.62610, -2692.39307, 7.5, "cylinder", 1.5, 0, 0, 255, 170 ) local market2 = createMarker ( 294.38306 + 2, -167.90103, 1.57813 - 1, "cylinder", 1.5, 0, 0, 255, 170 ) local market3 = createMarker ( 1526.51270, -1677.93237, 5, "cylinder", 1.5, 0, 0, 255, 170 ) local ped = createPed ( 286, 1525.26294, -1677.85596, 5.89063, 270 ) setElementFrozen(ped, true) GUIEditor_Grid = {} GUIEditor_Grid[1] = guiCreateGridList(258,160,294,357,false) guiSetVisible( GUIEditor_Grid[1], false ) guiGridListSetSelectionMode(GUIEditor_Grid[1],2) guiGridListAddColumn(GUIEditor_Grid[1],"Autos",0.50) for i = 1, 2 do guiGridListAddRow(GUIEditor_Grid[1]) end guiGridListSetItemText(GUIEditor_Grid[1],0,1,"Camion Polis",false,false) guiGridListSetItemText(GUIEditor_Grid[1],1,1,"Auto Polis",false,false) addEventHandler("onClientGUIDoubleClick", root, function ( ) if ( source == GUIEditor_Grid[1] ) then local row, col = guiGridListGetSelectedItem ( source ) if ( row and col and row ~= -1 and col ~= -1 ) then if ( row == 0 ) then v1 = createVehicle ( 427, x, y, z ) elseif ( row == 1 ) then v2 = createVehicle ( 596, x, y, z ) end guiSetVisible( GUIEditor_Grid[1], false ) end end end ) -- Te falto el parentesis. bindKey ( "enter", "down", function ( ) if ( isElementWithinMarker ( localPlayer, market3 ) ) then guiSetVisible ( GUIEditor_Grid[1], true ) end end ) addEventHandler ( 'onClientMarkerHit', root, function ( player ) if ( player == localPlayer and source == market ) then setTimer ( setElementPosition, 2000, 1, player, 294.38306, -167.90103, 1.57813 ); elseif ( player == localPlayer and source == market2 ) then setTimer ( setElementPosition, 2000, 1, player, 685.62610 + 2, -2692.39307 + 2, 7.5 + 2 ); elseif ( player == localPlayer and source == market3 ) then addEventHandler ( "onClientRender", root, drawText ) end end ) addEventHandler ( 'onClientMarkerLeave', root, function ( player ) if ( player == localPlayer and source == market3 ) then removeEventHandler ( "onClientRender", root, drawText ) end end ) function drawText ( ) dxDrawText("Press Enter for do the job",458.0,295.0,631.0,317.0,tocolor(255,0,0,170),1.2,"default","left","top",false,false,false) end function onMrWhoopeeEnter ( thePlayer ) if ( source == v1 or source == v2 ) then arrowMarker = createMarker ( 0, 0, 0, "arrow", .75, 255, 0, 0, 170 ) attachElements ( arrowMarker, source, 0, 0, 2 ) end end addEventHandler ( "onClientVehicleEnter", root, onMrWhoopeeEnter )
  16. createMarker + attachElements.
  17. There's also QT to Lua. viewtopic.php?f=91&t=27739 Is a program to create your GUI designs.
  18. That resource is very useful, I always use it for all my GUI's.
  19. local x = 1540.95654 local y = -1687.67078 local z = 5.89063 local market = createMarker ( 685.62610, -2692.39307, 7.5, "cylinder", 1.5, 0, 0, 255, 170 ) local market2 = createMarker ( 294.38306 + 2, -167.90103, 1.57813 - 1, "cylinder", 1.5, 0, 0, 255, 170 ) local market3 = createMarker ( 1526.51270, -1677.93237, 5, "cylinder", 1.5, 0, 0, 255, 170 ) local ped = createPed ( 286, 1525.26294, -1677.85596, 5.89063, 270 ) setElementFrozen(ped, true) GUIEditor_Grid = {} GUIEditor_Grid[1] = guiCreateGridList(258,160,294,357,false) guiSetVisible( GUIEditor_Grid[1], false ) guiGridListSetSelectionMode(GUIEditor_Grid[1],2) guiGridListAddColumn(GUIEditor_Grid[1],"Autos",0.50) for i = 1, 2 do guiGridListAddRow(GUIEditor_Grid[1]) end guiGridListSetItemText(GUIEditor_Grid[1],0,1,"Camion Polis",false,false) guiGridListSetItemText(GUIEditor_Grid[1],1,1,"Auto Polis",false,false) addEventHandler("onClientGUIDoubleClick", root, function ( ) if ( source == GUIEditor_Grid[1] ) then local row, col = guiGridListGetSelectedItem ( source ) if ( row and col and row ~= -1 and col ~= -1 ) then if ( row == 0 ) then createVehicle ( 427, x, y, z ) elseif ( row == 1 ) then createVehicle ( 596, x, y, z ) end guiSetVisible( GUIEditor_Grid[1], false ) end end end ) -- Te falto el parentesis. bindKey ( "enter", "down", function ( ) if ( isElementWithinMarker ( localPlayer, market3 ) ) then guiSetVisible ( GUIEditor_Grid[1], true ) end end ) addEventHandler ( 'onClientMarkerHit', root, function ( player ) if ( player == localPlayer and source == market ) then setTimer ( setElementPosition, 2000, 1, player, 294.38306, -167.90103, 1.57813 ); elseif ( player == localPlayer and source == market2 ) then setTimer ( setElementPosition, 2000, 1, player, 685.62610 + 2, -2692.39307 + 2, 7.5 + 2 ); elseif ( player == localPlayer and source == market3 ) then addEventHandler ( "onClientRender", root, drawText ) end end ) addEventHandler ( 'onClientMarkerLeave', root, function ( player ) if ( player == localPlayer and source == market3 ) then removeEventHandler ( "onClientRender", root, drawText ) end end ) function drawText ( ) dxDrawText("Press Enter for do the job",458.0,295.0,631.0,317.0,tocolor(255,0,0,170),1.2,"default","left","top",false,false,false) end
  20. Usa guiSetVisible para ocultarla al crearse, es algo muy facil, podes hacerlo solo.
  21. local x = 1540.95654 local y = -1687.67078 local z = 5.89063 local market = createMarker ( 685.62610, -2692.39307, 7.5, "cylinder", 1.5, 0, 0, 255, 170 ) local market2 = createMarker ( 294.38306 + 2, -167.90103, 1.57813 - 1, "cylinder", 1.5, 0, 0, 255, 170 ) local market3 = createMarker ( 1526.51270, -1677.93237, 5, "cylinder", 1.5, 0, 0, 255, 170 ) local ped = createPed ( 286, 1525.26294, -1677.85596, 5.89063, 270 ) setElementFrozen(ped, true) GUIEditor_Grid = {} GUIEditor_Grid[1] = guiCreateGridList(258,160,294,357,false) guiGridListSetSelectionMode(GUIEditor_Grid[1],2) guiGridListAddColumn(GUIEditor_Grid[1],"Autos",0.2) for i = 1, 2 do guiGridListAddRow(GUIEditor_Grid[1]) end local grid1 = guiGridListSetItemText(GUIEditor_Grid[1],0,1,"Camion Polis") local grid2 = guiGridListSetItemText(GUIEditor_Grid[1],1,1,"Auto Polis") addEventHandler("onClientDoubleClick", root, function ( ) if ( source == grid1 ) then createVehicle ( 427, x, y, z ) guiSetVisible( GUIEditor_Grid[1], false ) elseif ( source == grid2 ) then createVehicle ( 596, x, y, z ) guiSetVisible( GUIEditor_Grid[1], false ) end end ) -- You had a missing parentheses. bindKey ( "enter", "down", function ( ) if ( isElementWithinMarker ( localPlayer, market3 ) ) then guiSetVisible ( GUIEditor_Grid[1], true ) end end ) addEventHandler ( 'onClientMarkerHit', root, function ( player ) if ( player == localPlayer and source == market ) then setTimer ( setElementPosition, 2000, 1, player, 294.38306, -167.90103, 1.57813 ); elseif ( player == localPlayer and source == market2 ) then setTimer ( setElementPosition, 2000, 1, player, 685.62610 + 2, -2692.39307 + 2, 7.5 + 2 ); elseif ( player == localPlayer and source == market3 ) then addEventHandler ( "onClientRender", root, drawText ) end end ) addEventHandler ( 'onClientMarkerLeave', root, function ( player ) if ( player == localPlayer and source == market3 ) then removeEventHandler ( "onClientRender", root, drawText ) end end ) function drawText ( ) dxDrawText("Press Enter for do the job",458.0,295.0,631.0,317.0,tocolor(255,0,0,170),1.2,"default","left","top",false,false,false) end
  22. local x = 1540.95654 local y = -1687.67078 local z = 5.89063 local market = createMarker ( 685.62610, -2692.39307, 7.5, "cylinder", 1.5, 0, 0, 255, 170 ) local market2 = createMarker ( 294.38306 + 2, -167.90103, 1.57813 - 1, "cylinder", 1.5, 0, 0, 255, 170 ) local market3 = createMarker ( 1526.51270, -1677.93237, 5, "cylinder", 1.5, 0, 0, 255, 170 ) local ped = createPed ( 286, 1525.26294, -1677.85596, 5.89063, 270 ) setElementFrozen(ped, true) GUIEditor_Grid = {} GUIEditor_Grid[1] = guiCreateGridList(258,160,294,357,false) guiGridListSetSelectionMode(GUIEditor_Grid[1],2) guiGridListAddColumn(GUIEditor_Grid[1],"Autos",0.2) for i = 1, 2 do guiGridListAddRow(GUIEditor_Grid[1]) end local grid1 = guiGridListSetItemText(GUIEditor_Grid[1],0,1,"Camion Polis") local grid2 = guiGridListSetItemText(GUIEditor_Grid[1],1,1,"Auto Polis") addEventHandler("onClientDoubleClick", root, function ( ) if ( source == grid1 ) then createVehicle ( 427, x, y, z ) guiSetVisible( GUIEditor_Grid[1], false ) elseif ( source == grid2 ) then createVehicle ( 596, x, y, z ) guiSetVisible( GUIEditor_Grid[1], false ) end end ) -- Te falto el parentesis. bindKey ( "enter", "down", function ( ) if ( isElementWithinMarker ( localPlayer, market3 ) ) then guiSetVisible ( GUIEditor_Grid[1], true ) end end ) addEventHandler ( 'onClientMarkerHit', root, function ( player ) if ( player == localPlayer and source == market ) then setTimer ( setElementPosition, 2000, 1, player, 294.38306, -167.90103, 1.57813 ); elseif ( player == localPlayer and source == market2 ) then setTimer ( setElementPosition, 2000, 1, player, 685.62610 + 2, -2692.39307 + 2, 7.5 + 2 ); elseif ( player == localPlayer and source == market3 ) then addEventHandler ( "onClientRender", root, drawText ) end end ) addEventHandler ( 'onClientMarkerLeave', root, function ( player ) if ( player == localPlayer and source == market3 ) then removeEventHandler ( "onClientRender", root, drawText ) end end ) function drawText ( ) dxDrawText("Press Enter for do the job",458.0,295.0,631.0,317.0,tocolor(255,0,0,170),1.2,"default","left","top",false,false,false) end
  23. GUIEditor_Grid = {} GUIEditor_Grid[1] = guiCreateGridList(258,160,294,357,false) guiGridListSetSelectionMode(GUIEditor_Grid[1],2) guiGridListAddColumn(GUIEditor_Grid[1],"Autos",0.2) for i = 1, 2 do guiGridListAddRow(GUIEditor_Grid[1]) end guiGridListSetItemText(GUIEditor_Grid[1],0,1,"Camion Polis") guiGridListSetItemText(GUIEditor_Grid[1],1,1,"Auto Polis") local market = createMarker ( 685.62610, -2692.39307, 7.5, "cylinder", 1.5, 0, 0, 255, 170 ) local market2 = createMarker ( 294.38306 + 2, -167.90103, 1.57813 - 1, "cylinder", 1.5, 0, 0, 255, 170 ) local market3 = createMarker ( 1526.51270, -1677.93237, 5, "cylinder", 1.5, 0, 0, 255, 170 ) local ped = createPed ( 286, 1525.26294, -1677.85596, 5.89063, 270 ) setElementFrozen(ped, true) addEventHandler ( 'onClientMarkerHit', root, function ( player ) if ( player == localPlayer and source == market ) then setTimer ( setElementPosition, 2000, 1, player, 294.38306, -167.90103, 1.57813 ); elseif ( player == localPlayer and source == market2 ) then setTimer ( setElementPosition, 2000, 1, player, 685.62610 + 2, -2692.39307 + 2, 7.5 + 2 ); elseif ( player == localPlayer and source == market3 ) then addEventHandler ( "onClientRender", root, drawText ) end end ) addEventHandler ( 'onClientMarkerLeave', root, function ( player ) if ( player == localPlayer and source == market3 ) then removeEventHandler ( "onClientRender", root, drawText ) end end ) bindKey ( "enter", "down", function ( ) if ( isElementWithinMarker ( localPlayer, market3 ) ) then guiSetVisible ( GUIEditor_Grid[1], true ) end end ) function drawText ( ) dxDrawText("Press Enter for do the job",458.0,295.0,631.0,317.0,tocolor(255,0,0,170),1.2,"default","left","top",false,false,false) end
×
×
  • Create New...