Skin doesn't load from MySQL? -
Jing_Chan - 30.07.2018
pawn Код:
SetSpawnInfo(playerid, 0, pInfo[playerid][Skin], 1922.8219,2440.4648,11.1782,180.3614, -1, -1, -1, -1, -1, -1);
When I use this it just spawns me in with the CJ skin?
Re: Skin doesn't load from MySQL? -
Rufio - 30.07.2018
Can you show us your MySQL error log as well as yoır saving functions?
Re: Skin doesn't load from MySQL? -
Jyothiranand - 30.07.2018
Change the number 0 to any other number.The skin ID you want. On the setspawninfo line
Re: Skin doesn't load from MySQL? -
Jing_Chan - 30.07.2018
Quote:
Originally Posted by Rufio
Can you show us your MySQL error log as well as yoır saving functions?
|
This is the OnPlayerDisconnect query:
pawn Код:
mysql_format(Database, DB_Query, sizeof(DB_Query), "UPDATE `PLAYERS` SET `SCORE` = %d, `CASH` = %d, `KILLS` = %d, `DEATHS` = %d, `ADMIN` = %d, `SKIN` = %d, `DONATOR` = %d, `NAMECHANGES` = %d, `HEADSHOTS` WHERE `ID` = %d LIMIT 1",
pInfo[playerid][Score], pInfo[playerid][Cash], pInfo[playerid][Kills], pInfo[playerid][Deaths], pInfo[playerid][Admin], pInfo[playerid][Skin], pInfo[playerid][Donator], pInfo[playerid][Namechanges], pInfo[playerid][Headshots], pInfo[playerid][ID]);
during login..
pawn Код:
cache_get_value_int(0, "SKIN", pInfo[playerid][Skin]);
--
Quote:
Originally Posted by Jyothiranand
Change the number 0 to any other number.The skin ID you want. On the setspawninfo line
|
pawn Код:
(playerid, team, skin, Float:x, Float:y, Float:z, Float:rotation, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo)
that would be incorrect, refer to the SA:MP wiki
Re: Skin doesn't load from MySQL? -
jlalt - 30.07.2018
seems like your updating data query has an issue.
PHP код:
`HEADSHOTS` WHERE `ID` = %d LIMIT 1
has to be:
PHP код:
`HEADSHOTS` = %d WHERE `ID` = %d LIMIT 1
so ->
PHP код:
mysql_format(Database, DB_Query, sizeof(DB_Query), "UPDATE `PLAYERS` SET `SCORE` = %d, `CASH` = %d, `KILLS` = %d, `DEATHS` = %d, `ADMIN` = %d, `SKIN` = %d, `DONATOR` = %d, `NAMECHANGES` = %d, `HEADSHOTS`= %d WHERE `ID` = %d LIMIT 1",
pInfo[playerid][Score], pInfo[playerid][Cash], pInfo[playerid][Kills], pInfo[playerid][Deaths], pInfo[playerid][Admin], pInfo[playerid][Skin], pInfo[playerid][Donator], pInfo[playerid][Namechanges], pInfo[playerid][Headshots], pInfo[playerid][ID]);
Re: Skin doesn't load from MySQL? -
Jing_Chan - 30.07.2018
Quote:
Originally Posted by jlalt
seems like your updating data query has an issue.
PHP код:
`HEADSHOTS` WHERE `ID` = %d LIMIT 1
has to be:
PHP код:
`HEADSHOTS` = %d WHERE `ID` = %d LIMIT 1
so ->
PHP код:
mysql_format(Database, DB_Query, sizeof(DB_Query), "UPDATE `PLAYERS` SET `SCORE` = %d, `CASH` = %d, `KILLS` = %d, `DEATHS` = %d, `ADMIN` = %d, `SKIN` = %d, `DONATOR` = %d, `NAMECHANGES` = %d, `HEADSHOTS`= %d WHERE `ID` = %d LIMIT 1",
pInfo[playerid][Score], pInfo[playerid][Cash], pInfo[playerid][Kills], pInfo[playerid][Deaths], pInfo[playerid][Admin], pInfo[playerid][Skin], pInfo[playerid][Donator], pInfo[playerid][Namechanges], pInfo[playerid][Headshots], pInfo[playerid][ID]);
|
The skin saves perfectly, it just won't load it and set me it.
Re: Skin doesn't load from MySQL? -
jlalt - 30.07.2018
Quote:
Originally Posted by Jing_Chan
The skin saves perfectly, it just won't load it and set me it.
|
Have you checked the mysql database or predicting? may you do another test? [ buy a skin or whatever then relog? ]
Re: Skin doesn't load from MySQL? -
Jing_Chan - 30.07.2018
Quote:
Originally Posted by jlalt
Have you checked the mysql database or predicting? may you do another test? [ buy a skin or whatever then relog? ]
|
I'm testing it now..
I've checked and it doesn't seem to be saving, any ideas?
Re: Skin doesn't load from MySQL? -
Jing_Chan - 30.07.2018
The skin saves now but still won't load?
pawn Код:
SetPlayerSkin(playerid, pInfo[playerid][Skin]);
under OnPlayerSpawn etc..
Re: Skin doesn't load from MySQL? -
Rufio - 30.07.2018
Can you show us the code where you load your player's data? Does it only fail at loading skin or does it fail at loading EVERY variable?