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 :-
function GetLetter.
function IncCash.
Table is created.
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.
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.
Thanks Mashreq, I'll test it when I'm on my PC.
You have GetSQLColummnData()
Remove that extra m.
Solved.