TheMtaUser555 Posted December 21, 2011 Share Posted December 21, 2011 I want to display an image for all players when I type a certain command. My problem now is that I don't know how to mix client/server functions together to make it work.. This is client-side..It works client side wise, but of course it only shows the images to the player who typed the command. Please help me if you can! function showClientImage() myWindow = guiCreateStaticImage( 500, 50, 350, 150, "busted.png", false ) playSound ( "badboys.mp3") end addCommandHandler("busted", showClientImage) function changeVisibility ( ) if guiGetVisible ( mygui ) then guiSetVisible ( mygui, false ) else guiSetVisible ( mygui, true ) end end setTimer ( changeVisibility, 50, 0) function showClientImage2() mygui2 = guiCreateStaticImage( 500, 50, 350, 150, "escaped.png", false ) end addCommandHandler("escaped", showClientImage2) function changeVisibility2 ( ) if guiGetVisible ( mygui2 ) then guiSetVisible ( mygui2, false ) else guiSetVisible ( mygui2, true ) end end setTimer ( changeVisibility2, 50, 0) Link to comment
DiSaMe Posted December 21, 2011 Share Posted December 21, 2011 triggerClientEvent triggerServerEvent These functions allow server and client scripts to communicate. Make a server-side command which triggers your custom client-side event (create this event with addEvent) and make that event cause the image to be created. Link to comment
TheMtaUser555 Posted December 21, 2011 Author Share Posted December 21, 2011 triggerClientEvent triggerServerEvent These functions allow server and client scripts to communicate. Make a server-side command which triggers your custom client-side event (create this event with addEvent) and make that event cause the image to be created. thanks, I'll try it out! Link to comment
TheMtaUser555 Posted December 21, 2011 Author Share Posted December 21, 2011 to CrystalMV thanks alot! it works the way I wanted to 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