25.12.2012, 11:45
pawn Code:
stock LoadPlayer(playerid, inputtext[])
{
new hash[129];
WP_Hash(hash, sizeof(hash), inputtext);
if(IsPlayerConnected(playerid))
{
if(!strcmp(hash, mysql_ReturnPasswort(GetName(playerid)), true))
{
Spieler[playerid][pCash] = mysql_GetInt("accounts", "Cash", "Name", GetName(playerid));
//etc.
pawn Code:
stock SavePlayer(playerid)
{
if(IsPlayerConnected(playerid))
{
new query[1024];
format(query, sizeof(query), "UPDATE `accounts` SET Level=%d, Admin=%d, Cash=%d, Tutorial=%d, AccountLocked=%d, SpawnHealth=%f, Geschlecht=%d, Skin=%d, Perso=%d, CarLic=%d, Fraktion=%d, Rank=%d WHERE Name='%s'",
Spieler[playerid][pLevel],
Spieler[playerid][pAdmin],
GetPlayerMoney(playerid),
Spieler[playerid][pTutorial],
Spieler[playerid][pAccountLocked],
Spieler[playerid][pSpawnHealth],
Spieler[playerid][pGeschlecht],
Spieler[playerid][pSkin],
Spieler[playerid][pPerso],
Spieler[playerid][pCarLic],
Spieler[playerid][pFraktion],
Spieler[playerid][pRank],
GetName(playerid));
mysql_query(query);