-
Posts
130 -
Joined
-
Last visited
Everything posted by fmj02
-
New value inserted to the table must be separated by comma. These are syntax errors, commonly encountered problem of beginners, you shouldn't be worried.
-
Your english is not understandable, you mean that your script changes the skin when specified player dies only once? For now not your code is a secret but your problem.
-
You can't use onPlayerConnect because source of this event isn't player and there's no such parameter, use onPlayerJoin instead. Please be careful with onClientPlayerJoin, because the resources are not fully loaded then for client and it will fail. And it will not work anyway because you're only creating the GUI elements in login function, create them in the file scope(outside the function) and in the body of this function use guiSetVisible to show for specified player. Just like [sRN]xXMADEXx said, you can use onClientResourceStart. panel = guiCreateStaticImage(0.34, 0.28, 0.30, 0.40, "images/pnl.png", true) check = guiCreateCheckBox(0.57, 0.54, 0.01, 0.02, "", false, true, panel) ID = guiCreateEdit(0.14, 0.25, 0.69, 0.11, "ID", true, panel) PASS = guiCreateEdit(0.14, 0.51, 0.69, 0.11, "PASSWORD", true, panel) function showLoginWindow() guiSetVisible(panel, true) end addEventHandler("onClientResourceStart", resourceRoot, function () showLoginWindow() end )
-
Messed post, try this: Server-side addEvent("onlogin", true) addEventHandler("onlogin", getRootElement(), function (user, pass) local account = getAccount(user, pass) if (account ~= true) then if (logIn (source, user, pass) == true) then outputChatBox("Bejelentkeztél" .. user .. "nevű felhasználóba!") triggerClientEvent(source, "hideWindow", getRootElement()) else outputChatBox("Bejelentkezési hiba történt... Kérlek próbáld meg később!") end else outputChatBox("Helytelen felhasználónév / jelszó!") end end ) addEvent("onregister", true) addEventHandler("onregister", getRootElement(), function (user, pass) local account = getAccount(user, pass) if (account ~= false) then if (logIn (source, user, pass) == true) then outputChatBox("Sikeresen regisztráltál a szerverre!") triggerClientEvent(source, "hideWindow", getRootElement()) else outputChatBox("Már be vagy jelentkezve!") end else account = addAccount(user, pass) if (logIn ( source, account, pass ) == true) then outputChatBox ( "Sikeresen regisztráltál!") outputChatBox ( "Regisztráció adatai : [ Felhasználónév ] : #00FF00" .. user .. " #FFFF1A[ Jelszó ] : #00FF00" .. pass) triggerClientEvent(source, "hideWindow", getRootElement()) else outputChatBox("Regisztrációs hiba!") end end end ) ) Client-side --[[------------------------------------------------- Notes: > This code is using a relative image filepath. This will only work as long as the location it is from always exists, and the resource it is part of is running. To ensure it does not break, it is highly encouraged to move images into your local resource and reference them there. --]]------------------------------------------------- GUIEditor = { edit = {}, staticimage = {} } function mypanel() GUIEditor.staticimage[1] = guiCreateStaticImage(281, 257, 885, 361, "background_1.png", false) GUIEditor.staticimage[2] = guiCreateStaticImage(16, -41, 853, 70, "bar.png", false, GUIEditor.staticimage[1]) GUIEditor.edit[1] = guiCreateEdit(69, 114, 178, 33, "", false, GUIEditor.staticimage[1]) GUIEditor.edit[2] = guiCreateEdit(68, 187, 178, 33, "", false, GUIEditor.staticimage[1]) GUIEditor.staticimage[3] = guiCreateStaticImage(83, 267, 153, 48, "button_standart.png", false, GUIEditor.staticimage[1]) GUIEditor.staticimage[4] = guiCreateStaticImage(68, 157, 32, 30, "login_icon.png", false, GUIEditor.staticimage[1]) GUIEditor.edit[3] = guiCreateEdit(646, 114, 178, 33, "", false, GUIEditor.staticimage[1]) GUIEditor.staticimage[5] = guiCreateStaticImage(655, 267, 158, 43, "button_standart.png", false, GUIEditor.staticimage[1]) GUIEditor.edit[4] = guiCreateEdit(646, 188, 178, 33, "", false, GUIEditor.staticimage[1]) GUIEditor.staticimage[6] = guiCreateStaticImage(645, 158, 32, 30, "login_icon.png", false, GUIEditor.staticimage[1]) showCursor(true) guiSetInputEnabled(true) --addeventhandlers addEventHandler("onClientGUIClick", GUIEditor.staticimage[3], login) addEventHandler("onClientGUIClick", GUIEditor.staticimage[5], register) --ha rámegy akkor átváltozik addEventHandler ( "onClientMouseEnter", GUIEditor.staticimage[3], function () guiStaticImageLoadImage(GUIEditor.staticimage[3], "button_mouse.png") playSound("http://www.flashkit.com/imagesvr_ce/flashkit/soundfx/Interfaces/Blips/Blip_1-Surround-7482/Blip_1-Surround-7482_hifi.mp3") end ,false ) addEventHandler ( "onClientMouseEnter", GUIEditor.staticimage[5], function () guiStaticImageLoadImage(GUIEditor.staticimage[5], "button_mouse.png") playSound("http://www.flashkit.com/imagesvr_ce/flashkit/soundfx/Interfaces/Blips/Blip_1-Surround-7482/Blip_1-Surround-7482_hifi.mp3") end ,false ) addEventHandler ( "onClientMouseLeave", GUIEditor.staticimage[5], function () guiStaticImageLoadImage(GUIEditor.staticimage[5], "button_standart.png") end ,false ) --ha lelép róla visszaváltozik addEventHandler ( "onClientMouseLeave", GUIEditor.staticimage[3], function () guiStaticImageLoadImage(GUIEditor.staticimage[3], "button_standart.png") end ,false ) end addEventHandler("onClientResourceStart", resourceRoot, mypanel) function login(button) if button="left" then triggerServerEvent("onlogin", getLocalPlayer(), guiGetText(GUIEditor.edit[1]), guiGetText(GUIEditor.edit[2]) ) end end function register(button) if button="left" then triggerServerEvent("onregister", getLocalPlayer(), guiGetText(GUIEditor.edit[3]), guiGetText(GUIEditor.edit[4]) ) end end addEvent("hideWindow", true) addEventHandler ("hideWindow", getRootElement(), function() for i,v in ipairs(edit) do ---destroy all mywind if isElement(v) then destroyElement(v) end end showCursor(false) end) addEventHandler("onClientRender", root, function() dxDrawText("MTA RP PROJECT - ÁTNEVEZÉSRE VÁR -", 540, 257, 864, 281, tocolor(255, 255, 255, 255), 1.00, "pricedown", "left", "top", false, false, true, false, false) dxDrawText("Bejelentkezés", 356, 303, 563, 346, tocolor(255, 255, 255, 255), 1.00, "pricedown", "left", "top", false, false, true, false, false) dxDrawText("Bejelentkezés", 379, 536, 522, 568, tocolor(255, 255, 255, 255), 0.70, "pricedown", "left", "top", false, false, true, false, false) dxDrawText("Felhasználónév", 359, 346, 530, 371, tocolor(255, 255, 255, 255), 0.60, "bankgothic", "left", "top", false, false, true, false, false) dxDrawText("Jelszó", 382, 424, 553, 449, tocolor(255, 255, 255, 255), 0.60, "bankgothic", "left", "top", false, false, true, false, false) dxDrawText("Regisztráció", 928, 305, 1135, 348, tocolor(255, 255, 255, 255), 1.00, "pricedown", "left", "top", false, false, true, false, false) dxDrawText("Felhasználónév", 944, 348, 1115, 373, tocolor(255, 255, 255, 255), 0.60, "bankgothic", "left", "top", false, false, true, false, false) dxDrawText("Regisztráció", 959, 533, 1108, 561, tocolor(255, 255, 255, 255), 0.70, "pricedown", "left", "top", false, false, true, false, false) dxDrawText("Jelszó", 958, 424, 1125, 447, tocolor(255, 255, 255, 255), 0.60, "bankgothic", "left", "top", false, false, true, false, false) end ) Should work fine
-
You're missing correct arguments in line 4 and 6.
-
Search for sqlite to mysql converter with google. List of converter tools: http://www.sqlite.org/cvstrac/wiki?p=ConverterTools
-
Show the line which causes Edit: show the lines corresponding for showing the skin selector then.
-
Just add statement for showing skin selector in addEventHandler("onClientGUIClick",RgsBtn,function() here end Your code is ugly anyways, what is the function or event for showing skin selector? I don't want to dive so deep into it.. You should better make a one function for showing all skin selector elements. I see it's in parts.
-
Could you tell me how it's made? I would like to make cuboid like on screen below. Depend on radius probably and 3d lines? I think I can invent but from what is forum then ;]
-
Optymalne wywołania, a jest w ogóle coś takiego?? Masz na wiki opis o jakim można w innych projektach pośnić. Ten kod miał na celu przedstawienie różnicy tabel i setelementdata/getelementdata. Nie uzywaj go, w MTA masz juz te funkcje napisane w C. (oczywiscie roznicy zadnej nie ma, po to developerzy stworzyli set/get elementdata - aby ulatwic zycie) https://wiki.multitheftauto.com/wiki/Event_system komplikujesz ostro chłopie
-
Jakbyś napisał nie w polskim dziale to pewnie dostał byś odpowiedź szybciej, a tak to gdyby nie ja poczekałbyś jeszcze tydzień - poprawne triggery triggerEvent triggerClientEvent triggerServerEvent - gdy chce coś przypisać, uzyc zmiennej, setElementData a moze tablicy? setElementData działa podobnie tak jakbyś użył tablicy. Uzywaj wiec tego. set/getElementData w Lua(pod inny multiplayer): Data = { } for i = 0, GetMaxSlots( ) do Data[ i ] = { } end function SetPlayerData( playerid, dKey, dValue ) if playerid and dKey then if IsPlayerConnected( playerid ) and type( dKey ) == "string" then for i, pdata in ipairs( Data[playerid] ) do if pdata.key == dKey then if dValue == nil then table.remove( Data[ playerid ], i ) return true else pdata.value = dValue return true end end end table.insert( Data[ playerid ], { key = dKey, value = dValue } ) return true end return false end return false end function GetPlayerData( playerid, dKey ) if playerid and dKey then if IsPlayerConnected( playerid ) and type( dKey ) == "string" then for i, pdata in ipairs( Data[playerid] ) do if pdata.key == dKey then return pdata.value end end return false end return false end return false end - jakies sposoby by zastepowac petle czyms innym, da sie wogole tak? Możesz uzyc setTimer onClientRender https://wiki.multitheftauto.com/wiki/OnClientRender (cos nie pokazalo) Po prostu pisz i testuj to co pisałeś, wszystko przyjdzie samo w swoim czasie. Tak samo masz w filmach z Bruce Lee, czy w serii Karate Kid, bez sensu zakłada szmate i zdejmuje i na końcu okazuje się, że nauczył się walczyć poprzez zakładanie i zdejmowanie szmaty z wieszaka. Podobnie jest z programowaniem. Możesz nauczyć się wszystkiego. Przyjmij sobie taką radę. Jak robić triggery, z początku szczerze mówiąc gdy zaczynałem pisać w Lua też miałem problem z oddzieleniem Clienta od Serwera i często zdarzało się, że chciałem przenieść coś z jednej strony na drugą. Nie udawało się i w końcu się udało. Poczytaj sobie na wiki funkcje TriggerClientEvent, TriggerServerEvent, TriggerEvent (do usrania jeśli nie masz co robić ).Ogólnie TriggerEvent można dosłownie przetłumaczyć jako WywołajZdarzenie. Skrypty będą działać poprawnie jeśli poprawnie je napiszesz(według składni), a to jak wyglądać będzie kod zależy tylko i wyłącznie od ciebie. Z początku zapewne chujowo. Czytaj jak najwiecej, nie probuj samemu bo chuj wyjdzie. Pozdrawiam
-
https://wiki.multitheftauto.com/wiki/Cl ... _functions engineImportTXD engineLoadTXD
-
viewtopic.php?f=108&t=43639&hilit=dxgui
-
Unable to find modules/mta_mysql.dll
fmj02 replied to Qasby's topic in Pomoc z grą lub klientem/serwerem MTA
Dużo osób miało ten sam problem. Jeden z pierwszych wyników od góry search.php?st=0&sk=t&sd=d&sr=posts&keywords=Unable+to+find+modules%2Fmta_mysql.dll -
My physics resource from old server I have abandoned one year ago. I have no more time for MTA I think u like it. It's totally simple. - body recoil on collision with car - damage depends from vehicle's speed - artifical ragdoll when falling DOWNLOAD: https://community.multitheftauto.com/index.php?p= ... ls&id=6516 OLD TOPIC: viewtopic.php?f=108&t=50374&p=492691&hilit=simulated+ragdoll#p492691
-
You must edit jobs\jobs.lua local function createOurPed( ) if ped then destroyElement( ped ) end ped = createPed( 211, 359.7, 173.65, 1008.4 ) setPedRotation( ped, 270 ) setElementDimension( ped, 1 ) setElementInterior( ped, 3 ) end
-
exports.dxGUI:dxCreateWindow(resourceRoot,555,600,555,555,"blablalb",tocolor(255,255,255,255),"default","Orange") this should work and make sure the resource is really named dxGUI
-
you can simply use addCommandHandler and add exception for execution
-
There are no examples.. So stop throwing wiki and just post it here. I tried it before and I had some errors.
-
any example in making simple window? dxCreateWindow(resource,x,y,width,height,title,color,font,theme)
-
I know, but it's even good when you are on localhost. I was wondering if I release it because of this code, I should compile it
-
Simple MatrixCamera position outputting to file I've made few years ago. It allows you to create simple intros. Sorry for ugly code but I made it when I was starting learning LUA. Download( sorry for that it isn't on community but actually I haven't got account ): http://www7.zippyshare.com/v/18030100/file.html So how to use it? Use /introgen command first to start freecam then just press - to start recording intro and 0 to stop recording intro. Below image presents simple intro generated with it( made in about 1 minute). 2456 lines in 1 minute, cool isn't it?
-
hey I'd like to make gridlist based on dxdrawtext, but I have no idea how can I add "\n" when I use mouse scroll and how can I remove it... also I am wondering how to make event like "onClientDXGUIClick", "onClientMouseEnter", "onClientMouseLeave" and what should I exactly do to make it? any suggestions?(generally what functions should I use), there are some custom guis but I don't know how to use them so I've decided to write my own.. But as I said I am wondering how to make these gridlist and events for other dxgui functions
-
Since MTA hasn't got .IFP support I made fake-ragdoll physics - it just gives the impression of real ragdoll. ( even good effect huh, so I've decided to make a video ) Sorry for title "emulation" it should be "simulation"
-
weird, try to make also command /dance2 and use first /dance and then /dance2 after few tryouts you will see. It works on beginning fine for me too