Jump to content

JoinQuit


Reflex#

Recommended Posts

Posted
    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

  • Replies 57
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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

Posted
   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

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

Posted
    
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

Posted
    
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  

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

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

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

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

Posted
  
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

Posted
May be i must add this resource to admin group?

Yes, you do.

I forget..how to do,remind me:

Resources->Manage ACL->Groups->Admin->add object-->resource.joinquit

yes? :)

Posted (edited)

You need Kenix. You need admin rights to get a player data from admin panel.

Edited by Guest
Posted
You not need add resource to admin group in acl.

Idk why it not working for you.

Can you upload resource?

On community?

Or another file-sharing?

Posted
You not need add resource to admin group in acl.

Idk why it not working for you.

Can you upload resource?

On community?

Or another file-sharing?

I think he means on a file-share site.

Posted

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?

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