Jump to content

[Rel] GUI Messages.


Smart.

Recommended Posts

It's a easy to use resource, makes custom made GUI messages instead of the normal chatbox.

How to use it? It's really easy to use. I'll give you an example below

Server Sided:

-- exports ["guimessages"] : outputServer ( argue, "message" ,r, g, b ) 
exports ["guimessages"] : outputServer (root, "Server sided message" , 204, 51, 255) 

Client Sided:

-- exports ["guimessages"] : outpuClient ( "message" , r, g, b ) 
exports ["guimessages"] : outputClient ( "Client message" , 204, 51, 255) 

Using it in a script:

-- we register greetPlayer as a handler for the event 
function greetPlayer ( ) 
    -- we store the player's name 
    local joinedPlayerName = getPlayerName ( source ) 
    local serverName = getServerName( ) 
    -- and send him a greeting 
    exports ["guimessages"] : outputServer ( source, "Welcome " .. joinedPlayerName .. " to ".. serverName .."!" , 255, 255, 255 ) 
end 
addEventHandler ( "onPlayerJoin", getRootElement(), greetPlayer ) 

How does it look like?

http://i44.tinypic.com/153y7pw.png

http://i44.tinypic.com/o9inop.png

http://i39.tinypic.com/efrpzq.png

http://i43.tinypic.com/2cwty6x.png

Where can I download it? https://community.multitheftauto.com/index.php?p= ... ls&id=4448

  • Thanks 1
Link to comment
It's nice. It would be even better if you would support HEX codes :) So if you will be doing some update, don't forget to add HEX codes support :D

+ must be a "uncompiled" for edit the text position

ps: good job :)

Yep, that's problem too :D It doesn't have to be uncompiled, it can be done via settings. That would be useful.

Link to comment

Well not everyone is a noob, some people are experienced and are interested in learning from and tweaking your code.

If it is reuploaded by someone else, it is deleted by a mod when reported. Simple as that.

If you are worried about people on servers presenting as their own, just add a license.

At the least let some people acquire the source code, don't be afraid of people presenting it as their own.

The resource is good, but there are some modifications I would like to create to make it compliant with my own server.

Link to comment
  • 6 months later...

How to use it in join quit?

My code that isnt working:

g_Root = getRootElement() 
  
addEventHandler('onClientPlayerJoin', g_Root, 
    function() 
 local joinedPlayerName = getPlayerName ( source ) 
 exports ["guimessages"] : outputServer ( source, "*" .. joinedPlayerName .. " has joined" , 0, 255, 0 ) 
    end 
) 
  
addEventHandler('onClientPlayerChangeNick', g_Root, 
    function(oldNick, newNick) 
 local joinedPlayerName = getPlayerName ( source ) 
exports ["guimessages"] : outputServer ( source, "*" .. oldNick .. "'#FFF000 is now known as: #00FF00'" .. newNick .. "'#FFF000", 0, 255, 0 ) 
    end 
) 
  
addEventHandler('onClientPlayerQuit', g_Root, 
    function(reason) 
 local QuitPlayerName = getPlayerName ( source ) 
 exports ["guimessages"] : outputServer ( source," .. getPlayerName(source) .. "'#FF0000 has left the game #00ff00: #FF4500'" .. reason .. "'" , 255, 255, 255 ) 
    end 
) 
  

The guimessages resource and joinquit resource is started so idk

And also that the letter would fadeout(dissepear) not stay there.

Link to comment

Server.lua

g_Root = getRootElement() 
  
addEventHandler('onPlayerJoin', g_Root, 
    function() 
 local joinedPlayerName = getPlayerName ( source ) 
 exports ["guimessages"] : outputServer ( source, "*" .. joinedPlayerName .. " has joined" , 0, 255, 0 ) 
    end 
) 
  
addEventHandler('onPlayerChangeNick', g_Root, 
    function(oldNick, newNick) 
 local joinedPlayerName = getPlayerName ( source ) 
exports ["guimessages"] : outputServer ( source, "*" .. oldNick .. "'#FFF000 is now known as: #00FF00'" .. newNick .. "'#FFF000", 0, 255, 0 ) 
    end 
) 
  
addEventHandler('onPlayerQuit', g_Root, 
    function(reason) 
 local QuitPlayerName = getPlayerName ( source ) 
 exports ["guimessages"] : outputServer ( source," .. getPlayerName(source) .. "'#FF0000 has left the game #00ff00: #FF4500'" .. reason .. "'" , 255, 255, 255 ) 
    end 
) 
  
 

Meta.xml:

  
<script src="server.lua" type="server"/> 
  

Link to comment

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