Wysłany: 2016-07-25, 16:34
GamerHD11
Wiek: 24 Na forum: 4261 dni Posty: 259
Nick w MP: SzokoHD
Piwa : 23
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 ( editbox , wybor2 )
editbox = guiGetText ( edit )
wybor2 = guiGridListGetItemText ( grid3 , guiGridListGetSelectedItem ( grid3 ), 1 )
triggerServerEvent ( "dajUpomn" , localPlayer , editbox , wybor2 )
end
addEventHandler ( "onClientGUIClick" , wystaw2 , wystawOst )
function upomnienie ( editbox , wybor2 )
nick = getPlayerFromName ( wybor2 )
outputChatBox ( "Otrzyma?e? upomnienie od pracownika FCSD. Tre??: " .. editbox .. "" , nick , 0 , 0 , 0 , true )
end
addEvent ( "dajUpomn" , true )
addEventHandler ( "dajUpomn" , getRootElement (), upomnienie )
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
triggerServerEvent ( localPlayer , "dajUpomn" , localPlayer , editbox , wybor2 )
Wysłany: 2016-07-25, 21:33
GamerHD11
Wiek: 24 Na forum: 4261 dni Posty: 259
Nick w MP: SzokoHD
Piwa : 23
Nie dzia?a i tak wgl to co poda?e? to raczej ClientEvent.
Wysłany: 2016-07-25, 22:03
luki123luki123
Place Game
Wiek: 28 Na forum: 5275 dni Posty: 1948
Nick w MP: LuKiO
Piwa : 6101
GamerHD11 , hmm zobacz tak
function wystawOst ()
if source == wystaw2 then
value = guiGetText ( edit )
wybor2 = guiGridListGetItemText ( grid3 , guiGridListGetSelectedItem ( grid3 ), 1 )
if value and wybor2 then
triggerServerEvent ( "dajUpomn" , localPlayer , value , wybor2 )
end
end
end
addEventHandler ( "onClientGUIClick" , wystaw2 , wystawOst )
Wysłany: 2016-07-25, 22:09
GamerHD11
Wiek: 24 Na forum: 4261 dni Posty: 259
Nick w MP: SzokoHD
Piwa : 23
Wysłany: 2016-07-25, 22:12
luki123luki123
Place Game
Wiek: 28 Na forum: 5275 dni Posty: 1948
Nick w MP: LuKiO
Piwa : 6101
Wysłany: 2016-07-25, 22:18
GamerHD11
Wiek: 24 Na forum: 4261 dni Posty: 259
Nick w MP: SzokoHD
Piwa : 23
ERROR: Client (SzokoHD) triggered serverside event cofnijPrzebieg, but event is not added serverside
Wysłany: 2016-07-25, 22:19
luki123luki123
Place Game
Wiek: 28 Na forum: 5275 dni Posty: 1948
Nick w MP: LuKiO
Piwa : 6101
GamerHD11 , to nie ten skrpyt xd. Tutaj masz event dajUpomn.
Wysłany: 2016-07-25, 22:20
GamerHD11
Wiek: 24 Na forum: 4261 dni Posty: 259
Nick w MP: SzokoHD
Piwa : 23
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
Wysłany: 2016-07-25, 22:23
luki123luki123
Place Game
Wiek: 28 Na forum: 5275 dni Posty: 1948
Nick w MP: LuKiO
Piwa : 6101
GamerHD11 , wy??cz serwer i w??cz a nast?pnie skrypt.
[ Dodano : 2016-07-25, 22:25 ]
GamerHD11 , i zmie? na getLocalPlayer()
Wysłany: 2016-07-25, 22:25
GamerHD11
Wiek: 24 Na forum: 4261 dni Posty: 259
Nick w MP: SzokoHD
Piwa : 23
Robi?em tak i nic ;/
[ Dodano : 2016-07-25, 22:25 ]
Ale triggery w innych skryptach dzia?aj? tylko tu nie
Wysłany: 2016-07-25, 22:25
luki123luki123
Place Game
Wiek: 28 Na forum: 5275 dni Posty: 1948
Nick w MP: LuKiO
Piwa : 6101
GamerHD11, i zmie? na getLocalPlayer() w TriggerServerEvent
Wysłany: 2016-07-25, 22:26
GamerHD11
Wiek: 24 Na forum: 4261 dni Posty: 259
Nick w MP: SzokoHD
Piwa : 23
Znowu to samo
Wysłany: 2016-07-25, 22:27
luki123luki123
Place Game
Wiek: 28 Na forum: 5275 dni Posty: 1948
Nick w MP: LuKiO
Piwa : 6101
GamerHD11 , podaj pe?ny kod.
Wysłany: 2016-07-25, 22:29
GamerHD11
Wiek: 24 Na forum: 4261 dni Posty: 259
Nick w MP: SzokoHD
Piwa : 23
Client:
setElementData ( localPlayer , "pokazane" , false )
screenW , screenH = guiGetScreenSize ()
function GUI ()
dxDrawRectangle ( screenW * 0.3109 , screenH * 0.2602 , screenW * 0.3786 , screenH * 0.4796 , tocolor ( 0 , 180 , 247 , 178 ), false )
dxDrawRectangle ( screenW * 0.3109 , screenH * 0.2111 , screenW * 0.3786 , screenH * 0.0491 , tocolor ( 0 , 100 , 137 , 178 ), false )
dxDrawText ( "Panel FCSD" , screenW * 0.4203 , screenH * 0.2148 , screenW * 0.7297 , screenH * 0.2509 , tocolor ( 255 , 255 , 255 , 255 ), 1.50 , "bankgothic" , "left" , "top" , false , false , false , false , false )
dxDrawRectangle ( screenW * 0.3219 , screenH * 0.3157 , screenW * 0.1526 , screenH * 0.0620 , tocolor ( 0 , 82 , 113 , 178 ), false )
dxDrawRectangle ( screenW * 0.5245 , screenH * 0.3157 , screenW * 0.1526 , screenH * 0.0620 , tocolor ( 0 , 82 , 113 , 178 ), false )
dxDrawText ( "Ostrze?enie" , screenW * 0.5322 , screenH * 0.3269 , screenW * 0.6604 , screenH * 0.3778 , tocolor ( 255 , 255 , 255 , 255 ), 1.25 , "bankgothic" , "left" , "top" , false , false , false , false , false )
dxDrawText ( "Mandat" , screenW * 0.3563 , screenH * 0.3269 , screenW * 0.4745 , screenH * 0.3778 , tocolor ( 255 , 255 , 255 , 255 ), 1.25 , "bankgothic" , "left" , "top" , false , false , false , false , false )
dxDrawRectangle ( screenW * 0.3982 , screenH * 0.6630 , screenW * 0.2035 , screenH * 0.0676 , tocolor ( 0 , 82 , 113 , 178 ), false )
dxDrawText ( "Powr?t" , screenW * 0.4557 , screenH * 0.6722 , screenW * 0.7651 , screenH * 0.7083 , tocolor ( 255 , 255 , 255 , 255 ), 1.50 , "bankgothic" , "left" , "top" , false , false , false , false , false )
end
function GUI2 ()
dxDrawRectangle ( screenW * 0.3109 , screenH * 0.2602 , screenW * 0.3786 , screenH * 0.4796 , tocolor ( 0 , 180 , 247 , 178 ), false )
dxDrawRectangle ( screenW * 0.3109 , screenH * 0.2111 , screenW * 0.3786 , screenH * 0.0491 , tocolor ( 0 , 100 , 137 , 178 ), false )
dxDrawText ( "Panel FCSD" , screenW * 0.4203 , screenH * 0.2148 , ( screenW * 0.4203 ) + 594 , ( screenH * 0.2148 ) + 39 , tocolor ( 255 , 255 , 255 , 255 ), 1.50 , "bankgothic" , "left" , "top" , false , false , false , false , false )
dxDrawRectangle ( screenW * 0.3982 , screenH * 0.6630 , screenW * 0.2035 , screenH * 0.0676 , tocolor ( 0 , 82 , 113 , 178 ), false )
dxDrawText ( "Powr?t" , screenW * 0.4557 , screenH * 0.6722 , screenW * 0.7651 , screenH * 0.7083 , tocolor ( 255 , 255 , 255 , 255 ), 1.50 , "bankgothic" , "left" , "top" , false , false , false , false , false )
dxDrawRectangle ( screenW * 0.5234 , screenH * 0.2806 , screenW * 0.1573 , screenH * 0.0667 , tocolor ( 0 , 82 , 113 , 178 ), false )
dxDrawText ( "Wystaw" , screenW * 0.5547 , screenH * 0.2852 , screenW * 0.7026 , screenH * 0.3380 , tocolor ( 255 , 255 , 255 , 255 ), 1.50 , "bankgothic" , "left" , "top" , false , false , false , false , false )
end
function GUI3 ()
dxDrawRectangle ( screenW * 0.3109 , screenH * 0.2602 , screenW * 0.3786 , screenH * 0.4796 , tocolor ( 0 , 180 , 247 , 178 ), false )
dxDrawRectangle ( screenW * 0.3109 , screenH * 0.2111 , screenW * 0.3786 , screenH * 0.0491 , tocolor ( 0 , 100 , 137 , 178 ), false )
dxDrawText ( "Panel FCSD" , screenW * 0.4203 , screenH * 0.2148 , ( screenW * 0.4203 ) + 594 , ( screenH * 0.2148 ) + 39 , tocolor ( 255 , 255 , 255 , 255 ), 1.50 , "bankgothic" , "left" , "top" , false , false , false , false , false )
dxDrawRectangle ( screenW * 0.3982 , screenH * 0.6630 , 391 , 73 , tocolor ( 0 , 82 , 113 , 178 ), false )
dxDrawText ( "Powr?t" , screenW * 0.4557 , screenH * 0.6722 , ( screenW * 0.4557 ) + 594 , ( screenH * 0.6722 ) + 39 , tocolor ( 255 , 255 , 255 , 255 ), 1.50 , "bankgothic" , "left" , "top" , false , false , false , false , false )
dxDrawRectangle ( screenW * 0.5234 , screenH * 0.4074 , screenW * 0.1573 , screenH * 0.0667 , tocolor ( 0 , 82 , 113 , 178 ), false )
dxDrawText ( "Wystaw" , screenW * 0.5547 , screenH * 0.4167 , screenW * 0.7026 , screenH * 0.4694 , tocolor ( 255 , 255 , 255 , 255 ), 1.50 , "bankgothic" , "left" , "top" , false , false , false , false , false )
dxDrawText ( "Pow?d" , 607 , 341 , 717 , 407 , tocolor ( 255 , 255 , 255 , 255 ), 1.50 , "bankgothic" , "left" , "top" , false , false , false , false , false )
end
-- GUI
mandat = guiCreateButton ( 0.32 , 0.32 , 0.15 , 0.06 , "" , true )
guiSetAlpha ( mandat , 0.00 )
ostrzez = guiCreateButton ( 0.52 , 0.32 , 0.15 , 0.06 , "" , true )
guiSetAlpha ( ostrzez , 0.00 )
powrot = guiCreateButton ( 0.32 , 0.66 , 0.36 , 0.07 , "" , true )
guiSetAlpha ( powrot , 0.00 )
guiSetVisible ( mandat , false )
guiSetVisible ( ostrzez , false )
guiSetVisible ( powrot , false )
-- GUI2
wystaw = guiCreateButton ( 0.52 , 0.28 , 0.16 , 0.07 , "" , true )
guiSetAlpha ( wystaw , 0.00 )
grid = guiCreateGridList ( 0.32 , 0.28 , 0.09 , 0.37 , true )
guiGridListAddColumn ( grid , "Nick Gracza:" , 0.9 )
grid2 = guiCreateGridList ( 0.42 , 0.28 , 0.09 , 0.37 , true )
guiGridListAddColumn ( grid2 , "Rodzaj" , 0.5 )
guiGridListAddColumn ( grid2 , "Kwota" , 0.5 )
for i = 1 , 2 do
guiGridListAddRow ( grid2 )
end
guiGridListSetItemText ( grid2 , 0 , 1 , "Jazda pod pr?d" , false , false )
guiGridListSetItemText ( grid2 , 0 , 2 , "500 $" , false , false )
guiGridListSetItemText ( grid2 , 1 , 1 , "Nieprawid?owe parkowanie" , false , false )
guiGridListSetItemText ( grid2 , 1 , 2 , "150 $" , false , false )
powrot2 = guiCreateButton ( 0.32 , 0.66 , 0.36 , 0.07 , "" , true )
guiSetAlpha ( powrot2 , 0.00 )
guiSetVisible ( wystaw , false )
guiSetVisible ( grid , false )
guiSetVisible ( grid2 , false )
guiSetVisible ( powrot2 , false )
-- GUI3
wystaw2 = guiCreateButton ( 0.52 , 0.41 , 0.16 , 0.07 , "" , true )
guiSetAlpha ( wystaw2 , 0.00 )
powrot3 = guiCreateButton ( 0.40 , 0.66 , 0.20 , 0.07 , "" , true )
guiSetAlpha ( powrot3 , 0.00 )
edit = guiCreateEdit ( 0.40 , 0.31 , 0.28 , 0.06 , "" , true )
grid3 = guiCreateGridList ( 0.32 , 0.42 , 0.10 , 0.22 , true )
guiGridListAddColumn ( grid3 , "Nick Gracza:" , 0.9 )
guiSetVisible ( wystaw2 , false )
guiSetVisible ( grid3 , false )
guiSetVisible ( powrot3 , false )
guiSetVisible ( edit , false )
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 ( mandat , true )
guiSetVisible ( ostrzez , true )
guiSetVisible ( powrot , true )
showCursor ( true )
end
bindKey ( "F6" , "down" , pokaGUI )
function closeGUI ()
removeEventHandler ( "onClientRender" , getRootElement (), GUI )
setElementData ( localPlayer , "pokazane" , false )
guiSetVisible ( mandat , false )
guiSetVisible ( ostrzez , false )
guiSetVisible ( powrot , false )
showCursor ( false )
end
addEventHandler ( "onClientGUIClick" , powrot , closeGUI )
function pokaMandat ()
removeEventHandler ( "onClientRender" , getRootElement (), GUI )
addEventHandler ( "onClientRender" , getRootElement (), GUI2 )
guiSetVisible ( wystaw , true )
guiSetVisible ( grid , true )
guiSetVisible ( grid2 , true )
guiSetVisible ( powrot2 , true )
guiSetVisible ( mandat , false )
guiSetVisible ( ostrzez , false )
guiSetVisible ( powrot , false )
for k , v in ipairs ( getElementsByType ( "player" )) do
local row = guiGridListAddRow ( grid )
guiGridListSetItemText ( grid , row , 1 , getPlayerName ( v ), false , false )
end
end
addEventHandler ( "onClientGUIClick" , mandat , pokaMandat )
function pokaOst ()
removeEventHandler ( "onClientRender" , getRootElement (), GUI )
addEventHandler ( "onClientRender" , getRootElement (), GUI3 )
guiSetVisible ( wystaw2 , true )
guiSetVisible ( edit , true )
guiSetVisible ( powrot3 , true )
guiSetVisible ( grid3 , true )
guiSetVisible ( mandat , false )
guiSetVisible ( ostrzez , false )
guiSetVisible ( powrot , false )
for k , v in ipairs ( getElementsByType ( "player" )) do
local row = guiGridListAddRow ( grid3 )
guiGridListSetItemText ( grid3 , row , 1 , getPlayerName ( v ), false , false )
end
end
addEventHandler ( "onClientGUIClick" , ostrzez , pokaOst )
function pokaGUI2 ()
guiGridListClear ( grid2 )
guiGridListClear ( grid3 )
removeEventHandler ( "onClientRender" , getRootElement (), GUI2 )
removeEventHandler ( "onClientRender" , getRootElement (), GUI3 )
guiSetVisible ( wystaw , false )
guiSetVisible ( grid , false )
guiSetVisible ( grid2 , false )
guiSetVisible ( powrot2 , false )
guiSetVisible ( wystaw2 , false )
guiSetVisible ( powrot3 , false )
guiSetVisible ( grid3 , false )
guiSetVisible ( edit , false )
addEventHandler ( "onClientRender" , getRootElement (), GUI )
guiSetVisible ( mandat , true )
guiSetVisible ( ostrzez , true )
guiSetVisible ( powrot , true )
end
addEventHandler ( "onClientGUIClick" , powrot2 , pokaGUI2 )
addEventHandler ( "onClientGUIClick" , powrot3 , pokaGUI2 )
localPlayer = getLocalPlayer ()
function wystawOst ()
if source == wystaw2 then
value = guiGetText ( edit )
wybor2 = guiGridListGetItemText ( grid3 , guiGridListGetSelectedItem ( grid3 ), 1 )
if value and wybor2 then
triggerServerEvent ( "dajUpomn" , getLocalPlayer (), value , wybor2 )
end
end
end
addEventHandler ( "onClientGUIClick" , wystaw2 , wystawOst )
Server:
function upomnienie ( value , wybor2 )
nick = getPlayerFromName ( wybor2 )
outputChatBox ( "Otrzyma?e? upomnienie od pracownika FCSD. Tre??: " .. value .. "" , nick , 255 , 255 , 255 , true )
end
addEvent ( "dajUpomn" , true )
addEventHandler ( "dajUpomn" , getRootElement (), upomnienie )
Tagi: triggerserverevent
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: