erm..i see your script using alot of Permanent Global Variable...
it is better not to use Permanent Global Variable to store this type of information or data...
if you want..you can try script it like this way..
( Untested Script due to my PC Messed up....my Test Server Gone.. )
prontera,155,181,5 script Sample 757,{
mes "Do you want to register for Team PK ?";
if( getarraysize( .TeamCount ) ){
for( set .@i,0; .@i < getarraysize( .TeamCount ); set .@i,.@i + 1 )
mes "[ ^FF0000"+getarraysize( .TeamCount )+"th Team^000000 ] : ^0000FF"+getpartyname( .TeamCount[.@i] )+"^000000";
}
next;
if( select("Register as "+( getarraysize( .TeamCount ) + 1 )+"th Team:Cancel") == 2 ) close;
if( !getcharid(1) || getpartyleader( getcharid(1),2 ) != getcharid(1) ){
mes "You must be a ^0000FFLeader^000000 of a party to register for this .";
close;
}
deletearray $@partymembercount,getarraysize( $@partymembercount );
deletearray $@partymembercid,getarraysize( $@partymembercid );
getpartymember getcharid(1),1;
if( $@partymembercount != .RequiredMember ){
mes "Your party required total of ^FF0000"+.RequiredMember+"^000000 Members to register.";
close;
}
if( getarraysize( .TeamCount ) >= .TeamLimit ){
mes "Sorry to inform you that there is no more Slot for you to register.";
mes "Maximum of ^FF0000"+.TeamLimit+" Team^000000 each match.";
close;
}
for( set .@i,0; getarraysize( .TeamCount ); set .@i,.@i + 1 )
if( getcharid(1) == .TeamCount[.@i] ){
mes "Sorry, you cant register twice in a match.";
close;
}
set .TeamCount[ getarraysize( .TeamCount ) ],getcharid(1);
announce "New Team Registered, "+getarraysize( .TeamCount )+"th Team is "+getpartyname( getcharid(1) )+" .",bc_map;
mes "Your Team has been Registered.";
mes "However, the Registration will be eliminate if there is not enough team sign up in the next minutes.";
initnpctimer;
close;
OnTimer60000:
if( getarraysize( .TeamCount ) < .TeamLimit ){
announce "[ Team PK ] : Cancelled due to not enough teams Register in given time.",0;
deletearray .TeamCount,getarraysize( .TeamCount );
}else{
announce "[ Team PK ] : Match is going to start now. Prepare yourself..",0;
for( set .@i,0; getarraysize( .TeamCount ); set .@i,.@i + 1 )
warpparty .Map$,0,0,.TeamCount[.@i];
}
stopnpctimer;
end;
OnPCDieEvent:
if( strcharinfo(3) == .Map$ ){
announce "[ "+strcharinfo(0)+" ] killed by "+rid2name( killerrid )+" .",bc_map;
warp "SavePoint",0,0;
}
end;
OnInit:
// How many Available team for PK
set .TeamLimit,4;
// How many Party Members required each teams
set .RequiredMember,4;
// What Map will be used
set .Map$,"guild_vs5";
end;
}
anyway..based on your topic...
i dunno how you want to determine which guild win.....
>.<