Jump to content

Can't get a static image to work for all the players


TheMtaUser555

Recommended Posts

Posted

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) 
  

Posted
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.

Posted
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!

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...