01.12.2009, 15:07
Try with this(you need dini include).
If you want to read it and re-set it when the player connects, use this:
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.
Код:
#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; }
Код:
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; }
Before test the gamemode go to scriptfiles and create a folder named Users and then another one named Wanted inside Users.