[SOLVED]Saving Wanted Level
#6

Quote:
Originally Posted by Calon
Take a look at this:
http://forum.sa-mp.com/index.php?topic=981.0

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.
ok i will try this
Reply


Messages In This Thread
[SOLVED]Saving Wanted Level - by Hijolion - 28.12.2009, 20:16
Re: [UNSOLVED]Saving Wanted Level - by RyDeR` - 28.12.2009, 20:20
Re: [UNSOLVED]Saving Wanted Level - by Hijolion - 28.12.2009, 20:22
Re: [UNSOLVED]Saving Wanted Level - by JustinSton - 28.12.2009, 20:41
Re: [UNSOLVED]Saving Wanted Level - by Calon - 28.12.2009, 21:24
Re: [UNSOLVED]Saving Wanted Level - by Hijolion - 28.12.2009, 21:39
Re: [UNSOLVED]Saving Wanted Level - by Retardedwolf - 28.12.2009, 21:46
Re: [UNSOLVED]Saving Wanted Level - by Hijolion - 28.12.2009, 21:47
Re: [UNSOLVED]Saving Wanted Level - by Retardedwolf - 28.12.2009, 21:55
Re: [UNSOLVED]Saving Wanted Level - by Hijolion - 28.12.2009, 22:25

Forum Jump:


Users browsing this thread: 1 Guest(s)