Timic Posted September 16, 2010 Posted September 16, 2010 g_Root = getRootElement() addEventHandler('onClientPlayerJoin', g_Root, function() outputChatBox('#449ecbJOIN: #FFFFFF' .. getPlayerName(source) .. ' #449ecbhas joined from: #FFFFFF' .. [u]getPlayerCountry(source)[/u] .. ', 255, 100, 100,true) end ) addEventHandler('onClientPlayerChangeNick', g_Root, function(oldNick, newNick) outputChatBox('#449ecbNICK: #FFFFFF' .. oldNick .. ' #449ecbis now known as #FFFFFF' .. newNick, 255, 100, 100,true) end ) addEventHandler('onClientPlayerQuit', g_Root, function(reason) outputChatBox('#449ecbQUIT: #FFFFFF' .. getPlayerName(source) .. ' #449ecbhas left the game [' .. reason .. ']', 255, 100, 100,true) end ) Can somebody Help This Powered by My in-game nick is |Timic| addEventHandler ( "onPlayerJoin", getRootElement(), function() if (getPlayerName(source) == "Timic") then triggerClientEvent("onTimicJoin",getRootElement()) end end)
Castillo Posted September 16, 2010 Posted September 16, 2010 no exist such function: getPlayerCountry San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Timic Posted September 16, 2010 Author Posted September 16, 2010 Then how is it? Powered by My in-game nick is |Timic| addEventHandler ( "onPlayerJoin", getRootElement(), function() if (getPlayerName(source) == "Timic") then triggerClientEvent("onTimicJoin",getRootElement()) end end)
Moderators Zango Posted September 16, 2010 Moderators Posted September 16, 2010 no exist such function: getPlayerCountry I think he's wanting advise on how to do so. Having a look at how the admin resource pulled this off, I found this: --[[********************************** * * Multi Theft Auto - Admin Panel * * admin_ip2c.lua * * Original File by lil_Toady * **************************************]] aCountries = {} function getPlayerCountry ( player ) local ip = getPlayerIP ( player ) local ip_group = tonumber ( gettok ( ip, 1, 46 ) ) local ip_code = ( gettok ( ip, 1, 46 ) * 16777216 ) + ( gettok ( ip, 2, 46 ) * 65536 ) + ( gettok ( ip, 3, 46 ) * 256 ) + ( gettok ( ip, 4, 46 ) ) if ( not aCountries[ip_group] ) then loadIPGroup ( ip_group ) end for id, group in ipairs ( aCountries[ip_group] ) do if ( ( group.rstart <= ip_code ) and ( ip_code <= group.rend ) ) then return group.rcountry end end return false end function loadIPGroup ( group ) aCountries[group] = {} local node = xmlLoadFile ( "conf/ip2c/"..group..".xml" ) if ( node ) then local ranges = 0 while ( true ) do local range_node = xmlFindChild ( node, "range", ranges ) if ( not range_node ) then break end local rstart = tonumber ( xmlNodeGetAttribute ( range_node, "start" ) ) local rend = tonumber ( xmlNodeGetAttribute ( range_node, "end" ) ) local rcountry = xmlNodeGetAttribute ( range_node, "country" ) local count = #aCountries[group] + 1 aCountries[group][count] = {} aCountries[group][count].rstart = rstart aCountries[group][count].rend = rend aCountries[group][count].rcountry = rcountry ranges = ranges + 1 end xmlUnloadFile ( node ) end end In other words, put this code in the admin resource serverside file, and it should work fine. You'd have to convert this to serverside code too. onClientPlayerJoin is onPlayerJoin, for example.
Timic Posted September 16, 2010 Author Posted September 16, 2010 this not help to me ... Powered by My in-game nick is |Timic| addEventHandler ( "onPlayerJoin", getRootElement(), function() if (getPlayerName(source) == "Timic") then triggerClientEvent("onTimicJoin",getRootElement()) end end)
Moderators Zango Posted September 16, 2010 Moderators Posted September 16, 2010 this not help to me ... There is no specific function that retrieves a players country, the nearest you get is the IP. I think you need to deepen out your question a bit instead of concluding that it wont help you.
Timic Posted September 16, 2010 Author Posted September 16, 2010 then edit my Powered by My in-game nick is |Timic| addEventHandler ( "onPlayerJoin", getRootElement(), function() if (getPlayerName(source) == "Timic") then triggerClientEvent("onTimicJoin",getRootElement()) end end)
50p Posted September 16, 2010 Posted September 16, 2010 Just export that function from admin resource and call it from your resource... - MTA Script Editor - Ask your scripting questions properly, please. - 50p's public resources - Meta.xml - what is it for? How is it possible LOL
[DMC] Posted September 16, 2010 Posted September 16, 2010 this is a stolen client side script this is the 3rd stolen client side script timic posted ban him from here.... how do i know you say? well its from dmc... our client side is almost that but then + server =) and he edited this a tiny bit i think we should post/reply on timic stupid stuff anymore not even when he made it himself and really need help
Recommended Posts