Not wanted for cops?
#1

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

do you have any other variable for the player being a cop rather then the default GetPlayerTeam
?
Reply
#3

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

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

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

Are you sure team 3 is LSPD?
Reply
#7

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

Thanks alot!..

I wasen't full sure about return's works, but now I know thanks alot!..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)