Jump to content

JoinQuit


Reflex#

Recommended Posts

    g_Root = getRootElement() 
      
    addEventHandler('onPlayerJoin',g_Root, 
    function () 
        local country = exports['admin']:getPlayerCountry(source) 
        setElementData(source,'Country',country) 
        outputChatBox('[JOIN] #ffffff' .. getPlayerName(source) .. '#DB8181 joined game!' .. tostring(country) .. ' ', getRootElement(), 219, 129, 129, true) 
        end 
    ) 
      
    addEventHandler('onPlayerChangeNick', g_Root, 
        function(oldNick, newNick) 
            outputChatBox('[Change-Nick] #ffffff' .. oldNick .. '#DB8181 is now known as #ffffff' .. newNick, getRootElement(), 219, 129, 129, true) 
        end 
    ) 
      
    addEventHandler('onPlayerQuit', g_Root, 
        function(reason) 
            outputChatBox('[' .. reason .. '] #ffffff' .. getPlayerName(source) .. ' #DB8181disconnected.', getRootElement(), 255, 0, 0, true) 
        end 
    ) 

I try this..but dont work,i want that country showing from what player join ,write only [JOIN]Player joined game!false

Link to comment
  • Replies 57
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

   g_Root = getRootElement() 
      
    addEventHandler('onPlayerJoin',g_Root, 
    function () 
        local country = exports.admin:getPlayerCountry(source) 
        setElementData(source,'Country',country) 
        outputChatBox('[JOIN] #ffffff' .. getPlayerName(source) .. '#DB8181 joined game!' .. tostring(country) .. ' ', getRootElement(), 219, 129, 129, true) 
        end 
    ) 
      
    addEventHandler('onPlayerChangeNick', g_Root, 
        function(oldNick, newNick) 
            outputChatBox('[Change-Nick] #ffffff' .. oldNick .. '#DB8181 is now known as #ffffff' .. newNick, getRootElement(), 219, 129, 129, true) 
        end 
    ) 
      
    addEventHandler('onPlayerQuit', g_Root, 
        function(reason) 
            outputChatBox('[' .. reason .. '] #ffffff' .. getPlayerName(source) .. ' #DB8181disconnected.', getRootElement(), 255, 0, 0, true) 
        end 
    ) 

Link to comment
   g_Root = getRootElement() 
      
    addEventHandler('onPlayerJoin',g_Root, 
    function () 
        local country = exports.admin:getPlayerCountry(source) 
        setElementData(source,'Country',country) 
        outputChatBox('[JOIN] #ffffff' .. getPlayerName(source) .. '#DB8181 joined game!' .. tostring(country) .. ' ', getRootElement(), 219, 129, 129, true) 
        end 
    ) 
      
    addEventHandler('onPlayerChangeNick', g_Root, 
        function(oldNick, newNick) 
            outputChatBox('[Change-Nick] #ffffff' .. oldNick .. '#DB8181 is now known as #ffffff' .. newNick, getRootElement(), 219, 129, 129, true) 
        end 
    ) 
      
    addEventHandler('onPlayerQuit', g_Root, 
        function(reason) 
            outputChatBox('[' .. reason .. '] #ffffff' .. getPlayerName(source) .. ' #DB8181disconnected.', getRootElement(), 255, 0, 0, true) 
        end 
    ) 

Dont work..again writing:[JOIN][Name] joined game!false

Link to comment
    
