Page 1 of 5 123 ... LastLast
Results 1 to 10 of 47

Thread: IP to Country Mod for Reborn 2.5 Gamma+

  1. #1

    Default IP to Country Mod for Reborn 2.5 Gamma+

    I've seen people ask if this is possible, well, with Reborn, it's possible now... (Thanks Razo for making this possible)

    Here is a mod I made to show a player's Country. I think it is neat to know where everyone is from.


    Installation Instructions:
    Unzip both the .dat file and .pk3 file to main folder

    If you already have a custom DMPrecache.scr, add this to it...
    PHP Code:
        //REBORN EVENT REGISTERING
        
    local.result registerev "connected" global/connectedhandler.scr
        
        
    //load ip->country arrays
        
    waitexec global/ip2co/arrays.scr 
    If you already have a 'connected' event registered, add this in the connected event .scr...
    PHP Code:
    if(local.player)
    {
        
    local.player.data["name"] = netname local.player
        local
    .player.data["ip"] = getip local.player
        local
    .player.data["ccode"] = 235
        local
    .player.data["country"] = ""

        
    waitexec global/ip2co/ip2co.scr local.player.data["ip"local.player

    Requirements: Reborn 2.5 Gamma+

    Note: This may not work well with Elbot, since both mods are opening files for data, and there is a maximum of 32 files that can be opened at once. I 'think' it should be fine though. Just giving a heads up.

    Use this mod for other mods...
    Now, each player will have attached to them, local.player.data["ccode"] . With this you can see what country they are from. (country codes can be found in countries.txt of the .zip file) . Then you can take that and interpret things into other languages, such as huds and iprints, etc...
    Attached Files Attached Files
    Last edited by armageddon; January 6th, 2012 at 01:17 PM.

  2. #2
    Administrator James's Avatar
    Join Date
    May 2010
    Location
    on the intraweb
    Posts
    3,180

    Default

    AMAZING job!!! I know how hard you worked at accomplishing this. Excellent release man! Keep it up!!!

  3. #3

    Default

    Oh wow. I agree amazing.


    Edit: Again Amazing just installed and works perfect.
    Last edited by godsmack; January 6th, 2012 at 04:08 PM.

  4. #4

  5. #5

    Default

    Love it....Great work
    Thanks armageddon

  6. #6

    Default Cant see DMPrecache.scr

    Quote Originally Posted by armageddon View Post


    If you already have a custom DMPrecache.scr, add this to it...
    PHP Code:
        //REBORN EVENT REGISTERING
        
    local.result registerev "connected" global/connectedhandler.scr
        
        
    //load ip->country arrays
        
    waitexec global/ip2co/arrays.scr 
    If you already have a 'connected' event registered, add this in the connected event .scr...
    PHP Code:
    if(local.player)
    {
        
    local.player.data["name"] = netname local.player
        local
    .player.data["ip"] = getip local.player
        local
    .player.data["ccode"] = 235
        local
    .player.data["country"] = ""

        
    waitexec global/ip2co/ip2co.scr local.player.data["ip"local.player

    Requirements: Reborn 2.5 Gamma+

    Looks good but why cant i find the DMPrecache.scr file or the 'connected file in my server ?

  7. #7
    Über Prodigy & Developer Razo[R]apiD's Avatar
    Join Date
    May 2010
    Location
    Poland, Lublin
    Posts
    3,257

    Default

    Do you use Reborn 1.12 Gamma patch?

    If yes, then you have create one for yourself unless you use other mods that make use of "connected" event and in that case, you have to merge them.

  8. #8

    Default ..

    yea i have the patch, how do i create 1?

    Thanks

  9. #9

    Default ..

    ok so i have made a DMPrecache.scr file and a connectedevents.scr with the correct infomation but when i put them in my moh directory or my main it doesnt work, what am i doing wrong?

  10. #10
    Über Prodigy & Developer Razo[R]apiD's Avatar
    Join Date
    May 2010
    Location
    Poland, Lublin
    Posts
    3,257

    Default

    Well.. just download the mod that resides in .pk3. It's all you need to use this mod. If you are using other mods, then you have to open them, and merge files from them to one bigger mod.

    This description was made for editing mods in pk3 so you don't place those files in your main, you place them in .pk3 if you have other mods that use those files.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •