Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: Xmair on Aug 29, 2015, 04:21 AM

Title: GetSQLColumnData Doesn't exists?
Post by: Xmair on Aug 29, 2015, 04:21 AM
else if ( cmd == "readl" )
{
if(GetLetter( player )==0) ClientMessage("No letters received found.",player,255,255,0)
else if (!player.IsSpawned) ClientMessage("You're not spawned.",player,255,255,0)
else
{
local q = QuerySQL( db, "SELECT * FROM letters WHERE SentTo='"+player.Name+"'");
if ( GetSQLColummnData(q,1) )
{
local cashl = GetSQLColumnData( q, 2 );
ClientMessage("Letter from :- " + GetSQLColumnData( q, 3 ) + ".")
ClientMessage("Letter :- " + GetSQLColumnData( q, 1 ) + ".")
ClientMessage("Money sent :- " + GetSQLColumnData( q, 2 ) + ".")
IncCash( player, cashl )
        QuerySQL( db, "DELETE FROM letters WHERE Message='" + msg + "'" );
    FreeSQLQuery( q );
}
}
}
Things I have in this function :-
QuerySQL( db, "CREATE TABLE IF NOT EXISTS letters ( SentTo VARCHAR(32), Message TEXT, Cash NUMERIC, Sentfrom VARCHAR(32) )");Required and up to date everything like plugins and server.exe.
Error :-
onPlayerCommand Error :- The index "GetSQLColumnData" doesn't exists.
Yes, There is data inserted into that table, I've received a letter there.
Title: Re: GetSQLColumnData Doesn't exists?
Post by: Mashreq on Aug 29, 2015, 08:18 AM
You have forgot to include player and r, g, b color codes in your ClientMessage as well as you have not defined what is msg while deleting something in database.
Title: Re: GetSQLColumnData Doesn't exists?
Post by: Xmair on Aug 29, 2015, 08:54 AM
Thanks Mashreq, I'll test it when I'm on my PC.
Title: Re: GetSQLColumnData Doesn't exists?
Post by: Thijn on Aug 29, 2015, 10:55 AM
You have GetSQLColummnData()
Remove that extra m.
Title: Re: GetSQLColumnData Doesn't exists?
Post by: Xmair on Aug 29, 2015, 11:36 AM
Solved.