Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/27/21 in all areas

  1. Version 2.0.1

    353 downloads

    NB: This include does not entirely work like the original. NB: The class is now called instructionalButtons instead of hudManager. NB: This include also includes a more advanced version of the BasicScaleform class by kemperr, just called ScaleForm now. v2.0.0 - Added instructionalButton.hasControl(control). - Added instructionalButton.getButtonCount(). - Removed the padding of 10. - Added RGB support (instead of just RGBA... alpha defaults to 180 for RGB). - Revamped the structure used to store buttons (it was dumb before, wasting variables and not making use of Javascript features). v1.0.2 - You can now alter any instructional button without it being redrawn/shown to you (Basically you can edit them, without them popping up on your screen, forcefully). - Added instructionalButton.changeButtonControl(title, new_control). v1.0.1 - Fixed the an issue where when using multiple instructional buttons multi script wide, if one button count was more than others, the buttons would show up across different instructional buttons. - Removed support for hex colours with a #. Now to use a colour, just use 'FF00FF'. Using # here is a waste of time. v1.0.0 - Fixed instructional buttons rendering last button created on the client only. - Instructional buttons background now default to black, if no colour was used. - A padding of 10 is now set on horizontal instructional buttons. - Support for custom button names. - Added instructionalButton.changeButtonTitle(control, new_title). - Added instructionalButton.isActive(). - Example: const instructions = require('/better_instructions'); const horizontalInstructionList = new instructions(-1); horizontalInstructionList.addButton('Create Roadblock', 'M'); horizontalInstructionList.addButton('Right', 175); horizontalInstructionList.addButton('Left', 174); if(!horizontalInstructionList.isActive()) { horizontalInstructionList.toggleHud(true); } setTimeout( () => { if(horizontalInstructionList.isActive()) { horizontalInstructionList.toggleHud(false); } }, 10000); /* Vertical Instructions */ const verticalInstructionList = new instructions(1, 'ff000'); modShopInstructions.addButton('Toggle RAGE Menu', 'F2'); if(!verticalInstructionList.isActive()) { verticalInstructionList.toggleHud(true); } setTimeout( () => { if(verticalInstructionList.isActive()) { verticalInstructionList.toggleHud(false); } }, 10000); Original Include - Credits go to Captien for the original release.
    1 point
    i like it! i changed in index.html: </script> <style> #container { animation-duration: 3s; animation-name: slidein; } @keyframes slidein { from { padding-top:1080px; } to { padding-top:350px; } } </style> </head> <body style="overflow: hidden;"> <div id="container" style="position: absolute; padding-top:350px; padding-left: 1200px;"> and added after </body>: <script> //Make the DIV element draggagle: dragElement(document.getElementById("container")); function dragElement(elmnt) { var pos1 = 0, pos2 = 0, pos3 = 0, pos4 = 0; if (document.getElementById(elmnt.id + "phone-device")) { /* if present, the header is where you move the DIV from:*/ document.getElementById(elmnt.id + "phone-device").onmousedown = dragMouseDown; } else { /* otherwise, move the DIV from anywhere inside the DIV:*/ elmnt.onmousedown = dragMouseDown; } function dragMouseDown(e) { e = e || window.event; e.preventDefault(); // get the mouse cursor position at startup: pos3 = e.clientX; pos4 = e.clientY; document.onmouseup = closeDragElement; // call a function whenever the cursor moves: document.onmousemove = elementDrag; } function elementDrag(e) { e = e || window.event; e.preventDefault(); // calculate the new cursor position: pos1 = pos3 - e.clientX; pos2 = pos4 - e.clientY; pos3 = e.clientX; pos4 = e.clientY; // set the element's new position: elmnt.style.top = (elmnt.offsetTop - pos2) + "px"; elmnt.style.left = (elmnt.offsetLeft - pos1) + "px"; } function closeDragElement() { /* stop moving when mouse button is released:*/ document.onmouseup = null; document.onmousemove = null; } } </script> after that i did something like this in clientside: if(mp.keys.isUp(38) === true ){ }else{ if(!phoneup){ if(handytimeoutshow == null){ handytimeoutshow = setTimeout(() => { mp.gui.chat.push('show') if(!phoneup){ phoneup = true; } clearTimeout(handytimeoutshow) handytimeoutshow = null }, 1000); } }else{ if(handytimeouthidde == null && handytimeoutshow == null){ handytimeouthidde = setTimeout(() => { mp.gui.chat.push('hidde') if(phoneup){ phoneup = false; } clearTimeout(handytimeouthidde) handytimeouthidde = null }, 1000); } } } if(phoneup){ if(handy === null){ handy = mp.browsers.new("package://handy/index.html"); } }else{ if(handy != null){ handy.destroy() handy = null } }
    1 point
×
×
  • Create New...