KruTolic_rus Posted June 9, 2013 Share Posted June 9, 2013 (edited) Добрый день,возникла проблема,а точнее: несколько. 1.Дэбаг ругается на : "Client triggered severside event,but event isn't added severside" Как я понимаю,проблема на серверной стороне,однако вроде как "добавлен эвент" function ServerMission () outputChatBox ( "Mission 1 has been started!", source,true ) end addEvent( "MissionStartFirst", true ) addEventHandler( "MissionStartFirst", getRootElement(), ServerMission ) ---------------------------------------------------------------------------------------- function ServerMission2 () outputChatBox ( "Mission 2 has been started!", source,true ) end addEvent( "MissionSecoundStart", true ) addEventHandler( "MissionSecoundStart", getRootElement(), ServerMission2 ) ---------------------------------------------------------------------------------------- function DefendZoneMission () outputChatBox ( "Mission 3 has been started!", source,true ) end addEvent( "DefendZoneMission", true ) addEventHandler( "DefendZoneMission", getRootElement(), DefendZoneMission ) Но все-таки я кину и клиент... MissionStartSource = createMarker ( 210.38717651367, 1921.611328125, 18, "cylinder" ) GUIEditor = { button = {}, window = {} } addEventHandler("onClientMarkerHit", MissionStartSource , function() GUIEditor.window[1] = guiCreateWindow(0.32, 0.20, 0.35, 0.61, "Mission List", true) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.button[1] = guiCreateButton(21, 37, 402, 44, "Mission 1.Transport", false, GUIEditor.window[1]) GUIEditor.button[2] = guiCreateButton(118, 98, 212, 65, "Mission 2.Capture territority(GLOBAL!)", false, GUIEditor.window[1]) GUIEditor.button[3] = guiCreateButton(15, 185, 408, 49, "Mission 3.Defend Zone 51", false, GUIEditor.window[1]) GUIEditor.button[4] = guiCreateButton(25, 400, 20, 20, "x", false, GUIEditor.window[1]) showCursor ( true ) addEventHandler("onClientGUIClick", GUIEditor.button[2] , TerritorityMission , false ) addEventHandler("onClientGUIClick", GUIEditor.button[3] , DefendZoneMission , false ) addEventHandler("onClientGUIClick", GUIEditor.button[1] , TransportMissionTrigger, false ) addEvent ( "MissionSecoundStart",true ) addEvent ( "MissionStartFirst",true ) addEvent ( "DefendZoneMission",true ) end ) function TransportMissionTrigger () showCursor ( false ) triggerServerEvent ( "MissionStartFirst", getLocalPlayer()) guiSetVisible ( GUIEditor.window[1],false ) end -------------------------------------------------------------------------------------------------------------- function TerritorityMission () showCursor ( false ) triggerServerEvent ( "MissionSecoundStart", getLocalPlayer()) guiSetVisible ( GUIEditor.window[1],false) end --------------------------------------------------------------------------------------------------------------- function DefendZoneMission () showCursor ( false ) triggerServerEvent ( "DefendZoneMission", getLocalPlayer()) guiSetVisible ( GUIEditor.window[1],false ) end --------------------------------------------------------------------------------------------------------------- function CloseWindow () showCursor ( false ) guiSetVisible ( GUIEditor.window[1],false ) end addEventHandler("onClientGUIClick", GUIEditor.button[4] , CloseWindow , false ) А и еще,у меня почему то,не хочет закрыватся окошко,потому что ругается на GUIEditor.button[4] ,типо Bad Argument... HELP ME,SOS! Edited June 10, 2013 by Guest Link to comment
Memory Posted June 9, 2013 Share Posted June 9, 2013 (edited) Я думаю ошибка всё-таки на клиенте, попробуй так MissionStartSource = createMarker ( 210.38717651367, 1921.611328125, 18, "cylinder" ) GUIEditor = { button = {}, window = {} } addEventHandler("onClientMarkerHit", MissionStartSource , function() GUIEditor.window[1] = guiCreateWindow(0.32, 0.20, 0.35, 0.61, "Mission List", true) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.button[1] = guiCreateButton(21, 37, 402, 44, "Mission 1.Transport", false, GUIEditor.window[1]) GUIEditor.button[2] = guiCreateButton(118, 98, 212, 65, "Mission 2.Capture territority(GLOBAL!)", false, GUIEditor.window[1]) GUIEditor.button[3] = guiCreateButton(15, 185, 408, 49, "Mission 3.Defend Zone 51", false, GUIEditor.window[1]) GUIEditor.button[4] = guiCreateButton(25, 400, 20, 20, "x", false, GUIEditor.window[1]) showCursor ( true ) addEventHandler ("onClientGUIClick", getRootElement(), onButtonClick) end ) function onButtonClick (button, state) if (source == GUIEditor.button[1]) then showCursor ( false ) triggerServerEvent ( "MissionStartFirst", getLocalPlayer()) guiSetVisible ( GUIEditor.window[1],false ) end if (source == GUIEditor.button[2]) then showCursor ( false ) triggerServerEvent ( "DefendZoneMission", getLocalPlayer()) guiSetVisible ( GUIEditor.window[1],false ) end if (source == GUIEditor.button[3]) then showCursor ( false ) triggerServerEvent ( "DefendZoneMission", getLocalPlayer()) guiSetVisible ( GUIEditor.window[1],false ) end if (source == GUIEditor.button[4]) then showCursor ( false ) guiSetVisible ( GUIEditor.window[1],false ) end end Edited June 10, 2013 by Guest Link to comment
Ruga Posted June 9, 2013 Share Posted June 9, 2013 боюсь спросить, а в мета файл как серверный прописали? Link to comment
KruTolic_rus Posted June 10, 2013 Author Share Posted June 10, 2013 боюсь спросить, а в мета файл как серверный прописали? Ишь,ты смотри! Менял так и сяк весь свой скрипт,ломал свою голову 3 часа,потратил время людей из форума,зато проблема оказалась в МЕТА файле...Действительно,на сервере стоял тип : клиент... Link to comment
Ruga Posted June 10, 2013 Share Posted June 10, 2013 ну вот)) просто внимательнее к ошибкам они сами о себе много говорят)) Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now