Wei Posted April 22, 2012 Posted April 22, 2012 Whats the problem it doesn't open the window: client: addEvent ( "myevent", true ) function onmarkerhitevent () guiSetVisible( window, true ) end addEventHandler ( "myevent", onmarkerhitevent ) server: cmarker = createMarker (2069.53760, -1628.82056, 12.87616, "cylinder", 2, 255, 255, 0, 50 ) function jup() triggerClientEvent(myevent) end addEventHandler("onMarkerHit", cmarker, jup) Diet with russian vodka, lose 3 days in one week !
Kenix Posted April 22, 2012 Posted April 22, 2012 (edited) triggerClientEvent(myevent) lolwhat? Did you read arguments? Edited April 22, 2012 by Guest http://vk.com/the_kenix Вопросы задавайте на форуме, не пишите мне в личку. Please don't pm me.
Smart. Posted April 22, 2012 Posted April 22, 2012 try, server: cmarker = createMarker (2069.53760, -1628.82056, 12.87616, "cylinder", 2, 255, 255, 0, 50 ) function jup() triggerClientEvent( "myevent", source) -- you need to read the arguments kenix said. end addEventHandler("onMarkerHit", cmarker, jup) lol
Kenix Posted April 22, 2012 Posted April 22, 2012 seb:>, wrong. It's triggered for all players. I think he not needed it. http://vk.com/the_kenix Вопросы задавайте на форуме, не пишите мне в личку. Please don't pm me.
Wei Posted April 22, 2012 Author Posted April 22, 2012 doesn't work. Diet with russian vodka, lose 3 days in one week !
Kenix Posted April 22, 2012 Posted April 22, 2012 Did you create and define window? Also use /debugscript 3 and make your marker little upper + ~2 ( for test ).( because if your marker below ground, event not triggered ( "onMarkerHit" ) ) http://vk.com/the_kenix Вопросы задавайте на форуме, не пишите мне в личку. Please don't pm me.
Michael# Posted April 22, 2012 Posted April 22, 2012 local cmarker = createMarker ( 2069.53760, -1628.82056, 12.87616, "cylinder", 2, 255, 255, 0, 50 ) addEventHandler ( 'onClientMarkerHit', root, function ( uPlayer ) if ( source == cmarker ) then guiSetVisible ( window, true ) end end )
Smart. Posted April 22, 2012 Posted April 22, 2012 Helped him over skype, the problem was he had button5 = guiCreateButton(236,104,211,71,"Minigun" /n/ "6000$",false,window) where it's supposed to be button5 = guiCreateButton(236,104,211,71,"Minigun\n6000$",false,window) lol
Kenix Posted April 22, 2012 Posted April 22, 2012 local uMarker = createMarker ( 2069.53760, -1628.82056, 12.87616, "cylinder", 2, 255, 255, 0, 50 ) addEventHandler ( 'onClientMarkerHit', uMarker, function ( uPlayer ) if uPlayer == localPlayer then guiSetVisible ( window, true ) end end ) http://vk.com/the_kenix Вопросы задавайте на форуме, не пишите мне в личку. Please don't pm me.
Wei Posted April 22, 2012 Author Posted April 22, 2012 (edited) - Edited April 23, 2012 by Guest Diet with russian vodka, lose 3 days in one week !
Kenix Posted April 22, 2012 Posted April 22, 2012 (edited) You not add handlers for this buttons. Instand of this function buttonClick(button) if (button) ~= "left" then return end if (source == close) then guiSetVisible ( window, false ) showCursor ( false) end end addEventHandler("onClientGUIClick", resourceRoot, buttonClick, true) function buttonlick() if (source == button1) then triggerServerEvent ( "event1", localPlayer ) else if (source == button2) then triggerServerEvent ( "event2", localPlayer ) else if (source == button3) then triggerServerEvent ( "event3", localPlayer ) else if (source == button4) then triggerServerEvent ( "event4", localPlayer ) else if (source == button5) then triggerServerEvent ( "event5", localPlayer ) else if (source == button6) then triggerServerEvent ( "event6", localPlayer ) else if (source == button7) then triggerServerEvent ( "event7", localPlayer ) end end end end end end end end You need make this function fButtonClick( ) if source == button1 then triggerServerEvent ( 'event1', localPlayer ) elseif source == button2 then triggerServerEvent ( 'event2', localPlayer ) elseif source == button3 then triggerServerEvent ( 'event3', localPlayer ) elseif source == button4 then triggerServerEvent ( 'event4', localPlayer ) elseif source == button5 then triggerServerEvent ( 'event5', localPlayer ) elseif source == button6 then triggerServerEvent ( 'event6', localPlayer ) elseif source == button7 then triggerServerEvent ( 'event7', localPlayer ) elseif source == close then guiSetVisible ( window, false ) showCursor ( false ) end end addEventHandler( 'onClientGUIClick', guiRoot, fButtonClick ) Edited April 22, 2012 by Guest http://vk.com/the_kenix Вопросы задавайте на форуме, не пишите мне в личку. Please don't pm me.
Castillo Posted April 22, 2012 Posted April 22, 2012 @server side: Change "client" to "source" at giveWeapon. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Wei Posted April 22, 2012 Author Posted April 22, 2012 how can I do that. Can you show me example ? @Solidsnake Same Edit: Kenix works thanks ! Diet with russian vodka, lose 3 days in one week !
Castillo Posted April 22, 2012 Posted April 22, 2012 Is that hard to find and replace? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Kenix Posted April 22, 2012 Posted April 22, 2012 (edited) Edit: Kenix works thanks ! No problem. Edited April 22, 2012 by Guest http://vk.com/the_kenix Вопросы задавайте на форуме, не пишите мне в личку. Please don't pm me.
Castillo Posted April 22, 2012 Posted April 22, 2012 Oh, my bad, I forgot about that. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Wei Posted April 22, 2012 Author Posted April 22, 2012 Is that hard to find and replace? I said that to kenix. He edited he's post... Diet with russian vodka, lose 3 days in one week !
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