Doom clanstats

Started by Cool, May 26, 2016, 08:23 AM

Previous topic - Next topic

Cool

hi guys i have a problem thats not a bug as doom killers said its not modifyed too much i want know how to do it
like a clan is [MK] created in clans but when a player came with same clan but with tag of ==MK== YA MK_R THATS came in diffrent clan can you help me how to fix it :-\                                    http://vcmp.liberty-unleashed.co.uk/forum/index.php?topic=1669.0

DizzasTeR

Kratos_ had posted a modified function which can do what you desire, http://vcmp.liberty-unleashed.co.uk/forum/index.php?topic=2883.0

If you can't get that to work with the one I released, then you should think of another way yourself.

Cool

Thank you
and and geting it in work is not hard :P every one can do it

Cool

sORRY BUT I DIDnt check command that now when i typing cmd i getting error the index toupper does not exists
as here dided with nihongo
http://vcmp.liberty-unleashed.co.uk/forum/index.php?topic=2880.15

KAKAN

You said everyone can do it, then why not you?
oh no

Cool

Quote from: KAKAN on May 26, 2016, 03:34 PMYou said everyone can do it, then why not you?
he meant by other functions And not this that toupper shit

KAKAN

Quote from: Hercules on May 26, 2016, 03:54 PM
Quote from: KAKAN on May 26, 2016, 03:34 PMYou said everyone can do it, then why not you?
he meant by other functions And not this that toupper shit
Okay, let me ask, what if the value is null?
Try: print( "string".toupper() );
print( null.toupper() );
The same problem happens there I guess.
oh no

Cool

first one retruning string second giving error toupper does not exists

KAKAN

Quote from: Hercules on May 26, 2016, 05:19 PMfirst one retruning string second giving error toupper does not exists
Did you read my whole post even?
That's the problem, you didn't give me any code, so, I gave you examples. Now, instead of giving error codes, why not try to fix it yourself? If you can't, post it here, I'm here to help you :D
oh no

Cool

#9
:) ;)function GetTag( string )
{
        local
        Tag = FindClan( string ).toupper(),                 // Getting the clan tag & switching it to upper case just to match the table regardless of case.
        // There needed the alliance in big letters
        // Clan Table for defining slots of clan sublevels [ Trainee, Rookie & Scout ]
        Clans = { VU_T = "VU", VU_R = "VU", TLK = "ULK", TLKR = "ULK", MKT = "MK", MKS = "MK", DKR = "DK", DKT = "DK", DKS = "DK" };
       
         if ( Tag in Clans )    // Checking if the tag obtained through findclan( string ) is in Clan Table or not
        {
             return Clans[ Tag ];      // If yes, its time to calling their corresponding slots from the table
        }
        else return FindClan( string );    // if not, then tag will be as it is [ If no slot will be alloted for a clan then script may recognize sublevels as other clans ]
}
// FindClan Function
function FindClan( strPlayer )
{
local
     D_DELIM = regexp(@"([\[(=^<{]+\w+[\])=^>}]+)"),// Checking for double delimiter like [TX],{TX},(TX),=TX=,^TX^,<TX>
     D_DELIM_SYM_2 = regexp(@"([\[(=^<{]+\w+[\.*-=]+\w+[\])=^>}]+)"),    // Checking the presence of symbolic clan tag with 2 alphanumeric values like [T-X]Azazel [ Double Delimiter ]
     D_DELIM_SYM_3 = regexp(@"([\[(=^<{]+\w+[\.*-=]+\w+[\.*-=]+\w+[\])=^>}]+)"), // Checking the presence of symbolic clan tag with 3 alphanumeric values like [F.O.X]Sofia [ Double Delimiter ]
         S_DELIM = regexp(@"(\w.+[.*=]+)"),               // Checking for single delimiter like VT. VT= VT* 

     D_DELIM_res = D_DELIM.capture(strPlayer),// Capturing for the double delimiter expression in player.Name  [ will return some array blocks of clan as [TX] < WITH THE CLAN TAG SYMBOL INCLUDED>]
     D_DELIM_SYM_2_res = D_DELIM_SYM_2.capture(strPlayer),  // Capturing for T-X / T.X / T*X Type
     D_DELIM_SYM_3_res = D_DELIM_SYM_3.capture(strPlayer),  // Capturing for F-O-X / F.O.X / F*O*X Type
     S_DELIM_res = S_DELIM.capture(strPlayer);           // Capturing for the single delimiter expression in player.Name  [ will return some array blocks as VT. < WITH THE CLAN TAG SYMBOL INCLUDED>]

if ( D_DELIM_res != null )      // Are captured expressions true ? Do they physically exist in memory?
{
return strPlayer.slice( D_DELIM_res[ 0 ].begin + 1, D_DELIM_res[ 0 ].end - 1 );   // Slicing [TX] into TX by moving 1 step forward from beginning & same step backward from the end 
}
else if ( D_DELIM_SYM_2_res != null )     
{
local tag_sym_2 = strPlayer.slice( D_DELIM_SYM_2_res[ 0 ].begin + 1, D_DELIM_SYM_2_res[ 0 ].end - 1 );   // Slicing [T-X] into T-X by moving 1 step forward from beginning & same step backward from the end 
    local amalgamate_2 = split(tag_sym_2, ".*-=");                      // Splitting T-X into 2 array blocks like a[0] = T, a[1] = X [ DEFINED BY SEPARATORS ]
    return (amalgamate_2[0]+amalgamate_2[1]);                         // Returning the Sum i.e. TX
}
else if ( D_DELIM_SYM_3_res != null )      // Are captured expressions true ? Do they physically exist in memory?
{
local tag_sym_3 = strPlayer.slice( D_DELIM_SYM_3_res[ 0 ].begin + 1, D_DELIM_SYM_3_res[ 0 ].end - 1 );   // Slicing [F.0.X] into F.O.X by moving 1 step forward from beginning & same step backward from the end 
    local amalgamate_3 = split(tag_sym_3, ".*-=");                      // Splitting F.O.X into 3 array blocks like a[0] = F, a[1] = 0, a[2] = X [ DEFINED BY SEPARATORS ]
    return (amalgamate_3[0]+amalgamate_3[1]+amalgamate_3[2]);           // Returning the Sum i.e. FOX

}
else if ( S_DELIM_res != null )
{
return strPlayer.slice( S_DELIM_res[ 0 ].begin, S_DELIM_res[ 0 ].end - 1 ); // Slicing VT. into VT by moving 1 step backward from the end
}
        else return null;                            // No such expressions found? Probably player isn't in a clan. Let's return null !!!
}

DizzasTeR

Quote from: Hercules on May 26, 2016, 06:45 PMelse return null;    // No such expressions found? Probably player isn't in a clan. Let's return null !!!

That.

Cool

Quote from: Doom_Kill3R on May 27, 2016, 04:47 AM
Quote from: Hercules on May 26, 2016, 06:45 PMelse return null;    // No such expressions found? Probably player isn't in a clan. Let's return null !!!

That.
Please can you tell me in detail what to do if you are telling remove so its will cause error on playerjoin dont be angry :P

KAKAN

Quote from: Hercules on May 27, 2016, 01:12 PM
Quote from: Doom_Kill3R on May 27, 2016, 04:47 AM
Quote from: Hercules on May 26, 2016, 06:45 PMelse return null;    // No such expressions found? Probably player isn't in a clan. Let's return null !!!

That.
Please can you tell me in detail what to do if you are telling remove so its will cause error on playerjoin dont be angry :P
Change it to: return "";
oh no

Cool