Jump to content

Sasu

MTA Contributors
  • Posts

    1,056
  • Joined

  • Last visited

Everything posted by Sasu

  1. Sasu

    Funciones de gang

    Supone que es el gang_system basico que hizo castillo. El que esta en https://community.multitheftauto.com/ind ... ls&id=1514 Como seria?
  2. Cuales son las funciones con las que deberia usar para crear una puerta automatica pero que abra al gang y no al team. Por ejemplo para que se abra al team es: if getTeamName (getPlayerTeam(hitElement)) == "Elite" then Pero yo quiero que se abra al gang. Que funciones seria?
  3. Sasu

    Panel Elite

    Client: Wnd = guiCreateWindow ( 0.2, 0.2, 0.25, 0.5, "Vehiculos especiales de la Elite", true ) guiSetAlpha( Wnd, 1 ) button = guiCreateButton ( 0.01, 0.8, 0.50, 0.15, "Cerrar", true, Wnd ) button = guiCreateButton ( 0.01, 0.8, 0.50, 0.15, "Crear", true, Wnd ) label = guiCreateLabel ( 0.1, 0.1, 0.9, 0.1, "Bienvenido al panel de vehiculos de la Elite. Para obtener el vehiculo deseado, haz doble click en el.", true, Wnd ) showCursor(false) guiSetVisible( Wnd, false ) guiWindowSetSizable( Wnd, false ) guiWindowSetMovable( Wnd, true ) vehicles = { {"Sultan", 560}, {"HPV1000", 523} {"Police LS", 596}, {"Police LV", 598}, {"Police Ranger", 599} {"Hydra", 520} {"Police Maverick", 497} } grid = guiCreateGridList(0.01, 0.2, 0.99, 0.5, true, Wnd) guiGridListAddColumn(grid, "Vehicles", 0.85) for i,veh in ipairs(vehicles) do row = guiGridListAddRow(grid) -- guiGridListSetItemText(grid, row, 1, tostring(veh[1]), false, false) guiGridListSetItemData(grid, row, 1, tostring(veh[2])) end function use() local row, col = guiGridListGetSelectedItem(grid) if (row and col and row ~= -1 and col ~= -1) then local model = tonumber(guiGridListGetItemData(grid, row, 1)) if model ~= "" then triggerServerEvent("CreVehicle", localPlayer, model) end end end addEventHandler("onClientDoubleClick", root, use, true) function close() if (source == button) then guiSetVisible(Wnd,false) showCursor(false) end end addEventHandler("onClientGUIClick", button, close) function showGUI2p() guiSetVisible(Wnd,true) showCursor(true) end addEvent("showGUI2p",true) addEventHandler("showGUI2p", getRootElement(), showGUI2p) Server: local vehicles = {} function spawnVehP(id) theTeam = getPlayerTeam( source ) theTeamName = getTeamName( theTeam ) if ( theTeamName == "Elite" ) then local x, y, z = getElementPosition(source) if isElement(vehicles[source]) then destroyElement(vehicles[source]) end vehicles[source] = createVehicle(id, x + 1, y, z) warpPedIntoVehicle(source, vehicles[source]) else outputChatBox("Usted no es una fuerza Elite. Salga de la base inmediatamente antes de que un elite se de cuenta.", source, 0, 200, 0 , true) end end addEvent("CreVehicle",true) addEventHandler("CreVehicle", root, spawnVehP) addEventHandler("onPlayerQuit", root, function() if isElement(vehicles[source]) then destroyElement(vehicles[source]) vehicles[source] = nil end end) function showGUIp(hitPlayer) setElementFrozen(source, true) triggerClientEvent (hitPlayer,"showGUI2p",getRootElement(),hitPlayer) end addEventHandler("onMarkerHit",Marker1,showGUIp) addEventHandler("onMarkerHit",Marker2,showGUIp) Mi problema es que me dice: "WARNING: Loading script failed: base\vehicles_C.lua:13: "}" expected (to close "{" at line 12) near "," Y tambien: "ERROR: server triggered clientside event showGUI2p, but event is not added clientside" Muchas gracias por su atencion. Atte.: Sasuke
  4. Sasu

    Team Medico

    function createMedicTeam () MedicTeam = createTeam ("Medicos", 102, 255, 255) end addEventHandler ("onResourceStart", resourceRoot, createMedicTeam) function joinMedic() setPlayerTeam(source, MedicosTeam) setElementModel(source,274) giveWeapon ( source, 41, 9999 ) setElementData( source, "Occupation", "Recluta Medico", true ) outputChatBox("Ahora eres Recluta Medico",source,0,255,0) end addEvent("setMedic", true) addEventHandler("setMedic",root,joinMedic) addEvent("medic:healing", true) addEventHandler("medic:healing", root) function (medic) if (getElementHealth(source) < 100) then end local Heal = getElementHealth(source) + 5 -- New health setElementHealth(source, Heal) if (Heal > 100) then end setElementHealth(source, 100) givePlayerMoney(medic, 100) takePlayerMoney(source, 100) -- Takes 100$ from the source when he get healed end Me dice: SCRIPT ERROR: medico\medic-serverc.lua:20 ' expected near '<' Lo dice 2 veces.
  5. Sasu

    Modo STAFF

    Estoy tratando de crear un script para que solo los ACL: "Creador","Admin", "SuperModerator", "Moderator" puedan utilizar este comando. Problemas: #1 Cuando utilizo el comando /nostaff no pasa nada. #2 Cuando se utiliza el comando /equipostaff hace posible utilizar el comando para todos y yo no quiero eso. Que hago mal? function desactivarstaff() if isObjectInACLGroup ( aclGetGroup ( "Creador" or "Admin" or "Supermoderator" or "Moderator" ) ) then setTeamName ( getPlayerName ( source ).. "Civiles" ) outputChatBox("Modo Staff desactivado.",255,255,255) end end function activarstaff () if isObjectInACLGroup ( aclGetGroup ( "Creador" or "Admin" or "Supermoderator" or "Moderator" ) ) then setTeamName ( getPlayerName ( source ).. "STAFF" ) outputChatBox("Modo Staff activado.",255,255,255) else outputChatBox("Usted no es del Staff") end end addCommandHandler("equipostaff",activarstaff) addCommandHandler("nostaff",desactivarstaff)
  6. Sasu

    Puerta para base

    Porque cuando quiero entrar me dice: "base\puerta.lua:11: attempt to concatenate a boolean value" como lo arreglo?
  7. warehouse_door2b = createObject (3037, 834.19921875, -2067.8994140625, 14.10000038147, 0, 0, 90) warehouse_door2b2 = createObject (3037, 839, -2067.8994140625, 14.10000038147, 0, 0, 90) MarkerOpen = createMarker (836.90002441406, -2064.6999511719, 12.89999961853, "corona",10, 127, 127, 127, 0) MarkerClose = createMarker (835.70001220703, -2070.6000976563, 12.89999961853,"corona",10, 127, 127, 127, 0) function abrir ( hitElement ) if getTeamName(getPlayerTeam(hitElement)) ~= "Elite" then return end moveObject (warehouse_door2b, 3037, 834.20001220703, -2067.8999023438, 9.6000003814697) moveObject (warehouse_door2b2, 3037, 839, -2067.8999023438, 9.6000003814697) outputChatBox ( "Bienvenido " .. getPlayerName ( source ).." a la base Elite") else outputChatBox ( "Acceso Denegado. Usted no es una fuerza Elite. Contacta a GhostRiden" ) end function cerrar(hitElement) if getTeamName(getPlayerTeam(hitElement)) ~= "Elite" then return end moveObject (warehouse_door2b, 3037, 834.19921875, -2067.8994140625, 14.10000038147) moveObject (warehouse_door2b2, 3037, 839, -2067.8994140625, 14.10000038147) end addEventHandler( "onMarkerHit", MarkerOpen, abrir) addEventHandler( "onMarkerHit", MarkerClose, cerrar) Me ayudan a corregirlo. Cuando inicio el resource me dice: SCRIPT ERROR: base\puerta.lua:14 'end' expected near 'else'. Es para la puerta de una base.
  8. airportgate = createObject (980, 1759.5999755859, 552.59997558594, 27.700000762939, 0, 0, 340) MarkerOpen = createMarker (1761.3017578125, 571.13073730469, 24.565521240234, "cylinder",4, 255, 0, 0, 255) MarkerClose = createMarker (1749.8184814453, 531.37005615234, 27.262020111084,"cylinder",4, 255, 0, 0, 255) function abrir ( ) moveObject (airportgate, 5000, 1759.5999755859, 552.59997558594, 33.700000762939) end addEventHandler( "onMarkerHit", MarkerOpen, abrir) addEventHandler( "onMarkerHit", MarkerClose, abrir) Bueno, este script lo saque de otro post. Es para mover un objeto. Mi pregunta es: Si se trata de que de un solo marker mueva dos objetos, como sería?
  9. Sasu

    Script Vehiculos

    Muchas gracias @brad_vickers. Ya funciona.
  10. Server: markerp = createMarker( 1556.9852294922, -1608.1356201172, 12.3828125, "cylinder", 2, 0, 0, 255, 255 ) marker2p = createMarker( 1570.1909179688, -1610.1462402344, 12.3828125, "cylinder", 2, 0, 0, 255, 255 ) marker3p = createMarker( 1584.61328125, -1608.2557373047, 12.3828125, "cylinder", 2, 0, 0, 255, 255 ) marker4p = createMarker( 1595.1407470703, -1607.5220947266, 12.3828125, "cylinder", 2, 0, 0, 255, 255 ) marker5p = createMarker( 1544.63916016, -1609.2932128906, 12.3828125, "cylinder", 2, 0, 0, 255, 255 ) local vehicles = {} function spawnVehP(id) theTeam = getPlayerTeam( source ) theTeamName = getTeamName( theTeam ) if ( theTeamName == "Policia" ) or ( theTeamName == "F.B.I" ) then local x, y, z = getElementPosition(source) if isElement(vehicles[source]) then destroyElement(vehicles[source]) end vehicles[source] = createVehicle(id, x + 1, y, z) warpPedIntoVehicle(source, vehicles[source]) else outChatBox("Sólo los agentes de Policía, el FBI o Elite pueden obtener vehículos aquí!", source, 255, 0, 0) end end addEvent("CreVehicle",true) addEventHandler("CreVehicle", root, spawnVehP) addEventHandler("onPlayerQuit", root, function() if isElement(vehicles[source]) then destroyElement(vehicles[source]) vehicles[source] = nil end end) function showGUIp(hitPlayer) setElementFrozen(source, true) triggerClientEvent (hitPlayer,"showGUI2p",getRootElement(),hitPlayer) end addEventHandler("onMarkerHit",markerp,showGUIp) function showGUIp(hitPlayer) setElementFrozen(source, true) triggerClientEvent (hitPlayer,"showGUI2p",getRootElement(),hitPlayer) end addEventHandler("onMarkerHit",marker2p,showGUIp) function showGUIp(hitPlayer) setElementFrozen(source, true) triggerClientEvent (hitPlayer,"showGUI2p",getRootElement(),hitPlayer) end addEventHandler("onMarkerHit",marker3p,showGUIp) function showGUIp(hitPlayer) setElementFrozen(source, true) triggerClientEvent (hitPlayer,"showGUI2p",getRootElement(),hitPlayer) end addEventHandler("onMarkerHit",marker4p,showGUIp) function showGUIp(hitPlayer) setElementFrozen(source, true) triggerClientEvent (hitPlayer,"showGUI2p",getRootElement(),hitPlayer) end addEventHandler("onMarkerHit",marker5p,showGUIp) Client: Wnd = guiCreateWindow ( 0.2, 0.2, 0.25, 0.5, "Vehiculos Policiales", true ) guiSetAlpha( Wnd, 1 ) button = guiCreateButton ( 0.01, 0.8, 0.99, 0.15, "Cerrar", true, Wnd ) label = guiCreateLabel ( 0.1, 0.1, 0.9, 0.1, "Double click para obtener un vehiculo", true, Wnd ) showCursor(false) guiSetVisible( Wnd, false ) guiWindowSetSizable( Wnd, false ) guiWindowSetMovable( Wnd, false ) vehicles = { {"HPV1000", 523}, {"Police LS", 596}, {"Police LV", 598}, {"Police Ranger", 599}, } grid = guiCreateGridList(0.01, 0.2, 0.99, 0.5, true, Wnd) guiGridListAddColumn(grid, "Vehicles", 0.85) for i,veh in ipairs(vehicles) do row = guiGridListAddRow(grid) -- guiGridListSetItemText(grid, row, 1, tostring(veh[1]), false, false) guiGridListSetItemData(grid, row, 1, tostring(veh[2])) end function use() local row, col = guiGridListGetSelectedItem(grid) if (row and col and row ~= -1 and col ~= -1) then local model = tonumber(guiGridListGetItemData(grid, row, 1)) if model ~= "" then triggerServerEvent("CreVehicle", localPlayer, model) end end end addEventHandler("onClientDoubleClick", root, use, true) function close() if (source == button) then guiSetVisible(Wnd,false) showCursor(false) end end addEventHandler("onClientGUIClick", button, close) function showGUI2p() guiSetVisible(Wnd,true) showCursor(true) end addEvent("showGUI2p",true) addEventHandler("showGUI2p", getRootElement(), showGUI2p) Que esta mal en esto. Intento pero no me sale. Lo que pasa es que cuando elijo un vehiculo(policia) no me aparece nada. Alguien que me pueda ayudar a corregir.
×
×
  • Create New...