Jump to content

Mr.Loki

Members
  • Posts

    667
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by Mr.Loki

  1. @3laa33 yeah but what happens when he needs to close it? You didn't remove the event so it just keeps adding more. What @Tails posted was the correct solution. What this code does is if isContactOpened then add an event even tho the contact is open thus creating another contactBTN no need to use == true unless checking for specific results if it has a var it will always return true. you need to swap your add and remove handlers...
  2. All this does is adding multiple eventHandlers to contactBTN every time you left click.
  3. Mr.Loki

    Hide-Show Chat

    add showChat(true) in the closeInventory function at line:421 remove showChat from line 1 and 1708
  4. Can u paste the full gui code? I want to test it.
  5. Mr.Loki

    Hide-Show Chat

    Probably show us what you made?
  6. line 3 change ak47B to resourceRoot and if that does not work change it to root addEventHandler("onClientGUIClick", resourceRoot, function()
  7. Can you show the previous code?
  8. Even shorter addEventHandler("onClientMarkerHit", skillshop, function() local lp = localPlayer guiProgressBarSetProgress(pistolPr, getPlayerStat (lp,69)) guiProgressBarSetProgress(silencedPr, getPlayerStat (lp,70)) guiProgressBarSetProgress(deaglePr, getPlayerStat (lp,71)) guiProgressBarSetProgress(ShotgPr, getPlayerStat (lp,72)) guiProgressBarSetProgress(sawnoffPr, getPlayerStat (lp,73)) guiProgressBarSetProgress(spazPr, getPlayerStat (lp,74)) guiProgressBarSetProgress(tech9Pr, getPlayerStat (lp,75)) guiProgressBarSetProgress(mp5Pr, getPlayerStat (lp,76)) guiProgressBarSetProgress(ak47Pr, getPlayerStat (lp,77)) guiProgressBarSetProgress(m4Pr, getPlayerStat (lp,78)) end)
  9. Mr.Loki

    Punch Hand

    onPlayerWeaponSwitch if getPedweapon = 0 toggleControl fire to false else toggleControl fire to true
  10. Mr.Loki

    camera

    To make the camera move smoothly from point A to B use the interpolateBetween function. Try playing with this and test it out: local time = 10000 --10 seconds local start = getTickCount( ) --the start of the interpolation --Point A local x,y,z = 2046.943359375, 997.03973388672, 13.485786437988 --Point B local x2,y2,z2 = 2046.943359375, 1010, 13.485786437988 addEventHandler( "onClientRender", root, function ( ) local progress = (getTickCount( )-start)/time local x,y,z = interpolateBetween( x,y,z,x2,y2,z2, progress, "InOutQuad")-- create a new xyz of the updated position setCameraMatrix( x, y, z) end ) some examples https://streamable.com/68wwd https://streamable.com/3z931
  11. Mr.Loki

    open command

    You can still use it for a private base.
  12. Mr.Loki

    open command

    You can use /bind key command to bind a command to a key. /bind j open When I press j it will execute the open command it's better to use commandHandlers instead of bindKey because not all players would want to use the same key. Also instead of using 2 separate functions to open/close the gate just use 1 function so all you need is 1 command for example local opencommand = "gate" --toggle command local GateObject = 980 --object local OpenTime = 3000 --opening second local rotX, rotY, rotZ = 0, 0, 270 --rotations local x, y, z = -489.2,-562.4,27.299 --closed position local open --Var representing the state of the gate opened = true closed = false local ggate = createObject ( GateObject, x, y, z, rotX, rotY, rotZ) function toggleGate ( p ) if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(p)), aclGetGroup(ACL)) then if open then moveObject (ggate, OpenTime, x, y, z) else moveObject (ggate, OpenTime, x, y, z-5.5) end local state = not open and "opened." or "closed." -- check if gate opened and set the text to opened/closed outputChatBox("Admin base gate "..state, p,0,255,0,true) open = not open --toggle the open var between true/false else outputChatBox("Sorry, you dont have permission to do that!", p,0,255,0,true) end end addCommandHandler( opencommand, toggleGate)
  13. Mr.Loki

    Complie

    Get MTASE and paste your code into it, it should reveal any errors if there are.
  14. For each object get its distance from the ground if it's > 2 for example just delete its parent and then itself. getElementByType getDistancebetweenPoinrs3D getElementData destroyElement
  15. You gotta use dbPoll to make sure that the query is completed then use the result of the poll. if > 0 then acc exists
  16. count the result of the query if > 0 then there's an account
  17. Reduce the sizes of the images. If it's too large it will take the client a while to load each image. There's no rant to have images that are 2000x2000 when they are only 200x200 in-game.
  18. Oh wait you are using cegui lol use the scrollpane properties here there should be something to sort them.
  19. Oh, you want to wrap the GUI elements not clip. Try using the size of the scrollpane to decide whether the element should be placed under.
  20. guiSetProperty(guiElement,"ClippedByParent","true")
  21. Did you follow the steps correctly?
  22. Just use N++ or sublime autocomplete/syntax highlighter for the function names it helps a lot. function checkVehicles(theElement) -- Check if theElement is a vehicle. if getElementType(theElement) == "vehicle" then -- Get the driver of said vehicle. local driver = getVehicleController( theElement ) -- Check if he belongs to the group and get the count of current vehicles in colshape. if ( getElementData ( driver , "Group" ) == GroupName ) and #getElementsWithinColShape(source, "vehicle") > 15 then -- Sets the position of the player's vehicle. setElementPosition(veh, TeleportLocation[1], TeleportLocation[2], TeleportLocation[3]) else -- For each player in the vehicle... for _,plr in pairs (getVehicleOccupants( theElement )) do -- execute the sendMsg function. sendMsg(theElement, "Welcome Player") end end end end addEventHandler("onColShapeHit", root, checkVehicles)
×
×
  • Create New...