-
Posts
6,089 -
Joined
-
Last visited
-
Days Won
216
Everything posted by IIYAMA
-
@ bandi94 his code + suivant = v[i+1] and v[i+1][2] or v[1] and v[1][2] -- next row data 2 previous = v[i-1] and v[i-1][2] or v[#v] and v[#v][2] -- prev row data 2
-
Hi, I changed my serverip yesterday, how long will it take before the old server is out of the resource browser? (they have same server name)
-
Thx mate, cookie mystery solved!
-
Hey people, I can't find my clientside cookies any more. Folder: MTA San Andreas 1.4\mods\deathmatch\resources Is empty and I need to check one of my cookies which contains my Tiny Encryption data. Did you eat them?
-
First. serverside + lightweight_sync your (eating, sleeping, ...) data = Secure, client performance. Never do: Because of: client crash, connection timed outs, packet loss, server crash, "onResourceStop" and anything else what might make miscommunication.
-
it does work as long the image is also relative and adjust to the ratio.
-
If you read all comments(especially mine), your problems would be fixed already. code + a little: local sx,sy = guiGetScreenSize() addEventHandler("onClientRender",root, function () if isPedInVehicle(localPlayer) then local veh = getPedOccupiedVehicle(localPlayer) if veh and isElement(veh) then local ch,tw = getElementHealth(veh)-250, sx*(170/1920) local ch = ch / 750 * 100 -- before the directX FUNCTIONS!!!!! dxSetAspectRatioAdjustmentEnabled (true) -- here we fix this resolution problem <<<<< -- before the directX FUNCTIONS!!!!! dxDrawRectangle(sx*(844/1920), sy*(10/1080), tw, sy*(24/1080), tocolor(0, 0, 0, 150), true) if ch >= 0 then ------------------------- HEALTH ------------------------- dxDrawRectangle(sx*(844/1920), sy*(10/1080), ch*tw/100, sy*(24/1080), tocolor(0, 0, 0, 255), true) end end end end)
-
Missing an end. function, if, if, if = 4
-
dxSetAspectRatioAdjustmentEnabled Must be enabled before using the render functions, not after.
-
If you want to say something very negative, don't you think you need a bit of proof for that? Richt now you are destroying somebody his reputation, when hè is only asking for help. Next time keep it for yourself, unless you know where it is from.
-
If the vehicle doesn't have a collision somehow, you just got yourself an infinity loop.
-
On most of the pages it is there. This is probably one of the few events which has no information about that. Also you can figure out very easy if an event can be cancelled. If the event triggers before the "effect" it can be cancelled*. Doesn't count for all.* When the event triggers on the devise where the effect was created, there is more chance it can be cancelled. "onClientPlayerDamage" -- client triggers before the damage("effect") So can be cancelled. "onPlayerDamage" -- server triggers after the damage has been done. The player/his-ped might be already dead by now on the client his pc. You have to think with logic.
-
Try: if ((tonumber(string.sub(tostring(getElementData(player,"Cash")), 2)) or 0) >= tonumber(price)) then
-
>>>> https://wiki.multitheftauto.com/wiki/Dx ... entEnabled <<<<
-
function getPositionFromElementOffset(element,offX,offY,offZ) local m = getElementMatrix ( element ) -- Get the matrix local x = offX * m[1][1] + offY * m[2][1] + offZ * m[3][1] + m[4][1] -- Apply transform local y = offX * m[1][2] + offY * m[2][2] + offZ * m[3][2] + m[4][2] local z = offX * m[1][3] + offY * m[2][3] + offZ * m[3][3] + m[4][3] return x, y, z -- Return the transformed point end addCommandHandler("getThisPart", function () local vehicle = getPedOccupiedVehicle ( localPlayer ) if vehicle then local x,y,z = getPositionFromElementOffset(vehicle,0,0,10)-- offset x,y,z end end) https://wiki.multitheftauto.com/wiki/GetElementMatrix
-
math.randomseed(getTickCount ())
-
Circa 7 per weapon and some of them are shared. In my opinion that is not a big deal. But do what you want.
-
local sWidth, sHeight = guiGetScreenSize() local colorWhite = tocolor(255,255,255,255) local healthimages = function () local heal = getElementHealth(localPlayer) if heal >= 88 then dxDrawImage( (600.0/800)*sWidth, (175.0/600)*sHeight, (104.0/800)*sWidth, (54.0/600)*sHeight,"hud/images/0.png",0.0,0.0,0.0,colorWhite,false) elseif heal >= 75 then dxDrawImage( (600.0/800)*sWidth, (175.0/600)*sHeight, (104.0/800)*sWidth, (54.0/600)*sHeight,"hud/images/1.png",0.0,0.0,0.0,colorWhite,false) elseif heal >= 62 then dxDrawImage( (600.0/800)*sWidth, (175.0/600)*sHeight, (104.0/800)*sWidth, (54.0/600)*sHeight,"hud/images/2.png",0.0,0.0,0.0,colorWhite,false) elseif heal >= 49 then dxDrawImage( (600.0/800)*sWidth, (175.0/600)*sHeight, (104.0/800)*sWidth, (54.0/600)*sHeight,"hud/images/3.png",0.0,0.0,0.0,colorWhite,false) elseif heal >= 36 then dxDrawImage( (600.0/800)*sWidth, (175.0/600)*sHeight, (104.0/800)*sWidth, (54.0/600)*sHeight,"hud/images/4.png",0.0,0.0,0.0,colorWhite,false) elseif heal >= 23 then dxDrawImage( (600.0/800)*sWidth, (175.0/600)*sHeight, (104.0/800)*sWidth, (54.0/600)*sHeight,"hud/images/5.png",0.0,0.0,0.0,colorWhite,false) elseif heal >= 10 then dxDrawImage( (600.0/800)*sWidth, (175.0/600)*sHeight, (104.0/800)*sWidth, (54.0/600)*sHeight,"hud/images/6.png",0.0,0.0,0.0,colorWhite,false) elseif heal >= 6 then dxDrawImage( (600.0/800)*sWidth, (175.0/600)*sHeight, (104.0/800)*sWidth, (54.0/600)*sHeight,"hud/images/7.png",0.0,0.0,0.0,colorWhite,false) else dxDrawImage( (600.0/800)*sWidth, (175.0/600)*sHeight, (104.0/800)*sWidth, (54.0/600)*sHeight,"hud/images/8.png",0.0,0.0,0.0,colorWhite,false) end end addEventHandler("onClientRender",root, healthimages)
-
/start runcode /crun setDevelopmentMode ( true ) /showsound 1 SetWorldSoundEnabled
-
To answer your main question, Yes it is.
-
Player health can also be: 88.5 Second example is bug proof and faster.
-
Try this: local sWidth,sHeight = guiGetScreenSize() local teamHealthBarColor = tocolor(255,0,0,250) local teamHealthBarWidth = sWidth - sWidth*0.79 local showteamhealth = function ( ) local team = getPlayerTeam(localPlayer) if team then local health = 0 local players = getPlayersInTeam(team) for i=1,#players do health = health + getElementHealth(players[i]) end local HealthBar = teamHealthBarWidth*( health / (#players*100) ) dxDrawRectangle(sWidth*0.79,sHeight*0.072,HealthBar,sHeight*0.03,teamHealthBarColor ,false) end end addEventHandler("onClientRender", root, showteamhealth)
-
Every time you trigger an triggerLatentClientEvent there will be a new handler. So you can still trigger another one. If you cancel the handler, the data will stop reaching the client and the event on clientside won't get triggered for that handler.