Nick not register Clan bug

Started by Nihongo^, Dec 31, 2018, 02:51 PM

Previous topic - Next topic

Nihongo^

Hi first thanks to all of you who are helping me
i am trying to put clan system on my script i put clan tag and owner nick but server said that nick ( owner name ) not register while my nick is already on db and i am an admin



cmd
else if ( cmd == "addclan" )
  {
  if ( status[ player.ID ].Registered == false ) ErrorMessage( "[#FF0000][Server] - [#FFFFFF]You need to be a part of our community to use this command.", player );
  else if ( status[ player.ID ].Logged == false ) ErrorMessage( "[#FF0000][Server] - [#FFFFFF]You need to be identified to use this command.", player );
  else if ( GetLevel( player ) < 6 ) ErrorMessage("[Server] - [#FFFFFF]You don't have access to use this Command.", player );
  else if ( !text ) ErrorMessage( "[SYNTAX] - [#FFFFFF] /"+cmd+" <Clan-Tag> <Clan-Admin-Full-Nick>", player );
  else
    {
    local Clan = GetTok( text, " ", 1 );
    if ( !Clan ) ErrorMessage( "[ERROR] - Mention Clan-Tag.", player );
    else if ( Clan && IsClanRegister( Clan.tolower() ) ) ErrorMessage( "[ERROR] - [#FFFFFF]Clan [ "+Clan+" ] is already registered.", player );
    else
      {
      local Owner = GetTok( text, " ", 2 );
      if ( !Owner ) ErrorMessage( "[ERROR] - [#FFFFFF]Mention Clan-Admin-Nick.", player );
      else RegisterClan( player, Clan, Owner.tolower(ss) );
      }
    }
  }

Fucntion

function RegisterClan( player, Clan, OwnerNick )
  {
  local q = QuerySQL( db, "SELECT Name FROM Accounts WHERE lower(Name) LIKE '"+OwnerNick+"'" );
  if (!q) ErrorMessage( "[#FF0000][Server] - [#FFFFFF]"+OwnerNick+" is not a registered nick.", player );
  else if (q)
    {
    local Owner = GetSQLColumnData( q, 0 );
    QuerySQL( db, "UPDATE Accounts SET Clan='"+Clan.tolower()+"' WHERE Name='"+Owner+"'COLLATE NOCASE" );
    QuerySQL( db, "INSERT INTO ClanMembers ( Clan , Owner, Leader1, Leader2, Leader3, Users  ) VALUES ( '"+Clan.tolower()+"', '"+Owner+"', 'null', 'null', 'null', 'Members:' )" );
    QuerySQL( db, "INSERT INTO ClanStats ( Tag, Clan , Kills, Deaths, Deads ) VALUES ( '"+Clan+"', '"+Clan.tolower()+"', '0', '0', '0' )" );
    QuerySQL( db, "CREATE TABLE IF NOT EXISTS "+Clan.tolower()+" ( Clan TEXT, Member TEXT, Reporter TEXT, Reason TEXT, Date_Of_Report TEXT )" );
    ServerMessage( "Admin "+player.Name+" has registered a new clan:[ "+Clan+" ] clan admin:[ "+Owner+" ]." )

    }

!

#1
RegisterClan( player, Clan, Owner.tolower(ss) );
Why is there ss inside brackets?

PS:
The message in the server clearly says that the argument OwnerNick received is empty string.

Discord: zeus#5155