Wanted problem
#1

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(playeridCOLOR_REDstring);
                    } 
Reply
#2

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

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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)