Not wanted for cops? -
davve95 - 16.02.2013
Hi!
I tired to make a very simple wanted system when you steal a vehicle..
But I can't get any good idea to avoid cops getting the wanted level..
I don't want it for the cops..
I've tired with:
pawn Код:
if(GetPlayerTeam(playerid) == 3) SetPlayerWantedLevel(playerid, 0);
KillTimer(Wanted);
But didn't workt I can't get more idea then that ^^ ...
Thanks alot for help!.
Re: Not wanted for cops? -
park4bmx - 16.02.2013
do you have any other variable for the player being a
cop rather then the default
GetPlayerTeam
?
Re: Not wanted for cops? -
davve95 - 16.02.2013
Quote:
Originally Posted by park4bmx
do you have any other variable for the player being a cop rather then the default GetPlayerTeam
?
|
No, I don't think so.
Re: Not wanted for cops? -
park4bmx - 16.02.2013
welll then if cops are the
Team 3
then
pawn Код:
if(GetPlayerTeam(playerid) == 3){
  SetPlayerWantedLevel(playerid, 0);
  KillTimer(Wanted);
}
Nothing more.
As you haven't provided any info of what makes the wanted level go up, and how.
I have to be guessing here.
Re: Not wanted for cops? -
davve95 - 18.02.2013
Quote:
Originally Posted by park4bmx
welll then if cops are the Team 3
then
pawn Код:
if(GetPlayerTeam(playerid) == 3){ Â Â SetPlayerWantedLevel(playerid, 0); Â Â KillTimer(Wanted); }
Nothing more.
As you haven't provided any info of what makes the wanted level go up, and how.
I have to be guessing here.
|
Yeah, I forgot about some info..
I tired the script above here^
But the cops can still get wanted...
Here is whole code:
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
  if(GetPlayerTeam(playerid) == 3){  //I tired to change place with that code under there
  SetPlayerWantedLevel(playerid, 0); //but it just gave me some errors...
  KillTimer(notWanted);
}
    GetPlayerWantedLevel(playerid);
    SetPlayerWantedLevel(playerid, 2);
    notWanted = SetTimer("WantedT",500,true);
  return 1;
}
I mean I tired to change place with GetPlayerTeam blabla pece of code, with GetPlayerWanted blabla instead..
Re: Not wanted for cops? -
Da_Noob - 18.02.2013
Are you sure team 3 is LSPD?
Re: Not wanted for cops? -
DaRk_RaiN - 18.02.2013
Quote:
Originally Posted by davve95
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) {   if(GetPlayerTeam(playerid) == 3){  //I tired to change place with that code under there   SetPlayerWantedLevel(playerid, 0); //but it just gave me some errors...   KillTimer(notWanted); }     GetPlayerWantedLevel(playerid);     SetPlayerWantedLevel(playerid, 2);     notWanted = SetTimer("WantedT",500,true);   return 1; }
|
That code was half correct, you forgot to return.
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
  if(GetPlayerTeam(playerid) == 3){  //I tired to change place with that code under there
  SetPlayerWantedLevel(playerid, 0); //but it just gave me some errors...
  KillTimer(notWanted);
    return 1;//This will stop the code here and return.
}
    GetPlayerWantedLevel(playerid);
    SetPlayerWantedLevel(playerid, 2);
    notWanted = SetTimer("WantedT",500,true);
  return 1;
}
Re: Not wanted for cops? -
davve95 - 18.02.2013
Thanks alot!..
I wasen't full sure about return's works, but now I know thanks alot!..