mommytellme
Members-
Posts
178 -
Joined
-
Last visited
Everything posted by mommytellme
-
Zasiłek na setElementDatach
mommytellme replied to mommytellme's topic in Pomoc ze skryptami i programowaniem w Lua
Wiem że trzeba użyć tych funkcji, ale nie do końca wiem gdzie je wsadzić żeby skrypt się nie posypał -
Zasiłek na setElementDatach
mommytellme replied to mommytellme's topic in Pomoc ze skryptami i programowaniem w Lua
A jeszcze jedno pytanko, da się do tego dorobić sprawdzanie czy gracz jest w jakiejś frakcji? Jeśli jest - nie daje kasy a jeśli nie jest to daje. -
Zasiłek na setElementDatach
mommytellme replied to mommytellme's topic in Pomoc ze skryptami i programowaniem w Lua
Dziękuje Ci bardzo! Znowu mi pomogłeś Da się tu jakoś dawać reputację? -
Cześć! Robię zasiłek dla bezrobotnych, i tak. Napisałem taki oto kod: function dajdata () setElementData(thePlayer, "zasilek", 0) end addEventHandler("onClientResourceStart", root, dajdata) zasilek = createMarker(359, 169, 1008, "cylinder", 2) setElementInterior(zasilek, 3) function dajkase() if source == zasilek then getElementData(thePlayer, zasilek) if zasilek == 1then outputChatBox("Urzędnik mówi: Skorzystałeś/aś już z zasiłku!", thePlayer, 255,255,255) givePlayerMoney(200) setElementData(thePlayer, "zasilek", 1) end end end addEventHandler("onClientMarkerHit", root, dajkase) Jest po stronie serwera. Przed tem był po stronie klienta bez elementdatów i działał prawidłowo. Teraz już nie. Skrypt ma polegać na tym, że wchodzę w marker, daje mi kasę (200$) i mogę to zrobić tylko raz. Dodatkowo zrobię wykrywanie czy jest w jakiejś frakcji ale to później, najpierw to. Debugscript po odpaleniu skryptu nic nie pokazuje, po wejściu w marker tak samo.
-
Dzięki, za chwilę zaczynam tłumaczyć
-
Cześć! mam problem z tym to oto kodem: (w połowie napisany przez mnie, reszta to shader panel z XyzzyRP) GUIEditor = { button = {}, window = {}, staticimage = {}, label = {} } function pokazpanel() okno = guiCreateWindow(102, 119, 661, 406, "Panel ustawień", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.button[1] = guiCreateButton(13, 37, 59, 53, "", false, okno) GUIEditor.staticimage[1] = guiCreateStaticImage(10, 37, 62, 53, "gra.png", false, okno) GUIEditor.label[1] = guiCreateLabel(23, 95, 59, 20, "Gra", false, okno) GUIEditor.label[2] = guiCreateLabel(110, 41, 70, 15, "Shadery:", false, okno) przyciskshaderow = guiCreateButton(190, 37, 91, 33, "Włącz menu Shaderów", false, okno) addEventHandler("onClientRender", root, function() dxDrawLine(203, 152, 203, 513, tocolor(255, 255, 255, 255), 1, true) end ) showCursor(true) end function schowajpanel() guiSetVisible (okno, not guiGetVisible ( okno ) ) end shaderpanel = { checkbox = {}, staticimage = {}, scrollpane = {}, label = {} } shaderpanel.staticimage[1] = guiCreateStaticImage(0.69, 0.35, 0.27, 0.20, "karer_bar.png", true) shaderpanel.label[1] = guiCreateLabel(0.05, 0.03, 0.85, 0.19, "Panel shaderów", true, shaderpanel.staticimage[1]) local font_0 = guiCreateFont(":lss-gui/droid-sans.ttf", 13) guiSetFont(shaderpanel.label[1], font_0) guiLabelSetColor(shaderpanel.label[1], 0, 0, 0) guiLabelSetHorizontalAlign(shaderpanel.label[1], "center", false) guiLabelSetVerticalAlign(shaderpanel.label[1], "center") shaderpanel.staticimage[2] = guiCreateStaticImage(0.030, 0.29, 0.3, 0.16, "name_highlight.png", true, shaderpanel.staticimage[1]) shaderpanel.checkbox[1] = guiCreateCheckBox(0.06, 0.3, 0.3, 0.1, "Bloom", false, true, shaderpanel.staticimage[1]) shaderpanel.staticimage[3] = guiCreateStaticImage(0.030, 0.44, 0.3, 0.16, "name_highlight.png", true, shaderpanel.staticimage[1]) shaderpanel.checkbox[2] = guiCreateCheckBox(0.06, 0.45, 0.3, 0.1, "Woda", false, true, shaderpanel.staticimage[1]) shaderpanel.staticimage[4] = guiCreateStaticImage(0.030, 0.59, 0.3, 0.16, "name_highlight.png", true, shaderpanel.staticimage[1]) shaderpanel.checkbox[3] = guiCreateCheckBox(0.06, 0.6, 0.3, 0.1, "Karoseria", false, true, shaderpanel.staticimage[1]) shaderpanel.staticimage[5] = guiCreateStaticImage(0.330, 0.29, 0.3, 0.16, "name_highlight.png", true, shaderpanel.staticimage[1]) shaderpanel.checkbox[4] = guiCreateCheckBox(0.36, 0.3, 0.3, 0.1, "Detale", false, true, shaderpanel.staticimage[1]) shaderpanel.staticimage[6] = guiCreateStaticImage(0.330, 0.44, 0.3, 0.16, "name_highlight.png", true, shaderpanel.staticimage[1]) shaderpanel.checkbox[5] = guiCreateCheckBox(0.36, 0.45, 0.3, 0.1, "Czarno-biały", false, true, shaderpanel.staticimage[1]) shaderpanel.staticimage[7] = guiCreateStaticImage(0.330, 0.59, 0.3, 0.16, "name_highlight.png", true, shaderpanel.staticimage[1]) shaderpanel.checkbox[6] = guiCreateCheckBox(0.36, 0.6, 0.3, 0.1, "HDR", false, true, shaderpanel.staticimage[1]) shaderpanel.staticimage[8] = guiCreateStaticImage(0.630, 0.29, 0.3, 0.16, "name_highlight.png", true, shaderpanel.staticimage[1]) shaderpanel.checkbox[7] = guiCreateCheckBox(0.66, 0.3, 0.3, 0.1, "Noc+", false, true, shaderpanel.staticimage[1]) guiSetVisible(shaderpanel.staticimage[1], false) guiBringToFront(shaderpanel.checkbox[1]) guiBringToFront(shaderpanel.checkbox[2]) guiBringToFront(shaderpanel.checkbox[3]) guiBringToFront(shaderpanel.checkbox[4]) guiBringToFront(shaderpanel.checkbox[5]) guiBringToFront(shaderpanel.checkbox[6]) guiBringToFront(shaderpanel.checkbox[7]) function toggleWin() local uo_sb=getElementData(localPlayer, "uo_sb") uo_sb = uo_sb and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[1], uo_sb) local uo_sw=getElementData(localPlayer, "uo_sw") uo_sw = uo_sw and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[2], uo_sw) local uo_cp=getElementData(localPlayer, "uo_cp") uo_cp = uo_cp and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[3], uo_cp) local uo_det=getElementData(localPlayer, "uo_det") uo_det = uo_det and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[4], uo_det) local uo_bw=getElementData(localPlayer, "uo_bw") uo_bw = uo_bw and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[5], uo_bw) local uo_hdr=getElementData(localPlayer, "uo_hdr") uo_hdr = uo_hdr and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[6], uo_hdr) local uo_nig=getElementData(localPlayer, "uo_nig") uo_nig = uo_nig and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[7], uo_nig) if (guiGetVisible(shaderpanel.staticimage[1])) then showCursor(false) guiSetVisible(shaderpanel.staticimage[1],false) else showCursor(true) guiSetVisible(shaderpanel.staticimage[1],true) end end bindKey("F3","down",toggleWin) addEventHandler("onClientGUIClick", resourceRoot, function(btn,state) if btn == "left" then -- if state == "up" then if (getElementType(source)~="gui-checkbox") then guiBringToFront(shaderpanel.checkbox[1]) guiBringToFront(shaderpanel.checkbox[2]) guiBringToFront(shaderpanel.checkbox[3]) guiBringToFront(shaderpanel.checkbox[4]) guiBringToFront(shaderpanel.checkbox[5]) guiBringToFront(shaderpanel.checkbox[6]) guiBringToFront(shaderpanel.checkbox[7]) return end local uo_sb=guiCheckBoxGetSelected(shaderpanel.checkbox[1]) local uo_sw=guiCheckBoxGetSelected(shaderpanel.checkbox[2]) local uo_cp=guiCheckBoxGetSelected(shaderpanel.checkbox[3]) local uo_det=guiCheckBoxGetSelected(shaderpanel.checkbox[4]) local uo_bw=guiCheckBoxGetSelected(shaderpanel.checkbox[5]) local uo_hdr=guiCheckBoxGetSelected(shaderpanel.checkbox[6]) local uo_nig=guiCheckBoxGetSelected(shaderpanel.checkbox[7]) setElementData(localPlayer,"uo_sb", uo_sb) setElementData(localPlayer,"uo_sw", uo_sw) setElementData(localPlayer,"uo_cp", uo_cp) setElementData(localPlayer,"uo_det", uo_det) setElementData(localPlayer,"uo_bw", uo_bw) setElementData(localPlayer,"uo_hdr", uo_hdr) setElementData(localPlayer,"uo_nig", uo_nig) triggerServerEvent("saveGraphicOptions", resourceRoot, localPlayer, uo_sb, uo_sw, uo_cp, uo_det, uo_bw,uo_hdr,uo_nig) -- end end end) function toggleWin2() if source == przyciskshaderow then local uo_sb=getElementData(localPlayer, "uo_sb") uo_sb = uo_sb and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[1], uo_sb) local uo_sw=getElementData(localPlayer, "uo_sw") uo_sw = uo_sw and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[2], uo_sw) local uo_cp=getElementData(localPlayer, "uo_cp") uo_cp = uo_cp and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[3], uo_cp) local uo_det=getElementData(localPlayer, "uo_det") uo_det = uo_det and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[4], uo_det) local uo_bw=getElementData(localPlayer, "uo_bw") uo_bw = uo_bw and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[5], uo_bw) local uo_hdr=getElementData(localPlayer, "uo_hdr") uo_hdr = uo_hdr and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[6], uo_hdr) local uo_nig=getElementData(localPlayer, "uo_nig") uo_nig = uo_nig and true or false guiCheckBoxSetSelected(shaderpanel.checkbox[7], uo_nig) if (guiGetVisible(shaderpanel.staticimage[1])) then showCursor(false) guiSetVisible(shaderpanel.staticimage[1],false) else showCursor(true) guiSetVisible(shaderpanel.staticimage[1],true) end end end addEventHandler("onClientGUIClick", resourceRoot, function(btn,state) if btn == "left" then -- if state == "up" then if (getElementType(source)~="gui-checkbox") then guiBringToFront(shaderpanel.checkbox[1]) guiBringToFront(shaderpanel.checkbox[2]) guiBringToFront(shaderpanel.checkbox[3]) guiBringToFront(shaderpanel.checkbox[4]) guiBringToFront(shaderpanel.checkbox[5]) guiBringToFront(shaderpanel.checkbox[6]) guiBringToFront(shaderpanel.checkbox[7]) return end local uo_sb=guiCheckBoxGetSelected(shaderpanel.checkbox[1]) local uo_sw=guiCheckBoxGetSelected(shaderpanel.checkbox[2]) local uo_cp=guiCheckBoxGetSelected(shaderpanel.checkbox[3]) local uo_det=guiCheckBoxGetSelected(shaderpanel.checkbox[4]) local uo_bw=guiCheckBoxGetSelected(shaderpanel.checkbox[5]) local uo_hdr=guiCheckBoxGetSelected(shaderpanel.checkbox[6]) local uo_nig=guiCheckBoxGetSelected(shaderpanel.checkbox[7]) setElementData(localPlayer,"uo_sb", uo_sb) setElementData(localPlayer,"uo_sw", uo_sw) setElementData(localPlayer,"uo_cp", uo_cp) setElementData(localPlayer,"uo_det", uo_det) setElementData(localPlayer,"uo_bw", uo_bw) setElementData(localPlayer,"uo_hdr", uo_hdr) setElementData(localPlayer,"uo_nig", uo_nig) triggerServerEvent("saveGraphicOptions", resourceRoot, localPlayer, uo_sb, uo_sw, uo_cp, uo_det, uo_bw,uo_hdr,uo_nig) -- end end end) addEventHandler("onClientGUIClick", root, toggleWin2) bindKey("F4","down",pokazpanel) Problem polega na tym że jeśli kliknę F4 pierwszy raz, to fajnie wyświetla się okno panelu ustawień. Ale chciałbym, żeby kliknięcie F4 drugi raz chowało go, czyli np. wywoływało funkcję winoff (którą dopiero zrobię) ale nie wiem jak coś takiego zrobić. W tym shader panelu coś takiego jest (klawisz binda to F3) ale przeglądając jego kod nie zauważyłem tego o co mi chodzi. Pomożecie?
-
[Outdated] Unofficial MTA Script Editor 0.3 (4851) RELEASED!
mommytellme replied to 50p's topic in Scripting
Bug: Meta.xml is coded in ANSI (?), not in UTF8, and server is not load orginal meta, you moust first change encoding to UTF8 to use the script. Sorry for my bad english, beacuse i'm from Poland. -
Wiadomość tylko dla jednego gracza
mommytellme replied to mommytellme's topic in Pomoc ze skryptami i programowaniem w Lua
Dziękuje Ci bardzo! Teraz działa -
Jak wykonać range VIP z kodu
mommytellme replied to aski's topic in Pomoc ze skryptami i programowaniem w Lua
Z tego co widzę to to jest tylko kawałek kodu umożliwiający doładowywanie portfela za pośrednictwem LUA. Musisz do tego (ni e musisz, ale chcesz) dorobić GUI, zrobić pobieranie wartości z GUI przesyłanie danych na stronę (to robi ten kod) kod zwróci Ci czy kod jest poprawny czy też nie - i odpowiednio - kod jest poprawny = dajesz graczowi VIP'a na tyle ile wybrał, a jeśli nie = wyświetlasz komunikat. Funkcje które mogą Ci się przydać: https://wiki.multitheftauto.com/wiki/AclGroupAddObject https://wiki.multitheftauto.com/wiki/Ac ... moveObject https://wiki.multitheftauto.com/wiki/GuiGetText https://wiki.multitheftauto.com/wiki/On ... UIAccepted https://wiki.multitheftauto.com/wiki/OnClientGUIChanged -
It will be possible to sell the business which isn't yours. Sorry for bad, english beacuse i'm from Poland. Other form: You can sell business witch is not your.
-
Wiadomość tylko dla jednego gracza
mommytellme replied to mommytellme's topic in Pomoc ze skryptami i programowaniem w Lua
Dalej nie działa, jeśli ktoś zginie to napis wyświetla się wszystkim, usunąłem tylko z outputChatBox "true" i "player" ale i tak to nic nie dało. Napis ma się wyświetlić tylko dla osoby zabitej, a ja idę zobaczyć jak rozwiązali to w XyzzyRP //Edit tam jest to rozwiązane chyba tak samo, zawartość death_c z XyzzyRP: (Nie wiem czy mogę udostępnić, jeśli nie mogę napiszcie to usunę) --[[ @author RootKiller @copyright 2011-2013 Lukasz Biegaj @license GPLv2 @package MTA-XyzzyRP @link [url=https://github.com/lpiob/MTA-XyzzyRP]https://github.com/lpiob/MTA-XyzzyRP[/url] GitHub ]]-- local sx,sy = guiGetScreenSize() local death = {} function dli(x,a,b,c) if (x==1) then return a end if (x%10>1) and (x%10<5) and (not ((x%100>=10) and (x%100<=21))) then return b end return c end function bwUpdate() local toBwEnd = (getElementData(getLocalPlayer(), "bwEndTime")-getTickCount()) local x, y, z = getElementPosition ( getLocalPlayer () ) -- setCameraMatrix ( x + 10, y + 10, z + 15, x, y, z ) setCameraMatrix(x-(10 * math.sin(toBwEnd/40000)),y+(10 * math.cos(toBwEnd/40000)),z+15,x,y,z) if(toBwEnd <= 1) then outputChatBox("Żyjesz! Lecz masz tylko 1hp udaj się do szpitala po leki.") triggerEvent("onBwFinish", getRootElement()) removeEventHandler("onClientRender", getRootElement(), bwUpdate) return end local timeInt = math.floor(toBwEnd/1000) local timeStr = (timeInt >= 60 and dli(timeInt/60+1, "minuta", "minuty", "minut") or dli(timeInt, "sekunda", "sekund", "sekund")) local text = "Do końca BW pozostało " .. tostring(math.floor((timeInt >= 60 and timeInt/60+1 or timeInt))) .. " " .. timeStr local fX = (sx/2)-(dxGetTextWidth(text, 2)/2) local fY = (sx/2)-200 dxDrawText(text, fX + 1, fY, fX + 1, fY, tocolor(0, 0, 0, 255), 2) dxDrawText(text, fX - 1, fY, fX - 1, fY, tocolor(0, 0, 0, 255), 2) dxDrawText(text, fX, fY + 1, fX, fY + 1, tocolor(0, 0, 0, 255), 2) dxDrawText(text, fX, fY - 1, fX, fY - 1, tocolor(0, 0, 0, 255), 2) dxDrawText(text, fX, fY, fX, fY, tocolor(255, 255, 255, 255), 2) end addEventHandler("onClientPlayerWasted", getRootElement(), function(killer, weapon, bodypart) if(source == getLocalPlayer()) then local abs=getElementData(source,"abseiling") if abs and abs~="" then return end local bwSeconds = 10 if bodypart == 9 then -- głowa bwSeconds = (10 * 60) elseif bodypart == 9 then -- tyłek bwSeconds = (2 * 60) elseif tonumber(bodypart) and (tonumber(bodypart) >= 5 and tonumber(bodypart) <= -- s8) --> then -- kończyny bwSeconds = (5 * 60) elseif bodypart == 3 then -- klatka piersiowa bwSeconds = (5 * 60) else bwSeconds = (5 * 60) end setElementData(getLocalPlayer(), "bwEndTime", getTickCount()+(bwSeconds * 1000)) triggerEvent("onGUIOptionChange", getRootElement(), "grayscale", true) addEventHandler("onClientRender", getRootElement(), bwUpdate) fadeCamera ( false, 1.0, 0, 0, 0 ) setTimer ( fadeCamera, 2000, 1, true, 0.5 ) death.heartBeat = playSound("audio/heartbeat.mp3", true) end end ) addEvent("onBwFinish", true) addEventHandler("onBwFinish", getRootElement(), function() setCameraTarget(getLocalPlayer()) destroyElement(death.heartBeat) triggerServerEvent("onPlayerFinshBW", getLocalPlayer()) triggerEvent("onGUIOptionChange", getRootElement(), "grayscale", false) removeEventHandler("onClientRender", getRootElement(), bwUpdate) end ) addEventHandler ( "onClientPlayerDamage", getRootElement(), function() if(source == getLocalPlayer()) then fadeCamera ( false, 1.0, 255, 0, 0 ) setTimer ( fadeCamera, 500, 1, true, 0.5 ) end end ) -
Wiem że to bardzo głupie, ale spróbuj wyłączyć wszystkie skrypty gdy oni wbiją a potem włączać po jednym - kiedy zaczną dziać się dziwne rzeczy od razu wyłącz skrypty i sprawdź dokładnie zawartość tych skryptów które w chwili zaczenia dziać się dziwnych rzeczy były uruchomione - może głupie ale przynajmniej mniej roboty przy przeszukiwaniu skryptów.
-
Publikacja kodu serwera BestPlay - czy warto?
mommytellme replied to Wielebny's topic in Polish / Polski
Tak, mi by się bardzo przydał Zwłaszcza że otwieramy z kolegą drugi serwer RPG - Zapisy na atrakcje to by była perełka a system kont VIP przydał by się i mojemu RP i jego RPG Oczywiście że się przyda! Nie mogę się już doczekać jego opublikowania, o ile to w ogóle nastąpi. -
Cześć, ja znowu z kolejnym problemem Ten polega na tym że zacząłem robić skrypt na BW, i póki co to zwykły eventhandler i jedna funkcja, ale już jest problem. Chodzi o to że napis informujący o byciu zabitym pojawia się wszystkim, a nie tylko osobie zabitej. Zawartość kodu: function BW ( player ) outputChatBox("Zostałeś/aś zabity/a! Do czasu przyjazdu pogotowia które Cię uleczy będziesz miał/a stan BW", player, 255, 000, 000, true) end addEventHandler("onClientPlayerWasted", root, BW) Takie tam proste. próbowałem z "source" zamiast player ale efekt był taki sam.
-
Cześć! Niestety, witam Was z kolejnym, nowym problemem Problem polega na tym że chciałem zrobić teleportujące budki telefoniczne, póki co na komendę. Skrypt wygląda tak: GUIEditor = { button = {}, window = {} } function otworzgui () okienko = guiCreateWindow(579, 20, 221, 487, "Teleportujące budki", false) guiWindowSetSizable(okienko, false) sfd = guiCreateButton(28, 29, 171, 15, "San Fierro Downdown", false, okienko) gs = guiCreateButton(28, 44, 171, 15, "Grove Street", false, okienko) showCursor(true) end function grovestreet ( player ) if source == gs then spawnPlayer ( player, 2506, -1661, 13 ) end end addCommandHandler("otworz", otworzgui) addEventHandler("onClientGUIClick", getRootElement(), grovestreet) Aczkolwiek kliknięcie Grove Street nic nie daje. Debugscript 3 po kliknięciu Grove Street: Error: budki/skrypt.lua:20: attempt to call global 'spawnPlayer' (a nil value) Pomoże ktoś?
-
Ale ja chcę coś sam przetłumaczyć, tylko nie mogę znaleźć opcji do tego.
-
Cześć, nigdzie nie mogę znaleźć opcji do tłumaczenia wiki. Pomoże ktoś?
-
Cześć! Mam pytanie odnośnie zmiennej, a dokładniej wyświetlenie tego co wpiszę w EditBox na czacie. Nabazgrałem takie coś: GUIEditor = { edit = {}, window = {} } GUIEditor.window[1] = guiCreateWindow(352, 168, 364, 290, "", false) guiWindowSetSizable(GUIEditor.window[1], false) zmienna = guiCreateEdit(62, 96, 248, 67, "", false, GUIEditor.window[1]) showCursor(true) outputChatBox("Zmienna to: $zmienna") Ale nie działa Jakieś pomysły? Próbowałem też outputChatBox("Zmienna to: (zmienna)") ale nie działa.
