-
Posts
239 -
Joined
-
Last visited
Seba500PLK's Achievements

Trick (18/54)
0
Reputation
-
DzinyMaster started following Seba500PLK
-
Problem z wyciągnięciem danych z tabeli
Seba500PLK replied to dynia1221's topic in Pomoc ze skryptami i programowaniem w Lua
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) -
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)
-
Bad argument @'guiSetEnabled' [Expected gui-element at argument 1, got nil]
Seba500PLK replied to mgdmgd's topic in Scripting
change local function to function -
Bad argument @'guiSetEnabled' [Expected gui-element at argument 1, got nil]
Seba500PLK replied to mgdmgd's topic in Scripting
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 ) -
Potrzebuje pomocy ze skryptem
Seba500PLK replied to CertER's topic in Pomoc ze skryptami i programowaniem w Lua
jak dalej tego nie rozumiesz napisz mi na priv -
Automatyczne nadawanie nitra - problem
Seba500PLK replied to mrJakso's topic in Pomoc ze skryptami i programowaniem w Lua
co to onPlayerPickUpRacePickup ? -
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.
-
check with another models
-
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)
-
check this: pjs = engineLoadTXD("car/pjs.txd")
-
this is a full code?
-
maybe you use this on serverside?
-
meta.xml please
-
wait, add addEvent("kilLDayZPlayer",true) above addEventHandler