Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. It's ok, we're all busy . You're welcome .
  2. There's a clipboard function: setClipboard There isn't getClipboard for security reasons as far as I know.
  3. No te das cuenta que aun no tiene sentido? nomas estas cambiando el texto del label a: "PM a : playerName", nada mas.
  4. No necesitas obtener el nombre, ya lo tenes en la lista, solo obtene el item que selecciono y cambias el texto del label.
  5. @Jaysds1: Is that a joke? or you're just increasing your post count? because that'll never work. @Cassandra: You can get all the column names of a table with this: addCommandHandler ( "columnnames", function ( ) local descQuery = dbQuery ( connection, "DESCRIBE ??", "myTable" ) local descResult = dbPoll ( descQuery, -1 ) for _, column in ipairs( descResult ) do outputChatBox ( tostring ( column.Field ) ) end end )
  6. Dios mio, sos un desastre ( sin ofender ). function test ( ) local name = getPlayerName ( localPlayer ) if ( name == "ElMota[Gold]x~" ) then guiSetVisible ( GUIEditor_Window[1], true ) showCursor ( true ) end end bindKey ( "F6", "down", test )
  7. Pues depende de como quieras que la GUI se muestre, un comando, un bind, simplemente comparas el nombre del jugador.
  8. local skipData = { [ "username" ] = true, [ "password" ] = true, [ "loggedin " ] = true } function getMyData ( thePlayer ) local data = getAllElementData ( thePlayer ) for dataName, dataValue in pairs ( data ) do if ( not skipData[ dataName ] ) then outputChatBox ( dataName ..": ".. dataValue ) end end end addCommandHandler ( "mydata", getMyData ) Is that what you meant?
  9. Castillo

    help

    local policeCars = { } -- We create a table. --Create Stuff function testCreateTrainStuff ( ) test_marker_request = createMarker( 1543.98962, -1670.46398, 12.55753, "cylinder", 1.5, 255, 0, 0, 170 ) createBlip ( 1543.98962, -1670.46398, 13.55753, 41 ) ped = createPed (280,1543.98962,-1670.46398,13.55753, 90 ) addEventHandler ( 'onMarkerHit', test_marker_request, onMarkerHit ) setElementFrozen ( ped, true ) end addEventHandler ( "onResourceStart", resourceRoot, testCreateTrainStuff ) function onMarkerHit ( thePlayer ) local id = getElementModel ( thePlayer ) local teamName = getPlayerTeam ( thePlayer ) and getTeamName ( getPlayerTeam ( thePlayer ) ) or false if ( teamName == "Police" and id == 280 ) then -- Your code here. end end --Create Vehicle function testCreateTest ( ) if ( isElement ( policeCars[ source ] ) ) then -- We check if the player already has a car spawned. destroyElement ( policeCars[ source ] ) -- If so, we destroy it. end policeCars[ source ] = createVehicle ( 596, 1535.05615, -1675.60766, 13.56008 ) -- We create the vehicle stored in 'policeCars' table. outputChatBox ("Você virou Policial", source, 255, 0, 0 ) end addEvent ( "testCreateTest", true ) addEventHandler ( "testCreateTest", root, testCreateTest ) --Test Gui function testCreateTestGUI ( hitElement ) if ( source == test_marker_request ) then triggerClientEvent ( hitElement, "testCreateTestGUI", hitElement ) end end addEventHandler ( "onMarkerHit", root, testCreateTestGUI )
  10. Pues si, yo nomas arregle ese error que tenias, el resto estaba bien. Copia mi ultimo codigo.
  11. Me explicas para que dejaste esto? ( localPlayer ) function lanzamisiles ( ) local vehicle = getPedOccupiedVehicle ( localPlayer ) local x, y, z = getElementPosition (localPlayer) if ( vehicle and vehicle == getElementByID ( "misilero" ) ) then if ( not createProjectile ( localPlayer, 19, x, y, z + 15, 70) ) then outputChatBox ( "Ha ocurrido un problema, deja descansar el lanzamisiles" ) end end end bindKey ( "B", "down", lanzamisiles )
  12. Castillo

    help

    local policeCars = { } -- We create a table. --Create Stuff function testCreateTrainStuff ( ) test_marker_request = createMarker( 1543.98962, -1670.46398, 12.55753, "cylinder", 1.5, 255, 0, 0, 170 ) createBlip ( 1543.98962, -1670.46398, 13.55753, 41 ) ped = createPed (280,1543.98962,-1670.46398,13.55753, 90 ) addEventHandler ( 'onMarkerHit', test_marker_request, teamName ) setElementFrozen ( ped, true ) end addEventHandler ( "onResourceStart", resourceRoot, testCreateTrainStuff ) function teamName ( source, key, uElement) local id = getElementModel ( source ) if ( id == 280 ) then -- Your code here. end end --Create Vehicle function testCreateTest ( ) if ( isElement ( policeCars[ source ] ) ) then -- We check if the player already has a car spawned. destroyElement ( policeCars[ source ] ) -- If so, we destroy it. end policeCars[ source ] = createVehicle ( 596, 1535.05615, -1675.60766, 13.56008 ) -- We create the vehicle stored in 'policeCars' table. outputChatBox ("Você virou Policial", source, 255, 0, 0 ) end addEvent ( "testCreateTest", true ) addEventHandler ( "testCreateTest", root, testCreateTest ) --Test Gui function testCreateTestGUI ( hitElement ) if ( source == test_marker_request ) then triggerClientEvent ( hitElement, "testCreateTestGUI", hitElement ) end end addEventHandler ( "onMarkerHit", root, testCreateTestGUI )
  13. Si, quita el script . Nah, joda, es que vos le diste la posicion tuya como destino.
  14. Castillo

    help

    No, that won't work, you got a missing "end", maybe something else.
  15. -- client side: function lanzamisiles ( ) local vehicle = getPedOccupiedVehicle ( localPlayer ) if ( vehicle and vehicle == getElementByID ( "misilero" ) ) then if ( not createProjectile ( localPlayer, 19, getElementPosition ( localPlayer ), 70) ) then outputChatBox ( "Ha ocurrido un problema, deja descansar el lanzamisiles" ) end end end bindKey ( "B", "down", lanzamisiles ) -- server side: local misilero = createVehicle ( 411, 2224.51, 2459.16, 10.168 ) setElementID ( misilero, "misilero" )
  16. GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Label = {} GUIEditor_Edit = {} GUIEditor_Grid = {} GUIEditor_Window[1] = guiCreateWindow(11,92,229,464,"Mi panel de Spawn",false) GUIEditor_Button[1] = guiCreateButton(9,29,209,43,"Spawnear Vehiculo -1",false,GUIEditor_Window[1]) GUIEditor_Button[2] = guiCreateButton(9,75,208,41,"Spawnear Vehiculo -2",false,GUIEditor_Window[1]) GUIEditor_Button[3] = guiCreateButton(9,118,208,41,"Spawnear Vehiculo -3",false,GUIEditor_Window[1]) GUIEditor_Button[4] = guiCreateButton(9,162,208,41,"Spawnear Vehiculo -4",false,GUIEditor_Window[1]) GUIEditor_Button[5] = guiCreateButton(9,251,208,41,"Spawnear Vehiculo -5",false,GUIEditor_Window[1]) GUIEditor_Button[6] = guiCreateButton(9,206,208,41,"Spawnear Vehiculo -6",false,GUIEditor_Window[1]) GUIEditor_Button[7] = guiCreateButton(10,296,206,41,"Spawnear Vehiculo -7",false,GUIEditor_Window[1]) GUIEditor_Button[8] = guiCreateButton(10,340,206,41,"Spawnear Vehiculo -8",false,GUIEditor_Window[1]) GUIEditor_Label[1] = guiCreateLabel(12,396,205,56,"GUI Creada por ElMota",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[1],255,255,0) guiSetFont(GUIEditor_Label[1],"default-bold-small") GUIEditor_Window[2] = guiCreateWindow(11,340,219,216,"GUI Shop Panel",false) GUIEditor_Button[9] = guiCreateButton(18,70,168,32,"Comprar Vehiculo",false,GUIEditor_Window[2]) GUIEditor_Button[10] = guiCreateButton(18,109,168,32,"Vender Vehiculo",false,GUIEditor_Window[2]) GUIEditor_Button[12] = guiCreateButton(22,26,75,39,"Cancelar",false,GUIEditor_Window[2]) GUIEditor_Window[3] = guiCreateWindow(544,249,240,326,"Vehiculos",false) GUIEditor_Grid[1] = guiCreateGridList(9,24,222,293,false,GUIEditor_Window[3]) guiGridListSetSelectionMode(GUIEditor_Grid[1],2) guiGridListAddColumn(GUIEditor_Grid[1],"Autos",0.5) guiGridListAddColumn(GUIEditor_Grid[1],"Precio $",0.3) local cars = {{400,60000},{404,28000},{489,65000},{505,65000},{479,45000},{442,45000},{458,45000},{602,50000},{496,42500},{401,41000},{518,60000},{527,75000},{589,75000},{419,45000},{533,75000},{526,50000},{474,55000},{545,50000},{517,45000},{410,41000},{600,50000},{436,41000},{580,50000},{439,75000},{549,75000},{491,45000},{445,45000},{507,45000},{585,45000},{587,75000},{466,55000},{492,50000},{546,45000},{551,45000},{516,45000},{467,45000},{426,47500},{547,45000},{405,55000},{409,75000},{550,45000},{566,45000},{540,45000},{421,50000},{529,45000},{402,12000},{542,65000},{603,12000},{475,75000},{562,120000},{565,95000},{559,120000},{561,50000},{560,120000},{558,100000},{429,120000},{541,120000},{415,120000},{480,95000},{434,100000},{494,120000},{502,120000},{503,120000},{411,120000},{506,120000},{451,120000},{555,95000},{477,95000},{499,25000},{498,25000},{578,50000},{486,70000},{455,75000},{588,50000},{403,75000},{414,50000},{443,75000},{515,75000},{514,75000},{531,12000},{456,45000},{422,45000},{482,95000},{530,12000},{418,45000},{572,12000},{582,50000},{413,5000},{440,50000},{543,65000},{583,12000},{478,35000},{554,50000},{536,75000},{575,75000},{534,75000},{567,75000},{535,75000},{576,75000},{412,75000},{568,75000},{457,12000},{483,45000},{508,40000},{571,10000},{500,55000},{444,120000},{556,120000},{557,120000},{471,20000},{495,100000},{539,75000},{481,25050},{509,2500},{581,45000},{462,12000},{521,60000},{463,50000},{522,75000},{448,12000},{468,45000},{586,45000},{485,12000},{431,60000},{438,45000},{437,60000},{574,12000},{420,45000},{525,75000},{408,50000},{428,65000}} for i,v in ipairs (cars) do local carName = getVehicleNameFromModel (v[1]) local row = guiGridListAddRow (GUIEditor_Grid[1]) guiGridListSetItemText (GUIEditor_Grid[1], row, 1, carName, false, true) guiGridListSetItemText (GUIEditor_Grid[1], row, 2, tostring(v[2]), false, true) end GUIEditor_Window[4] = guiCreateWindow(252,171,409,187,"Verificacion",false) GUIEditor_Label[2] = guiCreateLabel(10,29,391,25,"Porfavor elije aqui un slot para tu vehiculo",false,GUIEditor_Window[4]) guiLabelSetColor(GUIEditor_Label[2],255,255,0) guiSetFont(GUIEditor_Label[2],"default-bold-small") GUIEditor_Button[13] = guiCreateButton(10,59,100,37,"Acepto",false,GUIEditor_Window[4]) GUIEditor_Button[14] = guiCreateButton(112,65,100,31,"Cancelar",false,GUIEditor_Window[4]) GUIEditor_Button[15] = guiCreateButton(10,128,43,46,"Slot-1",false,GUIEditor_Window[4]) GUIEditor_Button[16] = guiCreateButton(57,129,43,46,"Slot-2",false,GUIEditor_Window[4]) GUIEditor_Button[17] = guiCreateButton(103,129,43,46,"Slot-3",false,GUIEditor_Window[4]) GUIEditor_Button[18] = guiCreateButton(148,129,43,46,"Slot-4",false,GUIEditor_Window[4]) GUIEditor_Button[19] = guiCreateButton(193,129,43,46,"Slot-5",false,GUIEditor_Window[4]) GUIEditor_Button[20] = guiCreateButton(238,129,43,46,"Slot-6",false,GUIEditor_Window[4]) GUIEditor_Button[21] = guiCreateButton(283,129,43,46,"Slot-7",false,GUIEditor_Window[4]) GUIEditor_Button[22] = guiCreateButton(328,129,43,46,"Slot-8",false,GUIEditor_Window[4]) GUIEditor_Window[5] = guiCreateWindow(214,193,324,151,"GUI Sistema de Colores RGB",false) GUIEditor_Edit[1] = guiCreateEdit(24,53,51,28,"",false,GUIEditor_Window[5]) guiEditSetMaxLength(GUIEditor_Edit[1],3) GUIEditor_Label[3] = guiCreateLabel(43,32,8,16,"R",false,GUIEditor_Window[5]) guiSetFont(GUIEditor_Label[3],"default-bold-small") GUIEditor_Edit[2] = guiCreateEdit(140,53,51,28,"",false,GUIEditor_Window[5]) guiEditSetMaxLength(GUIEditor_Edit[2],3) GUIEditor_Label[4] = guiCreateLabel(159,32,8,16,"G",false,GUIEditor_Window[5]) guiSetFont(GUIEditor_Label[4],"default-bold-small") GUIEditor_Edit[3] = guiCreateEdit(256,53,51,28,"",false,GUIEditor_Window[5]) GUIEditor_Label[5] = guiCreateLabel(276,32,8,16,"B",false,GUIEditor_Window[5]) guiSetFont(GUIEditor_Label[5],"default-bold-small") GUIEditor_Button[23] = guiCreateButton(217,97,98,45,"Aceptar",false,GUIEditor_Window[5]) guiSetVisible(GUIEditor_Window[1], false) guiSetVisible(GUIEditor_Window[2], false) guiSetVisible(GUIEditor_Window[3], false) guiSetVisible(GUIEditor_Window[4], false) guiSetVisible(GUIEditor_Window[5], false) showCursor(false) function VerLaGUI() guiSetVisible( "GUIEditor_Window[1]", true ) showCursor(true) end bindKey("F2", "down", VerLaGUI) ----------------------------------------------------- --Los Markers y Blips---- local marker = createMarker(2131.91846, -1149.65430, 23.4, "cylinder", 1.5, 255, 0, 0 ) local marker2 = createMarker(1671.21094, 1814.30457, 10.82031, "cylinder", 1.5, 255, 0, 0 ) createBlipAttachedTo(marker,55,2,0,255,0,0,0,200) createBlipAttachedTo(marker2,55,2,0,255,0,0,0,200) ----------------------------------------------------- ----------------------------------------------------- --LasFunciones---- function VerLaGUI() guiSetVisible(GUIEditor_Window[1], not guiGetVisible(GUIEditor_Window[1])) showCursor(guiGetVisible(GUIEditor_Window[1])) end bindKey("F2", "down", VerLaGUI) addEventHandler("onClientGUIClick", root, function() if ( source == GUIEditor_Button[12] ) then guiSetVisible(GUIEditor_Window[2], false) guiSetVisible(GUIEditor_Window[3], false) guiSetVisible(GUIEditor_Window[5], false) showCursor(false) setCameraTarget(localPlayer,localPlayer) local x, y, z = getElementPosition ( localPlayer ) -- Get the position of the local player. setElementPosition ( localPlayer, x, y, z + 5 ) -- Set the position of the local player + 5 on the Z value. elseif ( source == GUIEditor_Button[9] ) then guiSetVisible(GUIEditor_Window[5], true) showCursor(true) elseif ( source == GUIEditor_Button[23] ) then guiSetVisible(GUIEditor_Window[5], false) showCursor(true) end end ) function markerHit (hitPlayer) if ( hitPlayer == localPlayer ) then guiSetVisible (GUIEditor_Window[2], true) guiSetVisible (GUIEditor_Window[3], true) showCursor (true) triggerServerEvent("lacamara", localPlayer, hitPlayer) end end addEventHandler ("onClientMarkerHit", marker, markerHit) addEventHandler ("onClientMarkerHit", marker2, markerHit) -----ElAuto---- local tCars = { } function Prototype( ) local uRow, uCol = guiGridListGetSelectedItem ( source ) if ( uRow and uCol and uRow ~= -1 and uCol ~= -1 ) then local id = 0 if ( #tCars >= 1 ) then destroyElement ( tCars [ #tCars ] ) end local id = id +1 local sName = guiGridListGetItemText ( GUIEditor_Grid[1], uRow, uCol ) tCars [ id ] = createVehicle ( getVehicleModelFromName ( sName ), -1953.80127, 264.75961, 35.46875 ) if ( tCars [ id ] ) then setVehicleColor ( tCars [ id ], tonumber ( guiGetText ( GUIEditor_Edit[1] ) ), tonumber ( guiGetText ( GUIEditor_Edit[2] ) ), tonumber ( guiGetText ( GUIEditor_Edit[3] ) ) ) end end end addEventHandler ( 'onClientGUIClick', GUIEditor_Grid[1],Prototype ) Do you mean that?
  17. local cc, dd pegarVar = function(aa,bb) cc = aa dd = bb end addEvent("enviarVar",true) addEventHandler("enviarVar",getRootElement(),pegarVar) recebeVar = function ( ) end Now your variables will be global, so you can use them outside "pegarVar" function.
  18. You can set it's handling? setVehicleHandling
  19. Castillo

    help

    getPlayerTeam -- Get player team. getElementModel -- Get element model, in this case a player.
  20. "source" no esta definido, tenes que obtener el vehiculo del jugador y luego compararlo. local misilero = createVehicle ( 411, 2224.51, 2459.16, 10.168 ) function lanzamisiles ( ) local vehicle = getPedOccupiedVehicle ( localPlayer ) if ( vehicle and vehicle == misilero ) then if ( not createProjectile ( localPlayer, 19, getElementPosition ( localPlayer ), 70) ) then outputChatBox ( "Ha ocurrido un problema, deja descansar el lanzamisiles" ) end end end bindKey ( "B", "down", lanzamisiles )
  21. I'm not sure if I understood you, do you mean this? passar = function ( aa, bb ) local cc = aa local dd = bb return cc, dd end recebe = function ( ) --I want to receive the value cc, dd function "pass". Here. How? local cc, dd = passar ( ) print ( cc ..": ".. dd ) end
  22. -----ElAuto---- local tCars = { } function Prototype( ) local uRow, uCol = guiGridListGetSelectedItem ( source ) if ( uRow and uCol and uRow ~= -1 and uCol ~= -1 ) then local id = 0 if #tCars >= 1 then destroyElement ( tCars [ #tCars ] ) end local id = id +1 local sName = guiGridListGetItemText ( GUIEditor_Grid[1], uRow, uCol ) tCars [ id ] = createVehicle ( getVehicleModelFromName ( sName ), -1953.80127, 264.75961, 35.46875 ) if ( tCars [ id ] ) then setVehicleColor ( tCars [ id ], tonumber ( guiGetText ( GUIEditor_Edit[1] ) ), tonumber ( guiGetText ( GUIEditor_Edit[2] ) ), tonumber ( guiGetText ( GUIEditor_Edit[3] ) ) ) end end end addEventHandler ( 'onClientGUIClick', GUIEditor_Grid[1],Prototype )
×
×
  • Create New...