• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Register duplicate unique ID on logs

arturhaddad

Member
Joined
Aug 14, 2010
Messages
217
Reaction score
8
Hello,

I would like a script that register the "duplicate unique id" console messages in a server log, simply:

17:32 Duplicate unique ID XXXX
(wich would be saved at logs/duplicateuid.txt)

It would be nice if the message could also contains the name of the player who's holding the item o.o and it's item id

Any ideas? :peace::peace:

-- edit --

It's important also that the message contains log in/log out information

Player arturhaddad has logged in
Duplicate uniqueID XXXX
 
Unique ID? I guess this is for duped items. It's better to create a virtual attribute and set it to the donated item when player receives it.

This php function of mine creates 26 million serials. Should last for 5 years at least :p
PHP:
function generateSerial($lastSerial)
{
    #This function creates 26,000,000 serials. It should be enough for you.
    if($lastSerial == null) return "A-0";
    
    $digit = explode("-",$lastSerial,2);
    if(intval($digit[1]) < 999999) return $digit[0]."-".(intval($digit[1])+1);    
    
    $key = str_split("ABCDEFGHIJKLMNOPQRSTUVWXYZ");
    if(intval($digit[1]) == 999999)    
    {
        for($i=0;count($key);$i++):
            if($digit[0] == $key[$i])
            {
                return $key[$i+1]."-0";
            }
        endfor;
    }
}
It is on auto-increment, always gives the next correct serial, instead of a random one to avoid serial dupe.
 
Last edited:
It's for a Duped&&Track System I'm trying to develop. It serializes the item at the moment the player 'buys' it when spending premium/donation points. It requires a few modifications to the shop table at db and the shop lua/php scripts in the server.
 
Premium Board ;)

@arturhaddad You need some queries to detect the items with same uid/serial, that are not recommended to do ingame.
You can buy Jano's antiDupe system aswell, it's pretty good ;)
 
Well, i made a system that sets a serial to the items, and then you can check items with same serial from database (player_items [attributes field]) and items with same serial are (of course) cloned

I used an attribute named "serial", with the function 'doItemSetAtribute'

Pic:
2n0lwyh.png
<-- items with same serial (cloned)
 
Darkhaos, but there's no way to use an query to read those values, look:

260z6v6.jpg


:X

I'm trying with mazen's class as Cykotitan recommended, but it's an non-pratical way too, 'cause you'll have to check item by item lol
 
Back
Top