Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. Castillo

    Que falla

    Tu function es: "Panel", no "maps", ademas, addEventHandler ( "onClientClick", boton2, Mapas1, false ) Tiene que ir fuera de la funcion: "Panel". function Panel ( ) dxDrawRectangle(1238.0,0.0,128.0,767.0,tocolor(0,0,0,200),true) boton1 = dxDrawImage(1240.0,163.0,126.0,96.0,"Imagenes/Stats.png",0.0,0.0,0.0,tocolor(255,255,255,255),true) boton2 = dxDrawImage(1239.0,1.0,126.0,102.0,"Imagenes/Maps.png",0.0,0.0,0.0,tocolor(255,255,255,255),true) end function Mapas1 ( ) state = ( not state ) removeEventHandler ( "onClientRender", root, Panel ) if ( state ) then addEventHandler ( "onClientRender", root, Panel ) end end addEventHandler ( "onClientClick", boton2, Mapas1, false )
  2. Castillo

    i can ?

    I already told you? https://wiki.multitheftauto.com/wiki/OnPlayerDamage
  3. Castillo

    explosion

    Yes, the rest seems to be fine. local elementType = getElementType( hitElement ) That's not being used, you should remove it maybe.
  4. Castillo

    i can ?

    I guess you can use: onPlayerDamage with: setElementVelocity.
  5. De nada entonces. P.D: Solo lo cierro cuando es muy necesario.
  6. No se si tu post era sarcastico o no. Que queres decir?
  7. This has been solved here already: viewtopic.php?f=91&t=46527 P.S: Your code is wrong as well Dev, read why on the topic I posted.
  8. You can use this resource: https://community.multitheftauto.com/ind ... ils&id=488
  9. Castillo

    explosion

    posx, posy, posz, type, syze, r, g, b, a Where did you define these variables?
  10. Donde definisto: posX, posY, posZ?
  11. Lo que el pregunto es imposible en el MTA, no podes borrar partes de un objeto.
  12. El script esta puesto como client side o server side?
  13. Castillo

    [HELP]Timer

    You must draw it client side with: dxDrawText or guiCreateLabel
  14. if ( check == true ) then That's wrong, because getPedOccupiedVehicle returns the vehicle element, false otherwise. function seatbelton ( player ) local check = isPedInVehicle ( player ) if ( check ) then local state = ( not getElementData ( player, "seatbelt" ) ) setElementData ( player, "seatbelt", state ) exports.global:sendLocalMeAction ( player, "takes their seatbelt ".. ( state and "on" or "off" ) ) else outputChatBox ( "You are not in a car!", player, 255, 0, 0 ) end end addCommandHandler ( "seatbelt", seatbelton )
  15. createMarker con el evento: onMarkerHit y setElementPosition. Clickea en cada uno de los links y lee.
  16. function garageOpenOrClose ( sourcePlayer, command, gaID ) --Open Verdeant Meadows garage local gaID = tonumber ( gaID ) if ( gaID ) then if ( gaID > 0 and gaID < 50 ) then local state = ( not isGarageOpen ( gaID ) ) setGarageOpen ( gaID, state ) outputChatBox ( "Garage ".. ( state and "opened" or "closed" ) .."!", sourcePlayer ) end else outputChatBox ( "Usage: /garage (Garage ID)", sourcePlayer, 255, 0, 0 ) end end addCommandHandler ( "garage", garageOpenOrClose ) That works.
  17. Because the second argument of addCommandHandler is the command used. function garageOpenOrClose(sourcePlayer, gaID) should be: function garageOpenOrClose(sourcePlayer, command, gaID)
  18. That's because is trying to set the text of a non existing element, as the GUI is not created at the start, you should add the event handler to render it inside "togHud" function, and remove it on "DestroyGUI" function. local char = (getPlayerName(localPlayer)):gsub( "_", " " ) local health = getElementHealth ( localPlayer ) local armor = getPedArmor ( localPlayer ) local money = getPlayerMoney ( ) local hour, minute = getTime ( ) function togHud ( ) mainWindow = guiCreateWindow(484,318,308,166,"Multi Theft Auto Roleplay",false) btnClose = guiCreateButton(200,127,100,30,"Close",false,mainWindow) btnNameLabel = guiCreateLabel(15,28,94,16,"Character Name: ",false,mainWindow) btnTimeLabel = guiCreateLabel(14,53,32,16,"Time: ",false,mainWindow) btnHealthLabel = guiCreateLabel(14,77,38,16,"Health: ",false,mainWindow) btnArmorLabel = guiCreateLabel(13,101,38,18,"Armor: ",false,mainWindow) btnMoneyLabel = guiCreateLabel(14,127,42,15,"Money: ",false,mainWindow) btnChar = guiCreateLabel(105,28,169,17," "..char.."",false,mainWindow) btnTime = guiCreateLabel(44,53,70,15," "..hour..":"..minute.."",false,mainWindow) btnHealth = guiCreateLabel(53,78,169,16,"lol",false,mainWindow) btnArmor = guiCreateLabel(49,101,70,19,"lol",false,mainWindow) btnMoney = guiCreateLabel(53,128,112,17,"lol",false,mainWindow) addEventHandler ( "onClientGUIClick", btnClose, DestroyGUI, false ) addEventHandler ( "onClientRender", getRootElement(), renderData ) end addCommandHandler("hud", togHud) function renderData ( ) guiSetText ( btnHealth, "" .. math.floor ( getElementHealth(localPlayer ) ) ) guiSetText ( btnArmor, "" .. math.floor ( getPedArmor( localPlayer ) ) ) guiSetText ( btnMoney, "" .. math.floor ( getPlayerMoney( ) ) ) end function DestroyGUI ( ) guiSetVisible ( mainWindow, false ) removeEventHandler ( "onClientRender", getRootElement(), renderData ) end
  19. If a player killed him, it shouldn't cause the error at line 38, but for the line 39, you didn't define anywhere: "victim".
  20. Because is not magic, the color picket triggers a event when click 'ok'. addEvent ( "onColorPickerOK", true ) addEventHandler ( "onColorPickerOK", root, function ( id, hex, r, g, b ) if ( id == "Car color" ) then -- Code to set vehicle color. elseif ( id == "Headlight color" ) then -- Code to set headlight color. end end )
×
×
  • Create New...