17.07.2013, 08:11
Always when a player spawns, his skin is ID 0. How can i fix this?
pawn Код:
enum PlayerInfo
{
Pass[129],
Adminlevel,
VIPlevel,
Money,
Scores,
Kills,
Deaths,
Skin,......
public loadaccount_user(playerid, name[], value[])
{
INI_String("Password", pInfo[playerid][Pass],129);
INI_Int("AdminLevel",pInfo[playerid][Adminlevel]);
INI_Int("VIPLevel",pInfo[playerid][VIPlevel]);
INI_Int("Money",pInfo[playerid][Money]);
INI_Int("Scores",pInfo[playerid][Scores]);
INI_Int("Kills",pInfo[playerid][Kills]);
INI_Int("Deaths",pInfo[playerid][Deaths]);
INI_Int("Skin", pInfo[playerid][Skin]);...................
This is in the login command -->
if ( pInfo[playerid][Skin]!= 0){
SetPlayerSkin(playerid, pInfo[playerid][Skin]);
}
dcmd_myskin(playerid, params[])
{
new skinid, string[256];
if( sscanf( params, "i", skinid ) ) return SendClientMessage( playerid, -1, "Използвай: /skin [ID]" );
if(skinid > 299 || skinid< 0) return SendClientMessage(playerid,COLOR_RED,"ГРЕШКА: Налични скинове: 0 - 299 !");
SetPlayerSkin(playerid,skinid);
format(string, sizeof(string), "Ти промени твоя скин!");
SendClientMessage(playerid, COLOR_YELLOW, string);
new INI:file = INI_Open( Path( playerid ) );
INI_WriteInt( file, "Skin",skinid);
INI_Close( file );
return 1;
}