Wanted problem - 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)
+--- Thread: Wanted problem (
/showthread.php?tid=434834)
Wanted problem -
Akcent_Voltaj - 04.05.2013
i have this thing..if player has wanted and relogs..he gets wanted again..but if he doesent enter and theres an innocent person with his id he gets wanted..
PHP код:
Onplayerconnect.
SetPlayerWantedLevel(playerid,WantedLevel[playerid]);
PHP код:
onplayerlogin
new string[256];
new wanted = WantedLevel[playerid];
if(wanted > 0)
{
format(string,sizeof(string), " Cand ai iesit ultima data ai avut wanted %d !", wanted);
SendClientMessage(playerid, COLOR_RED, string);
}
Re: Wanted problem -
Yashas - 04.05.2013
Obviously if a player gets the player who quits playerid all the wanted level goes to the innocent player.You have to save the WantedLevel using the playername not playerid because a player might get any playerid when he connects.
Use y_ini,dini,MySQL,SQLite to store Wanted Level when the player quits and load it back when he logs in.
Re: Wanted problem -
Lordzy - 04.05.2013
Quote:
Originally Posted by Akcent_Voltaj
i have this thing..if player has wanted and relogs..he gets wanted again..but if he doesent enter and theres an innocent person with his id he gets wanted..
|
If you're loading the data through any saving systems like file saving system or databases, reset the variable to prevent those.
pawn Код:
public OnPlayerConnect(playerid)
{
WantedLevel[playerid] = 0;
//Then the loading stuff, if you're using a saving system.
return 1;
}