[SOLVED]Saving Wanted Level
#1

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
Reply
#2

Use GetPlayerWantedLevel(playerid);
Reply
#3

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

i need two
Reply
#5

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.
Reply
#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
#7

Should have used PasteBin.

Indentation sucks.
Reply
#8

dosen't work
Reply
#9

http://pawn.pastebin.com/d3e60aad8

Might work
Reply
#10

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)