// START OF NEW CHECK - [Duplicate IP in one party?]
attachrid .@origin;
// for IP check
set .@party_list$, "";
set .@done_list$, "";
set .@dupli, 0;
// Check Party Members
for ( .@i = 0; .@i < $@partymembercount; .@i++ ) {
if (isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) == 0)
continue;{
attachrid $@partymemberaid[.@i];
query_sql ("SELECT `last_ip` FROM `login` WHERE `account_id`=" + $@partymemberaid[.@i] + "", .@ipd$);
// If same IP is on party
if(compare(.@party_list$, "|" + .@ipd$ + "|" ) == 1) {
set .@dupli, 1;
} else
// Add IP to party list for checking
.@party_list$ += "|" + .@ipd$ + "|";
// If acc has entered ladder
if (compare( .en_acc_list$, "|" + getcharid(3,strcharinfo(0)) + "|" ) == 1) {
if(.@done_list$ == "")
.@done_list$ += strcharinfo(0);
else
.@done_list$ += ", " + strcharinfo(0);
}
}
}
// Get back to PTL to display message
attachrid .@origin;
if(.@dupli) {
mes "Sorry, party members with the same IP address can't enter.";
close;
}
if(.@done_list$ != "") {
mes "Sorry, the following people has already entered the ladder today:";
mes .@done_list$;
close;
}
// END OF NEW CHECK
This checks the party member is the same IP as party leader.
But I'm also trying to check to see if the party member has done the event before using uniqueID, here's my attempt.
// START OF NEW CHECK - [Duplicate IP in one party?]
attachrid .@origin;
// for IP check
set .@party_list$, "";
set .@done_list$, "";
set .@dupli, 0;
set .@done, 0;
// Check Party Members
for ( .@i = 0; .@i < $@partymembercount; .@i++ ) {
if (isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) == 0)
continue;{
attachrid $@partymemberaid[.@i];
.@lip = query_sql ("SELECT `last_ip` FROM `login` WHERE `account_id`=" + $@partymemberaid[.@i] + "", .@ipd$);
.@pmu = query_sql("SELECT last_unique_id FROM `login` WHERE account_id ="+$@partymemberaid[.@i]+"", .@party_mem_uid$);
.@gpmu = query_sql("SELECT `dailybbq` FROM `bloody_branch_uid` WHERE `unique_id` = "+.@party_mem_uid$+" LIMIT 1", .@pmbbq$);
.@cip = compare(.@party_list$, "|" + .@ipd$ + "|" )
.@cuid = compare(.@party_list$, "|" + .@pmbbq$ + "|" )
//Check party member UniqueID and see if they have completed for the day.
if(.@cip == 0 && .@cuid == 1) {
set .@done, 1;
}
// If same IP is on party
else if(.@cip == 1 && .@cuid == 0) {
set .@dupli, 1;
}
else if(.@cip == 0 && .@cuid == 0) {
// Add IP to party list for checking
.@party_list$ += "|" + .@ipd$ + "|";
// Add Unique_ID to party list for checking
.@party_list$ += "|" + .@pmbbq$ + "|";
}
// If acc has entered ladder
if (compare( .en_acc_list$, "|" + getcharid(3,strcharinfo(0)) + "|" ) == 1) {
if(.@done_list$ == "")
.@done_list$ += strcharinfo(0);
else
.@done_list$ += ", " + strcharinfo(0);
}
}
}
// Get back to PTL to display message
attachrid .@origin;
if(.@done) {
mes "A party member has completed the Bloody branch Quest today.";
close;
}
if(.@dupli) {
mes "Sorry, party members with the same IP address can't enter.";
close;
}
if(.@done_list$ != "") {
mes "Sorry, the following people has already entered the ladder today:";
mes .@done_list$;
close;
}
// END OF NEW CHECK
Question
DR4LUC0N
So the original code is
// START OF NEW CHECK - [Duplicate IP in one party?] attachrid .@origin; // for IP check set .@party_list$, ""; set .@done_list$, ""; set .@dupli, 0; // Check Party Members for ( .@i = 0; .@i < $@partymembercount; .@i++ ) { if (isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) == 0) continue;{ attachrid $@partymemberaid[.@i]; query_sql ("SELECT `last_ip` FROM `login` WHERE `account_id`=" + $@partymemberaid[.@i] + "", .@ipd$); // If same IP is on party if(compare(.@party_list$, "|" + .@ipd$ + "|" ) == 1) { set .@dupli, 1; } else // Add IP to party list for checking .@party_list$ += "|" + .@ipd$ + "|"; // If acc has entered ladder if (compare( .en_acc_list$, "|" + getcharid(3,strcharinfo(0)) + "|" ) == 1) { if(.@done_list$ == "") .@done_list$ += strcharinfo(0); else .@done_list$ += ", " + strcharinfo(0); } } } // Get back to PTL to display message attachrid .@origin; if(.@dupli) { mes "Sorry, party members with the same IP address can't enter."; close; } if(.@done_list$ != "") { mes "Sorry, the following people has already entered the ladder today:"; mes .@done_list$; close; } // END OF NEW CHECK
This checks the party member is the same IP as party leader.
But I'm also trying to check to see if the party member has done the event before using uniqueID, here's my attempt.
// START OF NEW CHECK - [Duplicate IP in one party?] attachrid .@origin; // for IP check set .@party_list$, ""; set .@done_list$, ""; set .@dupli, 0; set .@done, 0; // Check Party Members for ( .@i = 0; .@i < $@partymembercount; .@i++ ) { if (isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) == 0) continue;{ attachrid $@partymemberaid[.@i]; .@lip = query_sql ("SELECT `last_ip` FROM `login` WHERE `account_id`=" + $@partymemberaid[.@i] + "", .@ipd$); .@pmu = query_sql("SELECT last_unique_id FROM `login` WHERE account_id ="+$@partymemberaid[.@i]+"", .@party_mem_uid$); .@gpmu = query_sql("SELECT `dailybbq` FROM `bloody_branch_uid` WHERE `unique_id` = "+.@party_mem_uid$+" LIMIT 1", .@pmbbq$); .@cip = compare(.@party_list$, "|" + .@ipd$ + "|" ) .@cuid = compare(.@party_list$, "|" + .@pmbbq$ + "|" ) //Check party member UniqueID and see if they have completed for the day. if(.@cip == 0 && .@cuid == 1) { set .@done, 1; } // If same IP is on party else if(.@cip == 1 && .@cuid == 0) { set .@dupli, 1; } else if(.@cip == 0 && .@cuid == 0) { // Add IP to party list for checking .@party_list$ += "|" + .@ipd$ + "|"; // Add Unique_ID to party list for checking .@party_list$ += "|" + .@pmbbq$ + "|"; } // If acc has entered ladder if (compare( .en_acc_list$, "|" + getcharid(3,strcharinfo(0)) + "|" ) == 1) { if(.@done_list$ == "") .@done_list$ += strcharinfo(0); else .@done_list$ += ", " + strcharinfo(0); } } } // Get back to PTL to display message attachrid .@origin; if(.@done) { mes "A party member has completed the Bloody branch Quest today."; close; } if(.@dupli) { mes "Sorry, party members with the same IP address can't enter."; close; } if(.@done_list$ != "") { mes "Sorry, the following people has already entered the ladder today:"; mes .@done_list$; close; } // END OF NEW CHECK
Could someone help me in this please?
Edited by DR4LUC0NLink to comment
Share on other sites
3 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.