Upper And Lower Case Problem

Started by ali_vcmp, Nov 17, 2014, 06:06 PM

Previous topic - Next topic

ali_vcmp

I add This Level System
function GetLevel( player )
{
   local lvl =  GetSQLColumnData( QuerySQL( database, "SELECT account_level FROM registration WHERE Name='" + player.Name.tolower() + "'" ), 0 );
   if ( lvl ) return lvl;
   else return 0;
}
function GetLevelTag(player)
{
local lvl = GetLevel(player);
if( lvl == 0 ) return "Un-Registered";
if( lvl == 1 ) return "Member";
if( lvl == 5 ) return "Moderator";
if( lvl == 6 ) return "Admin";
if( lvl >= 7 ) return "Management";
}
and Gone  server I type /level ali its normally work Level 1 Stats Member  but i use upper case alphabets ALI And Type /level ITs Send ME Level 0 stats nullx0000x0blablabla Help me :(

Sebastian

Have you checked if target player is online or not ?

ali_vcmp

I Try ON MY Self But Its Send Me Level: 0 Stats: Null0x00xblabla And I Try In Lower case ali Its Normally work ???

Sebastian

Do you have any line like this: else if ( !plr ) MessagePlayer("Error - Unknown Player",player) ?

ali_vcmp


ali_vcmp

                local Name = player.Name;
                if ( !plr ) MessagePlayer( "[#ffffff] [" + text + " ] unknown Player", player );

Sebastian

Have you checked if player is registered ?
You better post the /level command.

ali_vcmp

     else if ( cmd == "level" )
     {
         if ( !text ) ePrivMessage( "[Syntax] -  !" + cmd + " <Nick/ID>", player );
        else
        {
           local plr = GetPlayer( text );
          if ( !plr ) Message( "[Error] - Invalid Player", player );
           MessagePlayer( plr.Name + "'s Level:[ " + GetLevel(plr) + " ] State:[ " + GetLevelTag(plr) + " ]", player );

        }
     }


Lower Words Un-registered I type /stats its send me Level: 0 Stats: null0x0x0x0
Lower Words I Register And Again Type /stats its normally work LEvel 1 Stats member

Upper Words Un-registered I type /stats its send me Level: 0 Stats: null0x0x0x0
Upper Words I Register And Again Type /stats its send me level 0 stats null0x0x0x0x :( Help Me

Sebastian

You didn't check anywhere if the player is registered or not, so do it. ;)
else if ( (pData.account_id) && (!pData.logged_in) ) MessagePlayer( "Error - " + plr.Name + " is not a registered user !", player );
(this supposing you use VBS)


ali_vcmp


Sebastian

Can't you just give more details than "not work" ? :|
Learn to be more understable than now.

ON: The plr isn't registered, there is no level specified. This means the server can't return something that doesn't exist.

ali_vcmp

Quote from: sseebbyy on Nov 17, 2014, 07:53 PMCan't you just give more details than "not work" ? :|
Learn to be more understable than now.

ON: The plr isn't registered, there is no level specified. This means the server can't return something that doesn't exist.
Seby level system work 100% in lower words ITs Not Work On upper Words U Can Try On Your Script

ali_vcmp

seeby my problem solved my problem tolower I Change  COLLATE NOCASE And ITs Work 100%

ali_vcmp