02.05.2012, 13:58
pawn Код:
public OnPlayerConnect(playerid)
{
new file[40], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(file,sizeof(file),savefile,name);
if(!DOF2_FileExists(file))
{
DOF2_CreateFile(file);
DOF2_SetInt(file,"Exp", 0);
DOF2_SetInt(file,"Level", 0);
DOF2_SaveFile();
}
else
{
SendClientMessage(playerid,0xF0F8FFAA,"CHECK: Files Loaded!");
Exp[playerid] = DOF2_GetInt(file,"pExp");
Level[playerid] = DOF2_GetInt(file,"pLevel");
}
return 1;
}
public OnPlayerDisconnect(playerid)
{
new file[40], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(file,sizeof(file),savefile,name);
DOF2_SetInt(file,"pExp",Exp[playerid]);
DOF2_SetInt(file,"pLevel",Level[playerid]);
DOF2_SaveFile();
return 1;
}