Jump to content

TheTroll

Members
  • Posts

    16
  • Joined

  • Last visited

Details

  • Gang
    nothing

TheTroll's Achievements

Square

Square (6/54)

0

Reputation

  1. 25 slotów jest tylko na początek. Z czasem się je zwiększy. A z hostingu jesteśmy zadowoleni.
  2. Polski Truck World IP: 178.19.107.206:22331 Game Mod: Truck World 5.0 Sloty: x/25 Forum: truckworld.xaa.pl Serwer: Procesor: AMD FX X8 8120 8 x 3,1 GHz RAM: 23GB DDR3 Dyski: 2 x 500GB (RAID1) Łącze: 100Mbps Polski Truck World jest serwerem o tematyce truckerskiej na platformie MTA:SA. Posiadamy autorski Game Mod (Truck World 5.0), forum na silniku IPB oraz dużo ciekawych rzeczy. Kilka zdjęć z gry: Logowanie/Rejestrowanie: Do wyboru dwa języki: polski i angielski System towarów: Do wyboru różnego rodzaju towary, od produktów spożywczych do różnego rodzaju przemytów. Im lepsze towary, tym lepsze zarobki System Viatoll: System Viatoll to elektroniczny system pobierania opłat za przejazdy drogami płatnymi (głównie autostrady). System domów: Ładny oraz przejrzysty system zakupu bądź wynajmu domów. System paliw: Do wyboru mamy trzy opcje: Linia autobusowa: Zamiast taxi na naszym serwerze funkcjonuje tańsza, wygodniejsza oraz szybsza linia autobusowa Nasz serwer został założony w marcu i jak na razie się rozwija. Codziennie można zauważyć małe oraz duże zmiany takie jak: dodawanie nowych towarów bądź obiektów. W planach mamy bardzo dużo rzeczy, niektóre już są zrealizowane, nad niektórymi jeszcze pracujemy, a niektóre już są wcielone w życie. Posiadamy dużo prac własnego autorstwa, dobrych skrypterów oraz miłą, pomocną i wyszkoloną administrację. Serdecznie Was zapraszamy! Gra naprawdę wciąga oraz zapewnia godziny wspaniałej zabawy!
  3. Fakt troszkę nie przemyślałem Zrobiłem to teraz w ten sposób że podczas tworzenia pojazdu przydziela mu już ID a potem jak zmieniam właściciela to pobieram te ID. Tylko troszkę coś to nie działa. To znaczy ID przydziela normalnie ale jak zmieniam właściciela to dalej ten sam błąd co wyżej. Ale macie tutaj kod: function WlascicielZmien(nick) local root = xmlLoadFile ("auta.xml") local PojazdHeadRootNode = xmlFindChild (root,"autka",0) local vehicle = getPedOccupiedVehicle(source) if vehicle then local idPojazdu = xmlNodeGetAttribute (PojazdHeadRootNode,"numer") xmlNodeSetAttribute (idPojazdu,"owner",nick) outputChatBox("* Pomyślnie zmieniono właściciela pojazdu. Nowym włascicielem jest "..nick..".", source, 255, 255, 255) else outputChatBox("* Musisz być w pojeździe!", source, 255, 255, 255) end end addEvent("AutaServer:ZmienOwnera", true) addEventHandler("AutaServer:ZmienOwnera", root, WlascicielZmien)
  4. Tak wygląda plik xml. <auta> <autka> <auta x="-2424.1513671875" y="-614.8876953125" z="132.55892944336" model="404" owner=""></auta> </autka> </auta>
  5. Dzięki to już działa. Ale mam teraz mały problem z ustawieniem właściciela. tutaj macie kod: function WlascicielZmien(nick) local root = xmlLoadFile ("auta.xml") local PojazdHeadRootNode = xmlFindChild (root,"autka",0) local idPojazdu = tonumber(getPojazdCount()) local vehicle = getPedOccupiedVehicle(source) if vehicle then local PojazdRootNode = xmlFindChild (PojazdHeadRootNode,"auta",tonumber(idPojazdu)) xmlNodeSetAttribute (PojazdRootNode,"owner",nick) outputChatBox("* Pomyślnie zmieniono właściciela pojazdu. Nowym włascicielem jest "..nick..".", source, 255, 255, 255) else outputChatBox("* Musisz być w pojeździe!", source, 255, 255, 255) end end addEvent("AutaServer:ZmienOwnera", true) addEventHandler("AutaServer:ZmienOwnera", root, WlascicielZmien) a co do linijki w której pobieram id Pojazdu to tak wygląda ten kod: function getPojazdCount () local root = xmlLoadFile ("auta.xml") local PojazdyRoot = xmlFindChild (root,"autka",0) local allPojazdy = xmlNodeGetChildren (PojazdyRoot) autka = 0 for i,v in ipairs (allPojazdy) do autka = autka+1 end xmlUnloadFile (root) return autka end Błędy wyskakujące podczas zmiany właściciela: Bad argument @ 'xmlNodeSetAttribute' Proszę o pomoc
  6. Jak dodałem tą linijkę to na czacie nic się nie wyświetliło ale w debugscript wyskoczył taki błąd: Bad argument @ 'outputChatBox' [Expected string at argument 1, got player]. Napiszę jeszcze jaki błąd wyskakuje podczas tworzenia pojazdu. Bad argument @ 'createVehicle' [Expected number at argument 1, got player]. Proszę o pomoc.
  7. Witam. Pisze skrypt na prywatne pojazdy które zapisują się w pliku xml. Ale mam mały problem. Polega on na tym że kiedy wybieram pojazd z gridlisty i klikam stwórz to po stronie serwera dodaje się wszystko do pliku xml ale pojazd się nie tworzy. Kod po stronie klienta w którym dodaje pojazdy do gridlisty i potem pobieram pojazd do stworzenia. function pokazPanel() guiSetInputEnabled(true) guiSetVisible(GUIEditor.tabpanel[1],true) showCursor(true) for i = 0, 211 do if ( getVehicleNameFromModel ( 400 + i ) ~= "" ) then local row = guiGridListAddRow(GUIEditor.gridlist[2]) guiGridListSetItemText (GUIEditor.gridlist[2], row,1, getVehicleNameFromModel(400+i), false, false ) guiGridListSetItemText (GUIEditor.gridlist[2], row,2, 400+i, false, false ) end end end addEvent("Panel:Pokaz_Osobowe",true) addEventHandler("Panel:Pokaz_Osobowe",getRootElement(),pokazPanel) function AutaClientTworz() local nazwa = guiGridListGetItemText ( GUIEditor.gridlist[2], guiGridListGetSelectedItem ( GUIEditor.gridlist[2] ), 2 ) if nazwa ~= "" then triggerServerEvent("AutaServer:Tworz",getLocalPlayer(),getLocalPlayer(),nazwa) else outputChatBox("*Musisz wybrać pojazd z listy!", source, 255, 255, 255) end end addEventHandler("onClientGUIClick",GUIEditor.button[1],AutaClientTworz,false) I kod po stronie serwera w którym dodaje pojazd do pliku xml i tworze go. function AutaServerTworz(nazwa) if (not isPedInVehicle(source)) then if (hasObjectPermissionTo (source,"command.aexec",false)) then local x,y,z = getElementPosition (source) local PojazdCount = tonumber(getPojazdCount()) local root = xmlLoadFile ("auta.xml") local PojazdRoot = xmlFindChild (root,"autka",0) local newPojazd = xmlCreateChild (PojazdRoot,"auta") xmlNodeSetAttribute (newPojazd,"x",x) xmlNodeSetAttribute (newPojazd,"y",y) xmlNodeSetAttribute (newPojazd,"z",z) xmlNodeSetAttribute (newPojazd,"model",nazwa) xmlNodeSetAttribute (newPojazd,"owner","") pojazd = createVehicle (nazwa, x, y+5, z) outputChatBox ("* Pomyślnie stworzono pojazd prywanty. ID pojazdu: "..PojazdCount,source,255,255,255,false) xmlSaveFile (root) xmlUnloadFile (root) setTimer ( onStart, 2000, 1 ) else outputChatBox ("* Nie posiadasz dostępu do stawiania aut!",source,255,255,255,false) end else outputChatBox ("* Musisz wyjść z pojazdu!",thePlayer,255,255,255,false) end end addEvent("AutaServer:Tworz", true) addEventHandler("AutaServer:Tworz", root, AutaServerTworz) Bardzo proszę o pomoc.
  8. No tak ale jak pobrać na przykład wiek do 1 labelu(napisu) a potem imię do 2 labelu(napisu) ?
  9. Witam. Od nie dawna zacząłem pisać system postaci. Ale mam mały problem. Polega on na tym że kiedy tworzymy postać to Imię, Nazwisko i Wiek przenosi się do ComboBoxa. Po wybraniu tej postaci z comboboxa pobierały by się informacje(Imię, Nazwisko i Wiek) i przenosiły by się do osobnych labeli(napisów) ale niestety nie wiem jak pobrać te informację. Bardzo proszę o pomoc. Tutaj macie kod gdzie informacje dodają się do comboboxa: guiComboBoxAddItem(comboBox, "["..wiek.."] "..imie.." "..nazwisko)
  10. Witam. Chciał bym napisać skrypt na zmęczenie. Polega on na tym że podczas jazdy pojazdem będzie przybywać zmęczenia na danym pasku. Wiem że trzeba użyć funkcji DxDrawing i setElementData ale nie za bardzo wiem jak ich użyć. Więc proszę was o pomoc. A tutaj zrobiłem już pasek zmęczenia: addEventHandler("onClientRender", root, dxDrawRectangle(994, 214, 227, 19, tocolor(0, 0, 0, 255)) dxDrawRectangle(999, 219, 216, 9, tocolor(62, 66, 1, 255)) dxDrawRectangle(999, 219, 216, 9, tocolor(200, 213, 3, 255)) end)
  11. Witam. Pisze sobie system logowania do mta ale mam maly problem. Problem polega na tym ze po wcisnieciu buttonu "Zaloguj" powinno nas przeniesc do wyboru teamu ale nie przenosi. Sprawdzalem kod juz kilka razy ale nic nie znalazlem wiec moze wy cos znajdziecie . Bardzo prosze o pomoc tutaj macie kod: sound = playSound("logowanie.mp3") setSoundVolume(sound, 100) function centerGUIElement(center_window) local screenW,screenH=guiGetScreenSize() local windowW,windowH=guiGetSize(center_window,false) local x,y = (screenW-windowW)/2,(screenH-windowH)/2 guiSetPosition(center_window,x,y,false) end local localPlayer = getLocalPlayer() x,y = guiGetScreenSize() regtab = guiCreateTabPanel(x/3.30 - 22,y/3 - 60, 455,485,false) guiSetAlpha(regtab, 0.87) regulamin = guiCreateTab("Regulamin",regtab) akc_reg_serw = guiCreateLabel(128,4,187,30,"Akceptacja regulaminu serwera",false,regulamin) guiSetFont(akc_reg_serw,"default-bold-small") reg = xmlLoadFile( "regulamin.xml" ) ra = xmlNodeGetValue(reg) memo = guiCreateMemo(6,33,443,381,ra,false,regulamin) guiMemoSetReadOnly(memo,true) nieakceptuje = guiCreateButton(7,425,180,24,"Nie akceptuję regulaminu",false,regulamin) guiSetFont(nieakceptuje,"default-bold-small") guiSetProperty(nieakceptuje,"Disabled","true") akceptuje = guiCreateButton(267,425,180,24,"Akceptuję regulamin",false,regulamin) guiSetFont(akceptuje,"default-bold-small") guiSetProperty(akceptuje,"Disabled","true") local infoLabelText = "Witaj na serwerze. Jesli jeszcze tu nie grales to musisz sie zarejestrowac a jesli posiadasz juz konto to tylko sie zaloguj \"{SMILIES_PATH}/icon_biggrin.gif\" alt=\"\" title=\"Very Happy\" />" local usernameText = "Login:" local passwordText = "Haslo:" local registerButtonText = "Zarejestruj" local loginButtonText = "Zaloguj" local loginWindowText = "Rejestracja/ Login" fadeCamera(false) showCursor(true) toggleAllControls(false) local screenW, screenH = guiGetScreenSize() loginWindow = guiCreateWindow(screenW/2-648/2, screenH/2-303/2, 648, 303, loginWindowText, false) guiWindowSetMovable(loginWindow, false) guiWindowSetSizable(loginWindow, false) infoLabel = guiCreateLabel(0.01, 0.11, 0.97, 0.33, infoLabelText, true, loginWindow) guiSetFont(infoLabel, "default-bold-small") guiLabelSetHorizontalAlign(infoLabel, "center", false) guiLabelSetVerticalAlign(infoLabel, "center") usernameLabel = guiCreateLabel(0.02, 0.48, 0.25, 0.13, usernameText, true, loginWindow) guiSetFont(usernameLabel, "default-bold-small") guiLabelSetHorizontalAlign(usernameLabel, "right", false) guiLabelSetVerticalAlign(usernameLabel, "center") usernameInput = guiCreateEdit(0.28, 0.50, 0.71, 0.10, getPlayerName(localPlayer), true, loginWindow) guiEditSetMaxLength(usernameInput, 21) passwordLabel = guiCreateLabel(0.02, 0.63, 0.25, 0.13, passwordText, true, loginWindow) guiSetFont(passwordLabel, "default-bold-small") guiLabelSetHorizontalAlign(passwordLabel, "right", false) guiLabelSetVerticalAlign(passwordLabel, "center") passwordInput = guiCreateEdit(0.28, 0.64, 0.71, 0.10, "", true, loginWindow) guiEditSetMasked(passwordInput, true) guiEditSetMaxLength(passwordInput, 32) registerButton = guiCreateButton(0.02, 0.81, 0.43, 0.13, registerButtonText, true, loginWindow) guiSetFont(registerButton, "default-bold-small") guiSetProperty(registerButton, "NormalTextColour", "FFFFFFFF") loginButton = guiCreateButton(0.46, 0.81, 0.52, 0.13, loginButtonText, true, loginWindow) guiSetFont(loginButton, "default-bold-small") guiSetProperty(loginButton, "NormalTextColour", "FFFFFFFF") function buttonClick() if source == registerButton then if #guiGetText(usernameInput) < 5 then guiSetText(infoLabel,"Twoja nazwa uzytkownika musi miec co najmniej 5 znakow.") return end if #guiGetText(passwordInput) < 5 then guiSetText(infoLabel,"Twoje haslo musi miec co najmniej 5 znakow.") return end triggerServerEvent("registerServer",localPlayer,guiGetText(usernameInput),guiGetText(passwordInput)) guiSetEnabled(registerButton,false) setTimer(guiSetEnabled,3000,1,registerButton,true) elseif source == loginButton then triggerServerEvent("loginServer",localPlayer,guiGetText(usernameInput),guiGetText(passwordInput)) guiSetEnabled(loginButton,false) setTimer(guiSetEnabled,3000,1,loginButton,true) end end addEventHandler("onClientGUIClick",root,buttonClick) addEvent("clientResponse",true) function onResponse(n) if n == 3 then destroyElement(loginWindow) fadeCamera(true,5) showCursor(true) toggleAllControls(true) return elseif n == 2 then guiSetText(passwordInput,"") guiLabelSetColor(passwordLabel, 255, 0, 0) elseif n == 1 then guiSetProperty(registerButton, "NormalTextColour", "FFFF0000") elseif n == 4 or n == 5 then guiSetProperty(loginButton, "NormalTextColour", "FFFF0000") end responseText = { [1] = "To konto nie istnieje. Najpierw musisz sie zarejestrowac!", [2] = "Zle haslo sproboj ponownie!", [4] = "Konto z taka nazwa juz istnieje!", [5] = "Pomyslnie zarejestrowano. Mozesz teraz sie zalogowac!" } guiSetText(infoLabel,responseText[n]) end addEventHandler("clientResponse",root,onResponse) wybor = guiCreateTabPanel(x/2,y/2,465,280,false) guiSetAlpha(wybor, 0.87) praca = guiCreateTab("Wybór pracy",wybor) napisa = guiCreateLabel(6,9,449,50,"Wybierz frakcje/firme do której należysz a następnie kliknij przycisk 'Wybierz'.\nJeśli nie posiadasz żadnej pracy zaznacz pole 'Truckerzy'",false,praca) guiSetFont(napisa,"default-bold-small") gridteam = guiCreateGridList ( 22, 63, 418, 150, false, praca ) kolteam = guiGridListAddColumn( gridteam, "Dostępne drużyny", 0.95 ) truc = guiGridListAddRow(gridteam) guiGridListSetItemText(gridteam, truc, kolteam, "Kierowcy", false, false) policja = guiGridListAddRow(gridteam) guiGridListSetItemText(gridteam, policja, kolteam, "Policja", false, false) pd = guiGridListAddRow(gridteam) guiGridListSetItemText(gridteam, pd, kolteam, "Pomoc Drogowa", false, false) pogo = guiGridListAddRow(gridteam) guiGridListSetItemText(gridteam, pogo, kolteam, "Pogotowie", false, false) tax = guiGridListAddRow(gridteam) guiGridListSetItemText(gridteam, tax, kolteam, "Taxi", false, false) pet = guiGridListAddRow(gridteam) guiGridListSetItemText(gridteam, pet, kolteam, "Petrol", false, false) sped = guiGridListAddRow(gridteam) guiGridListSetItemText(gridteam, sped, kolteam, "InSped Transport", false, false) wybierz = guiCreateButton(289,221,147,28,"Wybierz",false,praca) guiSetFont(wybierz,"default-bold-small") tabspawn = guiCreateTabPanel(x/2, y/2,465,226,false) guiSetAlpha(tabspawn,0.87) spawn = guiCreateTab("Miejsce spawnu",tabspawn) najedg = guiCreateLabel(0.0151,0.06,0.9484,0.135,"Wybierz miasto w którym chcesz rozpocząć grę. Zaznacz odpowiednie miasto,\nnastępnie naciśnij przycisk 'Wybierz'.",true,spawn) guiSetFont(najedg,"default-bold-small") gridmiej = guiCreateGridList(0.0452,0.24,0.8925,0.53,true,spawn) guiGridListSetSelectionMode(gridmiej,1) miast = guiGridListAddColumn(gridmiej,"Miasta",0.90) sf = guiGridListAddRow(gridmiej) guiGridListSetItemText(gridmiej, sf, miast, "San Fierro", false, false) lv = guiGridListAddRow(gridmiej) guiGridListSetItemText(gridmiej, lv, miast, "Las Venturas", false, false) ls = guiGridListAddRow(gridmiej) guiGridListSetItemText(gridmiej, ls, miast, "Los Santos", false, false) wybspawn = guiCreateButton(0.6258,0.805,0.3032,0.15,"Wybierz",true,spawn) guiSetFont(wybspawn,"default-bold-small") --Chowanie GUI-- guiSetVisible(regtab,false) guiSetVisible (loginWindow, false) guiSetVisible(wybor, false) guiSetVisible(tabspawn, false) centerGUIElement(loginWindow) centerGUIElement(regtab) centerGUIElement(tabspawn) centerGUIElement(wybor) function przyciski (button, state, absoluteX, absoluteY) if (source == akceptuje) then guiSetVisible(regtab,false) guiSetVisible(regulamin,false) guiSetVisible(loginWindow, true) guiSetInputMode("no_binds_when_editing") elseif(source == nieakceptuje) then triggerServerEvent ("Kick", getLocalPlayer()) end end addEventHandler ("onClientGUIClick", getResourceRootElement(getThisResource()), przyciski) function x() guiSetVisible(regtab, true, true) showPlayerHudComponent ( "radar", false ) showPlayerHudComponent ( "area_name", false ) setTimer(zmien, 1000, 1) showCursor(true) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), x) function zmien() guiSetProperty(nieakceptuje,"Disabled","false") guiSetProperty(akceptuje,"Disabled","false") end function hide() guiSetEnablet(true) guiSetVisible(loginWindow,false) guiSetVisible(wybor,true) end addEvent("hide", true) addEventHandler("hide", getResourceRootElement(getThisResource()), hide) local facing = 0 function kamerka() local x, y, z = -2502.8571777344, 2417.1428222656, 62 --bayside local camX = x + math.cos( facing / math.pi * 180 ) * 5 local camY = y + math.sin( facing / math.pi * 180 ) * 5 setCameraMatrix( camX, camY, z+1, x, y, z-2) facing = facing + 0.000012 end addEventHandler("onClientRender", getRootElement(), kamerka) --Wybieranie pracy-- function pr(button, state, thePlayer) if (source == wybierz) then if button == "left" and state == "up" then local praca = guiGridListGetItemText (gridteam, guiGridListGetSelectedItem(gridteam)) if (praca == "Kierowcy") then guiSetVisible(wybor, false) guiSetVisible(tabspawn, true) elseif (praca == "Policja") then triggerServerEvent("pol", getRootElement(), getLocalPlayer()) elseif (praca == "Pogotowie") then triggerServerEvent("pogo", getRootElement(), getLocalPlayer()) elseif (praca == "Pomoc Drogowa") then triggerServerEvent("pd", getRootElement(), getLocalPlayer()) elseif (praca == "Taxi") then triggerServerEvent("tax", getRootElement(), getLocalPlayer()) elseif (praca == "Petrol") then triggerServerEvent("pet", getRootElement(), getLocalPlayer()) elseif (praca == "InSped Transport") then triggerServerEvent("sped", getRootElement(), getLocalPlayer()) else outputChatBox ("Nie wybrałeś żadnej pracy. Jeśli nie jesteś nigdzie zatrudniony wybierz pole #FFCC00Kierowcy#FFFFFF.", 255, 255, 255, true) end end end end addEventHandler ("onClientGUIClick", wybierz, pr, false) --Wybieranie spawnu-- function so(button, state, thePlayer) if (source == wybspawn) then if button == "left" and state == "up" then local ms = guiGridListGetItemText (gridmiej, guiGridListGetSelectedItem(gridmiej)) if (ms == "San Fierro") then showCursor(false) guiSetVisible(tabspawn, false) triggerServerEvent("sf", getRootElement(), getLocalPlayer()) showPlayerHudComponent ("all", true) elseif (ms == "Las Venturas") then
  12. ze skryptem na towary juz sobie poradzilem. Teraz potrzebuje skryptu na logowanie/rejestracje i po rejestracji trzeba stworzyc postac, wybrac skina, wybrac spawn itp.
  13. dalej szukam skryptera. Skrypterzy prosze pomóżcie mi !
  14. No np wjezdzamy do markera i otwiera sie nam gui gdzie pisze Zaladuj Rozladuj i Anuluj. Kiedy np wybierzemy Zaladuj to otwiera sie kolejne gui z lista towarów do zaladowania i mamy tam np towar Cola od 0 score i np Przemyt Narkotyki od 200 score. Kiedy wybierzemy towar to musimy wybrac ilosc mozemy przeladowac itp mam ss'a jak to ma mniej wiecej wygladac: http://imageshack.us/photo/my-images/40 ... 53918.png/ . Kiedy wybierzemy ilosc to musimy wybrac miejsce rozladunku mozemy kliknac Sam wybiore - wybieramy sami lub Wybierz losowo - wybiera automatycznie. To chyba tyle
×
×
  • Create New...