AL-SAYED Posted November 21, 2012 Share Posted November 21, 2012 function onImageClick() if source == policeImage then triggerServerEvent("setTeam", localPlayer, "police") playSound("1.mp3") elseif source == groveImage then triggerServerEvent("setTeam", localPlayer, "grove") playSound("2.mp3") elseif source == ballasImage then triggerServerEvent("setTeam", localPlayer, "ballas") playSound("3.mp3") end ابغيه لذا ضغط على الفريق يطلع ساوند محدد واذا راح الفريق الثاني ساوند مجدد Link to comment
3NAD Posted November 21, 2012 Share Posted November 21, 2012 طيب وين المشكلة بالكود السابق ؟ Link to comment
AL-SAYED Posted November 21, 2012 Author Share Posted November 21, 2012 اذا انتقل لفريق الثاني ما يوقف الساوند الاول يشتغل مع الثاني Link to comment
AL-SAYED Posted November 21, 2012 Author Share Posted November 21, 2012 احطه معه الكود يعني function onImageClick() if source == policeImage then triggerServerEvent("setTeam", localPlayer, "police") playSound("1.mp3") elseif source == groveImage then triggerServerEvent("setTeam", localPlayer, "grove") stopSound( "1.mp3" ) playSound("2.mp3") elseif source == ballasImage then triggerServerEvent("setTeam", localPlayer, "ballas") playSound("3.mp3") end ما صار Link to comment
./BlackBird# Posted November 21, 2012 Share Posted November 21, 2012 جرب ذذ function stopAllSounds() stopSound(sound1) stopSound(sound2) stopSound(sound3) end function onImageClick() if source == policeImage then triggerServerEvent("setTeam", localPlayer, "police") stopAllSounds() sound1 = playSound("1.mp3") elseif source == groveImage then triggerServerEvent("setTeam", localPlayer, "grove") stopAllSounds() sound2 = playSound("2.mp3") elseif source == ballasImage then triggerServerEvent("setTeam", localPlayer, "ballas") stopAllSounds() sound3 = playSound("3.mp3") end Link to comment
AL-SAYED Posted November 21, 2012 Author Share Posted November 21, 2012 ذا يصير الكل يبتدون مع بعض اذا تضغط على فريق Link to comment
|Mr|-Talal07-| Posted November 21, 2012 Share Posted November 21, 2012 اول شي كودك انت ناسي end Link to comment
abu5lf Posted November 21, 2012 Share Posted November 21, 2012 اذا انتقل لفريق الثاني ما يوقف الساوند الاول يشتغل مع الثاني if isElement( sound ) then stopSound( sound ) end Link to comment
|Mr|-Talal07-| Posted November 21, 2012 Share Posted November 21, 2012 يب end function الـ وينها ؟؟ Link to comment
3NAD Posted November 21, 2012 Share Posted November 21, 2012 addEventHandler ( "onClientGUIClick", root, function ( ) theData = getElementData ( localPlayer, "theSound" ) if source == policeImage then triggerServerEvent ( "setTeam", localPlayer, "police" ) if theData then destroyElement ( theData ) end theSound = playSound ( "1.mp3" ) setElementData ( localPlayer, "theSound", theSound ) elseif source == groveImage then triggerServerEvent ( "setTeam", localPlayer, "grove" ) if theData then destroyElement ( theData ) end theSound = playSound ( "2.mp3" ) setElementData ( localPlayer, "theSound", theSound ) elseif source == ballasImage then triggerServerEvent ( "setTeam", localPlayer, "ballas" ) if theData then destroyElement ( theData ) end theSound = playSound ( "3.mp3" ) setElementData ( localPlayer, "theSound", theSound ) end end ) Link to comment
AL-SAYED Posted November 21, 2012 Author Share Posted November 21, 2012 صارت قائمة الفريق ما تطلع Link to comment
AL-SAYED Posted November 21, 2012 Author Share Posted November 21, 2012 groveImage = guiCreateStaticImage(525, 400, 200, 200, "w.png", false) policeImage = guiCreateStaticImage(175, 400, 200, 200, "s.png", false) ballasImage = guiCreateStaticImage(875, 400, 260, 200, "d.png", false) local x, y, z, lx, ly, lz = getCameraMatrix() x, lx = x + 1, lx + 1 setCameraMatrix(1474.0025634766,-2386.3781738281,44.17036819458,1474.0025634766,-2386.3781738281,44.17036819458) showCursor(true) function onImageClick() if source == groveImage then triggerServerEvent("setTeam", localPlayer, "grove") elseif source == policeImage then triggerServerEvent("setTeam", localPlayer, "police") elseif source == policeImage then triggerServerEvent("setTeam", localPlayer, "ballas") end guiSetVisible(groveImage, false) guiSetVisible(ballasImage, false) guiSetVisible(policeImage, false) showCursor(false) end addEventHandler("onClientGUIClick", resourceRoot, onImageClick) addEventHandler ( 'onClientPlayerWasted', getLocalPlayer ( ), function ( ) guiSetVisible ( ballasImage, true ); guiSetVisible ( groveImage, true ); guiSetVisible ( policeImage, true ); showCursor ( true ) end ) bindKey("F4", "down", function() if not guiGetVisible(groveImage) then guiSetVisible(groveImage, true) guiSetVisible(ballasImage, true) guiSetVisible(policeImage, true) showCursor(true) else guiSetVisible(groveImage, false) guiSetVisible(ballasImage, false) guiSetVisible(policeImage, false) showCursor(false) end end) Link to comment
3NAD Posted November 21, 2012 Share Posted November 21, 2012 groveImage = guiCreateStaticImage ( 525, 400, 200, 200, "w.png", false ) policeImage = guiCreateStaticImage ( 175, 400, 200, 200, "s.png", false ) ballasImage = guiCreateStaticImage ( 875, 400, 260, 200, "d.png", false ) setCameraMatrix ( 1474, -2386, 44, 1474, -2386, 44 ) showCursor ( true ) function VisibleOff ( ) guiSetVisible ( groveImage, false ) guiSetVisible ( ballasImage, false ) guiSetVisible ( policeImage, false ) showCursor ( false ) end function VisibleOn ( ) guiSetVisible ( groveImage, true ) guiSetVisible ( ballasImage, true ) guiSetVisible ( policeImage, true ) showCursor ( true ) end addEventHandler ( "onClientPlayerWasted", localPlayer, VisibleOn ) bindKey ( "F4", "down", function ( ) if not guiGetVisible ( groveImage ) then VisibleOn ( ) else VisibleOff ( ) end end ) addEventHandler ( "onClientGUIClick", root, function ( ) theData = getElementData ( localPlayer, "theSound" ) if source == policeImage then triggerServerEvent ( "setTeam", localPlayer, "police" ) if theData then destroyElement ( theData ) end theSound = playSound ( "1.mp3" ) setElementData ( localPlayer, "theSound", theSound ) VisibleOff ( ) elseif source == groveImage then triggerServerEvent ( "setTeam", localPlayer, "grove" ) if theData then destroyElement ( theData ) end theSound = playSound ( "2.mp3" ) setElementData ( localPlayer, "theSound", theSound ) VisibleOff ( ) elseif source == ballasImage then triggerServerEvent ( "setTeam", localPlayer, "ballas" ) if theData then destroyElement ( theData ) end theSound = playSound ( "3.mp3" ) setElementData ( localPlayer, "theSound", theSound ) VisibleOff ( ) end end ) 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