Hello iam trying to add gems on my script
ok to save gems stats my friend use savestats function which mean if the player left the server, script store his info ( gems ) into database
Quotefunction SaveStatus( player )
{
QuerySQL(db, "UPDATE Accounts SET Gems = '"+status[ player.ID ].Gems+"', GemsRange = '"+status[ player.ID ].GemsRange+ "' WHERE Name = '"+ player.Name +"'");
print( "saved status of player: "+player.Name+"." );
}
but i remove the savestats function and add this
Quotefunction IncGems( player )
{
local Calc = PlayerGems( player ) + 1;
local query1 = format( "UPDATE Account SET Gems=%i WHERE Name='" + player.Name +"'", Calc );
QuerySQL( db, query1 );
}
function PlayerGems( player )
{
local name = player.Name;
local Answer = QuerySQL( db, "SELECT Kills, Deaths, Joins, Gems FROM Account WHERE Name='" + player.Name +"' COLLATE NOCASE" );
local Gems = GetSQLColumnData( Answer, 0 );
if ( !Gems ) return 0;
else return Gems;
FreeSQLQuery( Answer );
}
But the script is not updating the gems value in db also what is the use of this value
Quotelocal Gems = GetSQLColumnData( Answer, 0 );
why we put the 0 ?. I saw on my cash function it was 2
Rip this forum man nobodys helping me
What u Man, i Don't Understand Anything.
Man just Use The Fuzzie Account System, Its very Good.
P.S Your English RAPED.
Good Luck.
Try To Add it For function OnPlayerJoin & OnPlayerPart.
SaveStatus( player );
GL.
Quote from: Mohamed on Dec 05, 2017, 06:30 PMP.S Your English RAPED.
Like You did master in inglish
Fast Go School And Learn how to talk English
Good Luck.
Quote from: Mohamed on Dec 06, 2017, 07:26 AMFast Go School And Learn how to talk English
Good Luck.
I suggest you to do the same.
Quote from: Xmair on Dec 06, 2017, 09:06 AMQuote from: Mohamed on Dec 06, 2017, 07:26 AMFast Go School And Learn how to talk English
Good Luck.
I suggest you to do the same.
Nah, i Already Learned
i Suggest You To Do the Same.
Quote from: Mohamed on Dec 06, 2017, 09:35 AMQuote from: Xmair on Dec 06, 2017, 09:06 AMQuote from: Mohamed on Dec 06, 2017, 07:26 AMFast Go School And Learn how to talk English
Good Luck.
I suggest you to do the same.
Nah, i Already Learned
i Suggest You To Do the Same.
Lol and what was the reason of suggesting him Fuzzie Account System if you don't even know what he needs.
Quote from: Mohamed on Dec 05, 2017, 06:30 PMWhat u Man, i Don't Understand Anything.
Man just Use The Fuzzie Account System, Its very Good.
P.S Your English RAPED.
Good Luck.
Now we all know who needs to go to school.
@Nihongo^ try this
function IncGems( player )
{
local Calc = PlayerGems( player ) + 1;
QuerySQL( db, "UPDATE Account SET Gems='"+Calc+"' WHERE Name='"+player.Name+"'" );
}
function PlayerGems( player )
{
local query = QuerySQL( db, "SELECT Gems FROM Account WHERE Name='"+player.Name+"'" );
if ( !query ) return 0;
local Gems = GetSQLColumnData( query, 0 );
FreeSQLQuery( query );
return Gems.tointeger();
}