Thanks to Ittermat and Kristhasirah I was able to get this code working. Basically, when users claim adopts through the promocode system, conditions don't work. Because the Mysidia script applies conditions to adopts purchased through the adopt shop. So now, my promocode area blocks users from getting more than one of this specific adopt I set, which is Dimas. The only file you need to mod is promo.php.
In the public function index you'll find the input->post code, this:
In the public function index you'll find the input->post code, this:
if($mysidia->input->post("promocode")){
$mysidia->session->validate("promo");
$promo = new Promocode($mysidia->input->post("promocode"));
switch($promo->pid){
case 0:
throw new PromocodeException("fail");
break;
default:
if($promo->validate($mysidia->input->post("promocode"))) $promo->execute();
}
$mysidia->session->terminate("promo");
return;
}
$mysidia->session->assign("promo", 1);
}
and we're going to change it to this:
$check = $mysidia->db->select("owned_adoptables", array("type"), "type='Mitikabe' and owner = '{$mysidia->user->username}'")->rowCount();
$dimas = $mysidia->db->select("owned_adoptables",array("type"),"type='Mitikabe' and owner='{$mysidia->user->username}'")->rowCount();
if($mysidia->input->post("promocode") == '779369439249332' and $dimas >= 1){
$mysidia = Registry::get("mysidia");
$this->setFlags("error", "<br><br><b>Sorry, you have already claimed this code. If you believe this is a problem, please message an admin or moderator.</b>");
}
elseif($mysidia->input->post("promocode")){
$mysidia->session->validate("promo");
$promo = new Promocode($mysidia->input->post("promocode"));
switch($promo->pid){
case 0:
throw new PromocodeException("fail");
break;
default:
if($promo->validate($mysidia->input->post("promocode"))) $promo->execute();
}
$mysidia->session->terminate("promo");
return;
}
$mysidia->session->assign("promo", 1);
}
}
You'll need to change the 'type' areas because Mitikabe is my own species, of course lol, and change the $check and $dimas if you want. That 779369439249332 area is the promocode code, annnnd that's it!