/favkskin
#1

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
Reply
#2

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]);
Reply
#3

Thanks Cjgogo
Rep+


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

Bump
Reply
#5

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

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
Reply
#7

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

Thnx Worked
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)