Cmd Not Work

Started by ali_vcmp, Dec 05, 2014, 01:07 AM

Previous topic - Next topic

ali_vcmp

I Make This Addmanager Cmd For Clanstats I Type /addmanager (Clan)Ali ITs Doesnt work its show me error on console error
i Error From This Line           else if ( i <= 3 ) Msg( "Syntax > /addmanager <[Tag]Owner> <[Tag]Leader> <[Tag]Leader2> <Clan-Without-Symbol>", player );

I Remove this then its show me 3 error from this line                                 local Owner = params[ 0 ], Manager1 = params[ 1 ], Manager2 = params[ 2 ], Clan = params[ 3 ];


I Was Tried To Fix This Cmd I Update Numtok Gettok Function





             else if ( cmd == "addmanager" )
             {
                    // This command is for any admin
                    if ( !text ) Msg( "Syntax > !addmanager <[Tag]Owner> <[Tag]Leader> <[Tag]Leader2> <Clan-Without-Symbol>", player );
          else if ( i <= 3 ) Msg( "Syntax > !addmanager <[Tag]Owner> <[Tag]Leader> <[Tag]Leader2> <Clan-Without-Symbol>", player );
                    else
                       {
                       if ( !IsClanRegister( params[ 3 ].tolower() ) ) Msg( "Error > The clan " + params[ 3 ] + " is no register!", player );
                       else {
                                local Owner = params[ 0 ], Manager1 = params[ 1 ], Manager2 = params[ 2 ], Clan = params[ 3 ];
                              if ( !GetTag( Owner ) ) PM( "Error > The owner need clan!!", player );
                               else if ( !GetTag( Manager1 ) ) PM( "Error > The Manager 1 need clan!!", player );
                              else if ( !GetTag( Manager2 ) ) PM( "Error > The Manager 2 need clan!!", player );

                                All( player.Name + "'s added owner/managers in Clan: " + Clan );
                                All( "(Owner)-> " + Owner + " - (Managers)-> " + Manager1 + ", " + Manager2 );
                                QuerySQL( db, format( "UPDATE ClanStats SET Leaders='%s' WHERE Clan='" + Clan + "' COLLATE NOCASE", "" + Owner + ", " + Manager1 + ", " + Manager2 + "" ) );

                                PM( "Okay! Now need put !adduser <Your Player Of Clan> Example: deviL", player );
                                local dos = QuerySQL( db, "SELECT Users FROM ClanUsers WHERE Clans='" + Clan.tolower() + "' COLLATE NOCASE" ), Users = GetSQLColumnData( dos, 0 );
                                // Create Managers And owner in database dont delete this "DFAX0067XLPKDW"

                                if ( Users ) QuerySQL( db, format( "UPDATE ClanUsers SET Users='%s' WHERE Clans='" + Clan + "' COLLATE NOCASE", ""+Users+" " + TruncateClan( Owner ) + " " + TruncateClan( Manager1 ) + " " + TruncateClan( Manager2 ) + "" ) );
                                else QuerySQL( db, format( "UPDATE ClanUsers SET Users='%s' WHERE Clans='" + Clan + "' COLLATE NOCASE", "DFAX0067XLPKDW " + TruncateClan( Owner ) + " " + TruncateClan( Manager1 ) + " " + TruncateClan( Manager2 ) + "" ) );

                            }
                       }
             }

.

#1
Good luck to whoever attempts to read that crap :D DA FUQ YOU THINK THOSE [.CODE.]TAGS ARE FOR?
.

Thijn

And for fuck sake, post the actually error message.

ali_vcmp

Thijin Message Is normaly Work

Honey

Add CODE tags secondly post your full code including all the functions that are being used, And try to be more specific with your errors, I guess my HowTo about posting errors is useless :-\

ali_vcmp

Here's CMd Functions

function IsClanManager( clan )
{

                local q = QuerySQL( db, "SELECT Leaders FROM ClanStats WHERE Clan='" + GetTag( clan ).tolower() + "' COLLATE NOCASE" );
                local Leader = GetSQLColumnData( q, 0 );
                FreeSQLQuery( q );
      if ( Leader )
      {
         local param = split( Leader, ", " );

                          if ( param[ 0 ].tolower() == clan )
                          {
                            local ResultFirst = TruncateClan( param[ 0 ].tolower() );
                                  Result <- ResultFirst == TruncateClan( clan );
                              if ( !Result ) return null;
                        else return Result.tointeger();
                          }
                          if ( param[ 1 ].tolower() == clan )
                          {
                            local ResultSec = TruncateClan( param[ 1 ].tolower() );
                                  Result <- ResultSec == TruncateClan( clan );
                              if ( !Result ) return null;
                        else return Result.tointeger();
                          }
                          if ( param[ 2 ].tolower() == clan )
                          {
                            local ResultTree = TruncateClan( param[ 2 ].tolower() );
                                  Result <- ResultTree == TruncateClan( clan );
                              if ( !Result ) return null;
                        else return Result.tointeger();
                          }
                 }
}

Thijn

Locked.

You clearly don't read our replies regarding code tags and posting the actual error message.