SA-MP Forums Archive
/favkskin - 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: /favkskin (/showthread.php?tid=362659)



/favkskin - misho1 - 25.07.2012

Hi,
I Made /FavSkin Cmd It Save The Player's Favourite Skin,When I Typed /FavSkin It Saved My Favourite Skin In My Account File
Код:
Favourite Skin = 23
But The Problem When I Type /MyFSkin It Show To Me CJ Skin ID = 0

pawn Код:
YCMD:favskin(playerid,params[],healp)
                {
                new string[128],skinid;
                skinid = GetPlayerSkin(playerid);
                new INI:File = INI_Open(Path(playerid));
                INI_SetTag(File,"Player's Data");
                INI_WriteInt(File,"Favourite Skin",GetPlayerSkin(playerid));
                format(string,sizeof(string),"You Hade Set Skin (id: %d) As Your Favourite Skin",skinid);
                SendClientMessage(playerid,GREEN,string);
                INI_Close(File);
                return 1;
            }
           
                YCMD:myfskin(playerid,params[],healp)
                {
                SetPlayerSkin(playerid,PInfo[playerid][FSkin]);
                SendClientMessage(playerid,GREEN,"Here Is Your Favourit Skin!");
                return 1;
            }

Thanks


Re: /favkskin - Cjgogo - 25.07.2012

Add this to the /favskin command:
pawn Код:
PInfo[playerid][FSkin]=GetPlayerSKin(playerid);
And then change the writing line to:
pawn Код:
INI_WriteInt(File,"Favourite Skin",PInfo[playerid][FSkin]);



Re: /favkskin - misho1 - 25.07.2012

Thanks Cjgogo
Rep+


EDITED
When I Close And Open The Server And I Type /myfskin it show CJ Skin


Re: /favkskin - misho1 - 08.08.2012

Bump


Respuesta: /favkskin - [DOG]irinel1996 - 08.08.2012

You have to load the skin when player login/connect. Because you don't load anywhere as I see.


Re: /favkskin - misho1 - 19.08.2012

I Have Loaded It
pawn Код:
public loadaccount_user(playerid, name[], value[])
{
    INI_String("Password", PInfo[playerid][Pass],129);
    INI_Int("AdminLevel",PInfo[playerid][Adminlevel]);
    INI_Int("VIPLevel",PInfo[playerid][VIPlevel]);
    INI_Int("Money",PInfo[playerid][Money]);
    INI_Int("Scores",PInfo[playerid][Scores]);
    INI_Int("Kills",PInfo[playerid][Kills]);
    INI_Int("Deaths",PInfo[playerid][Deaths]);
    INI_Int("Favorite Skin",PInfo[playerid][FSkin]);
    return 1;
}
When I Close And Open The Server And I Type /MyFSkin it show CJ Skin


Re: /favkskin - Shetch - 19.08.2012

From:
Код:
INI_Int("Favorite Skin",PInfo[playerid][FSkin]);
To:
Код:
INI_Int("FavoriteSkin",PInfo[playerid][FSkin]);
Do not use spaces between the names of files!


Re: /favkskin - misho1 - 19.08.2012

Thnx Worked