Doom Clan stats

Started by Finch Real, Jun 10, 2016, 05:42 PM

Previous topic - Next topic

Finch Real

Well i am using Doom Clan Stats Provided in Old Forum I have replaced Kratos FindClanTag Function and whenever i type /clanstats [HS] or HS it say HS or [HS] does not exist But they are inserted in DB

function FindClanTag( 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 "";                           // No such expressions found? Probably player isn't in a clan. Let's return null !!!
}

Cmd
else if ( cmd == "clanstats" )
    {
        if( !text ) ePrivMessage(">> Use: / clanstats <Clan Name> (Example: / clanstats [MK]. Using only text won't work, Use clan symbols with it)", player );
        else
        {
            local cname = FindClanTag( text );
            if( cname )
            {
                local ckills = GetSQLColumnData( QuerySQL( cs, "SELECT Kills FROM Clan WHERE Name='" + cname + "'" ), 0 );
                if ( ckills )
                {
                Message( ">> " + text + " Has total kills of: " + ckills );
                }
                else ePrivMessage( "Clan " + text + " does not exist ", player );
            }
        }   
    }
My Snipet Showroom

http://pastebin.com/5KKuU5cg

Cool

i am sure you did some hell in it its works perfect for me

Finch Real

You can see the Code i just change
else return 0; to
else ePrivMessage( "Clan " + text + " does not exist ", player ); in end of cmd
My Snipet Showroom

http://pastebin.com/5KKuU5cg

Cool

you have database conected as cs?

Finch Real

Yes i have connect database even score changes after some clan member kill
My Snipet Showroom

http://pastebin.com/5KKuU5cg

EK.IceFlake

He is asking if you did this
cs <- ...
instead of the more common
db <- ...
(oh now I get it... YOU MADE A NEW FUCKING DATABASE FOR A CLAN SYSTEM!!!!)