Save/load player skin after exit (/q)
#1

Im using Luxadmin filterscript after you register, choose skin and exit the server. Then enters back, the skin you choose before dont load. You must choose that skin you choose before again. And im not satisfied to that. I dont want my players to click many times to just find their favorite skin.
Reply
#2

pawn Код:
enum PlayerInfo
{
    skin,//And all other data
}
new pInfo[MAX_PLAYERS][PlayerInfo];
forward LoadUser_data(playerid,name[],value[]);
public LoadUser_data(playerid,name[],value[])
{
     INI_Int("Skin",pInfo[playerid][skin]);//And all other data
    return 1;
}
public OnPlayerConnect(playerid)
{
    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
    //After Player Log IN.
    SetPlayerSkin(playerid,pInfo[playerid][skin];
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    new INI:File = INI_Open(UserPath(playerid));
    INI_SetTag(File,"data");
    INI_WriteInt(File,"Skin",PlayerInfo[playerid][skin]);
    INI_Close(File);
    return 1;
}
Reply
#3

Quote:
Originally Posted by [MM]RoXoR[FS]
Посмотреть сообщение
pawn Код:
enum PlayerInfo
{
    skin,//And all other data
}
new pInfo[MAX_PLAYERS][PlayerInfo];
forward LoadUser_data(playerid,name[],value[]);
public LoadUser_data(playerid,name[],value[])
{
     INI_Int("Skin",pInfo[playerid][skin]);//And all other data
    return 1;
}
public OnPlayerConnect(playerid)
{
    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
    //After Player Log IN.
    SetPlayerSkin(playerid,pInfo[playerid][skin];
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    new INI:File = INI_Open(UserPath(playerid));
    INI_SetTag(File,"data");
    INI_WriteInt(File,"Skin",PlayerInfo[playerid][skin]);
    INI_Close(File);
    return 1;
}
Can you put this script in Luxadmin and make a link in pastebin. i think im going to messed up my luxadmin if i do that by myself.
Reply
#4

Any one know how to put this script in Luxadmin without errors after compiling??

PHP код:
enum PlayerInfo
{
    
skin,//And all other data
}
new 
pInfo[MAX_PLAYERS][PlayerInfo];
forward LoadUser_data(playerid,name[],value[]);
public 
LoadUser_data(playerid,name[],value[])
{
     
INI_Int("Skin",pInfo[playerid][skin]);//And all other data
    
return 1;
}
public 
OnPlayerConnect(playerid)
{
    
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra true, .extra playerid);
    
//After Player Log IN.
    
SetPlayerSkin(playerid,pInfo[playerid][skin];
    return 
1;
}
public 
OnPlayerDisconnect(playeridreason)
{
    new 
INI:File INI_Open(UserPath(playerid));
    
INI_SetTag(File,"data");
    
INI_WriteInt(File,"Skin",PlayerInfo[playerid][skin]);
    
INI_Close(File);
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)