Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2016-07-25, 16:34


GamerHD11







Wiek: 24
Na forum: 4261 dni
Posty: 259
Nick w MP: SzokoHD

Piwa: 23

Respekt: 50

Witam m?j problem polega na tym, ?e wywala b??d ?e event nie zosta? dodany po stronie serwera a dla mnie jest w porz?dku. Milion razy analizowa?em kod i nic. Prosz? o pomoc.

function wystawOst(editboxwybor2)
editbox guiGetText(edit)
wybor2 guiGridListGetItemText(grid3guiGridListGetSelectedItem(grid3), 1)
triggerServerEvent("dajUpomn"localPlayereditboxwybor2)
end
addEventHandler("onClientGUIClick"wystaw2wystawOst)


function upomnienie(editboxwybor2)
nick getPlayerFromName(wybor2)
outputChatBox("Otrzyma?e? upomnienie od pracownika FCSD.  Tre??: "..editbox..""nick000true)
end
addEvent("dajUpomn"true)
addEventHandler("dajUpomn"getRootElement(), upomnienie)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-25, 20:55


marcin778

Krytyk serwerów MTA






Wiek: 24
Na forum: 4149 dni
Posty: 2268
Nick w MP: Marcineg

Piwa: 4662

Respekt: 1436,8
Respekt: 1436,8

triggerServerEvent(localPlayer"dajUpomn"localPlayereditboxwybor2)


Podpis
Moje prace: https://www.youtube.com/c...MuaWGHPp1mhlGnw

-- obecnie
-- obecnie
-- dawniej
-- dawniej
-- dawniej
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-25, 21:33


GamerHD11







Wiek: 24
Na forum: 4261 dni
Posty: 259
Nick w MP: SzokoHD

Piwa: 23

Respekt: 50

Nie dzia?a i tak wgl to co poda?e? to raczej ClientEvent.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-25, 22:03


luki123luki123

Place Game






Wiek: 28
Na forum: 5275 dni
Posty: 1948
Nick w MP: LuKiO

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611

GamerHD11, hmm zobacz tak :D
function wystawOst()
    if source == wystaw2 then
        value guiGetText(edit)
        wybor2 guiGridListGetItemText(grid3guiGridListGetSelectedItem(grid3), 1)
            if value and wybor2 then
                triggerServerEvent("dajUpomn"localPlayervaluewybor2)
            end
    end    
end
addEventHandler("onClientGUIClick"wystaw2wystawOst)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-25, 22:09


GamerHD11







Wiek: 24
Na forum: 4261 dni
Posty: 259
Nick w MP: SzokoHD

Piwa: 23

Respekt: 50

Ci?gle ten sam b??d

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-25, 22:12


luki123luki123

Place Game






Wiek: 28
Na forum: 5275 dni
Posty: 1948
Nick w MP: LuKiO

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611

GamerHD11, pokaz b??d.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-25, 22:18


GamerHD11







Wiek: 24
Na forum: 4261 dni
Posty: 259
Nick w MP: SzokoHD

Piwa: 23

Respekt: 50

ERROR: Client (SzokoHD) triggered serverside event cofnijPrzebieg, but event is not added serverside

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-25, 22:19


luki123luki123

Place Game






Wiek: 28
Na forum: 5275 dni
Posty: 1948
Nick w MP: LuKiO

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611

GamerHD11, to nie ten skrpyt xd. Tutaj masz event dajUpomn.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-25, 22:20


GamerHD11







Wiek: 24
Na forum: 4261 dni
Posty: 259
Nick w MP: SzokoHD

Piwa: 23

Respekt: 50

Oj sorry bo mi w dw?ch skryptach to wyskakuje ale ten sam blad

ERROR: Client (SzokoHD) triggered serverside event dajUpomn, but event is not added serverside

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-25, 22:23


luki123luki123

Place Game






Wiek: 28
Na forum: 5275 dni
Posty: 1948
Nick w MP: LuKiO

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611

