10.09.2013, 01:24
Ok all things is work fine now i have fixed anything and just a little more problem is how can i load player data...
i maded this
And
But it don't give me the money...
i maded this
pawn Код:
stock MySQL_Login(playerid)
{
new Query[300],pname[24],savestr[50];
GetPlayerName(playerid,pname,sizeof(pname));
format(Query,sizeof(Query),"SELECT * FROM accounts WHERE user = '%s'",pname);
mysql_query(Query);
mysql_store_result();
while(mysql_fetch_row_format(Query,"|"))
{
mysql_fetch_field_row(savestr, "money"); MoneyGiven[playerid] = strval(savestr);
}
mysql_free_result();
SendClientMessage(playerid,-1,"SERVER BOT: You have been logged in!");
Logged[playerid] = 1;
return 1;
}
pawn Код:
public OnPlayerSpawn(playerid)
{
if(MoneyGiven[playerid] != -1)
{
GivePlayerMoney(playerid, MoneyGiven[playerid]);
MoneyGiven[playerid] = -1;
}
return 1;
}