Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: BANDauthorized on Nov 18, 2016, 12:37 AM

Title: 'tostring'
Post by: BANDauthorized on Nov 18, 2016, 12:37 AM
AN ERROR HAS OCCURED [the index 'tostring' does not exist]

CALLSTACK
*FUNCTION [FindPlayerClan()] Functions.nut line [258]

LOCALS
[string] "BANDauthorized"
[player] INSTANCE
[this] TABLE
[player] INSTANCE
[this] TABLE
[player] INSTANCE
[this] TABLE

function FindPlayerClan( player, string )
{
        string = string;
        q <- QuerySQL( db, "SELECT * FROM ClanUsers WHERE Clans='" + GetTag( string ) + "' COLLATE NOCASE" );
        db <- GetSQLColumnData( q, 1 ).tostring(); //258
        TCC <- TruncateClan;

              if ( db.tolower().find( TCC( string.tolower() ) ) ) { PrivMessage( "Your Nick " + TCC( string ) + ", Clan: " + GetTag( string ), player ); } else { ClanKick( player ); return null; }
}
Title: Re: 'tostring'
Post by: aXXo on Nov 18, 2016, 01:39 AM
You need to check the result of GetSQLColumnData( q, 1 ) before using the tostring() property.
If it is null, you will get the error.
Title: Re: 'tostring'
Post by: Cool on Nov 18, 2016, 07:07 AM
This Clanstats Will never work if you fixed this error then its will start working but will  crash ur server better to leave