GamerHD11, wy??cz serwer i w??cz a nast?pnie skrypt.

[ Dodano: 2016-07-25, 22:25 ]
GamerHD11, i zmie? na getLocalPlayer()

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-25, 22:25


GamerHD11







Wiek: 24
Na forum: 4261 dni
Posty: 259
Nick w MP: SzokoHD

Piwa: 23

Respekt: 50

Robi?em tak i nic ;/

[ Dodano: 2016-07-25, 22:25 ]
Ale triggery w innych skryptach dzia?aj? tylko tu nie

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-25, 22:25


luki123luki123

Place Game






Wiek: 28
Na forum: 5275 dni
Posty: 1948
Nick w MP: LuKiO

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611

GamerHD11, i zmie? na getLocalPlayer() w TriggerServerEvent

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-25, 22:26


GamerHD11







Wiek: 24
Na forum: 4261 dni
Posty: 259
Nick w MP: SzokoHD

Piwa: 23

Respekt: 50

Znowu to samo :(

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-25, 22:27


luki123luki123

Place Game






Wiek: 28
Na forum: 5275 dni
Posty: 1948
Nick w MP: LuKiO

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611

GamerHD11, podaj pe?ny kod.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-25, 22:29


GamerHD11







Wiek: 24
Na forum: 4261 dni
Posty: 259
Nick w MP: SzokoHD

Piwa: 23

Respekt: 50

Client:

setElementData(localPlayer"pokazane"false)
screenWscreenH guiGetScreenSize()

function GUI()
dxDrawRectangle(screenW 0.3109screenH 0.2602screenW 0.3786screenH 0.4796tocolor(0180247178), false)
dxDrawRectangle(screenW 0.3109screenH 0.2111screenW 0.3786screenH 0.0491tocolor(0100137178), false)
dxDrawText("Panel FCSD"screenW 0.4203screenH 0.2148screenW 0.7297screenH 0.2509tocolor(255255255255), 1.50"bankgothic""left""top"falsefalsefalsefalsefalse)
dxDrawRectangle(screenW 0.3219screenH 0.3157screenW 0.1526screenH 0.0620tocolor(082113178), false)
dxDrawRectangle(screenW 0.5245screenH 0.3157screenW 0.1526screenH 0.0620tocolor(082113178), false)
dxDrawText("Ostrze?enie"screenW 0.5322screenH 0.3269screenW 0.6604screenH 0.3778tocolor(255255255255), 1.25"bankgothic""left""top"falsefalsefalsefalsefalse)
dxDrawText("Mandat"screenW 0.3563screenH 0.3269screenW 0.4745screenH 0.3778tocolor(255255255255), 1.25"bankgothic""left""top"falsefalsefalsefalsefalse)
dxDrawRectangle(screenW 0.3982screenH 0.6630screenW 0.2035screenH 0.0676tocolor(082113178), false)
dxDrawText("Powr?t"screenW 0.4557screenH 0.6722screenW 0.7651screenH 0.7083tocolor(255255255255), 1.50"bankgothic""left""top"falsefalsefalsefalsefalse)
end

function GUI2()
dxDrawRectangle(screenW 0.3109screenH 0.2602screenW 0.3786screenH 0.4796tocolor(0180247178), false)
dxDrawRectangle(screenW 0.3109screenH 0.2111screenW 0.3786screenH 0.0491tocolor(0100137178), false)
dxDrawText("Panel FCSD"screenW 0.4203screenH 0.2148, (screenW 0.4203) + 594, ( screenH 0.2148) + 39tocolor(255255255255), 1.50"bankgothic""left""top"falsefalsefalsefalsefalse)
dxDrawRectangle(screenW 0.3982screenH 0.6630screenW 0.2035screenH 0.0676tocolor(082113178), false)
dxDrawText("Powr?t"screenW 0.4557screenH 0.6722screenW 0.7651screenH 0.7083tocolor(255255255255), 1.50"bankgothic""left""top"falsefalsefalsefalsefalse)
dxDrawRectangle(screenW 0.5234screenH 0.2806screenW 0.1573screenH 0.0667tocolor(082113178), false)
dxDrawText("Wystaw"screenW 0.5547screenH 0.2852screenW 0.7026screenH 0.3380tocolor(255255255255), 1.50"bankgothic""left""top"falsefalsefalsefalsefalse)
end

function GUI3()
        dxDrawRectangle(screenW 0.3109screenH 0.2602screenW 0.3786screenH 0.4796tocolor(0180247178), false)
        dxDrawRectangle(screenW 0.3109screenH 0.2111screenW 0.3786screenH 0.0491tocolor(0100137178), false)
        dxDrawText("Panel FCSD"screenW 0.4203screenH 0.2148, (screenW 0.4203) + 594, ( screenH 0.2148) + 39tocolor(255255255255), 1.50"bankgothic""left""top"falsefalsefalsefalsefalse)
        dxDrawRectangle(screenW 0.3982screenH 0.663039173tocolor(082113178), false)
        dxDrawText("Powr?t"screenW 0.4557screenH 0.6722, (screenW 0.4557) + 594, ( screenH 0.6722) + 39tocolor(255255255255), 1.50"bankgothic""left""top"falsefalsefalsefalsefalse)
        dxDrawRectangle(screenW 0.5234screenH 0.4074screenW 0.1573screenH 0.0667tocolor(082113178), false)
        dxDrawText("Wystaw"screenW 0.5547screenH 0.4167screenW 0.7026screenH 0.4694tocolor(255255255255), 1.50"bankgothic""left""top"falsefalsefalsefalsefalse)
        dxDrawText("Pow?d"607341717407tocolor(255255255255), 1.50"bankgothic""left""top"falsefalsefalsefalsefalse)
end

-- GUI

mandat guiCreateButton(0.320.320.150.06""true)
guiSetAlpha(mandat0.00)
ostrzez guiCreateButton(0.520.320.150.06""true)
guiSetAlpha(ostrzez0.00)
powrot guiCreateButton(0.320.660.360.07""true)
guiSetAlpha(powrot0.00)

guiSetVisible(mandatfalse)
guiSetVisible(ostrzezfalse)
guiSetVisible(powrotfalse)

-- GUI2

wystaw guiCreateButton(0.520.280.160.07""true)
guiSetAlpha(wystaw0.00)
grid guiCreateGridList(0.320.280.090.37true)
guiGridListAddColumn(grid"Nick Gracza:"0.9)
grid2 guiCreateGridList(0.420.280.090.37true)
guiGridListAddColumn(grid2"Rodzaj"0.5)
guiGridListAddColumn(grid2"Kwota"0.5)
for 1do
guiGridListAddRow(grid2)
end
guiGridListSetItemText(grid201"Jazda pod pr?d"falsefalse)
guiGridListSetItemText(grid202"500 $"falsefalse)
guiGridListSetItemText(grid211"Nieprawid?owe parkowanie"falsefalse)
guiGridListSetItemText(grid212"150 $"falsefalse)
powrot2 guiCreateButton(0.320.660.360.07""true)
guiSetAlpha(powrot20.00)

guiSetVisible(wystawfalse)
guiSetVisible(gridfalse)
guiSetVisible(grid2false)
guiSetVisible(powrot2false)

-- GUI3

wystaw2 guiCreateButton(0.520.410.160.07""true)
guiSetAlpha(wystaw20.00)
powrot3 guiCreateButton(0.400.660.200.07""true)
guiSetAlpha(powrot30.00)
edit guiCreateEdit(0.400.310.280.06""true)
grid3 guiCreateGridList(0.320.420.100.22true)
guiGridListAddColumn(grid3"Nick Gracza:"0.9)    

guiSetVisible(wystaw2false)
guiSetVisible(grid3false)
guiSetVisible(powrot3false)
guiSetVisible(editfalse)

function pokaGUI()
if getElementData(localPlayer"duty") ~= "FCSD" then return end
if getElementData(localPlayer"pokazane") == true then return end
setElementData(localPlayer"pokazane"true)
addEventHandler("onClientRender"getRootElement(), GUI)
guiSetVisible(mandattrue)
guiSetVisible(ostrzeztrue)
guiSetVisible(powrottrue)
showCursor(true)
end
bindKey("F6""down"pokaGUI)

function closeGUI()
removeEventHandler("onClientRender"getRootElement(), GUI)
setElementData(localPlayer"pokazane"false)
guiSetVisible(mandatfalse)
guiSetVisible(ostrzezfalse)
guiSetVisible(powrotfalse)
showCursor(false)
end
addEventHandler("onClientGUIClick"powrotcloseGUI)

function pokaMandat()
removeEventHandler("onClientRender"getRootElement(), GUI)
addEventHandler("onClientRender"getRootElement(), GUI2)
guiSetVisible(wystawtrue)
guiSetVisible(gridtrue)
guiSetVisible(grid2true)
guiSetVisible(powrot2true)
guiSetVisible(mandatfalse)
guiSetVisible(ostrzezfalse)
guiSetVisible(powrotfalse)
for kv in ipairs (getElementsByType("player")) do
local row guiGridListAddRow(grid)
guiGridListSetItemText(gridrow1getPlayerName(v), falsefalse)
end
end
addEventHandler("onClientGUIClick"mandatpokaMandat)

function pokaOst()
removeEventHandler("onClientRender"getRootElement(), GUI)
addEventHandler("onClientRender"getRootElement(), GUI3)
guiSetVisible(wystaw2true)
guiSetVisible(edittrue)
guiSetVisible(powrot3true)
guiSetVisible(grid3true)
guiSetVisible(mandatfalse)
guiSetVisible(ostrzezfalse)
guiSetVisible(powrotfalse)
for kv in ipairs (getElementsByType("player")) do
local row guiGridListAddRow(grid3)
guiGridListSetItemText(grid3row1getPlayerName(v), falsefalse)
end
end
addEventHandler("onClientGUIClick"ostrzezpokaOst)

function pokaGUI2()
guiGridListClear(grid2)
guiGridListClear(grid3)
removeEventHandler("onClientRender"getRootElement(), GUI2)
removeEventHandler("onClientRender"getRootElement(), GUI3)
guiSetVisible(wystawfalse)
guiSetVisible(gridfalse)
guiSetVisible(grid2false)
guiSetVisible(powrot2false)
guiSetVisible(wystaw2false)
guiSetVisible(powrot3false)
guiSetVisible(grid3false)
guiSetVisible(editfalse)
addEventHandler("onClientRender"getRootElement(), GUI)
guiSetVisible(mandattrue)
guiSetVisible(ostrzeztrue)
guiSetVisible(powrottrue)
end
addEventHandler("onClientGUIClick"powrot2pokaGUI2)
addEventHandler("onClientGUIClick"powrot3pokaGUI2)

localPlayer getLocalPlayer()

function wystawOst()
    if source == wystaw2 then
        value guiGetText(edit)
        wybor2 guiGridListGetItemText(grid3guiGridListGetSelectedItem(grid3), 1)
            if value and wybor2 then
                triggerServerEvent("dajUpomn"getLocalPlayer(), valuewybor2)
            end
    end    
end
addEventHandler("onClientGUIClick"wystaw2wystawOst)


Server:

function upomnienie(valuewybor2)
nick getPlayerFromName(wybor2)
outputChatBox("Otrzyma?e? upomnienie od pracownika FCSD.  Tre??: "..value..""nick255255255true)
end
addEvent("dajUpomn"true)
addEventHandler("dajUpomn"getRootElement(), upomnienie)


Postaw piwo autorowi tego posta
 

 
Tagi: triggerserverevent
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku