You can just re-use the check since you're already attaching the party members .gui = get_unique_id(); .@nb = query_sql("SELECT `bloodybranch` FROM `bloody_branch` WHERE `unique_id` = "+.gui+" LIMIT 1", .@bbq); if (.@nb) .@dupli = 1;   There's a simpler way, instead of the checking the IPs and unique ID, you can also save their account ids.