SA-MP Forums Archive
[SOLVED]Saving Wanted Level - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [SOLVED]Saving Wanted Level (/showthread.php?tid=116441)



[SOLVED]Saving Wanted Level - Hijolion - 28.12.2009

I don't know how to save players wanted level i really need this script
Please someone make me a WantedLevel Saving for players Script



Re: [UNSOLVED]Saving Wanted Level - RyDeR` - 28.12.2009

Use GetPlayerWantedLevel(playerid);



Re: [UNSOLVED]Saving Wanted Level - Hijolion - 28.12.2009

Quote:
Originally Posted by » RэРиR «
Use GetPlayerWantedLevel(playerid);
Yes but I want Wanted Levels to be saved in a file


Re: [UNSOLVED]Saving Wanted Level - JustinSton - 28.12.2009

i need two


Re: [UNSOLVED]Saving Wanted Level - Calon - 28.12.2009

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.


Re: [UNSOLVED]Saving Wanted Level - Hijolion - 28.12.2009

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


Re: [UNSOLVED]Saving Wanted Level - Retardedwolf - 28.12.2009

Should have used PasteBin.

Indentation sucks.



Re: [UNSOLVED]Saving Wanted Level - Hijolion - 28.12.2009

dosen't work


Re: [UNSOLVED]Saving Wanted Level - Retardedwolf - 28.12.2009

http://pawn.pastebin.com/d3e60aad8

Might work


Re: [UNSOLVED]Saving Wanted Level - Hijolion - 28.12.2009

Quote:
Originally Posted by www.******.com
pawn Код:
C:\Users\HIJOL GOSWAMI\COD Modern Warfare\filterscripts\PremiumPackage.pwn(62) : error 017: undefined symbol "dini_Int"
C:\Users\HIJOL GOSWAMI\COD Modern Warfare\filterscripts\PremiumPackage.pwn(66) : error 017: undefined symbol "dini_Create"
C:\Users\HIJOL GOSWAMI\COD Modern Warfare\filterscripts\PremiumPackage.pwn(67) : error 017: undefined symbol "dini_IntSet"
C:\Users\HIJOL GOSWAMI\COD Modern Warfare\filterscripts\PremiumPackage.pwn(85) : error 017: undefined symbol "dini_IntSet"
C:\Users\HIJOL GOSWAMI\COD Modern Warfare\filterscripts\PremiumPackage.pwn(89) : error 017: undefined symbol "dini_Create"
C:\Users\HIJOL GOSWAMI\COD Modern Warfare\filterscripts\PremiumPackage.pwn(90) : error 017: undefined symbol "dini_IntSet"
C:\Users\HIJOL GOSWAMI\COD Modern Warfare\filterscripts\PremiumPackage.pwn(78) : warning 203: symbol is never used: "dini_Set"
C:\Users\HIJOL GOSWAMI\COD Modern Warfare\filterscripts\PremiumPackage.pwn(78 -- 95) : error 010: invalid function or declaration
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


7 Errors.
HELp