Jump to content

Tosti

Members
  • Posts

    35
  • Joined

  • Last visited

Everything posted by Tosti

  1. Yeah but it's not my point. Ur idea is really cool, but what when someone logs on account, on another computer? I've already made account system basing on IPS4 Already if i will ban serial then there are methods to change your serial because it is based on hardware and software. I've aleady met few people which had changed serial and be able to join MTA Server (on same computer) where they were banned
  2. Hello there. Is there any way to get connected client MAC address? I found few topics but they we're imo depreciated. I'm thinking about creating ban "system" based on MAC address and serial.
  3. Is it possible to make crypt function from php in lua? I connected IPS 4 by php script using PHP SDK but on Linux it returns array not JSON (so weird, returns JSON on Windows and array on Linux). It makes few casualities in my script so i decided to ask here. Is it possible to make php crypt function in MTA?
  4. Hey guys, i've made a script which should apply textures on wall on both sides. Problem is that only one side of wall has applied texture and don't know why. Maybe i did some mistake in code. http://pastebin.com/Ju47WaMD
  5. Works! Thanks u much!
  6. Nah, u didnt understood me. I'm counting objects on Map Editor, it isn't same resource as mine. I'd created another resource to count objects from Map Editor.
  7. Hey guys! I want to create an object counter for Map Editor but when i use #getElementsByType("object") it still show 1 object when there's 0 object on editor's list. with object: without object: x,y = guiGetScreenSize() addEventHandler("onClientRender", root, function() dxDrawText(string.format("obj: %d", #getElementsByType("object")), x * 0.4470, y * 0.1514, x * 0.5071, y * 0.1800, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", false, false, false, false, false) end)
  8. Cześć, pisze ten temat bo właśnie rozpocząłem prace nad gamemodem RPG i tu pytanie do was, jako iż ja swoje na wszelkich RPG przesiedziałem to swoje wiem, ale chciałbym wiedzieć co Wy chcielibyście na takim serwerze(w takim skrypcie) widzieć, jakieś dodatkowe zabawy, atrakcje, misje poboczne, hm? Piszcie!
  9. Cześć, rozpocząłem pisanie gamemodu truck i zająłem się towarami. Lecz mam problem, po wejściu do pojazdu o nazwie Roadtrain ma się pokazywać, a po wyjściu ma znikać. Problem w tym że nie znika po wyjściu z pojazdu. Daję kody, błędów nie wyświetla. Server-side: tir = createVehicle (515, -1686.1357421875, 366.8349609375, 10.03125) naczepa = createVehicle (435, -1697.3203125, 399.306640625, 7.1796875) function showGUI(veh, costam1, costam2) local model=getElementModel(veh) if model == 515 then triggerClientEvent(source, "pokazGUI", source) else end end function hideGUI(vehicle, seat, jacked) triggerClientEvent(source, "schowajGUI", source) end addEventHandler("onPlayerVehicleEnter", getRootElement(), showGUI) addEventHandler("onPlayerVehicleExit", resourceRoot, hideGUI) Client-side: tlo = guiCreateStaticImage(0.79, 0.00, 0.21, 0.15, "bckgrnd.png", true) guiSetAlpha(tlo, 0.69) towarStringLabel1 = guiCreateLabel(0.03, 0.15, 0.14, 0.14, "Towar:", true, tlo) guiSetFont(towarStringLabel1, "default-bold-small") cenaStringLabel1 = guiCreateLabel(0.03, 0.37, 0.11, 0.14, "Cena:", true, tlo) guiSetFont(cenaStringLabel1, "default-bold-small") scoreStringLabel1 = guiCreateLabel(0.03, 0.59, 0.13, 0.14, "Score:", true, tlo) guiSetFont(scoreStringLabel1, "default-bold-small") wagaStringLabel1 = guiCreateLabel(0.03, 0.78, 0.13, 0.14, "Waga:", true, tlo) guiSetFont(wagaStringLabel1, "default-bold-small") towarStringLabel2 = guiCreateLabel(0.17, 0.15, 0.50, 0.14, "", true, tlo) guiSetFont(towarStringLabel2, "default-bold-small") cenaStringLabel2 = guiCreateLabel(0.14, 0.37, 0.50, 0.14, "", true, tlo) guiSetFont(cenaStringLabel2, "default-bold-small") scoreStringLabel2 = guiCreateLabel(0.16, 0.59, 0.50, 0.14, "", true, tlo) guiSetFont(scoreStringLabel2, "default-bold-small") wagaStringLabel2 = guiCreateLabel(0.16, 0.78, 0.50, 0.14, "", true, tlo) guiSetFont(wagaStringLabel2, "default-bold-small") function pokazGUI() guiSetVisible(tlo, true) end addEvent("pokazGUI", true) addEventHandler("pokazGUI", root, pokazGUI) function ukryjGUI() guiSetVisible(tlo, false) end addEvent("schowajGUI", true) addEventHandler("schowajGUI", getResourceRootElement(), ukryjGUI) addEventHandler("onClientResourceStart", getResourceRootElement(), ukryjGUI)
  10. Sądze że Mefisto_PL ma rację, będzie tak samo jak ze skryptem Valhalla Gaming, czy XyzzyRP. Wydajcie pare skryptów z tego na community, ale nie cały gamemode. Według mnie powstanie zbyt dużo pseudolów. Można zrobić tak jak wspomniał koleżka wyżej, aby na podstawie kodu zrobić jakiś poradnik np. na funkcje mysql bo ich nie ma dużo, a nie każdy ma na tyle sił i inteligencji by siedzieć 3 godziny i szukać poradnika do mysql i jego funkcji.
  11. Jak skrypt ma wykonać nie istniejącą funkcję? bindKey ("F9", "down", showUserPanel)
  12. Wrzuć do \mods\deathmatch\resources jako .zip (poprostu pobrany plik wrzucasz do resources). A co do poradników, to: - plik mtaserver.conf odpowiada za konfigurację serwera. Jeśli ogarniasz angielski tamtejsze komentarze ci pomogą. (zmieniaj go tylko gdy serwer jest wyłączony, zmiany będą widoczne po restarcie); - plik acl.xml odpowiada on za "prawa" każdej grupy, administratora, super moderatora, moderatora itp. (modyfikacja przy włączonym serwerze może prowadzić do jego uszkodzenia). To zgrubsza by było na tyle z tych najpotrzebniejszych rzeczy. Apropo reszty pisz na PW, pomogę ci z ustawieniem serwera.
  13. Cześć! Ostatnio sobie chodziłem po serwerach i widziałem poprostu napis podczas pobierania plików. Wrzuciłem do siebie na serwer i wywaliłem wszystko z resources, wchodze na serwer i nic mi się nie wyświetla. Kod(client-side): function checkTransfer() if isTransferBoxActive() == true then dxCos(source) setTimer(checkTransfer,2000,1) else fadeCamera(true) end end addEventHandler("onPlayerJoin",resourceRoot,checkTransfer) function dxCos() dxDrawText("Gdy już się pobiorą zostaniesz przeniesiony/a do okna logowania.", 83, 273, 1278, 319, tocolor(255, 255, 255, 255), 3, "default-bold", "left", "top", false, false, true, false, false) dxDrawText("Aktualnie są pobierane wszystkie zasoby serwera.", 231, 185, 1138, 229, tocolor(255, 255, 255, 255), 3, "default-bold", "left", "top", false, false, true, false, false) dxDrawText("Witaj na (tu jest nazwa serwera)!!", 413, 91, 948, 133, tocolor(255, 0, 0, 255), 3, "default-bold", "center", "center", false, false, true, false, false) dxDrawText("Dziękujemy za wybranie akurat nas.", 78, 336, 728, 382, tocolor(255, 255, 255, 255), 3, "default-bold", "left", "top", false, false, true, false, false) dxDrawText("Ekipa serwera (tu jest nazwa serwera).", 738, 471, 1355, 520, tocolor(255, 255, 255, 255), 3, "default-bold", "left", "top", false, false, true, false, false) end addEventHandler("onClientPreRender", root, dxCos) EDIT: Trochę mi pomógł Mefisto_PL lecz tekst się wyświetla po pobraniu, nie podczas pobierania ;/
  14. Witam, jako iż jestem początkujący i lubię porządek w kodzie napisałem sobie funkcję na komendę /zaloguj [frakcja]. Lecz problem polega na tym że nie daje mnie do teamu podanego w stringu tylko do pierwszego uwzględnionego w kodzie. Kod: (serverside) policja = createTeam("Policja", 0, 0, 255) pogotowie = createTeam("Pogotowie", 255, 0, 0) pd = createTeam("Pomoc Drogowa", 255, 0, 255) sn = createTeam("San Andreas News", 69, 99, 99) cywile = createTeam("Cywile", 255, 255, 255) function logowanie(thePlayer, komenda, team) if team == "Policja" or "policja" or "poli" and isObjectInACLGroup("user."..getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("Policja"))then setPlayerTeam(thePlayer, policja) setPlayerNametagColor(thePlayer, 0, 0, 255) giveWeapon(thePlayer, 3) setElementModel(thePlayer, 280) elseif team=="Pogotowie" or "pogotowie" or "pogo" and isObjectInACLGroup("user."..getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("Pogotowie")) then setPlayerTeam(thePlayer, pogotowie) setElementModel(thePlayer, 275) setPlayerNametagColor(thePlayer, 255, 0, 0) elseif team=="Pomoc" or "pd" or "pomoc" and isObjectInACLGroup("user."..getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("PD"))then setPlayerTeam(thePlayer, pd) setElementModel(thePlayer, 50) setPlayerNametagColor(thePlayer, 255, 0, 255) elseif team=="san" or "sn" or "SAN" and isObjectInACLGroup("user."..getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("San News")) then setPlayerTeam(thePlayer, sn) setPlayerNametagColor(thePlayer, 0, 255, 255) giveWeapon(thePlayer, 43) setElementModel(thePlayer, 60) elseif team=="cywil" or "cywile" then setPlayerTeam(thePlayer, cywile) setElementModel(thePlayer, 0) outputChatBox("Od teraz jesteś cywilem!", thePlayer) else end end addCommandHandler("zaloguj", logowanie)
  15. Mefi, wiem że jestem nieogarem ale nie kieruj się stereotypami (skąd ja znam to słowo ). Ale wracając do rzeczy, to zrobiłem rzecz oczywistą (czego z początku nie zrobiłem) a mianowicie ustawiłem setElementData przy wejściu na serwer. Nie ma żadnych błędów w debugu a skrypt jak się nie wykonywał tak się nie wykonuje. Kodzik wypocin (standardowo clientside): function ustawianie() setElementData(source,"gracz.wyzwany", "nie") end addEventHandler("onClientPlayerJoin", getRootElement(), ustawianie)
  16. Witam, postanowiłem napisać autorski skrypt na freeroam począwszy od systemy wyścigów. Jest więc sobie komenda /wyzwij [Nick] lecz po wpisaniu jej nie ma błędu a wyskakuje na czacie wiadomość "Błąd przy ifie z getElementData". Kodzik (clientside): function wyzwanie(komenda, cel) if cel then gracz=getPlayerName(getLocalPlayer()) nick=getPlayerFromName(cel) if (getElementData(getLocalPlayer(),"gracz.wyzwany")) == "nie" and (getElementData(nick,"gracz.wyzwany")) == "nie" then setElementData(getLocalPlayer(),"gracz.wyzwany", "tak") setElementData(nick,"gracz.wyzwany", "tak") outputChatBox("Wyzwałeś/aś gracza "..cel.." na wyścig!", getLocalPlayer()) outputChatBox("Gracz "..gracz.." wyzwał cię na wyścig! Wpisz /akceptuj by zaakceptować wyzwanie", nick) else outputChatBox("Błąd przy ifie z getElementData", getLocalPlayer()) end else outputChatBox("WZÓR: /"..komenda.." [Nick Gracza]", getLocalPlayer()) end end addCommandHandler("wyzwij", wyzwanie)
  17. Cześć, chciałem się spytać jak stworzyć coś takiego: http://puu.sh/2vQUn Jest jakaś funkcja na to, bo patrzyłem na wiki i nic nie znalazłem.
  18. Tak, dzięki za pomoc, jeśli coś znowu sknoce to napisze
  19. Czyli ma wyglądać to tak: local gracz = getPlayerAccount(thePlayer) if isObjectInACLGroup( "user." .. gracz, aclGetGroup ( "Policja" ) ) then Jak nie to powiedzcie co robię źle, bo jestem zielony w lua choć staram się pojąć podstawę od pół roku.
  20. Witam. Mam skrypt na logowanie do frakcji, lecz gdy wpisuje komendę wyskakuje taki błąd: EDIT: Fakt, sorki, zapomniałem w ogóle o tym, prosze : policja = createTeam("Policja", 0, 0, 255) pogotowie = createTeam("Pogotowie", 255, 0, 0) pd = createTeam("Pomoc Drogowa", 255, 0, 255) sn = createTeam("San News", 0, 255, 255) --wersja 0.3 rc --cywile = createTeam("Cywile", 255, 255, 255) --policja function loginpolicja (thePlayer) if isObjectInACLGroup( "user." .. getPlayerAccount(thePlayer), aclGetGroup ( "Policja" ) ) then setPlayerTeam(thePlayer, policja) setPlayerNametagColor(thePlayer, 0, 0, 255) giveWeapon(thePlayer, 3) setPlayerSkin(thePlayer, 280) else outputChatBox("Nie jesteś policjantem!", thePlayer) end end addCommandHandler("loginpolicja", loginpolicja) --pogotowie function pogotowie(thePlayer) local pogoacl = isObjectInACLGroup( "user." .. getPlayerAccount(thePlayer), aclGetGroup ( "Pogotowie" ) ) if pogoacl then setPlayerTeam(thePlayer, pogotowie) setPlayerSkin(thePlayer, 275) setPlayerNametagColor(thePlayer, 255, 0, 0) else outputChatBox("Nie jesteś pracownikiem pogotowia!", thePlayer) end end addCommandHandler("loginpogotowie", pogotowie) --pomoc drogowa function pd(thePlayer) if isObjectInACLGroup( "user." .. getAccountName(thePlayer), aclGetGroup ( "PD" ) ) then setPlayerTeam(thePlayer, pd) setPlayerSkin(thePlayer, 50) setPlayerNametagColor(thePlayer, 255, 0, 255) else outputChatBox("Nie jesteś pracownikiem pomocy drogowej!", thePlayer) end end addCommandHandler("loginpd", pd) --san news function loginsn (thePlayer) if isObjectInACLGroup( "user." .. getPlayerAccount(thePlayer), aclGetGroup ( "SN" ) ) then setPlayerTeam(thePlayer, sn) setPlayerNametagColor(thePlayer, 0, 255, 255) giveWeapon(thePlayer, 43) setPlayerSkin(thePlayer, 60) else outputChatBox("Nie jesteś pracownikiem San News!", thePlayer) end end addCommandHandler("loginsn", loginsn) --wersja 0.3 rc
  21. Hi i've got a problem. I try to install FCRP and i can't register... I launch it in local and this is logs in console: Anyone can help me ? Please
  22. Witam, napisałem skrypt który usuwa obiekty z mapy SA. Okej wszystko ładnie chodzi lecz gdy obiekty znikną zostaje tylko takie coś, wiem tylko to że widać to z daleka i nie ma kolizji. Proszę pomóżcie mi to dla mnie ważne. Zdjęcie "tego czegoś" + okno konsoli które nic nie wskazuje i logi debuggera (nie patrzcie na to ostatnie już się tym uporałem) : http://puu.sh/Ybfs PS. Jeśli będzie potrzebny kod skryptu to napiszcie i proszę o szybką pomoc bo to dla mnie bardzo ważne.
  23. To co mi sie wyswietla w debugerze: ERROR: exports: Call to non-running server resource (pool) [string "?"] ERROR: fuel-system\s_fuel_system.lua:21: bad argument #1 to 'ipairs' (table expected, got nil)
  24. Witam. Posiadam pewien skrypt który powinien tworzyć NPC który sprzedaje paliwo (tankuje), dostając go powiedziano mi że koordynaty musze sam wpisać. Wpisałem je i nic niemam jeżeli ktoś mógłby powiedzieć co mam źle ew. dać poprawiony kod. Z góry dzięki. Pozdrawiam To' oto kod: function createFuelPed(217, 1940.7587890625, -1776.2998046875, 13.390598297119, 87, name, priceratio) theNewPed = createPed (50, 1941.5654296875, -1769.1708984375, 13.640625) exports.pool:allocateElement(theNewPed) setPedRotation (theNewPed, rotZ) setPedFrozen(theNewPed, true) setPedAnimation(theNewPed, "FOOD", "FF_Sit_Loop", -1, true, false, true) exports['anticheat-system']:changeProtectedElementDataEx(theNewPed, "ped:name", name, true) exports['anticheat-system']:changeProtectedElementDataEx(theNewPed, "ped:fuelped",true) exports['anticheat-system']:changeProtectedElementDataEx(theNewPed, "fuel:priceratio" , priceratio or 100, false) -- For the language system exports['anticheat-system']:changeProtectedElementDataEx(theNewPed, "languages.lang1" , 1, false) exports['anticheat-system']:changeProtectedElementDataEx(theNewPed, "languages.lang1skill", 100, false) exports['anticheat-system']:changeProtectedElementDataEx(theNewPed, "languages.lang2" , 2, false) exports['anticheat-system']:changeProtectedElementDataEx(theNewPed, "languages.lang2skill", 100, false) exports['anticheat-system']:changeProtectedElementDataEx(theNewPed, "languages.current", 1, false) return theNewPed end function onServerStart() local sqlHandler = mysql:query("SELECT * FROM fuelpeds") if (sqlHandler) then while true do local row = mysql:fetch_assoc( sqlHandler ) if not row then break end createFuelPed(tonumber(row["skin"]),tonumber(row["posX"]),tonumber(row["posY"]),tonumber(row["posZ"]), tonumber(row["rotZ"]), row["name"],tonumber(row["priceratio"])) end end mysql:free_result(sqlHandler) end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), onServerStart) --createFuelPed(217, 1940.7587890625, -1776.2998046875, 13.390598297119,87)
  25. [lua] to kod zeby było jakoś odrębnione niewiem jak to nazwać... część posta w którym pokazujesz kod pliku więc daj przed kodem [lua] a na końcu [/lua] i to powinno potem wyglądać tak: [lua] kod trolololololo [/lua]
×
×
  • Create New...