[HELP] How to save a player skin with Y_ini?
#1

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

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

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

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;
}
Reply
#5

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


Forum Jump:


Users browsing this thread: 1 Guest(s)