To juz ostatnie gui z mojej serii i przestaje was zadreczac
Wyswietla blad w debugu w linijce 84 w addEventHandler
CLIENT:
[lua]local marker = createMarker(2043, 1543, 10, "cylinder", 2, 0, 255, 0, 30)
local blip = createBlip ( 2043, 1543, 11, 45 )
Wiem ze zawalam dzial , ale probuje czegos sie nauczyc
co tu jest zle ? W konsoli pokazuje mi
[code]
WARNING: gracz requires upgrade as <min_mta_version> section in the meta.xml is incorrect or missing (expected at least client 1.3.0-9.04491 because of 'warpPedIntoVehicle')
[20] Use the 'upgrade' command to perform a basic upgrade of resources.[/code]
function open5(thePlayer, team) local xml = xmlLoadFile ( "lide.xml" ) local team = xmlFindChild ( xml, "Lider", 0 ) local success = xmlNodeGetValue ( team ) accountname = getAccountName ( getPlayerAccount( thePlayer ) )
if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "success" ) ) then
triggerClientEvent(thePlayer,"pokaz5", getRootElement()) end
end
addCommandHandler("lider", open5)
Clinet:
function Pokaz5()
if (guiGetVisible(lider_Window[1]) == false) then
showCursor(true) guiSetVisible(lider_Window[1], true)
if (kolumna) then for id, player in ipairs(getElementsByType("player")) do local row = guiGridListAddRow(lider_Grid[1]) guiGridListSetItemText(lider_Grid[1], row, kolumna, getPlayerName(player), false, false) end
end else guiSetVisible(lider_Window[1], false) showCursor(false) guiGridListClear(lider_Grid[1]) end
end
addEvent("pokaz5", true) addEventHandler("pokaz5", getRootElement(), Pokaz5)
Witam chcia?bym zrobi? panel lidera ?eby mo?na by?o dodawa? graczy do frakcji typu policja,pogotowie,pomocdrogowa itp tylko nie wiem jak to zrobi? jestem w tym nowy nigdy nie robi?em lua pom??cie postawie poz pozdrawiam
M?j problem na dzi? to, label i brak w nim informacji o kt?re prosz?...
A mianowicie, mam sobie gui w kt?rym stworzy?em pusty label. Chc? aby po wybraniu gracza z listy pojawia? si? jego nick w tym labelu. Pokarz? kod.
addEventHandler("onClientGUIClick",root,
function ()
if ( source == GUIEditor_Grid[1] ) then
local sel = guiGridListGetSelectedItem(grid) local text = guiGridListGetItemText(grid,sel,1) local player = getPlayerFromName(text)
if ( player ) then
guiSetText(GUIEditor_Label[1],"Nick: " .. getPlayerName(player))
else guiSetText(GUIEditor_Label[1],"Nick: N/A") end
end
end )
Teraz jak wybior? gracza wy?wietla si? tylko "Nick: N/A"
Co robi? ?le?
Witam ponownie, zrobi?em panel logowania do frakcji. Chcia?em ?eby wy?wietla? si? gdy gracz wejdzie w marker, nie dzia?a i wyskakuje taki b??d, po stronie servera w 4 linijce:
bad argument@ 'addEventHandler' [Expected element at argument 2, got nil]
Serwer
function show(hitPlayer) triggerClientEvent (hitPlayer,"show",getRootElement(),hitPlayer) end
addEventHandler("onMarkerHit", zalo, show)
function show()
if (getPlayerTeam(getLocalPlayer()) == getTeamFromName("Pomoc Drogowa")) then
guiSetVisible(GUIEditor_Window[1], true) showCursor(true) end
end
addEvent("show",true) addEventHandler("show", getRootElement(), show)
Siema tym razem mam problem z panelem pd. W debugu pokazuje UTF-8 i b??d w linijce 20 czyli tutaj pierwszej, po stronie clienta. Panel si? nie wy?wietla.
function show() < Tutaj rzekomy b??d
guiGridListClear(GUIEditor_Grid[1])
for id, playeritem in ipairs(getElementsByType("player")) do local row = guiGridListAddRow ( GUIEditor_Grid[1] ) guiGridListSetItemText ( GUIEditor_Grid[1], row, kolumna, getPlayerName ( playeritem ), false, false ) end
guiSetVisible(GUIEditor_Window[1], true) showCursor(true) end
addCommandHandler("panelpd", show )
function wyjdz ()
if (source == GUIEditor_Button[4]) then
guiSetVisible( GUIEditor_Window[1], false) showCursor(false) guiGridListClear( GUIEditor_Grid[1]) end
end
addEventHandler("onClientGUIClick", GUIEditor_Button[4], wyjdz)
function fix() local player = guiGridListGetItemText (GUIEditor_Grid[1], guiGridListGetSelectedItem (GUIEditor_Grid[1]), 1) triggerServerEvent("fix", getRootElement(), player, getLocalPlayer()) end
addEventHandler( "onClientGUIClick", GUIEditor_Button[2], fix )
server na wszelki wypadek
addEvent("fix", true) addEventHandler("fix", getRootElement(), function(player, potem) local player = getPlayerFromName ( player ) local car = getPedOccupiedVehicle(player) fixVehicle(car) end)
function show()
guiGridListClear(GUIEditor_Grid[1])
for id, playeritem in ipairs(getElementsByType("player")) do
local row = guiGridListAddRow ( GUIEditor_Grid[1] )
guiGridListSetItemText ( GUIEditor_Grid[1], row, kolumna, getPlayerName ( playeritem ), false, false )
end
guiSetVisible(GUIEditor_Window[1], true)
showCursor(true)
end
end
Witajcie, m?j problem polega na tym ?e m?j panel policji, przed reinstalacj? dzia?a? poprawnie, teraz nie dziala nic, tylko sie pokazuje. W debugu zero bled?w.
[b]Krok 4:[/b] Pod linijkami gdzie masz te dwie linijki : [code]<object name="resource.admin"></object>
<object name="resource.webadmin"></object>[/code]
[b]Krok 4:[/b] Zamiast tej cz?stki "login" wpisz sw?j login. B?dzie Ci on p??niej potrzebny.
[b]Krok 5:[/b] Zapisz plik.
[b]Krok 6:[/b] W??cz sw?j serwer i wejd? do gry.
[b]Krok 7:[/b] Wejd? na sw?j serwer.
[b]Krok 8:[/b] Wpisz komend? /register [login] [has?o]
W miejsce [login] wpisz sw?j login, kt?ry poda?e? przy wpisywaniu w notatniku, natomiast zamiast [haslo] wpisz swoje has?o, kt?rym b?dziesz logowa? si? na konto.
[b]Krok 9:[/b] Wpisz komend? /login [login] [has?o] tak jak poprzednio zamiast [login] sw?j login podany tam w notatniku, a zamiast [has?o] wpisz swoje has?o, kt?re u?y?e? w rejestracji punkt wy?ej.
[b]Krok 10:[/b] Po wci?ni?ciu klawisza "p" wy?wietli Ci si? Panel Admina, kt?rym mo?esz zarz?dza? ca?ym serwerem.
[ Komentarz dodany przez: DestroY : 2015-09-22, 15:45 ]
U?ci?lenie wszystkich poj??, tak ab...
Sorki ?e pisz? na taki prosty problem ale mia?em przerw? i nie mam nic na kompie od pr?cz moje oryginalnego panelu lidera tylko on jest na 1 frakcje i chce to zrobi? na tabele . je?eli mi kto? pomo?e daje piwka
[code]function Pokaz5()
guiGridListClear(GUIEditor_Grid[1])
for id, playeritem in ipairs(getElementsByType("player")) do
local row = guiGridListAddRow ( GUIEditor_Grid[1] )
guiGridListSetItemText ( GUIEditor_Grid[1], row, kolumna, getPlayerName ( playeritem ), false, false )
end
guiSetVisible(GUIEditor_Window[1], true)
showCursor(true)
end
addEvent("pokaz5", true)
addEventHandler("pokaz5", getRootElement(), Pokaz5)
function dodaj5()
local gracz = guiGridListGetItemText (GUIEditor_Grid[1], guiGridListGetSelectedItem (GUIEditor_Grid[1]), 1)
if gracz ~= "" then
triggerServerEvent("dodaj5", getRootElement(), gracz)
end
end
addEventHandler ( "onClientGUIClick", GUIEditor_Button[1], dodaj5, false )
function usun5()
local gracz = guiGridListGetItemText (GUIEditor_Grid[1], guiGridListGetSelectedItem (GUIEditor_Grid[1]), 1)
if gracz ~= "" then
triggerServerEvent("usun5", getRootElement(), gracz)
end
end
addEventHandler ( &qu...
Witajcie dopiero co zaczynam z lua mysle ze nie poszed?em na wysok? wode . zrobi?em juz panel pd i wzorujac sie na nim chcialem zrobic cos dla pogotowia
local kolumna = guiGridListAddColumn(GUIEditor.gridlist[1],"Gracze",0.9)
bindKey("m", "down",
function ()
if (getPlayerTeam(getLocalPlayer()) == getTeamFromName("Pomoc Drogowa")) then
if (guiGetVisible(GUIEditor.gridlist[1]) == false) then
showCursor(true)
guiSetVisible(GUIEditor.gridlist[1], true)
if (kolumna) then
for id, player in ipairs(getElementsByType("player")) do
local row = guiGridListAddRow(GUIEditor.gridlist[1])
guiGridListSetItemText(GUIEditor.gridlist[1], row, kolumna, getPlayerName(player), false, false)
end
end
else
guiSetVisible(GUIEditor.gridlist[1], false)
showCursor(false)
guiGridListClear(GUIEditor.gridlist[1])
end
end
end)
function lecz()
local player = guiGridListGetItemText (GUIEditor.gridlist[1], guiGridListGetSelectedItem (GUIEditor.gridlist[1]), 1)
triggerServerEvent("lecz", getRootElement(), player, getLocalPlayer(""))
end
addEventHandler( "onClientGUIClick", GUIEditor.gridlist[1], lecz )[/code]
Witajcie, dzisiaj zrobi?em panel aby da? fix, flip i nitro. Ale wla?nie, tutaj problem.
B??d?w w debugu zero.
Client:
[lua]function dajnitro ()
if (source == nitrotn) then
triggerServerEvent("buyNitro", getRootElement())
end
end
addEventHandler("onClientGUIClick", nitrobtn, dajfix)
function dajfix ()
if (source == fixbtn) then
triggerServerEvent("buyRepair", getRootElement())
end
end
addEventHandler("onClientGUIClick", fixbtn, dajfix)
function dajflipa ()
if (source == flipbtn) then
triggerServerEvent("buyFlip", getRootElement())
end
end
addEventHandler("onClientGUIClick", fliptn, dajflipa [/lua]
Server:
[lua]addEvent("buyNitro", true)
addEventHandler("buyNitro", rootElement,
function()
if isPedInVehicle(source) then
if ( getPlayerMoney (source) >= 7000 ) then
takePlayerMoney(source, 7000)
addVehicleUpgrade(getPedOccupiedVehicle(source),1010)
outputChatBox("Nitro dodano", source, 255, 255, 0, true)
else
outputChatBox("Nie masz tyle kasy.", source, 255, 0, 0, true)
end
else
outputChatBox("Nie jestes w aucie", source, 255, 0, 0, true)
end
end
)
addEvent("buyRepair", true)
addEventHandler("buyRepair", rootElement,
function()
if isPedInVehicle(source) then
if ( getPlayerMoney (source) >= 40 ) th...
Witajcie, robie panel lidera z dodawaniem wyplat. Mozecie mi pokazac, co tutaj jest zle ?
Server:
[lua]
addEvent("kasa3", true)
addEventHandler("kasa3", getRootElement(), function(kasa3, player)
local player = getPlayerFromName ( player )
takePlayerMoney (player, tonumber(kasa3))
end)
addEvent("score3", true)
addEventHandler("score3", getRootElement(), function(score3, player)
local daj3score = getPlayerFromName ( player )
local scoreP3 = getElementData(daj3score, "Score")
setElementData(dajscore3, "Score", tonumber(scoreP3+score3))
end)
addCommandHandler("lider", open3)
[/lua]
Client:
[lua]function dajkase3(gracz)
local kasa3 = guiGetText(GUIEditor_Edit[1])
local player = guiGridListGetItemText (GUIEditor_Grid[1], guiGridListGetSelectedItem (GUIEditor_Grid[1]), 1)
if kasa3 ~= "" then
if player ~= "" then
triggerServerEvent("kasa3", getRootElement(), kasa3 ,player)
else
outputChatBox("Nie wybra?e? gracza!", gracz)
end
else
outputChatBox("Nie wpisa?e? liczby!", gracz)
end
end
addEventHandler( "onClientGUIClick", GUIEditor_Button[2], kasa3 )
function score3(gracz)
local score3 = guiGetText(GUIEditor_Edit[1])
local player = guiGridListGetItemText (GUIEditor_Grid[1], guiGridListGetSelectedItem (GUIEditor_Grid[1]), 1)
if score3 ~...
Siemkaaaa
Hmm mam taki problem a mianowicie chodzi mi o take co? ?eby po wej?ciu na serwer wyskoczy? panel logowania i jak kto? si? zaloguje to ?eby m?g? potem wybra? skina.
Mam ju? panel wybierania skina a panel logowania Community :E
ale nie wiem jak zrobi? to co u g?ry pisa?em.
Mam nadzieje ze kto? pomo?e
Kod wybierania skina
[lua]
local x, y = guiGetScreenSize()
Witajcie, robie panel lidera z dawaniem wyplat i mam male problemiki
Client :
function dajkase3() local kasa3 = guiGetText(GUIEditor_Edit[1]) local player = guiGridListGetItemText (GUIEditor_Grid[1], guiGridListGetSelectedItem (GUIEditor_Grid[1]), 1) triggerServerEvent("kasa1", getRootElement(), kasa1,player) end
addEventHandler( "onClientGUIClick", GUIEditor_Button[2], kasa3 )
function score3() local score3 = guiGetText(GUIEditor_Edit[1]) local player = guiGridListGetItemText (GUIEditor_Grid[1], guiGridListGetSelectedItem (GUIEditor_Grid[1]), 1) triggerServerEvent("score3", getRootElement(), score3,player) end
addEventHandler( "onClientGUIClick", GUIEditor_Button[1], score3 )
Server
addEvent("kasa3", true) addEventHandler("kasa3", getRootElement(), function(mandat, player) local kasa = getPlayerFromName ( player ) givePlayerMoney (kasa, tonumber(kasa3)) end)
addEvent("score3", true) addEventHandler("score3", getRootElement(), function(score3, player) local daj3score = getPlayerFromName ( player ) local scoreP3 = getElementData(daj3score, "Score") setElementData(dajscore3, "Score", scoreP3+score) end) addCommandHandler("lider", open3)
Witajcie, problem polega na tym ze panel nie dodaje, jak i nie usuwa z acl. I po wpisaniu komendy na otwarcie pokazuje panel kazdemu graczowi.
Server:
function open(lider) accountname = getAccountName ( getPlayerAccount( lider ) )
if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "LPoli" ) ) then
triggerClientEvent("pokaz", getRootElement()) end
end
function Dodaj(gracz) local aclGroup = aclGetGroup("Poli") local accName = getPlayerAccount ( getPlayerFromName( gracz ) ) aclGroupAddACL(aclGroup,accName) end
addEvent("dodaj", true) addEventHandler("dodaj", getRootElement(), Dodaj)
function Usun(gracz) local aclGroup = aclGetGroup("Poli") local accName = getPlayerAccount ( getPlayerFromName( gracz ) ) aclGroupRemoveACL(aclGroup,accName) end
addEvent("usun", true) addEventHandler("usun", getRootElement(), Usun)
Witajcie, dzisiaj chcia? bym was, poprosi? o pomoc w zrobieniu mojego pierwszego, panelu logowania. Stron? Clienta zrobi?em poprawnie, wszystko ?adnie dzia?a. Teraz tylko strona servera. Chchia? bym kogo? poprosi?, o nakierowanie mnie na w?a?ciwy kurs.
[lua]function loguj()
local login = guiGetText(GUIEditor_Edit[1])
local haslo = guiGetText(GUIEditor_Edit[2])
if login~= "" and haslo ~= "" then
triggerServerEvent("loguj", getLocalPlayer(), login,haslo,getLocalPlayer())
end
end
addEventHandler( "onClientGUIClick", GUIEditor_Button[1], loguj )[/lua]
Funkcja przeznaczona do logowania.
[lua]function rejestruj()
local reje = guiGetText(GUIEditor_Edit[1])
local haslo = guiGetText(GUIEditor_Edit[2])
if reje ~= "" and haslo ~= "" then
triggerServerEvent("rejestruj", getLocalPlayer(), reje,haslo,getLocalPlayer())
end
end
addEventHandler( "onClientGUIClick", GUIEditor_Button[2], rejestruj )[/lua]Funkcja, przeznaczona do rejestracji.
[lua]function pokaz()
guiGridListClear(GUIEditor_Grid[1])
for id, playeritem in ipairs(getElementsByType("player")) do
local row = guiGridListAddRow ( GUIEditor_Grid[1] )
guiGridListSetItemText ( GUIEditor_Grid[1], row, kolumna, getPlayerName ( playeritem ), false, false )
end
guiSetVisible(GUIEditor_Window[1], true)
showCursor(true)
end
addEventHandler("onClientResourceStart",getRootElement(),po...
Witajcie, dzisiaj proboje zrobic panel policji. Wszystko w panelu dziala, procz dania mandatu. A po wpisaniu /debugscript 3 wyskakuje bad argument @ takePlayerMoney
Oto serwer mojego panelu :
addEvent("mandat", true)
addEventHandler("mandat", getRootElement(), function(mandat, player)
local kasa = getPlayerFromName ( player )
takePlayerMoney (player,kasa, mandat)
end)
Witam mam problem bo nie wiem jak zrobi? funkcje dla panelu Taxi.
Panel ma by? wyposa?ony w :
1.Poka? osobie na g w samochodzie cen? przejazdu
2.Wyrzu? z samochodu osoby na g(mo?e to by? osobny skrypt z komenda /outcarg)
3.CheckBox z gdy jest w??czony nalicza gdy kto? wejdzie na g i zabiera jak wyjdzie.
4.W label napis ile ju? przejecha? KM
5.Progresbar 1 przej?cie 1 KM
Prosz? chocia? poda? funkcje do tego.
Wiem ?e id? na g??bok? wod? ale kiedy? trzeba(Pewnie dostane wielki poemat ?ebym si? douczy? lua i sam b?d? wiedzia?).
Witam mam problem z dodaniem wymagania score na kupno.
Czyli np.
Za na n?? trzeba 10score
ammo_c
[lua]GUIEditor_Window = {}
GUIEditor_Button = {}
GUIEditor_Grid = {}
local team = getTeamFromName("Ammonation")
weapons ={
"Kastet"
}
function show()
if getPlayerTeam(getLocalPlayer()) == team then
local column = guiGridListAddColumn( GridList1, "Player", 0.99 )
local column1 = guiGridListAddColumn( GridList2, "Bron", 0.99 )
local column2 = guiGridListAddColumn( GridList3, "Kasa", 0.50)
if ( column ) then
for id, playeritem in ipairs(getElementsByType("player")) do
local row = guiGridListAddRow ( GridList1 )
guiGridListSetItemText ( GridList1, row, column, getPlayerName ( playeritem ), false, false )
end
for key,weaponName in pairs(weapons) d...
Witam. Jestem nowy na forum to chyba widac i chcialbym je wyprobowac.
Mam panel logowania do serwera RP wysle w linku poniewaz codem jest za dlugi: http://hostuje.net/f...35df92a16a99691
i chcialem dodac z innego serwera tutorial serwerow rp tzn napisy ktore leca na chacie przy wejsciu gry cos jak na valhalli i quiz ale nie dziala o to link do pliczku z quizem: http://hostuje.net/f...af941deb2f20381