*** Terrible Title Removed
#1

Hello
Removed
Reply
#2

Replace it with:
pawn Код:
new query[256], pname[24];
GetPlayerName(playerid, pname, 24);
format(query,sizeof(query),"SELECT SavSkin FROM data WHERE UseSkin=1 AND user='%s LIMIT 1'",pname);
mysql_query(query);
mysql_store_result();
new skinstr[26];
if(mysql_retrieve_row())
{
    mysql_fetch_field_row(skinstr, "SavSkin");
    SetPlayerSkin(playerid,strval(skinstr));
    mysql_free_result();
}
else
{
    SetPlayerSkin(playerid,1); // Default Skin if query failed.
}
Reply
#3

Removed
Reply
#4

Okay,
But when he doesn't use a skin the UseSkin is 0 right?
So if it's 0 it won't retrieve any rows, but here is a solution if that doesnt work.
Replace it with:
pawn Код:
new query[256], pname[24];
GetPlayerName(playerid, pname, 24);
format(query,sizeof(query),"SELECT SavSkin FROM data WHERE UseSkin=1 AND user='%s LIMIT 1'",pname);
mysql_query(query);
mysql_store_result();
new skinstr[26];
if(mysql_retrieve_row())
{
    mysql_fetch_field_row(skinstr, "SavSkin");
        if(strval(skinstr) > 0)
        {
    SetPlayerSkin(playerid,strval(skinstr));
        }
        else
        {
         SetPlayerSkin(playerid,1); // default skin.
         }
    mysql_free_result();
}
else
{
    SetPlayerSkin(playerid,1); // Default Skin if query failed.
}
Reply
#5

Removed
Reply
#6

No, the default skin (CJ) = ID 0.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)