-
Posts
667 -
Joined
-
Last visited
-
Days Won
4
Everything posted by Mr.Loki
-
@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...
-
All this does is adding multiple eventHandlers to contactBTN every time you left click.
-
add showChat(true) in the closeInventory function at line:421 remove showChat from line 1 and 1708
-
Can u paste the full gui code? I want to test it.
-
show what you did.
-
Probably show us what you made?
-
line 3 change ak47B to resourceRoot and if that does not work change it to root addEventHandler("onClientGUIClick", resourceRoot, function()
-
Can you show the previous code?
-
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)
-
onPlayerWeaponSwitch if getPedweapon = 0 toggleControl fire to false else toggleControl fire to true
-
onClientPlayerWasted
-
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
-
You can still use it for a private base.
-
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)
-
Get MTASE and paste your code into it, it should reveal any errors if there are.
-
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
-
You gotta use dbPoll to make sure that the query is completed then use the result of the poll. if > 0 then acc exists
-
count the result of the query if > 0 then there's an account
-
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.
-
Oh wait you are using cegui lol use the scrollpane properties here there should be something to sort them.
-
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.
-
guiSetProperty(guiElement,"ClippedByParent","true")
-
dxCreateRenderTarget
-
Did you follow the steps correctly?
-
Check how many vehicle the player has in the base HELP URGENT
Mr.Loki replied to Gabriel1375's topic in Scripting
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)