Reflex# Posted March 24, 2012 Posted March 24, 2012 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
TAPL Posted March 24, 2012 Posted March 24, 2012 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 )
Kenix Posted March 24, 2012 Posted March 24, 2012 It's some code. getPlayerCountry can return false if player country not found.
Reflex# Posted March 24, 2012 Author Posted March 24, 2012 It's some code.getPlayerCountry can return false if player country not found. but in scoreboard write country...
Reflex# Posted March 25, 2012 Author Posted March 25, 2012 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
myyusuf Posted March 25, 2012 Posted March 25, 2012 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.
Reflex# Posted March 25, 2012 Author Posted March 25, 2012 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
Kenix Posted March 25, 2012 Posted March 25, 2012 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
Reflex# Posted March 25, 2012 Author Posted March 25, 2012 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?
Kenix Posted March 25, 2012 Posted March 25, 2012 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.
Reflex# Posted March 25, 2012 Author Posted March 25, 2012 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?
CapY Posted March 25, 2012 Posted March 25, 2012 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 )
Reflex# Posted March 25, 2012 Author Posted March 25, 2012 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
CapY Posted March 25, 2012 Posted March 25, 2012 Well, it works for me. Have you put it server-side ?
Reflex# Posted March 25, 2012 Author Posted March 25, 2012 Well, it works for me.Have you put it server-side ? Yes..of course..wait i try again
Reflex# Posted March 25, 2012 Author Posted March 25, 2012 May be i must add this resource to admin group?
CapY Posted March 25, 2012 Posted March 25, 2012 May be i must add this resource to admin group? Yes, you do.
Reflex# Posted March 25, 2012 Author Posted March 25, 2012 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?
Kenix Posted March 25, 2012 Posted March 25, 2012 You not need add resource to admin group in acl. Idk why it not working for you. Can you upload resource?
drk Posted March 25, 2012 Posted March 25, 2012 (edited) You need Kenix. You need admin rights to get a player data from admin panel. Edited March 25, 2012 by Guest
Reflex# Posted March 25, 2012 Author Posted March 25, 2012 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?
Jaysds1 Posted March 25, 2012 Posted March 25, 2012 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.
drk Posted March 25, 2012 Posted March 25, 2012 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 Note: Change "yourJoinquitResourceName" to your joinquit resource name, understand?
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