18.01.2015, 18:20
Quote:
It saves it now ye forgot that function but i want to make it so when player registers he choose skin but when he logs in(as registered ofc)he get spawned how this could be implemented?
|
Here is the code that you asked for; this should be places under OnPlayerSpawn Callback.
pawn Код:
if((PlayerInfo[playerid][LoggedIn] == 1)) {
new query[100];
mysql_format(mysql, query, sizeof(query), "SELECT `pskin` FROM `accounts` WHERE `pid` = '%d'", pinfo[playerid][pMySQLID]);
new Cache:result = mysql_query(mysql, query);
if(cache_get_row_count() != 0)
{
pinfo[playerid][Skin] = cache_get_field_content_int(0, "pskin");
SetPlayerSkin(playerid,pinfo[playerid][Skin]);
}
cache_delete(result);}