Jump to content

Mefisto_PL

Members
  • Posts

    460
  • Joined

  • Last visited

Everything posted by Mefisto_PL

  1. Hmm, but how I must use InrepolateBetween? : o
  2. How can I make dxDrawRectangle with animate.. For example in scoreboard is drawing, but I want to move my window from left to right. What events/functions I must use for it? I need an answer and I know that is possible ! ///EDIT Or if it's easier I want to drawing it from left to right, I think it's better way
  3. Poczytaj trochę tutaj i się nauczysz. To i to.
  4. 6:attempt to concatenate field 'name' ( a nil value) Error..
  5. respawn_s :6 attempt to concatenate local 'mapinfo' (a table value)
  6. bad argument #1 to find string expected got nil
  7. What's wrong? It's error in finding map name. local running = false -- if race is running addEvent("onClientRequestRespawn", true) addEventHandler("onClientRequestRespawn", getRootElement(), function(mapInfo, mapOptions, gameOptions,vehicleData) if (ismapDM(mapInfo.name) == 1) then -- source is the player that requested respawn. -- spawn at the position where last saved. triggerClientEvent(source, 'onClientCall_race', source, "Spectate.stop", 'manual') triggerEvent('onClientRequestSpectate', source, false) spawnPlayer(source, vehicleData.posX, vehicleData.posY, vehicleData.posZ) local vehicle = exports.race:getPlayerVehicle(source) warpPedIntoVehicle(source, vehicle) triggerClientEvent(source, 'onClientCall_race', source, "Spectate.stop", 'manual') setElementData(source, "race.spectating", true) setElementData(source, "status1", "dead") setElementData(source, "status2", "") --setElementData(source, "state", "training") setElementData(source, "race.finished", true) setCameraTarget(source, source) setElementData(vehicle, "race.collideworld", 1) setElementData(vehicle, "race.collideothers", 0) setElementData(source, "race.alpha", 255) setElementData(vehicle, "race.alpha", 255) setElementHealth(vehicle, vehicleData.health) setElementModel(vehicle, 481) -- fix motor sound. setElementModel(vehicle, tonumber(vehicleData.model)) setElementPosition(vehicle, vehicleData.posX, vehicleData.posY, vehicleData.posZ) setElementRotation(vehicle, vehicleData.rotX, vehicleData.rotY, vehicleData.rotZ) if(vehicleData.nitro ~= nil)then addVehicleUpgrade(vehicle, tonumber(vehicleData.nitro)) end setElementFrozen(vehicle, true) toggleAllControls(source, true) setVehicleLandingGearDown(vehicle, true) setTimer(delayedRespawn, 2000, 1, source, vehicle, vehicleData) elseif (ismapDM(mapInfo.name) == 2) then cancelEvent() elseif (ismapDM(mapInfo.name) == 3) then cancelEvent() end end ) function ismapDM ( mapInfo ) if string.find( mapInfo.name, "[DM]", 1, true ) then return 1 elseif string.find( mapInfo.name, "[DD]", 1, true ) then return 2 elseif string.find( mapInfo.name, "[FUN]", 1, true ) then return 3 end end function delayedRespawn(player, vehicle, vehicleData) triggerClientEvent(player, "clientUnfreezeOnReady", player, vehicle, vehicleData) end addEvent("onRaceStateChanging", true) addEventHandler("onRaceStateChanging", getRootElement(), function(newState, oldState) triggerClientEvent("onClientRaceStateChanging", getRootElement(), newState, oldState) if(newState == "Running")then running = true end if(newState == "PostFinish" or newState == "NoMap")then running = false local player = getElementsByType("player") for i = 1, #player do local replaying = getElementData(player[i], "respawn.playing") if(replaying)then setElementData(source, "race.spectating", false) setElementData(source, "status1", "dead") setElementData(source, "status2", "") setElementData(source, "race.finished", false) end end end end) -- Add training mode before player has played once addEventHandler("onElementDataChange", getRootElement(), function(theName, oldValue) if(getElementType(source) == "player")then if(tostring(getElementData(source, "state")) == "waiting" and running)then --triggerClientEvent(source, "onClientRaceStateChanging", source, "Running", "GridCountdown") end end end) -- Kill when respawned and gets hunter. addEvent("onPlayerPickUpRacePickup", true) addEventHandler("onPlayerPickUpRacePickup", getRootElement(), function(pickupID, pickupType, vehicleModel) if(pickupType == "vehiclechange" and vehicleModel == 425)then local state = getElementData(source, "state") or "dead" if(state == "dead")then setElementHealth(source, 0) end end end)
  8. Okey, I understand. Thank you.
  9. But idk that I understand what they said.
  10. So I can't do anything when I click on dx elements?
  11. TAPL, you mean I must do that: function blackBG ( button, state, absoluteX, absoluteY, worldX, worldY, worldZ, clickedElement ) if ( button == blackpoint ) then bg = tocolor ( 0, 0, 0, 250 ) wbg = tocolor ( 255, 255, 255, 250 ) end end addEventHandler ( "onClientClick", getRootElement(), blackBG ) right? It doesn't working.
  12. I don't understand how to use tocolor in this situation local bg = tocolor ( 0, 158, 255, 200 ) local wbg = tocolor ( 0, 0, 0, 200 ) function dupa ( ) dxDrawRectangle ( x/3.7, y/3.9, x/2.02, y/2.2, bg ) dxDrawRectangle ( x/3.6, y/3.5, x/2.08, y/2.4, wbg ) local blackpoint = dxDrawRectangle ( x/1.357, y/3.8, x/50, y/50, tocolor ( 0, 0, 0, 255 ) ) end function blackBG ( clickedElement ) if ( clickedElement == blackpoint ) then bg = tocolor ( 0, 0, 0, 250 ) wbg = tocolor ( 255, 255, 255, 250 ) end end addEventHandler ( "onClientClick", getRootElement(), blackBG )
  13. If in this is custom HUD you must create function for that .
  14. Po pierwsze używaj tagów [lua][/lua] jak cos wstawiasz na forum po drugie function createVehicleForPlayer(thePlayer, command, vehicleModel) local x,y,z = getElementPosition(thePlayer) createVehicle ( tonumber(vehicleModel), x, y, z + 10 ) end addCommandHandler("v", createVehicleForPlayer) createVehicleForPlayer(thePlayer,"v","468") i teraz tak zawsze po "local argument" dajesz "=" przykład local asdf = ciastko(thePlayer) przy używaniu funkcji typu createVehicle musisz sprawdzic czy jest client czy server side, poczytaj trochę https://wiki.multitheftauto.com/wiki/Scr ... troduction
  15. Mefisto_PL

    Clock

    Ok working, but how can I restart this timer?
  16. Mefisto_PL

    Clock

    Working perfectly ! Thanks ! ///EDIT Debugscript when I want to remove display: onClientRender is already handled
  17. Mefisto_PL

    Clock

    It doesn't help me sorry.. ( I KNOW HOW TO USE KILLTIMER )
  18. Mefisto_PL

    Clock

    Count hasn't started and how in your I could stop this timer ?
  19. Mefisto_PL

    Clock

    I have a problem.. I want to make timer.. When I use the command then create a count which is higher and higher and higher and when I use another command then it's stopped. In my version of code it can't be stopped.. screenX,screenY = guiGetScreenSize() function startTheClock () if not systemUpTime then systemUpTime = getTickCount () --Store the system tick count, this will be 0 for us end currentCount = getTickCount () dxDrawRectangle (screenX *.40, screenY * .09, 250, 50, tocolor(0,0,0,150)) dxDrawText ( currentCount - systemUpTime, screenX * .48, screenY * .1, screenX, screenY, tocolor(255,255,255), 2) addEventHandler ( "onClientRender", root, startTheClock ) end addCommandHandler("clock", startTheClock) In debugscript is error that onClientRender is already handled, but when I remove this handler it doesn't create a timer.. pls help..
  20. Mefisto_PL

    Question

    But you can create your own chat ; )
  21. I see.. don't be nervous .
  22. Cadu12 Wrote that is easy to hack for hackers.. but I forget about hacks isn't allowed in MTA ;x ( I know this way, and I want to use that, I understand it ) ///EDIT In server-side isn't "addEvent" function and only that I don't understand.
×
×
  • Create New...