Yep, login table is update when you login. The script needs account variables and use OnPCLogin/OnPcLogout events.
Like:
OnPCLoginEvent:
##LAST_LOGIN = atoi(gettimestr("%Y%m%d,21));
end;
and also a switch to check days difference or months..
also maybe need a SQL protecction for this a player could create accounts that only log one time for farm the price.
I dont check function is a Euphy original work but edited by me.
function script Check_IP {
// Get list of accounts with attached character's IP address.
set .@size, query_sql("SELECT `account_id` FROM `login` WHERE `last_ip` = '"+getcharip()+"'",.@aid);
if(.@size <2) return;
for(.@i=0;.@i<.@size;.@i++){
attachrid(.@aid[i]);
set ##LAST_LOGIN = atoi(gettimestr("%Y%m%d,21));
}
return;
}