Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: ali_vcmp on Nov 17, 2014, 06:06 PM

Title: Upper And Lower Case Problem
Post by: ali_vcmp on Nov 17, 2014, 06:06 PM
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 :(
Title: Re: Upper And Lower Case Problem
Post by: Sebastian on Nov 17, 2014, 06:30 PM
Have you checked if target player is online or not ?
Title: Re: Upper And Lower Case Problem
Post by: ali_vcmp on Nov 17, 2014, 06:50 PM
I Try ON MY Self But Its Send Me Level: 0 Stats: Null0x00xblabla And I Try In Lower case ali Its Normally work ???
Title: Re: Upper And Lower Case Problem
Post by: Sebastian on Nov 17, 2014, 07:01 PM
Do you have any line like this: else if ( !plr ) MessagePlayer("Error - Unknown Player",player) ?
Title: Re: Upper And Lower Case Problem
Post by: ali_vcmp on Nov 17, 2014, 07:05 PM
Yes I have
Title: Re: Upper And Lower Case Problem
Post by: ali_vcmp on Nov 17, 2014, 07:05 PM
                local Name = player.Name;
                if ( !plr ) MessagePlayer( "[#ffffff] [" + text + " ] unknown Player", player );
Title: Re: Upper And Lower Case Problem
Post by: Sebastian on Nov 17, 2014, 07:12 PM
Have you checked if player is registered ?
You better post the /level command.
Title: Re: Upper And Lower Case Problem
Post by: ali_vcmp on Nov 17, 2014, 07:17 PM
     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
Title: Re: Upper And Lower Case Problem
Post by: Sebastian on Nov 17, 2014, 07:23 PM
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)
Title: Re: Upper And Lower Case Problem
Post by: ali_vcmp on Nov 17, 2014, 07:29 PM
not work ???
Title: Re: Upper And Lower Case Problem
Post by: ali_vcmp on Nov 17, 2014, 07:37 PM
Why Its Not Work ???
Title: Re: Upper And Lower Case Problem
Post by: Sebastian on Nov 17, 2014, 07:53 PM
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.
Title: Re: Upper And Lower Case Problem
Post by: ali_vcmp on Nov 17, 2014, 08:59 PM
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
Title: Re: Upper And Lower Case Problem
Post by: ali_vcmp on Nov 17, 2014, 09:53 PM
seeby my problem solved my problem tolower I Change  COLLATE NOCASE And ITs Work 100%
Title: Re: Upper And Lower Case Problem
Post by: ali_vcmp on Nov 17, 2014, 09:54 PM
Thanks Seby Topic! Locked ;)