Here's an example of how you could use it (I added udb_encode, set and udb_decode from DUDB for security):
pawn Код:
public OnPlayerConnect(playerid)
{
new string[128], PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
format(string, sizeof(string), "%s.ini", PlayerName);
if(fexist(string))
{
SetPlayerWantedLevel(playerid, dini_Int(string, "WantedLevel"));
}
else
{
dini_Create(string);
dini_IntSet(string, "WantedLevel", 0);
}
}
public OnPlayerDisconnect(playerid, reason)
{
new string[128], PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
format(string, sizeof(string), "%s.ini", PlayerName);
if(fexist(string))
{
dini_IntSet(string, "WantedLevel", GetPlayerWantedLevel(playerid));
}
else
{
dini_Create(string);
dini_IntSet(string, "WantedLevel", GetPlayerWantedLevel(playerid));
}
}
Please note this isn't secure and I rushed this in a few minutes, so if it doesn't compile don't rage.