29.08.2011, 17:41
(
Последний раз редактировалось Kingunit; 29.08.2011 в 18:30.
)
<fixed>
SetPlayerSkin(playerid,PlayerInfo[playerid][Skin]);
pawn Код:
|
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
PlayerInfo[playerid][Skin] = GetPlayerSkin(playerid);
INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
INI_WriteInt(File,"Kills",PlayerInfo[playerid][Kills]);
INI_WriteInt(File,"Deaths",PlayerInfo[playerid][Deaths]);
INI_WriteInt(File,"Score",GetPlayerScore(playerid));
INI_WriteInt(File,"Adminlevel",PlayerInfo[playerid][Adminlevel]);
INI_WriteInt(File,"Skin", PlayerInfo[playerid][Skin];
INI_Close(File);
public OnPlayerDialogResponse blabla
{
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Password",udb_hash(inputtext));
INI_WriteInt(File,"Cash",0);
INI_WriteInt(File,"Kills",0);
INI_WriteInt(File,"Deaths",0);
INI_WriteInt(File,"Score",0);
INI_WriteInt(File,"Adminlevel",0);
INI_WriteInt(File,"Skin", PlayerInfo[playerid][Skin];
INI_Close(File);
}
public OnPlayerSpawn
{
SetPlayerSkin(playerid, PlayerInfo[playerid][Skin]);
}
forward SavePlayerStats(playerid);
public SavePlayerStats(playerid)
{
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
INI_WriteInt(File,"Kills",PlayerInfo[playerid][Kills]);
INI_WriteInt(File,"Deaths",PlayerInfo[playerid][Deaths]);
INI_WriteInt(File,"Score",GetPlayerScore(playerid));
INI_WriteInt(File,"Adminlevel",PlayerInfo[playerid][Adminlevel]);
INI_WriteInt(File,"Skin",GetPlayerSkin(playerid));
INI_Close(File);
return true;
}
//OnPlayerDisconnect:
SavePlayerStats(playerid);
//OnDialogResponse:
SavePlayerStats(playerid);
//OnGameModeExit:
for(new i=0; i<MAX_PLAYERS; i++) //or foreach(Player, i)
{
if(IsPlayerConnected(i)) SavePlayerStats(playerid);
}