MySQL skins not saving
#1

So this is an extract of my script on OnPlayerDisconnect, so when you logout this saves the skin ID into the DB.

pawn Код:
SavePlayerSkin(playerid);
This is my setskin CMD (untidy, I know), at the bottom I tried SavePlayerSkin(targetid); in attempt to make that users skin save instantly after setting. This does not work, any reason why?

pawn Код:
CMD:setskin(playerid, params[])
{
    new targetid, skin, sendername[MAX_PLAYER_NAME], receiver[MAX_PLAYER_NAME], string[128];
    if(sscanf(params,"ui", targetid, skin)) return SendClientMessage(playerid, COLOR_RED,"[SERVER] USAGE: /setskin [PlayerID] [Skinmodel]");
    if(PlayerData[playerid][pAdminLevel] < 1) return SendClientMessage(playerid, COLOR_RED,"[SERVER] You are not authorised to use this command!");
    if(skin > 299 || skin < 1) return SendClientMessage(playerid, COLOR_RED,"[ADMIN] Skins range between 1-299.");
    if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_RED,"[ADMIN] This player is not connected.");
    GetPlayerName(playerid, sendername, sizeof(sendername));
    GetPlayerName(targetid, receiver,sizeof(receiver));
    format(string, sizeof(string),"[ADMIN] Your skin have been set to model %d by admin %s", skin, sendername);
    SendClientMessage(targetid, COLOR_RED, string);
    format(string, sizeof(string),"You have set %s skin to model %d", receiver, skin);
    SendClientMessage(playerid, COLOR_RED, string);
    SetPlayerSkin(targetid, skin); // just added pSkin to auto set when SetPlayerSkin is called, basically added more functionality to SetPlayerS ah alright, so should it save on
    SavePlayerSkin(targetid);
    return 1;
}
Reply


Messages In This Thread
MySQL skins not saving - by Jing_Chan - 11.09.2017, 23:07
Re: MySQL skins not saving - by Eoussama - 11.09.2017, 23:10
Re: MySQL skins not saving - by Jing_Chan - 11.09.2017, 23:23
Re: MySQL skins not saving - by Kane - 11.09.2017, 23:26
Re: MySQL skins not saving - by Jing_Chan - 11.09.2017, 23:32
Re: MySQL skins not saving - by Kane - 11.09.2017, 23:33
Re: MySQL skins not saving - by Jing_Chan - 11.09.2017, 23:42

Forum Jump:


Users browsing this thread: 1 Guest(s)