Try with this(you need dini include).
Код:
#define USER_WANTED_FOLDER "Users/Wanted/%s"
public OnPlayerDisconnect(playerid, reason){
new WantedLevel = GetPlayerWantedLevel(playerid);
new string[256];
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
format(string, sizeof(string), USER_WANTED_FOLDER, pName);
if(!dini_Exists(string)){
dini_Create(string);
dini_Set(string, "WantedLevel", WantedLevel);
}else{
dini_Set(string, "WantedLevel", WantedLevel);
}
return 1;
}
If you want to read it and re-set it when the player connects, use this:
Код:
public OnPlayerConnect(playerid){
new string[256];
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
format(string, sizeof(string), USER_WANTED_FOLDER, pName);
if(dini_Exists(string)){
new WantedLevel = dini_Set(string, "WantedLevel", WantedLevel);
SetPlayerWantedLevel(playerid, WantedLevel);
}
return 1;
}
I no tested the code in pawno, but it will work...
Before test the gamemode go to scriptfiles and create a folder named Users and then another one named Wanted inside Users.