Jump to content

Chaos

Members
  • Posts

    299
  • Joined

  • Last visited

1 Follower

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Chaos's Achievements

Pee-Wee

Pee-Wee (21/54)

1

Reputation

  1. Well, i know how to attach it with normal function such as dxDrawImage but this kind complicated to me
  2. Hi, i was messing with dxDrawGifImage function on wiki and it works good but how can i attach it on element like this https://wiki.multitheftauto.com/wiki/File:DxDrawImageOnElement.png function dxDrawGifImage ( x, y, w, h, path, iStart, iType, effectSpeed ) local gifElement = createElement ( "dx-gif" ) if ( gifElement ) then setElementData ( gifElement, "gifData", { x = x, y = y, w = w, h = h, imgPath = path, startID = iStart, imgID = iStart, imgType = iType, speed = effectSpeed, tick = getTickCount ( ) }, false ) return gifElement else return false end end addEventHandler ( "onClientRender", root, function ( ) local currentTick = getTickCount ( ) for index, gif in ipairs ( getElementsByType ( "dx-gif" ) ) do local gifData = getElementData ( gif, "gifData" ) if ( gifData ) then if ( currentTick - gifData.tick >= gifData.speed ) then gifData.tick = currentTick gifData.imgID = ( gifData.imgID + 1 ) if ( fileExists ( gifData.imgPath .."".. gifData.imgID ..".".. gifData.imgType ) ) then gifData.imgID = gifData.imgID setElementData ( gif, "gifData", gifData, false ) else gifData.imgID = gifData.startID setElementData ( gif, "gifData", gifData, false ) end end dxDrawImage ( gifData.x, gifData.y, gifData.w, gifData.h, gifData.imgPath .."".. gifData.imgID ..".".. gifData.imgType ) end end end )
  3. it works great thanks a lot
  4. Actually that's the code i posted
  5. it's still the same nothing has changed http://image.prntscr.com/image/f14f5945dae24f908d27600a081e9d7a.png
  6. Hi, i'm trying to draw DX Rectangle and fit it with all screen resolutions but i can't figure what's wrong with rectangle it seems doesn't fit, here's the code : local sWidth, sHeight = guiGetScreenSize() local sx, sy = sWidth/1280, sHeight/720 addEventHandler("onClientRender", root, function() dxDrawRectangle(sx*506, sy*616, sx*297, sy*76, tocolor(0, 0, 0, 133),true) dxDrawText("Team 1 Score: 0", sx*556, sy*626, sx*793, sy*650, tocolor(255, 255, 255, 255), 0.80, "bankgothic", "left", "top", false, false, true, false, false) dxDrawText("Team 2 Score: 0", sx*556, sy*658, sx*793, sy*682, tocolor(255, 255, 255, 255), 0.80, "bankgothic", "left", "top", false, false, true, false, false) end ) as you can see here it's fine with res 1280 * 720 http://image.prntscr.com/image/402d0c42b10341c2be6bc64d90498aca.png and here with res 800 * 600 http://image.prntscr.com/image/24f660b05d2243a6916d4d42d392bf96.png
  7. triggerServerEvent ("penzhp", getLocalPlayer())
  8. Chaos

    Vehicle's name

    The source of the event is the vehicle that the player entered. Try this function carName () local vehicleName = getVehicleName ( source ) dxDrawText ( vehicleName , 320, 380+115, 2500, 150, tocolor ( 255, 255, 255, 255 ), 1.5, "bankgothic" ) end addEventHandler( "onClientVehicleEnter", getRootElement(), carName )
  9. Chaos

    Bot issue

    Hi, so i tried to make change in slothbot script that Bot could use Rocket launcher but the problem is when he shoots on ground or nearby he'll die and message appears as a player has killed him, how can i fix this kind of issue ? function mon (killer) if killer and killer ~= source and isElement( killer ) and getElementType(killer) == "player" then if source == Nemesis then outputChatBox ("[NEMESIS-ANNOUNCEMENT] "..getPlayerName(killer):gsub('#%x%x%x%x%x%x', '').." has killed a Nemesis.",root,0,255,0) end end boss() end addEvent("onBotWasted",true) addEventHandler("onBotWasted",getRootElement(), mon )
  10. check this one made by xXMADEXx https://community.multitheftauto.com/in ... ls&id=7330
  11. hi, i have a question how do i get max days of a month like this month has 31 max day ?
  12. hi, i got problem with this code, i'm trying to get ID from event name but it seems not working and every time it gives random number and the event names is containing space any idea? addEvent('nextEventVoteResult') addEventHandler('nextEventVoteResult', getRootElement(), function(eventName) local eventID = getIDFromEventName(eventName) outputChatBox(eventID,root) end ) function getIDFromEventName(eventName) for i,v in ipairs(events) do if v.name == eventName then return i end end return false end
  13. Rly thanks. working One more question. How I can add here blowVehicle? after setElementPosition. function warent ( posX, posY, posZ ) for i ,v in ipairs (getElementsByType("player")) do if getElementData(v,"state") == "alive" then local vehicles = getPedOccupiedVehicle ( v ) if vehicles then setElementPosition ( vehicles, 200, 150, 15 ) blowVehicle(vehicles) end end end end bindKey("enter","down",warent)
  14. try something like that function warent ( posX, posY, posZ ) for i ,v in ipairs (getElementsByType("player")) do if getElementData(v,"state") == "alive" then local vehicles = getPedOccupiedVehicle ( v ) if vehicles then setElementPosition ( vehicles, 200, 150, 15 ) end end end end bindKey("enter","down",warent)
×
×
  • Create New...