SA-MP Forums Archive
/skin Won't work, Not sure of why!? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: /skin Won't work, Not sure of why!? (/showthread.php?tid=299574)



/skin Won't work, Not sure of why!? - Dokins - 26.11.2011

pawn Код:
CMD:skin(playerid, params[])
{
    if(LoggedIn[playerid] == 0) return SendClientMessage(playerid, COLOUR_GREY, "You must be logged in to use this command.");
    new slot;
    if(sscanf(params, "d", slot)) return SendClientMessage(playerid, COLOUR_GREY, "Usage: /skin [slot id] Slot id's range from 1 - 10");
    if(IsPlayerInRangeOfPoint(playerid, 5.0, 958.1796, 2096.8029, 1011.0222) && Faction[playerid] == 3 && FRank[playerid] >= 1)
    if(slot == 1)
    {
        FactionSkin1[Faction[playerid]] = MySQL_GetValue(FactionSkin1[Faction[playerid]], "FactionSkin1", "factions");
        SetPlayerSkin(playerid, FactionSkin1[Faction[playerid]]);
    }
    if(slot == 2)
    {
        FactionSkin2[Faction[playerid]] = MySQL_GetValue(FactionSkin2[Faction[playerid]], "FactionSkin2", "factions");
        SetPlayerSkin(playerid, FactionSkin2[Faction[playerid]]);
    }
    if(slot == 3)
    {
        FactionSkin3[Faction[playerid]] = MySQL_GetValue(FactionSkin3[Faction[playerid]], "FactionSkin2", "factions");
        SetPlayerSkin(playerid, FactionSkin3[Faction[playerid]]);
    }
    if(slot == 4)
    {
        FactionSkin4[Faction[playerid]] = MySQL_GetValue(FactionSkin4[Faction[playerid]], "FactionSkin4", "factions");
        SetPlayerSkin(playerid, FactionSkin4[Faction[playerid]]);
    }
    if(slot == 5)
    {
        FactionSkin5[Faction[playerid]] = MySQL_GetValue(FactionSkin5[Faction[playerid]], "FactionSkin5", "factions");
        SetPlayerSkin(playerid, FactionSkin5[Faction[playerid]]);
    }
    if(slot == 6)
    {
        FactionSkin6[Faction[playerid]] = MySQL_GetValue(FactionSkin6[Faction[playerid]], "FactionSkin6", "factions");
        SetPlayerSkin(playerid, FactionSkin6[Faction[playerid]]);
    }
    if(slot == 7)
    {
        FactionSkin7[Faction[playerid]] = MySQL_GetValue(FactionSkin7[Faction[playerid]], "FactionSkin7", "factions");
        SetPlayerSkin(playerid, FactionSkin7[Faction[playerid]]);
    }
    if(slot == 8)
    {
        FactionSkin8[Faction[playerid]] = MySQL_GetValue(FactionSkin8[Faction[playerid]], "FactionSkin8", "factions");
        SetPlayerSkin(playerid, FactionSkin8[Faction[playerid]]);
    }
    if(slot == 9)
    {
        FactionSkin9[Faction[playerid]] = MySQL_GetValue(FactionSkin9[Faction[playerid]], "FactionSkin9", "factions");
        SetPlayerSkin(playerid, FactionSkin9[Faction[playerid]]);
    }
    if(slot == 10)
    {
        FactionSkin10[Faction[playerid]] = MySQL_GetValue(FactionSkin10[Faction[playerid]], "FactionSkin10", "factions");
        SetPlayerSkin(playerid, FactionSkin10[Faction[playerid]]);
    }
    return 1;
}
When I type /skin it doesnt retrieve the skin and set the player's skin with it, I already loaded them from mysql however. and I've done tests to see if it retrieves them correctly.


Re: /skin Won't work, Not sure of why!? - Joshb93 - 26.11.2011

Change this:

pawn Код:
if(sscanf(params, "d", slot))
To this:

pawn Код:
if(sscanf(params, "i", slot))



Re: /skin Won't work, Not sure of why!? - Dokins - 26.11.2011

+ rep fixed it! Thanks!!


Re: /skin Won't work, Not sure of why!? - Joshb93 - 27.11.2011

Great! XD