-
Posts
6,097 -
Joined
-
Last visited
-
Days Won
218
Everything posted by IIYAMA
-
createBlip on Player for a specific Team or Group
IIYAMA replied to Zuher Laith's topic in Scripting
https://wiki.multitheftauto.com/wiki/AclGetGroup See example 2. -
Check if the setting is added to the meta.xml and filled in correctly. If that doesn't work, you can do something like this: (replace line 3) exp_kill = get("nivel.ExpPorKill") or 10 -- fill in a fallback value
-
Remove removeEventHandler( "onClientRender", root, callfunction )
-
local attachedElements = getAttachedElements(veh) if attachedElements[1] then fireWeapon ( attachedElements[1] ) end P.s. you are not attaching gun2 in your code. There is a typo.
- 2 replies
-
- getattachedelements
- table
-
(and 1 more)
Tagged with:
-
The element has to exist first before you can have interaction with it. Real world example: How can I help people on this forum, if they haven't been born yet? The answer to that is: I can not. So use: if isElement(aWarpForm) then Before you are going to have interaction with this element.
-
You aren't executing the function `szinvaltas`. And I have also no clue why you put a function there. Also I do not understand where the variable `speed`/ speed value comes from.
-
That is not the error/warning. But this: c.lua:5: attempt to concatenate local 'amount' (a nil value) Which makes the meaning of the issue very different. local screenW, screenH = guiGetScreenSize() local amount function asdasd() dxDrawRectangle(screenW * 0.8069, screenH * 0.5656, screenW * 0.1931, screenH * 0.0289, tocolor(0, 0, 0, 178), false) dxDrawText("Kaptál #01AC41"..amount.."Ft-ot.", screenW * 0.8063, screenH * 0.5656, screenW * 1.0000, screenH * 0.5944, tocolor(255, 255, 255, 255), 1.00, "sans", "center", "center", false, false, false, true, false) end addEvent("theclienteventname", true ) addEventHandler("theclienteventname", root, function ( amount_ ) amount = amount_ addEventHandler("onClientRender", root, asdasd) end)
-
You can use fetchRemote to make a 'download' progress, but more in this way: fileSize / totalFileSize * 100 = additional progress.(% after a file has been downloaded) Which is more or less a file transfer progress instead of a download progress. With a transition you can make it more smooth. But it will not tell the client that a part of a file has been downloaded. See also the function downloadFile which also validate the file if it has been corrected downloaded and not edited by the client.
-
I don't think there is a download progress indication for fetchremote. But you can use the trigger latent functions to show the client download progress once the server has downloaded the files.
-
Nice done mate. Now get serious please. https://wiki.multitheftauto.com/wiki/Client_Scripting_Functions https://wiki.multitheftauto.com/wiki/Client_Scripting_Events https://wiki.multitheftauto.com/wiki/Server_Scripting_Functions https://wiki.multitheftauto.com/wiki/Server_Scripting_Events
-
After you did some serious research and collecting the parts you need. I am not creating medium examples, if I am not sure if you will learn something of it. That are my rules.
-
You can't give weapons reload animations with setWeaponProperty because they simply do not exist(for some weapons) in GTA by default. An overwrite is required. (with setPedAnimation etc.)
-
local hover = false; showCursor(true); function dxDraw() dxDrawRectangle(567, 263, 229, 236, tocolor(0, 0, 0, 206), false); local move -- keep move local if isMouseInPosition(567, 263, 229, 236) then if not hover then start = getTickCount() iprint("state has been changed! (1)") hover = true end move = interpolateBetween(0, 0, 0, 236, 0, 0, ((getTickCount()-start)/500), "Linear"); else if hover then start = getTickCount() iprint("state has been changed! (2)") hover = false end move = interpolateBetween(0, 0, 236, 0, 0, 0, ((getTickCount()-start)/500), "Linear"); end dxDrawRectangle(567, 263, 229, move, tocolor(189, 131, 131, 206), false); end addEventHandler("onClientRender", getRootElement(), dxDraw) function isMouseInPosition ( x, y, width, height ) if ( not isCursorShowing( ) ) then return false end local sx, sy = guiGetScreenSize ( ) local cx, cy = getCursorPosition ( ) local cx, cy = ( cx * sx ), ( cy * sy ) if ( cx >= x and cx <= x + width ) and ( cy >= y and cy <= y + height ) then return true else return false end end That's because you only need to update the start tickCount when you change state. And not when you your state is true or false. Please check the debug console.
-
local begin = ( ( getTickCount() - start ) % 500 / 500 ); This will repeat the animation. It is not what you want.(so don't apply it in your end code) But it might tell you what you are doing wrong with the timing. What you need to do is using a boolean to set a status. This status indicates when you switch between hovering and not hovering. local hovering = false if not hovering then start = getTickCount() hovering = true end if hovering then start = getTickCount() hovering = false end The code will rest the timing, when you switch states. I leave the applying of the code to you.
-
By defining the resourceRoot as source element and attach it at the other side with the resourceRoot as well. Client triggerServerEvent("event", resourceRoot) theElement: The element that is the source of the event. Server addEvent("event", true) addEventHandler("event", resourceRoot, attachedTo: The element you wish to attach the handler to. The handler will only be called when the event it is attached to is triggered for this element, or one of its children. Often, this can be the root element (meaning the handler will be called when the event is triggered for any element). https://wiki.multitheftauto.com/wiki/AddEventHandler The source element is LINKED to the attachedTo element. The attachedTo element will only accept the same element or the children of that same element. The triggerEventSystem is a global system and the events will always be global accessible. You have to do this for every resource that uses the same event name. The root element will accepts everything, included resourceRoot's.
- 3 replies
-
- 2
-
-
- triggerserverevent
- triggerclientevent
-
(and 1 more)
Tagged with:
-
addEventHandler("onClientGUIClick",weather_button,setCustomWeather) function setCustomWeather(button,state) --Function to change weather You can't use the same name for the function `setWeather`, because it will actually overwrite it. Which means that if you call setWeather on line 42, it will re-call the function setWeather of line 38 (and not the mta function).
-
Attach the addCommandHandler to a function. Not the GUI element `aWarpForm`. I will take a closer look at it, once you debug your code.
-
Use the camera object. https://wiki.multitheftauto.com/wiki/GetCamera local camera = getCamera() bindKey( "w", "down", function () if getKeyState( "lshift" ) == true then -- position is already included in the matrix local x,y,z = getPositionFromElementOffset(camera, 0, 3, 0) setElementPosition(localPlayer, x, y, z) end end )
-
Blow-up and down scaling is not working?
-
I do not recommend to use renderTargets for text. Because rendertargets do not include anti-aliasing. There reason behind that is for me unknown. Maybe it can work with blendmode as idarrr said.
-
You could try to scale up and scale down. Also texture images have better quality than images rendered directly from file.
-
I get the feeling that you are not taking me seriously. (I am out of here,)
-
bla bla bla bla I REALLY don't care!!! DEBUG! DEBUG! DEBUG!!! I do care! iprint("script has been executed") function blablabla (source, command) iprint("function blablabla has been executed") local players = getPlayerTeam(source) local team = getTeamName(players) iprint("player teamName", team) if team == "team" then iprint("team name is correct") setPedStat(source, 69, 999) setPedStat(source, 70, 999) setPedStat(source, 71, 999) setPedStat(source, 72, 999) setPedStat(source, 73, 999) setPedStat(source, 74, 999) setPedStat(source, 75, 999) setPedStat(source, 76, 999) setPedStat(source, 77, 999) setPedStat(source, 78, 999) setPedStat(source, 79, 999) outputChatBox("Done.", source) local boss = getElementData(source,'boss') iprint("boss value", boss) if boss == true then outputChatBox("You can not use this now while boss is activated.", source) end end end addCommandHandler("team", blablabla)
