ECD amount check

Started by Nihongo^, Aug 29, 2016, 08:29 AM

Previous topic - Next topic

KAKAN

Quote from: Nihongo^ on Aug 29, 2016, 01:17 PMi saved ecd in database in db the ecd are updating but not in game you have to rejoin the server for updating
simply update your variable. Show me how you update it in-game. Add the same function to your Inc, Dec ECD function(s).
oh no

Nihongo^

Quote from: KAKAN on Aug 29, 2016, 03:16 PM
Quote from: Nihongo^ on Aug 29, 2016, 01:17 PMi saved ecd in database in db the ecd are updating but not in game you have to rejoin the server for updating
simply update your variable. Show me how you update it in-game. Add the same function to your Inc, Dec ECD function(s).
Variable mean in database ?

btw here;'s my function that show the ECD

show <- CreateTextdraw("Vice Coins | " + GetSQLColumnData( QuerySQL( db, "SELECT VC FROM Account WHERE Name='" + player.Name + "'" ), 0 ) +  "",10,-30,Colors[ rand() % Colors.len() ]);

KAKAN

You manually need to delete and re-create it.
oh no

Nihongo^

Quote from: KAKAN on Aug 29, 2016, 03:53 PMYou manually need to delete and re-create it.
recreate the table ??

KAKAN

#19
Quote from: Nihongo^ on Aug 29, 2016, 04:05 PM
Quote from: KAKAN on Aug 29, 2016, 03:53 PMYou manually need to delete and re-create it.
recreate the table ??
no, the textdraw.
Here's an example:-
data <- array( 100 );
function onPlayerJoin( player ){
local ddraw = CreateTextdraw("Vice Coins | " + GetSQLColumnData( QuerySQL( db, "SELECT VC FROM Account WHERE Name='" + player.Name + "'" ), 0 ) +  "",10,-30,Colors[ rand() % Colors.len() ]);
data[ player.ID ] = ddraw; //Using arrays, you can store a lot more!
}

function IncECD( player, amount ){
//Your code.
//newecd is no of ECDs the player is having currently( increased one )
data[ player.ID ].Delete();
data[ player.ID ] = CreateTextdraw("Vice Coins | " + newecd +  "",10 ,-30,Colors[ rand() % Colors.len() ]);
}
oh no

Nihongo^

Thanks kakan this example help a lot :D
problem solved Thanks Again :D