[HELP] with skin saving!
#5

Quote:
Originally Posted by irinel1996
Посмотреть сообщение
First you have to download it, and put the file in pawno/include. OK, time to save the skins. Create a folder in scriptfiles called Skins.
pawn Код:
//You have to include it:
#include <dini>
//You can put this line under #include <a_samp>

new bool:FirstSpawn[MAX_PLAYERS char] = false;

//---
public OnPlayerConnect(playerid)
{
    FirstSpawn[playerid] = true;
    new name[MAX_PLAYER_NAME], file_path[50];
    GetPlayerName(playerid,name,MAX_PLAYER_NAME);
    format(file_path,50,"/Skins/%s.ini",name);
    if(!dini_exists(file_path))
    {
        dini_Create(file_path);
        dini_IntSet(file_path,"Skin",0);
    }
    return 1;
}

public OnPlayerDisconnect(playerid)
{
    new name[MAX_PLAYER_NAME], file_path[50];
    GetPlayerName(playerid,name,MAX_PLAYER_NAME);
    format(file_path,50,"/Skins/%s.ini",name);
    dini_IntSet(file_path,"Skin",GetPlayerSkin(playerid));
    return 1;
}

public OnPlayerSpawn(playerid)
{
    if(FirstSpawn[playerid] == true)
    {
        new name[MAX_PLAYER_NAME], file_path[50];
        GetPlayerName(playerid,name,MAX_PLAYER_NAME);
        format(file_path,50,"/Skins/%s.ini",name);
        SetPlayerSkin(playerid, dini_Get(file_path,"Skin"));
        SendClientMessage(playerid,-1,"Skin loaded");
        FirstSpawn[playerid] = false;
    }
    return 1;
}
It should work, I didn't test it.
Here is the thing. I asked one user for help before this thread and he sent me skin code he made with ysi so it works. I don't need this code sir but i gave you rep+! Thank you!
Reply


Messages In This Thread
[HELP] with skin saving! - by anito - 02.07.2012, 09:47
Respuesta: [HELP] with skin saving! - by [DOG]irinel1996 - 02.07.2012, 10:10
Re: Respuesta: [HELP] with skin saving! - by anito - 02.07.2012, 10:12
Respuesta: [HELP] with skin saving! - by [DOG]irinel1996 - 02.07.2012, 10:23
Re: Respuesta: [HELP] with skin saving! - by anito - 02.07.2012, 10:50
Respuesta: [HELP] with skin saving! - by [DOG]irinel1996 - 02.07.2012, 11:00

Forum Jump:


Users browsing this thread: 3 Guest(s)