SA-MP Forums Archive
[HELP] How to save a player skin with Y_ini? - 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: [HELP] How to save a player skin with Y_ini? (/showthread.php?tid=365739)



[HELP] How to save a player skin with Y_ini? - maxive - 04.08.2012

I want to make like a CMD with ZCMD... lets say for example /myskin (The skin number you want...) and when you do that cmd it will save the skin of your preference to a file using Y_ini... So the next time he relogs... or die... he has the same skin... Practically everytime he spawn he will have the skin he chosed with "/myskin"... can you post the code? I need to learn how to use "Y_ini"... Zcmd is not the problem..


Re : [HELP] How to save a player skin with Y_ini? - lelemaster - 04.08.2012

Don't you look at the forum sometimes? I said 99999 times: Feel free to post Here!!!!!!!!!!


Re: [HELP] How to save a player skin with Y_ini? - Devilxz97 - 04.08.2012

pawn Код:
CMD:myskin(playerid, params[])
{
    new skinid, string[256];
    if(sscanf(params, "i", skinid)) SendClientMessage(playerid, 0xFFFFFFAA,"usage: /myskin [skinid]");
    if(skinid > 299) return SendClientMessage(playerid,0xFF0000AA,"error: Available skin: 0 - 299 !");
    SetPlayerSkin(playerid,skinid);
    format(string, sizeof(string), "You have change your skin!");
    SendClientMessage(playerid, 0xFF0000AA, string);
    return 1;
}
pawn Код:
public OnPlayerSpawn(playerid)
{
    PlayerInfo[playerid][pSkins] = GetPlayerSkin(playerid); //i dont know your variables
    return 1;
}
hmm


Re : Re: [HELP] How to save a player skin with Y_ini? - Sandiel - 04.08.2012

Quote:
Originally Posted by Devilxz97
Посмотреть сообщение
pawn Код:
CMD:myskin(playerid, params[])
{
    new skinid, string[256];
    if(sscanf(params, "i", skinid)) SendClientMessage(playerid, 0xFFFFFFAA,"usage: /myskin [skinid]");
    if(skinid > 299) return SendClientMessage(playerid,0xFF0000AA,"error: Available skin: 0 - 299 !");
    SetPlayerSkin(playerid,skinid);
    format(string, sizeof(string), "You have change your skin!");
    SendClientMessage(playerid, 0xFF0000AA, string);
    return 1;
}
pawn Код:
public OnPlayerSpawn(playerid)
{
    PlayerInfo[playerid][pSkins] = GetPlayerSkin(playerid); //i dont know your variables
    return 1;
}
hmm
You did NOT show him how to SAVE the skin with YSI\Y_ini, just set it...
pawn Код:
CMD:myskin(playerid, params[])
{
    new skinid, string[256];
    if(sscanf(params, "i", skinid)) SendClientMessage(playerid, 0xFFFFFFAA,"usage: /myskin [skinid]");
    if(skinid > 299) return SendClientMessage(playerid,0xFF0000AA,"error: Available skin: 0 - 299 !");
    SetPlayerSkin(playerid,skinid);
    format(string, sizeof(string), "You have change your skin!");
    SendClientMessage(playerid, 0xFF0000AA, string);
   // Now we save it..
   new INI:File = INI_Open(UserPath(playerid));
   INI_SetTag(File,"data");
   INI_WriteInt(File,"SkinID",skinid);
   INI_Close(File);
   return 1;
}



Re: [HELP] How to save a player skin with Y_ini? - Devilxz97 - 04.08.2012

oh shit , forgot it , thank for fixing it ;P