Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. That function won't make it follow him, it'll only set the player as syncer. If you are talking about a ped, then you should use setPedControlState.
  2. Asi: local theMarker = createMarker ( 2290.21240, 2431.08228, 8.3, "cylinder", 1.5, 255, 0, 0, 170 ) setElementInterior ( theMarker, 3 )
  3. Lo cambiaste de interior al marcador?
  4. Search here: https://community.multitheftauto.com/
  5. Just so you know, this only creates the rope.
  6. You can either create a hidden GUI element in the same position or check the cursor position whenever you click.
  7. Any error on the debugscript? ( /debugscript 3 in-game ).
  8. You forgot about: function ( ) addEventHandler ( "onClientResourceStart", resourceRoot, function ( ) for i = 550, 20000 do engineSetModelLODDistance ( i, 10000000 ) end end )
  9. I cleaned and fixed your script, should work just fine now. -- client side: local marker = nil local blip = nil local marker0 = createMarker ( 1809.6, -1897.8, 12.6, "Cylinder", 2, 255, 255, 0, 100 ) local skins = { "Bus Driver 1 (skin: 253)", "Bus Driver 2 (skin: 255)" } windowjob = guiCreateWindow(0.335,0.14,0.3963,0.6817,"Bus Driver Job",true) guiSetVisible(windowjob, false) infomemo = guiCreateMemo(0.0347,0.0611,0.9369,0.3667,"The role of the Bus driver is to drive to vatious populous locations around the city\nWhen you enter a bus,you will be given a stop to drive to,marked by a waypoint blip\nWhen you arrive stop,you will then paid and given a new stop to drive to.\nPick up players to earn additional cash.\nThe bus stops will be given to you in a set order along a route.",true,windowjob) skinsgrid = guiCreateGridList(0.0347,0.4841,0.9369,0.313,true,windowjob) guiGridListSetSelectionMode(skinsgrid,2) _skins = guiGridListAddColumn(skinsgrid,"Skins",0.95) takebtn = guiCreateButton(0.2492,0.8289,0.5047,0.0562,"Accept",true,windowjob) closebtn = guiCreateButton(0.2492,0.9095,0.5047,0.0562,"Cancel",true,windowjob) infolbl = guiCreateLabel(0.2681,0.4279,0.4637,0.0538,"Choose your skin :",true,windowjob) guiLabelSetColor(infolbl,0,0,255) guiLabelSetVerticalAlign(infolbl,"center") guiLabelSetHorizontalAlign(infolbl,"center",false) guiSetFont(infolbl,"default-bold-small") for index, skin in ipairs ( skins ) do local row = guiGridListAddRow ( skinsgrid ) guiGridListSetItemText ( skinsgrid, row, _skins, tostring ( skin ), false, false ) end addEventHandler ( "onClientGUIClick", guiRoot, function ( ) if ( source == takebtn ) then local row, col = guiGridListGetSelectedItem ( skinsgrid ) if ( row and col and row ~= -1 and col ~= -1 ) then local skinName = guiGridListGetItemText ( skinsgrid, row, 1 ) if ( skinName == "Bus Driver 1 (skin: 253)" ) then triggerServerEvent ( "setBUS", localPlayer, 253 ) elseif ( skinName == "Bus Driver 2 (skin: 255)" ) then triggerServerEvent ( "setBUS", localPlayer, 255 ) end guiSetVisible ( windowjob, false ) showCursor ( false ) else outputChatBox ( "Please, select a skin of the list.", 255, 0, 0 ) end elseif ( source == closebtn ) then guiSetVisible ( windowjob, false ) showCursor ( false ) end end ) function BUSjob ( hitElement ) if ( getElementType ( hitElement ) == "player" ) and ( hitElement == localPlayer ) then if ( not guiGetVisible ( windowjob ) ) then guiSetVisible ( windowjob, true ) showCursor ( true ) end end end addEventHandler ( "onClientMarkerHit", marker0, BUSjob ) function BUSjobleave ( leaveElement ) if ( getElementType ( leaveElement ) == "player" ) and ( leaveElement == localPlayer ) then if guiGetVisible ( windowjob ) then guiSetVisible ( windowjob, false ) showCursor ( false ) end end end addEventHandler ( "onClientMarkerLeave", marker0, BUSjobleave ) addEvent ( "bus_set_location", true ) addEventHandler ( "bus_set_location", root, function ( x, y, z ) marker = createMarker ( x, y, z - 1, "cylinder", 3.5, 255, 255, 0, 170 ) blip = createBlipAttachedTo ( marker, 51 ) addEventHandler ( "onClientMarkerHit", marker, onBusStopHit ) end ) function onBusStopHit ( hitPlayer ) if ( getElementType ( hitPlayer ) == "player" ) and ( hitPlayer == localPlayer ) then triggerServerEvent ( "bus_finish", localPlayer ) if isElement ( blip ) then destroyElement ( blip ) end if isElement ( marker ) then removeEventHandler ( "onClientMarkerHit", marker, onBusStopHit ) destroyElement ( marker ) end end end addEventHandler ( "onClientVehicleExit", root, function ( thePlayer ) if ( thePlayer == localPlayer ) then if isElement ( blip ) then destroyElement ( blip ) end if isElement ( marker ) then removeEventHandler ( "onClientMarkerHit", marker, onBusStopHit ) destroyElement ( marker ) end end end ) -- server side: local busses = { [ 431 ] = true, [ 437 ] = true } local busSkins = { [ 255 ] = true, [ 253 ] = true } local busTable = { { 1743.1, -1857.6, 12.4 }, { 1043.1, -1983.7, 11.9 }, { 1670.9, -2251.2, 12.4 }, { 1277.2, -2053.4, 57.8 }, { 1478.3, -1729.5, 12.4 }, { 1467.9, -1157.9, 22.7 }, { 1787, -1175.7, 22.5 }, { 1854.2, -1394.7, 12.4 }, { 2227.4, -1381.3, 22.8 }, { 2740.5, -1447.3, 29.3 }, { 2160.2, -1001.7, 61.1 }, { 1990.1, -1355.8, 22.8 }, { 1436.1, -1437.7,12.4 }, { 659.5, -1392.1, 12.6 }, { 358.1, -1649.4, 31.6 }, { 206.3, -1464, 11.9 }, { 442, -1235.5, 48.6 }, { 1394.3, -934, 34.5 }, { 2182.6, -1104.7, 23.9 }, { 2819.9, -2034.2, 10 }, { 2215.2, -1908.8, 12.4 }, { 1818.6, -1907.8, 12.4 }, { 2115.7, -1481.2, 22.8 }, { 2091.7, -1764.8, 12.4 }, { 2332.1, -1969.7, 12.1 }, { 2468.6, -1729.2, 12.4 }, { 2532.6, -1924.4, 12.4 }, { 2766.5, -1952.1, 12.4 }, { 2514.8, -1296.6, 33.7 }, { 1065.1, -1568.9, 12.1 }, { 673.2, -1583.6, 12.8 }, { 527, -1544.2, 13.8 } } function getRandombusTable ( ) return unpack ( busTable [ math.random ( #busTable ) ] ) end function createbusTeam ( ) theTeam = createTeam ( "Bus Drivers", 218, 134, 32 ) end addEventHandler ( "onResourceStart", resourceRoot, createbusTeam ) addEventHandler ( "onVehicleStartEnter", root, function ( player, seat, jacked, door ) if ( busses [ getElementModel ( source ) ] ) and ( not busSkins [ getElementModel ( player ) ] ) and ( seat == 0 ) then cancelEvent ( ) end end ) function joinBUS ( skin ) setPlayerTeam ( source, theTeam ) setElementModel ( source, skin ) setElementData ( source, "Occupation", "Bus Drivers", true ) end addEvent ( "setBUS", true ) addEventHandler ( "setBUS", root, joinBUS ) function getNewBusLocation ( thePlayer ) local x, y, z = getRandombusTable ( ) triggerClientEvent ( thePlayer, "bus_set_location", thePlayer, x, y, z ) end function onVehicleEnter ( thePlayer ) if ( not busses [ getElementModel ( source ) ] ) then return end if ( not getPlayerTeam ( thePlayer ) ) then return end if ( getTeamName ( getPlayerTeam ( thePlayer ) ) == "Bus Drivers" ) then getNewBusLocation ( thePlayer ) end end addEventHandler ( "onVehicleEnter", root, onVehicleEnter ) addEvent ( "bus_finish", true ) addEventHandler("bus_finish", root, function ( ) if ( not isPedInVehicle ( source ) ) then return end local vehicle = getPedOccupiedVehicle ( source ) if ( not busses [ getElementModel ( vehicle ) ] ) then return end local money = math.random ( 150, 300 ) givePlayerMoney ( source, money ) setElementFrozen ( vehicle, true ) fadeCamera ( source, false, 1, 0, 0, 0 ) setTimer ( function ( ) fadeCamera ( source, true, 1 ) setElementFrozen ( vehicle, false ) end ,1000, 1 ) getNewBusLocation ( source ) end )
  10. 1: https://wiki.multitheftauto.com/wiki/Sha ... Skid_marks 2: https://wiki.multitheftauto.com/wiki/Sha ... ples#Water 3: https://community.multitheftauto.com/ind ... ls&id=5078
  11. As far as I know, there aren't any game mode which does what you want. What you can do is create the vehicles in map editor and load the map in your server.
  12. Here you got some: https://community.multitheftauto.com/ind ... ls&id=5640 https://community.multitheftauto.com/ind ... ls&id=3011
  13. Si, podes usar: nombre:gsub ( "#%x%x%x%x%x%x", "" )
  14. Si la creas en el mismo lugar donde es teleportado, entonces volvera al instante que aparezca en el lugar, porque estaria tocando el marcador para salir. Podes hacer una de dos: crear el marcador de salida mas atras de donde lo teleportas, o podrias crear una tabla y hacer una restriccion para que no pase lo que mencione arriba.
  15. Decis ponerle multi colores a un item de la grid list? si es asi, entonces no es posible.
  16. Anda a la carpeta de "mabako-services/server/shops.lua" y busca la funcion: "switchJetpack" y remplazala con esta: function switchJetpack( source ) if( doesPedHaveJetPack( source ) ) then removePedJetPack( source ) elseif( getElementData( source, "jetpackFuel" ) and getElementInterior( source ) == 0 ) then if( tonumber( getElementData( source, "jetpackFuel" ) ) > 1 ) then givePedJetPack( source ) end end end Luego anda a "mabako-services/client/jetpack_control.lua" y busca la funcion: "updateFuel" y remplazala con esta: function updateFuel( ) if( not getElementData( _local, "jetpackFuel" ) ) then return end local currentFuel = tonumber( getElementData( _local, "jetpackFuel" ) ) if( (getElementInterior( _local ) > 0 and guiGetVisible( jMenu ) ) or currentFuel == 0 ) then toggleJetpackWindow( false ) elseif( getElementInterior( _local ) == 0 and not guiGetVisible( jMenu ) ) then toggleJetpackWindow( true ) end if( doesPedHaveJetPack( _local ) ) then if( currentFuel > 0 ) then local veloX, veloY, veloZ = getElementVelocity( _local ) if( not veloX ) then return end if( veloZ < 0 ) then veloZ = 0 end -- literally going down is ignored, since you dont need fuel for that currentFuel = currentFuel - getDistanceBetweenPoints3D( veloX, veloY, veloZ, 0, 0, 0 ) * jetpackVeloMultiplier if( currentFuel < 1 ) then currentFuel = 0 end if( currentFuel == 0 ) then -- down, down, down toggleControl( "sprint", false ) setControlState( "jump", true ) outputChatBox( "Your JetPack ran out of fuel!", 255, 255, 0 ) end setElementData( _local, "jetpackFuel", currentFuel ) else if( currentFuel == 0 ) then triggerServerEvent( "forceJetpackRemove", _local ) end end end local shownValue = math.floor(currentFuel/jetpackMaxFuel*100) if( guiGetText( jText ) ~= shownValue .. "%" ) then guiProgressBarSetProgress( jBar, shownValue ) guiSetText( jText, shownValue .. "%" ) end end ADVERTENCIA: PUEDE QUE EL NOMBRE DEL RECURSO NO LO TENGAS COMO "mabako-services".
  17. Your script should work, what is the exact problem?
  18. Castillo

    string

    Porque no existe tal cosa, un argumento es algo que definis vos, luego pasas un valor al ejecutar la funcion.
  19. Castillo

    string

    Lo que decis no tiene sentido.
  20. local playersInTeam = getPlayersInTeam ( team ) blips [ player ] = createBlipAttachedTo ( player, 19, 2, 255, 0, 0, 0, 99999.0 ) setElementVisibleTo ( blips [ player ], root, false ) for _, player_ in ipairs ( playersInTeam ) do setElementVisibleTo ( blips [ player ], player_, true ) end Try it.
  21. That wouldn't work, because "onResourceStart" has no player argument.
×
×
  • Create New...