-
Posts
6,063 -
Joined
-
Last visited
-
Days Won
209
Everything posted by IIYAMA
-
bool exports.object_preview:createObjectPreview(element object, float rotX rotY, rotZ, projPosX, projPosY, projSizeX, projSizeY [, bool isRelative = false, postGUI = false, [color=#FF0000]isSecRT = true][/color]) Set to true...
-
A resource is a container which can contain: scripts(Lua), maps files, xml files, etc. What does a resource minimal contain to be a resource? A folder which contains a meta.xml file. Some people call resources scripts too, which isn't a wrong definition when that resource is using scripts. Yet I keep those two apart, just to prevent misunderstandings.
-
Try this:(not tested) local myNumber = 23553.3546 local myText = tostring(myNumber) local myTable = split(myText,".") local myNumber,myDecimal = myTable[1],myTable[2] outputChatBox(myNumber) outputChatBox(myDecimal)
-
Attempt to arithmetic on local x1 ( a boolean value )
IIYAMA replied to stefutz101's topic in Scripting
x1 is defined, yet the function getScreenFromWorldPosition can't return correct values, because that position is behind your camera. Add line between line 2 and 3: if x1 then And of course add an end... end P.s: z1 is nothing. -
I don't know exactly what (Multiple Render Targets) are, but afaik that has nothing to do with rendering 2D MTA(dx functions) layers over each other. But if you have your visuals, it has to do with your or ren's code.
-
Did you test it without other gui's arround it? And yes your hardware/software must support it in order to use it.
-
These are the two factors that can change the render ordering between two onClientRender handlers. There is only 1 thing left, both are using the same event >"onClientRender"<? If they are, then you are mistaking somewhere else.
-
dxDrawRectangle(35, 24, 744, 551, tocolor(0, 0, 0, 236), [color=#FF0000]true[/color]) syntax dxDrawRectangle ( float startX, float startY, float width, float height [, int color = white, [color=#FF0000]bool postGUI = false[/color], bool subPixelPositioning = false ] ) dxDrawRectangle(35, 24, 744, 551, tocolor(0, 0, 0, 236), [color=#00BF00]false[/color])
-
onWeaponFire, you can't create custom weapons serverside yet, so forget it's existence. There is only onClientWeaponFire. If you want onWeaponFire to work, you have to make it a custom event.
-
Well, then I am sorry too. But that is how addEventHandlers work. You sure you aren't drawing anything over the GUI? Because if you set that optional argument to true, the dx will be drawing after the gui's have been drawn.
-
line 26 of the first code: end, true, "high+10") end, true, "low") Lower = later triggered = on top.
-
You can start by giving those variables an appropriate name. And as Noki said, add the content of the variable shadowDist to those messy named ones: l,t,r,b
-
because the variable "weapon" can contain only one number. And "and" mean AND and not OR. Put it exactly like this: if isElement ( attacker ) and (weapon == 30 or weapon == 22 or weapon == 28 or weapon == 29) -- between (), because it have to be 1 result. and getElementType(attacker) == "player" and getElementModel(source) == 165 then
-
Yea, you should have. You can't just leave an argument open. Last time it was using the bodypart as loss. addEventHandler("onClientPlayerDamage", localPlayer, function (attacker, weapon,bodypart, loss) -- source is the player that got damaged. if isElement ( attacker ) and weapon == 51 and getElementType(attacker) == "player" and getElementModel(source) == 165 then local oldHealth = getElementHealth(source) local newHealth = oldHealth + loss - 5 if newHealth > 0 then setElementHealth(source,newHealth ) cancelEvent() elseif oldHealth > 0 then setElementHealth(source,0) end end end)
-
no, you missed placed it. Try this: (not tested) addEventHandler("onClientPlayerDamage", localPlayer, function (attacker, weapon, loss) -- source is the player that got damaged. if isElement ( attacker ) and weapon == 51 and getElementType(attacker) == "player" and getElementModel(source) == 165 then local oldHealth = getElementHealth(source) local newHealth = oldHealth + loss - 5 if newHealth > 0 then setElementHealth(source,newHealth ) cancelEvent() elseif oldHealth > 0 then setElementHealth(source,0) end end end) Make sure you are wearing skin 165, when somebody attacks you.
-
Add(new stuff), replace(that look a like) and remove.(strike)
-
You have to add the health loss, before you set the new health. local newHealth = getElementHealth(source) + loss - 5 if newHealth > 0 then setElementHealth(source,newHealth ) else setElementHealth(source,0) end And not to forget, put the handler on the localPlayer. addEventHandler("onClientPlayerDamage", localPlayer, You can't set the health of a remote player with success, only the localPlayer as source can give correct result. and attacker== localPlayer The attacker can also be a vehicle. getElementType(attacker) == "player"
-
Scaling stuff in two directions, gives a terrible result when the ratio chances. That's why I am using only 1 scalingFactor.
-
I scale down like this. local scaleFactor = math.min(guiGetScreenSize ())/1080 My resolution is 1920x1080. So when you are making your dx stuff on your screen, replace 1080 with your screen height*. * probably your screen height, I don't think people (can)play with 1080x1920. Also sometimes you must limit the scaleFactor when you are working with text functions. When text get too small, people can't read it any more. For example: local scaleFactorText = scaleFactor if scaleFactorText < 0.3 then scaleFactorText = 0.3 end
-
Line 6 >local randomteam = teams[math.random(#teams)]<, must be placed between line 9 and 10. Else it isn't random per player.
-
Atenos, what does dxDrawRectangle return? You can find the answer here: https://wiki.multitheftauto.com/wiki/DxDrawRectangle Which is also the answer why it doesn't work.
-
Both choices have benefits, but it has nothing to do with optimization. You won't notice those extra execution time for exports. As long as you use more exports in stead of custom events, everything is al right. This is a choice for the developer, based on his knowledge and logic thinking. Some resources can be placed together and others can better not.
-
https://wiki.multitheftauto.com/wiki/Se ... ntrolState