Jump to content

Seba500PLK

Members
  • Posts

    239
  • Joined

  • Last visited

1 Follower

Details

  • Gang
    RealZ

Recent Profile Visitors

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

Seba500PLK's Achievements

Trick

Trick (18/54)

0

Reputation

  1. Trochę namieszałeś local dbPolicja = dbConnect("sqlite",":/frakcje.db") function spawn() local nazwaGracza = getPlayerName(source) local nazwa = getServerName () outputChatBox ("Witaj "..nazwaGracza.. " na serwerze "..nazwa.."! Administracja zyczy milej gry!",source) spawnPlayer(source,-204.71535, 1119.36426, 19.74219,-90,0,0,0) fadeCamera(source,true) setCameraTarget(source,source) if dbPolicja then local qh = dbQuery(dbPolicja,"SELECT * FROM pol WHERE nick=?", nazwaGracza) local wynik = dbPoll(qh,-1) if wynik and wynik[1] then if wynik[1]['nick'] == nazwaGracza then setElementData(source,"policja",true) end end end end addEventHandler("onPlayerJoin",root,spawn)
  2. local useItem = {}; function onPlayerUseMedicObject(itemName) local playersource = source if ( not useItem[playersource] ) then useItem[playersource] = true; setPedAnimation (playersource,"BOMBER","BOM_Plant",2,true,false,nil,false) setTimer( function () if itemName == "Bandage" then setElementData(playersource,"bleeding",0) setElementData(playersource,itemName,getElementData(playersource,itemName)-1) elseif itemName == "First Aid Kit" then setElementData(playersource,"blood",getElementData(playersource,"blood")+math.random(3000,9000)) setElementData(playersource,"bleeding",0) setElementData(playersource,itemName,getElementData(playersource,itemName)-1) elseif itemName == "Warmer" then setElementData(playersource,"cold",false) setElementData(playersource,"temperature",37) setElementData(playersource,itemName,getElementData(playersource,itemName)-1) elseif itemName == "Painkiller" then setElementData(playersource,"pain",false) setElementData(playersource,itemName,getElementData(playersource,itemName)-1) elseif itemName == "Morphine" then setElementData(playersource,"brokenbone",false) setElementData(playersource,itemName,getElementData(playersource,itemName)-1) elseif itemName == "Antibiotics" then setElementData(playersource,"bleeding",0) setElementData(playersource,"infection",false) setElementData(playersource,itemName,getElementData(playersource,itemName)-1) end useItem[playersource] = nil; end,2500,1) triggerClientEvent(playersource,"refreshInventoryManual",playersource) end end addEvent("onPlayerUseMedicObject",true) addEventHandler("onPlayerUseMedicObject",getRootElement(),onPlayerUseMedicObject)
  3. local wInventory = false local function openElementInventory( ax, ay ) ... end addEvent( "openElementInventory", true ) addEventHandler( "openElementInventory", getRootElement(), openElementInventory ) addEventHandler( "onClientChangeChar", getRootElement(), hideMenu ) addEvent( "fini:~emMove", true ) addEventHandler( "fini:~emMove", getLocalPlayer(), function( ) guiSetEnabled( wInventory, true ) guiSetVisible( wWait, false ) end )
  4. Tutaj chodzi o to że wywołujesz funkcje panel1 a nie fpanelu1 addCommandHandler("panel1", panel1) wszystko dziala tak jak powinno w twoim kodzie, funkcja fpanelu1 nie jest w ogole uzywana, dodatkowo korzystasz z addEventHandler ("onClientRender", root, panel1) co jest bez sensu z uzywaniem GUI, to uzywa sie np w przypadku dx (np dxDrawText) w GUI tego nie uzywamy. Caly skrypt powinnien wygladac tak: open = false; spawnScreenMenu = guiCreateWindow ( 0.15, 0.33, 0.7, 0.34, "Naglowek", true ); botton = guiCreateButton ( 0.4, 0.85, 0.20, 0.15, "OK", true, spawnScreenMenu ); guiSetVisible(spawnScreenMenu, false); function fpanelu1() if open == false then showCursor (true); guiSetVisible(spawnScreenMenu, true); open = true; else showCursor (false); guiSetVisible(spawnScreenMenu, false); open = false; end end addCommandHandler("panel1", fpanelu1); Skrypt uruchamia sie ukrywając GUI, gdy wpiszesz "panel1" pokaze sie, co widac w tej linjce guiSetVisible(spawnScreenMenu, true); i zmienia sie zmienna open na true, gdy znow wpiszesz "panel1" gui sie ukrywa guiSetVisible(spawnScreenMenu, false); i zmienna open zmienia sie na false i tak w kolko. Najwazniejsza zmiana w calym kodzie jest tu: zamiast addCommandHandler("panel1", panel1); powinno byc: addCommandHandler("panel1", fpanelu1); Caly skrypt jest po stronie klienta. Jakbys mial jakies pytania lub czegos nie rozumial to pisz, chetnie wytlumacze.
  5. Seba500PLK

    help me

    LicenseVehicles = { [411]=true, [602]=true, [593]=true } function licensecheck(thePlayer, seat) local carlicense = getElementData(thePlayer, "license") if (carlicense == 1 ) and (seat == 0) then else if (LicenseVehicles[getElementModel ( source )]) outputChatBox("You are not a driver license", thePlayer, 255, 0, 0) removePedFromVehicle(thePlayer) end end end addEventHandler("onVehicleEnter", getRootElement(), licensecheck)
  6. check this: pjs = engineLoadTXD("car/pjs.txd")
  7. maybe you use this on serverside?
  8. wait, add addEvent("kilLDayZPlayer",true) above addEventHandler
×
×
  • Create New...