Wysłany: 2012-10-10, 20:44
luki123luki123
Place Game
Wiek: 28 Na forum: 5275 dni Posty: 1948
Nick w MP: LuKiO
Piwa : 6101
Problem :
Klinet:
x , y = guiGetScreenSize ()
function ininstall ()
Zapis_Window = guiCreateWindow (( x / 2 )- 150 ,( y / 2 )- 200 , 300 , 400 , "Panel San-News" , false )
guiSetAlpha ( Zapis_Window , 255 )
radio_bug = guiCreateRadioButton ( 0.1 , 0.04 , 0.4 , 0.1 , "Wydarzenia" , true , Zapis_Window )
radio_idea = guiCreateRadioButton ( 0.4 , 0.04 , 0.4 , 0.1 , "Z Wysig?w" , true , Zapis_Window )
radio_question = guiCreateRadioButton ( 0.7 , 0.04 , 0.4 , 0.1 , "Z Adminami" , true , Zapis_Window )
guiRadioButtonSetSelected ( radio_idea , true )
main_memo = guiCreateMemo ( 0.05 , 0.15 , 0.92 , 0.605 , "Napisz tu co sie staÓŻ" , true , Zapis_Window )
zapis_memo = guiCreateMemo ( 0.0467 , 0.765 , 0.92 , 0.14 , "" , true , Zapis_Window )
button_send = guiCreateButton ( 0.15 , 0.93 , 0.3 , 0.05 , "Zapisz!" , true , Zapis_Window )
button_cancel = guiCreateButton ( 0.55 , 0.93 , 0.3 , 0.05 , "Wyjdz" , true , Zapis_Window )
guiSetVisible ( Zapis_Window , false )
addEventHandler ( "onClientGUIClick" , button_send ,function()
if button_send == source then
send ()
end
end )
addEventHandler ( "onClientGUIClick" , button_cancel ,function()
if button_cancel == source then
cancel ()
guiSetVisible ( Zapis_Window , false )
end
end )
end
addEventHandler ( "onClientResourceStart" , getRootElement (), ininstall )
function visible ()
if guiGetVisible ( Zapis_Window )== true then
showChat ( true )
showCursor ( false )
guiSetVisible ( Zapis_Window , false )
else
showChat ( false )
showCursor ( true )
guiSetVisible ( Zapis_Window , true )
end
end
addCommandHandler ( "R" , visible )
function send ()
text = guiGetText ( main_memo )
memo = guiGetText ( zapis_memo )
if ( guiRadioButtonGetSelected ( radio_bug )) then
art = "Wydarzenie Spotowe"
elseif ( guiRadioButtonGetSelected ( radio_idea )) then
art = "Ruzne wydarzenia"
elseif ( guiRadioButtonGetSelected ( radio_question )) then
art = "Z Adminami"
end
triggerServerEvent ( "send" , getLocalPlayer (), getLocalPlayer (), text , memo , art )
visible ()
end
function cancel ()
visible ()
end
Serwer:
addEvent ( "send" , true )
function send ( player , text , art , memo )
filename = "Raport/" .. tostring ( art ).. " - " .. tostring ( memo ).. " - " .. tostring ( getPlayerName ( player )).. ".xml"
RootNode = xmlCreateFile ( tostring ( filename ), "Raport" )
NewNode = xmlCreateChild ( RootNode , "Text" )
xmlNodeSetValue ( NewNode , text )
xmlSaveFile ( RootNode )
end
addEventHandler ( "send" , getRootElement (), send )
B??d :
xmlCreateChild
xmlNodeSetValue
xmlSaveFile
Wysłany: 2012-10-11, 16:10
Piorun
Wiek: 32 Na forum: 6712 dni Posty: 1837
Nick w MP: Piorun
Piwa : 516
Nie zapominaj o "local" przed zmiennymi, bo potem mo?esz sobie bajzlu narobi?.
Nie sprawdza?em ca?o?ci ale masz pomieszane argumenty tutaj:
triggerServerEvent ( "send" , getLocalPlayer (), getLocalPlayer (), text , memo , art )
w stosunku do
function send ( player , text , art , memo )
Wysłany: 2012-10-11, 18:59
luki123luki123
Place Game
Wiek: 28 Na forum: 5275 dni Posty: 1948
Nick w MP: LuKiO
Piwa : 6101
Wysłany: 2012-10-11, 19:02
Riot
3X
Wiek: 29 Na forum: 5729 dni Posty: 1123
Nick w MP: Riot/3X
Piwa : 286
"luki123luki123" napisał/a :
Przet?umacz teraz to zdanie na j?zyk polski, bo masz z tym wyra?ny problem.
Sprawdza?e? to co podes?a? Ci Piorun?
Kolejno?? argument?w musi by? taka sama, jak dajesz j? w triggerze.
Wysłany: 2012-10-11, 19:08
luki123luki123
Place Game
Wiek: 28 Na forum: 5275 dni Posty: 1948
Nick w MP: LuKiO
Piwa : 6101
Serwer :
addEvent ( "send" , true )
function send ( player , text , art , memo )
filename = "Raport/" .. tostring ( art ).. " - " .. tostring ( memo ).. " - " .. tostring ( getPlayerName ( player )).. ".xml"
RootNode = xmlCreateFile ( tostring ( filename ), "Raport" )
NewNode = xmlCreateChild ( RootNode , "Text" )
xmlNodeSetValue ( NewNode , text )
xmlSaveFile ( RootNode )
end
addEventHandler ( "send" , getRootElement (), send )
Klinet :
function send ()
text = guiGetText ( main_memo )
memo = guiGetText ( zapis_memo )
if ( guiRadioButtonGetSelected ( radio_bug )) then
art = "Wydarzenie Spotowe"
elseif ( guiRadioButtonGetSelected ( radio_idea )) then
art = "Ruzne wydarzenia"
elseif ( guiRadioButtonGetSelected ( radio_question )) then
art = "Z Adminami"
end
triggerServerEvent ( "send" , getLocalPlayer (), getLocalPlayer (), text , art , getLocalPlayer (), memo )
visible ()
end
Tagi: san :: news
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: