Police and SRT Speedtrap problems
#1

pawn Код:
if (IsVehicleAirVehicle(vehicleid) == 0)
            if (APlayerData[playerid][PlayerClass] != ClassPolice || APlayerData[playerid][PlayerClass] != ClassSRT) // Check if the player isn't speeding Cops and SRT shouldn't be able to get a speed ticket.
                CheckPlayerSpeeding(playerid);
Well it ain't work..

Both classes are getting caught for speeding.

I don't know what I am doing wrong.
Reply
#2

Are you not just checking if the Police/SRT are speeding with the:
pawn Код:
CheckPlayerSpeeding(playerid);
Beneath the line where you check for the players class?

pawn Код:
if (APlayerData[playerid][PlayerClass] != ClassPolice || APlayerData[playerid][PlayerClass] != ClassSRT) // Check if the player isn't speeding Cops and SRT shouldn't be able to get a speed ticket.
                CheckPlayerSpeeding(playerid);
Shouldn't you just return 1; at the end of the that line instead of continuing to check if they are speeding or not? Otherwise, the class in which the player is doesn't really matter since it does nothing according to that line.
Reply
#3

!= means if it's not a cop or not a SRT.
Reply
#4

bump
Reply
#5

Try this
pawn Код:
if (APlayerData[playerid][PlayerClass] == ClassPolice || APlayerData[playerid][PlayerClass] == ClassSRT) // Check if the player isn't speeding Cops and SRT shouldn't be able to get a speed ticket.
                return 1;
Reply
#6

hm. you want none of those classes getting caught by a speedtrap?
pawn Код:
if (IsVehicleAirVehicle(vehicleid) == 0)
            if (APlayerData[playerid][PlayerClass] != ClassPolice && APlayerData[playerid][PlayerClass] != ClassSRT) // Check if the player isn't speeding Cops and SRT shouldn't be able to get a speed ticket.
                CheckPlayerSpeeding(playerid);
you were checking
"if player is (not cop) OR (not srt)", but you needed:
"if player is (not cop) AND (not srt)", basically a "nor"...
so a player should get checked only when hes none of both factions, right?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)