PtokaX forum

Archive => Archived 5.0 boards => Request for scripts => Topic started by: ??']['??l? on 21 July, 2006, 11:54:24

Title: Little GeoIP info for connecting users
Post by: ??']['??l? on 21 July, 2006, 11:54:24
<...:::RuthlessRicK?:::...> You are connecting from Finland ?There are 1 others of your kind ?Your Current IP is - xxx.xxx.xx.xxx

This is from the geoIP-07.a script and i only need this kinda message when users connect to my hub, so they can see if there`s others from the same country....

So can someone make a simple script like that, bcuz i don`t need other parts from tha geoIP script, only that^^^^^^ :) :) :) :) :)

Thanks...
Title: Re: Little GeoIP info for connecting users
Post by: Alexinno on 21 July, 2006, 12:50:48
edit GeoIP-0.7a.lua and search this function

function GeoIP:SendConnectData( user, scountry )
if scountry and ( self._SendInfoOnConnect == 1 ) then
-- Send Info
user:SendData( self._bot, "?  Hello "..user.sName.."  ?\r\n"..
"? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? \r\n"..
"  Welcome to "..frmHub:GetHubName().." :0)\r\n"..
"   ? You are connecting from "..scountry..",\r\n"..
"    ? There are  "..(self._online[scountry][2]-1).."  others of your kind\r\n"..
"     ? & Your Current IP is - "..user.sIP.." -\r\n"..
"? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ")
end


and remove the the lines that ou don't need, here is an example for user name , user country, and others from user country
function GeoIP:SendConnectData( user, scountry )
if scountry and ( self._SendInfoOnConnect == 1 ) then
-- Send Info
user:SendData( self._bot, "?  Hello "..user.sName.."  ?\r\n"..
"? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? \r\n"..
"   ? You are connecting from "..scountry..",\r\n"..
"    ? There are  "..(self._online[scountry][2]-1).."  others of your kind\r\n"..
"? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ")
end


i hope this will help ;)
Title: Re: Little GeoIP info for connecting users
Post by: ??']['??l? on 24 July, 2006, 14:39:49
function GeoIP:SendConnectData( user, scountry )
if scountry and ( self._SendInfoOnConnect == 1 ) then
-- Send Info
user:SendData( self._bot, "You are connecting from "..scountry.." ?There are "..(self._online[scountry][2]-1).." others of your kind ?Your Current IP is - "..user.sIP.."  \r\n"..




"")
end


I have already done that^^^^, but  what i meant was that i only need a little send info on connect script....like that, bcuz i don`t need the whole geoip script... :)

Thanks... ;)
Title: Re: Little GeoIP info for connecting users
Post by: Alexinno on 24 July, 2006, 20:04:16
you need only this function ? , to show users this info ???
Title: Re: Little GeoIP info for connecting users
Post by: ??']['??l? on 25 July, 2006, 13:19:15
Yes... :-\
Title: Re: Little GeoIP info for connecting users
Post by: Typhoon on 26 July, 2006, 09:01:17
Quote from: ??']['??l??S on 24 July, 2006, 14:39:49
function GeoIP:SendConnectData( user, scountry )
if scountry and ( self._SendInfoOnConnect == 1 ) then
-- Send Info
user:SendData( self._bot, "You are connecting from "..scountry.." ?There are "..(self._online[scountry][2]-1).." others of your kind ?Your Current IP is - "..user.sIP.."  \r\n"..




"")
end


I have already done that^^^^, but  what i meant was that i only need a little send info on connect script....like that, bcuz i don`t need the whole geoip script... :)

Thanks... ;)

but that function uses the rest of the GeoIP script to extract the users country.
it's only a very small part you can remove so my best idea is to keep it as it is..
btw .  is there a point in removing stuff from the script then please say so ?

Typhoon?