Jump to content
  • 0

H>about this script (Read Pls)


Question

7 answers to this question

Recommended Posts

Posted

Create a table in your logs schema with this query:

CREATE TABLE IF NOT EXISTS `freebielog` (
	`id` int(11) unsigned NOT NULL auto_increment,
	`account` int(11) NOT NULL,
	`ip_address` varchar(100) NOT NULL,
	`timestamp` datetime NOT NULL,
	PRIMARY KEY  (`id`)
) ENGINE=MyISAM;

After giving freebies, add this code before that section of your script ends:

// Log IP address
query_logsql "INSERT INTO `freebielog` VALUES(NULL, '"+ getcharid(3) +"', '"+ getcharip(strcharinfo(0)) +"', NOW())";

To check if someone's already received freebies, add this code beforehand:

// Search for IP address
query_logsql "SELECT `ip_address` FROM `freebielog` WHERE `ip_address` = '"+ getcharip(strcharinfo(0)) +"'", .@char_ip$;

// Check if IP address matches search query
if (getcharip(strcharinfo(0)) == .@char_ip$) {
	// Error message or script
	mes "Sorry, you've already received freebies.";
	close;
}

You can replace the error message with your own, if you'd like.

Posted

what if.. they are in same PC Shop..? what about the other player wants some freebies.. but he can't get anything becoz the other player gets his freebies.. and that IP registered already

Posted

If they play behind the same router, they'll share their IP. If you're looking for a more "locked-down" solution, you may want to try using Harmony or a similar third-party program that allows for MAC address logging (in which case you'd need a slightly different method of retrieving and comparing computer identities). Even so, this could be bypassed in a matter of seconds by someone savvy enough to look around. You'd be better off logging hardware UIDs (as they are not so simply changed); if you figure that out, do share! ;>

 

The best advice I can offer right now is to just not give anything worthwhile or transferable as a freebie, since such things are exploitable even with good third-party software. There's always the idea of centralised accounts with your website, but again you'd be relying on a third-party source as a comparison and still be vulnerable to exploitation.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...