local country = exports["admin"]:getPlayerCountry(source) 
g_Root = getRootElement() 
      
    addEventHandler('onPlayerJoin',g_Root, 
    function () 
        outputChatBox('[JOIN] #ffffff' .. getPlayerName(source) .. '#DB8181 joined game!' .. country', getRootElement(), 219, 129, 129, true) 
        end 
    ) 
      
    addEventHandler('onPlayerChangeNick', g_Root, 
        function(oldNick, newNick) 
            outputChatBox('[Change-Nick] #ffffff' .. oldNick .. '#DB8181 is now known as #ffffff' .. newNick, getRootElement(), 219, 129, 129, true) 
        end 
    ) 
      
    addEventHandler('onPlayerQuit', g_Root, 
        function(reason) 
            outputChatBox('[' .. reason .. '] #ffffff' .. getPlayerName(source) .. ' #DB8181disconnected.', getRootElement(), 255, 0, 0, true) 
        end 
    ) 
  
  
  
 

also you need to give admin rights to script.

Link to comment
    
local country = exports["admin"]:getPlayerCountry(source) 
g_Root = getRootElement() 
      
    addEventHandler('onPlayerJoin',g_Root, 
    function () 
        outputChatBox('[JOIN] #ffffff' .. getPlayerName(source) .. '#DB8181 joined game!' .. country', getRootElement(), 219, 129, 129, true) 
        end 
    ) 
      
    addEventHandler('onPlayerChangeNick', g_Root, 
        function(oldNick, newNick) 
            outputChatBox('[Change-Nick] #ffffff' .. oldNick .. '#DB8181 is now known as #ffffff' .. newNick, getRootElement(), 219, 129, 129, true) 
        end 
    ) 
      
    addEventHandler('onPlayerQuit', g_Root, 
        function(reason) 
            outputChatBox('[' .. reason .. '] #ffffff' .. getPlayerName(source) .. ' #DB8181disconnected.', getRootElement(), 255, 0, 0, true) 
        end 
    ) 
  
  
  
  
 

also you need to give admin rights to script.

now write nothing :D

Link to comment
    
local country = exports["admin"]:getPlayerCountry(source) 
g_Root = getRootElement() 
      
    addEventHandler('onPlayerJoin',g_Root, 
    function () 
        outputChatBox('[JOIN] #ffffff' .. getPlayerName(source) .. '#DB8181 joined game!' .. country', getRootElement(), 219, 129, 129, true) 
        end 
    ) 
      
    addEventHandler('onPlayerChangeNick', g_Root, 
        function(oldNick, newNick) 
            outputChatBox('[Change-Nick] #ffffff' .. oldNick .. '#DB8181 is now known as #ffffff' .. newNick, getRootElement(), 219, 129, 129, true) 
        end 
    ) 
      
    addEventHandler('onPlayerQuit', g_Root, 
        function(reason) 
            outputChatBox('[' .. reason .. '] #ffffff' .. getPlayerName(source) .. ' #DB8181disconnected.', getRootElement(), 255, 0, 0, true) 
        end 
    ) 
  
  
  
  
  
  
  
 

Your code is wrong.

also you need to give admin rights to script.

oO

Ok i create test my code now.

Edit: I tested code. All working.

[JOIN] Kenix joined game!RU  

Link to comment
    
local country = exports["admin"]:getPlayerCountry(source) 
g_Root = getRootElement() 
      
    addEventHandler('onPlayerJoin',g_Root, 
    function () 
        outputChatBox('[JOIN] #ffffff' .. getPlayerName(source) .. '#DB8181 joined game!' .. country', getRootElement(), 219, 129, 129, true) 
        end 
    ) 
      
    addEventHandler('onPlayerChangeNick', g_Root, 
        function(oldNick, newNick) 
            outputChatBox('[Change-Nick] #ffffff' .. oldNick .. '#DB8181 is now known as #ffffff' .. newNick, getRootElement(), 219, 129, 129, true) 
        end 
    ) 
      
    addEventHandler('onPlayerQuit', g_Root, 
        function(reason) 
            outputChatBox('[' .. reason .. '] #ffffff' .. getPlayerName(source) .. ' #DB8181disconnected.', getRootElement(), 255, 0, 0, true) 
        end 
    ) 
  
  
  
  
  
  
  
  
 

Your code is wrong.

also you need to give admin rights to script.

oO

Ok i create test my code now.

Edit: I tested code. All working.

[JOIN] Kenix joined game!RU  

What code you test?

Link to comment
    g_Root = getRootElement() 
      
    addEventHandler('onPlayerJoin',g_Root, 
    function () 
        local country = exports['admin']:getPlayerCountry(source) 
        setElementData(source,'Country',country) 
        outputChatBox('[JOIN] #ffffff' .. getPlayerName(source) .. '#DB8181 joined game!' .. tostring(country) .. ' ', getRootElement(), 219, 129, 129, true) 
        end 
    ) 
      
    addEventHandler('onPlayerChangeNick', g_Root, 
        function(oldNick, newNick) 
            outputChatBox('[Change-Nick] #ffffff' .. oldNick .. '#DB8181 is now known as #ffffff' .. newNick, getRootElement(), 219, 129, 129, true) 
        end 
    ) 
      
    addEventHandler('onPlayerQuit', g_Root, 
        function(reason) 
            outputChatBox('[' .. reason .. '] #ffffff' .. getPlayerName(source) .. ' #DB8181disconnected.', getRootElement(), 255, 0, 0, true) 
        end 
    ) 

I try this..but dont work,i want that country showing from what player join ,write only [JOIN]Player joined game!false

This.

Link to comment
    g_Root = getRootElement() 
      
    addEventHandler('onPlayerJoin',g_Root, 
    function () 
        local country = exports['admin']:getPlayerCountry(source) 
        setElementData(source,'Country',country) 
        outputChatBox('[JOIN] #ffffff' .. getPlayerName(source) .. '#DB8181 joined game!' .. tostring(country) .. ' ', getRootElement(), 219, 129, 129, true) 
        end 
    ) 
      
    addEventHandler('onPlayerChangeNick', g_Root, 
        function(oldNick, newNick) 
            outputChatBox('[Change-Nick] #ffffff' .. oldNick .. '#DB8181 is now known as #ffffff' .. newNick, getRootElement(), 219, 129, 129, true) 
        end 
    ) 
      
    addEventHandler('onPlayerQuit', g_Root, 
        function(reason) 
            outputChatBox('[' .. reason .. '] #ffffff' .. getPlayerName(source) .. ' #DB8181disconnected.', getRootElement(), 255, 0, 0, true) 
        end 
    ) 

I try this..but dont work,i want that country showing from what player join ,write only [JOIN]Player joined game!false

This.

As i know..this is server side?

Link to comment
  
local countryNames = { 
    ["AD"]="Andorra", 
    ["AG"]="Antigua - Barbuda", 
    ["AI"]="Anguilla Arabia", 
    ["AL"]="Albania", 
    ["AM"]="Armenia", 
    ["AR"]="Argentina", 
    ["AT"]="Austria", 
    ["AU"]="Australia", 
    ["AW"]="Aruba", 
    ["BA"]="Bosnia", 
    ["BE"]="Belgium", 
    ["BG"]="Bulgaria", 
    ["BH"]="Bahrain", 
    ["BM"]="Bermuda", 
    ["BN"]="Bronei ", 
    ["BO"]="Bolivia", 
    ["BR"]="Brazil", 
    ["BS"]="Bahamas", 
    ["BW"]="Botswana", 
    ["BY"]="Belarus", 
    ["BZ"]="Belize", 
    ["CA"]="Canada", 
    ["CC"]="Cocos", 
    ["CH"]="Switzerland", 
    ["CI"]="Ivory Coast", 
    ["CL"]="Chile", 
    ["CN"]="China", 
    ["CO"]="Colombia", 
    ["CU"]="Cuba", 
    ["CY"]="Cyprus", 
    ["CZ"]="Czech", 
    ["DE"]="Germany", 
    ["DK"]="Denmark", 
    ["DM"]="Dominica", 
    ["DO"]="Dominican", 
    ["EC"]="Ecuador", 
    ["EE"]="Estonia", 
    ["EG"]="Egypt", 
    ["ES"]="Spain", 
    ["ET"]="Ethiopia", 
    ["FI"]="Finland", 
    ["FR"]="France", 
    ["GB"]="Great-Britain", 
    ["GL"]="Greenland", 
    ["GY"]="Guyana", 
    ["HR"]="Croatia", 
    ["HU"]="Hungary", 
    ["ID"]="Indonesia", 
    ["IE"]="Ireland", 
    ["IR"]="Iran", 
    ["IS"]="Iceland", 
    ["IT"]="Italy", 
    ["IN"]="India", 
    ["JO"]="Jordan", 
    ["JM"]="Jamaica", 
    ["jp"]="Mexico", 
    ["KW"]="Kuwait", 
    ["IT"]="Italy", 
    ["LU"]="Luxembourg", 
    ["LV"]="Latvia", 
    ["MA"]="Morocco", 
    ["MC"]="Monaco", 
    ["MT"]="Malta", 
    ["MX"]="Mexico", 
    ["NG"]="Nigeria", 
    ["NL"]="Netherlands", 
    ["NO"]="Norway", 
    ["PA"]="Panama", 
    ["PE"]="Peru", 
    ["PH"]="Philipines", 
    ["PK"]="Pakistan", 
    ["PL"]="Poland", 
    ["PT"]="Portugal", 
    ["QA"]="Qatar", 
    ["RO"]="Romania", 
    ["RU"]="Russia", 
    ["SA"]="Saudi Arbia", 
    ["SE"]="Sweden", 
    ["SI"]="Slovania", 
    ["TO"]="Tonga", 
    ["TR"]="Turkey", 
    ["UA"]="Ukraine", 
    ["UK"]="United Kingdom", 
    ["US"]="United States", 
    ["UY"]="Uruguay", 
    ["VN"]="Vietnam", 
    ["YE"]="Yemen", 
    ["YU"]="Yugoslavia", 
    ["ZA"]="South Africa" 
} 
  
  
function onJoin() 
    local country = exports['admin']:getPlayerCountry(source) 
    setElementData(source,'Country', country) 
    outputChatBox( getPlayerName ( source ) .. " has joined the game from " .. countryName[tostring(country)], 255, 100, 100 ) 
end 
addEventHandler ( "onPlayerJoin", getRootElement(), onJoin ) 

Link to comment
  
local countryNames = { 
    ["AD"]="Andorra", 
    ["AG"]="Antigua - Barbuda", 
    ["AI"]="Anguilla Arabia", 
    ["AL"]="Albania", 
    ["AM"]="Armenia", 
    ["AR"]="Argentina", 
    ["AT"]="Austria", 
    ["AU"]="Australia", 
    ["AW"]="Aruba", 
    ["BA"]="Bosnia", 
    ["BE"]="Belgium", 
    ["BG"]="Bulgaria", 
    ["BH"]="Bahrain", 
    ["BM"]="Bermuda", 
    ["BN"]="Bronei ", 
    ["BO"]="Bolivia", 
    ["BR"]="Brazil", 
    ["BS"]="Bahamas", 
    ["BW"]="Botswana", 
    ["BY"]="Belarus", 
    ["BZ"]="Belize", 
    ["CA"]="Canada", 
    ["CC"]="Cocos", 
    ["CH"]="Switzerland", 
    ["CI"]="Ivory Coast", 
    ["CL"]="Chile", 
    ["CN"]="China", 
    ["CO"]="Colombia", 
    ["CU"]="Cuba", 
    ["CY"]="Cyprus", 
    ["CZ"]="Czech", 
    ["DE"]="Germany", 
    ["DK"]="Denmark", 
    ["DM"]="Dominica", 
    ["DO"]="Dominican", 
    ["EC"]="Ecuador", 
    ["EE"]="Estonia", 
    ["EG"]="Egypt", 
    ["ES"]="Spain", 
    ["ET"]="Ethiopia", 
    ["FI"]="Finland", 
    ["FR"]="France", 
    ["GB"]="Great-Britain", 
    ["GL"]="Greenland", 
    ["GY"]="Guyana", 
    ["HR"]="Croatia", 
    ["HU"]="Hungary", 
    ["ID"]="Indonesia", 
    ["IE"]="Ireland", 
    ["IR"]="Iran", 
    ["IS"]="Iceland", 
    ["IT"]="Italy", 
    ["IN"]="India", 
    ["JO"]="Jordan", 
    ["JM"]="Jamaica", 
    ["jp"]="Mexico", 
    ["KW"]="Kuwait", 
    ["IT"]="Italy", 
    ["LU"]="Luxembourg", 
    ["LV"]="Latvia", 
    ["MA"]="Morocco", 
    ["MC"]="Monaco", 
    ["MT"]="Malta", 
    ["MX"]="Mexico", 
    ["NG"]="Nigeria", 
    ["NL"]="Netherlands", 
    ["NO"]="Norway", 
    ["PA"]="Panama", 
    ["PE"]="Peru", 
    ["PH"]="Philipines", 
    ["PK"]="Pakistan", 
    ["PL"]="Poland", 
    ["PT"]="Portugal", 
    ["QA"]="Qatar", 
    ["RO"]="Romania", 
    ["RU"]="Russia", 
    ["SA"]="Saudi Arbia", 
    ["SE"]="Sweden", 
    ["SI"]="Slovania", 
    ["TO"]="Tonga", 
    ["TR"]="Turkey", 
    ["UA"]="Ukraine", 
    ["UK"]="United Kingdom", 
    ["US"]="United States", 
    ["UY"]="Uruguay", 
    ["VN"]="Vietnam", 
    ["YE"]="Yemen", 
    ["YU"]="Yugoslavia", 
    ["ZA"]="South Africa" 
} 
  
  
function onJoin() 
    local country = exports['admin']:getPlayerCountry(source) 
    setElementData(source,'Country', country) 
    outputChatBox( getPlayerName ( source ) .. " has joined the game from " .. countryName[tostring(country)], 255, 100, 100 ) 
end 
addEventHandler ( "onPlayerJoin", getRootElement(), onJoin ) 

When player join,happend nothing

Link to comment

ReFleX add your script to the acl.xml ( group Admin ).

Admin Panel -> Resources Tab -> Manage ACL -> Double click in Admin Group -> Add object -> Type "resource.yourJoinquitResourceName" -> Ok -> Restart resource or maybe not needed :lol:

Note: Change "yourJoinquitResourceName" to your joinquit resource name, understand?

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