Jump to content

Michcio

Members
  • Posts

    84
  • Joined

  • Last visited

Everything posted by Michcio

  1. I have problem with hitting a marker. I want to do sth like only one player can open gui window at the same time. My code: function ukryj () guiSetVisible(oknolicencja,false) showCursor(false) unbindKey("z","down",ukryj) setElementData(marker,"wolne",false) setElementData(getLocalPlayer(),"marker_prawko",false) end function pokaz2 (hitPlayer, matchingDimension) if source == marker then for k,v in ipairs(getElementsByType("player")) do if getElementData(v,"zdaje_prawko") == false then bindKey("z","down",pokaz) setElementData(hitPlayer,"marker_prawko",true) elseif getElementData(v,"zdaje_prawko") == true then unbindKey("z","down",pokaz) callServerFunction("outputChatBox","***| Gracz "..getPlayerName(v).." teraz zdaje prawko! |***",hitPlayer,255,255,255) end end end end addEventHandler("onClientMarkerHit",marker,pokaz2) function pokaz () guiGridListSetItemText ( glicencja, row1, kol1, "Prawko kat.B", false, false ) guiGridListSetItemText ( glicencja, row1, kol2, "2000$", false, false ) guiSetVisible(oknolicencja,true) setElementData(gracz,"zdaje_prawko",true) showCursor(true) centerWindow(oknolicencja) bindKey("x","down",ukryj) outputChatBox("***| Aby zamknac okienko wcisnij 'x' |***",255,255,255) end
  2. Hi. I have simple function to depleting player health but when player spawn after he die health depleting faster. Here's code: function healthDepleting() local currentHealth = getElementHealth(gracz) setElementHealth(gracz,tostring(currentHealth - 0.002)) end function setUp() setTimer(healthDepleting,500,0) end addEventHandler("onClientPlayerSpawn",getRootElement(),setUp)
  3. Hi! How can I add some restaurants in mabako-services?
  4. Oh thanks. It was exactly what I mean. Thanks a lot.
  5. Yes but it's not too realistic when i freeze vehicle. Is possible to freeze player when he is in vehicle?
  6. None errors in debug. Chatbox output text but player is not frozen.
  7. I have problem with freezing player. function wypadek (loss) local gracz = getVehicleOccupant(source) if(gracz) then if loss >= 100 then if countPlayersInTeam(getTeamFromName("Pogotowie")) == 0 then outputChatBox("***| Masz wypadek! Aktualnie nie ma lekarzy na serwerze! Za 20 sekund sam się ockniesz! |***", gracz, 255,255,255,true) setElementFrozen(gracz,true) setTimer(unfreeze,20000,1,gracz,false) else outputChatBox("***| Masz wypadek! Zaraz przyjedzie pogotowie! |***", gracz, 255,255,255,true) setElementFrozen(gracz,true) end end end end addEventHandler("onVehicleDamage", getRootElement(), wypadek) function unfreeze (co,jak) setElementFrozen ( co,jak ) end
  8. Thanks. I thought that its this page but i wasn't sure.
  9. Where can I find id of car wheels? I want to replace wheels with new downloaded from internet.
  10. https://wiki.multitheftauto.com/wiki/Cli ... _functions
  11. This script change newslbl text only once. I have no idea why. Will someone help me? Here's my code: addEventHandler("onClientRender", root, function() dxDrawRectangle(x*0.3078125, 0, x*0.4203125, y*0.0390625, tocolor(24, 24, 24, 219), false) end ) newsy = { "Nowe forum serwera! [url=http://www.truckworld.ugu.pl]www.truckworld.ugu.pl[/url] <-- Zapraszamy!", "Nowa wersja serwera juz niebawem!", "Filmik autorstwa sebaziola został dodany na forum! Zapraszamy!" } index = 0 function HandleTheRendering ( ) newslbl = guiCreateLabel(0.32, 0.00, 0.40, 0.03, "Nowe forum serwera! [url=http://www.truckworld.ugu.pl]www.truckworld.ugu.pl[/url] <-- Zapraszamy!", true) guiSetFont(newslbl, "default-bold-small") guiLabelSetColor(newslbl, 255, 0, 0) guiLabelSetHorizontalAlign(newslbl, "center", false) guiLabelSetVerticalAlign(newslbl, "center") setTimer(guiSetText,20000,0,newslbl,newsy[math.random(1,3)]) end addEventHandler ( "onClientResourceStart", resourceRoot, HandleTheRendering )
  12. Michcio

    Skin select

    Hi! I have problem with skin select. I want do sth like you click "prawobutt" button and button "skinidbutt" text will be set to next skin id from table. skiny = { 0, 24, 26, 44, 432 } addEventHandler( "onClientGUIClick", getRootElement(), function() if source == prawobutt then s = guiGetText(skinidbutt) i = 1 for i,v in ipairs(skiny) do s = skiny[i] end guiSetText(skinidbutt,s) end end )
  13. Try something like this and add more dff files. function replaceModel() dff = engineLoadDFF("sandking.dff", 495 ) engineImportDFF(dff, 495) dff2 = engineLoadDFF("supergt.dff", 506 ) engineImportDFF(dff2, 506) dff3 = engineLoadDFF("uranus.dff", 558 ) engineImportDFF(dff3, 558) txd = engineLoadDFF("bloodra.txd", 504 ) engineReplaceModel(txd, 504) txd2 = engineLoadTXD("elegy.txd", 562 ) engineReplaceModel(txd2, 562) txd3 = engineLoadTXD("flash.txd", 565 ) engineReplaceModel(txd3, 565) txd4 = engineLoadTXD("jester.txd", 29 ) engineReplaceModel(txd4, 29) txd5 = engineLoadTXD("sandking.txd", 495 ) engineReplaceModel(txd5, 495) txd6 = engineLoadTXD("stratum.txd", 561 ) engineReplaceModel(txd6, 561) txd7 = engineLoadTXD("sultan.txd", 560 ) engineReplaceModel(txd7, 560) txd8 = engineLoadTXD("supergt.txd", 506 ) engineReplaceModel(txd8, 506) txd9 = engineLoadTXD("uranus.txd", 558 ) engineReplaceModel(txd9, 558) end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceModel)
  14. Here it's in english: http://code.google.com/p/luaforwindows/ ... e&can=2&q= You must right click on .lua file and choose "Edit script" then you have window with 10 tabs so choose "Tools" tab and there is Compile.
  15. Use this: http://www.sendspace.pl/file/f2dde5ee422463f0fdd1653 In my view it's the best way to compile lua code. Click "Pobierz" to download.
  16. Michcio

    I need help.

    Thanks for help. I will try.
  17. Michcio

    I need help.

    Hi! I want to do a dxtext when player download resources on join. What events should I use?
  18. Michcio

    Help

    Thanks i had freeroam running.
  19. Michcio

    Help

    Thanks but when i write "-hi" chatbox outputs me "-hi" and "CB: hi".
  20. Michcio

    Help

    Hi! How to make sth like this: I write "-Hi everyone!" and chat outputs: "CB: Hi everyone!"?
  21. I know it but it shows it to players who is in team at the moment. I need to do that it is visible to players who is in this team all the time.
  22. Blip is unvisible for all players. Maybe I must do it on client side and trigger setElementVisibleTo in onClientRender function.
×
×
  • Create New...