new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]);
INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
INI_WriteInt(File,"Score",PlayerInfo[playerid][pScore]);
INI_WriteInt(File,"Muted",PlayerInfo[playerid][pMuted]);
INI_Close(File);
Are you sure it's the saving that's a problem? Open a userfile and see if it's saved. If it is, it's your loading that should be focused on.
|
public OnPlayerDisconnect(playerid, reason) { if(INI_Open(getINI(playerid))) { INI_WriteInt("Score",GetPlayerScore(playerid)); INI_WriteInt("Cash",GetPlayerMoney(playerid)); INI_WriteInt("Admin",PlayerInfo[playerid][pAdmin]); INI_WriteInt("Pass",PlayerInfo[playerid][pPass]); INI_WriteInt("Kills",PlayerInfo[playerid][pKills]); INI_WriteInt("Deaths",PlayerInfo[playerid][pDeaths]); INI_Save(); INI_Close(); } return 1; }
Код:
public OnPlayerDisconnect(playerid, reason) { if(INI_Open(getINI(playerid))) { INI_WriteInt("Score",GetPlayerScore(playerid)); INI_WriteInt("Cash",GetPlayerMoney(playerid)); INI_WriteInt("Admin",PlayerInfo[playerid][pAdmin]); INI_WriteInt("Pass",PlayerInfo[playerid][pPass]); INI_WriteInt("Kills",PlayerInfo[playerid][pKills]); INI_WriteInt("Deaths",PlayerInfo[playerid][pDeaths]); INI_Save(); INI_Close(); } return 1; } |
forward OnPlayerSaveAcount(playerid);
if(IsPlayerConnected(playerid)) {
OnPlayerSaveAcount(playerid); // Make the onplayersaveaccount function
IsLogged[playerid] = false;
TextDrawHideForPlayer(playerid, Time);
TextDrawHideForPlayer(playerid, Date);
}
public OnPlayerSaveAcount(playerid)
{
if(IsPlayerConnected(playerid)) {
INI_WriteInt("Score",GetPlayerScore(playerid));
INI_WriteInt("Cash",GetPlayerMoney(playerid));
INI_WriteInt("Admin",PlayerInfo[playerid][pAdmin]);
INI_WriteInt("Pass",PlayerInfo[playerid][pPass]);
INI_WriteInt("Kills",PlayerInfo[playerid][pKills]);
INI_WriteInt("Deaths",PlayerInfo[playerid][pDeaths]);
}
return 1;
}
Use Y_INI And follow Kush's tutorial step by step in the tutorial's section or Follow Kush's tutorial on SII if you want
|
Also here is the guide I followed this time: https://sampforum.blast.hk/showthread.php?tid=267808
|
try this
pawn Код:
pawn Код:
public OnPlayerDisconnect(playerid, reason) then pawn Код:
|
C:\Users\Meeee\Desktop\Night-Drifterz\gamemodes\nightdrifterz.pwn(421) : error 010: invalid function or declaration
C:\Users\Meeee\Desktop\Night-Drifterz\gamemodes\nightdrifterz.pwn(423) : error 010: invalid function or declaration
C:\Users\Meeee\Desktop\Night-Drifterz\gamemodes\nightdrifterz.pwn(542) : error 035: argument type mismatch (argument 1)
C:\Users\Meeee\Desktop\Night-Drifterz\gamemodes\nightdrifterz.pwn(543) : error 035: argument type mismatch (argument 1)
C:\Users\Meeee\Desktop\Night-Drifterz\gamemodes\nightdrifterz.pwn(544) : error 035: argument type mismatch (argument 1)
C:\Users\Meeee\Desktop\Night-Drifterz\gamemodes\nightdrifterz.pwn(545) : error 035: argument type mismatch (argument 1)
C:\Users\Meeee\Desktop\Night-Drifterz\gamemodes\nightdrifterz.pwn(546) : error 035: argument type mismatch (argument 1)
C:\Users\Meeee\Desktop\Night-Drifterz\gamemodes\nightdrifterz.pwn(547) : error 035: argument type mismatch (argument 1)