Yes i understand all that. I want to make it so the NPC takes a record of their IP and block usage of that npc afterwards.
I did some searching and found a guild pack script to use in what I'm after. From this thread: https://rathena.org/board/topic/94294-guild-pack-npc-giver-help-please/
1. First script needs label to call in callsub:
return query_sql("SELECT 1 FROM `guildpack` join login on login.`last_ip` = `guildpack`.`last_ip` where login.account_id = "+ getcharid(CHAR_ID_ACCOUNT), .@tmp);
2. Then define IP:
.@myip$ = getcharip();
3. Return true through callsub if IP exists in table:
mes("^616D7EIt seems I have already recorded your IP Address: ^ff0000" + .@myip$ + "^000000.");
4. If does not exist, enter new entry to previously created table:
query_sql("INSERT INTO `guildpack` VALUES (NULL," + getcharid(CHAR_ID_ACCOUNT) + ",'" + escape_sql(strcharinfo(PC_NAME)) + "','" + .@myip$ + "')");
All in all it looks something like this: https://pastebin.com/Lk8MHMBg
This can be used for get_unique_id() too if you have gepard shield.
My intention was to use this in a Lottery script, so people could only purchase one ticket per week.
After each lottery draw, the table would be truncated so everybody can buy tickets again.
Edited by True Zeal, 20 April 2017 - 10:58 AM.