17.04.2009, 23:05
Trying to get a skin id from a users file when they connect...
If they've not saved a skin then the default value is "Skin=999"
As soon as the player connects, they're checked weather they are registered or not. If they are their file will be checked for a saved skin...
If the skin is 999 then they'll be sent to class selection... Otherwise they'll be spawned in an area with their saved skin loaded. And remain there until they login..
This is the check i've done for the skin in the players file, It doesn't work right though im always getting CJ skin.
If they've not saved a skin then the default value is "Skin=999"
As soon as the player connects, they're checked weather they are registered or not. If they are their file will be checked for a saved skin...
If the skin is 999 then they'll be sent to class selection... Otherwise they'll be spawned in an area with their saved skin loaded. And remain there until they login..
This is the check i've done for the skin in the players file, It doesn't work right though im always getting CJ skin.
pawn Код:
stock AccountSkinCheck(playerid)
{
if(gPlayerAccount[playerid] == 1)
{
new string[128];
new plname[32];
GetPlayerName(playerid, plname, 32);
format(string, sizeof(string), "lcs-admin/accounts/%s.ini", plname);
new File: plFile = fopen(string, io_read);
if(plFile)
{
new key[128],val[128],Data[128];
while (fread(plFile, Data, sizeof(Data)))
key = ini_GetKey( Data );
if( strcmp( key , "Skin" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pSkin] = strval( val ); }
fclose(plFile);
}
pSavedSkin[playerid] = 1;
}
return 1;
}