Police and SRT Speedtrap problems - 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: Police and SRT Speedtrap problems (
/showthread.php?tid=308658)
Police and SRT Speedtrap problems -
SomebodyAndMe - 04.01.2012
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.
Re: Police and SRT Speedtrap problems -
Mosslah - 04.01.2012
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.
Re: Police and SRT Speedtrap problems -
SomebodyAndMe - 05.01.2012
!= means if it's not a cop or not a SRT.
Re: Police and SRT Speedtrap problems -
SomebodyAndMe - 13.01.2012
bump
Re: Police and SRT Speedtrap problems -
Outcast - 13.01.2012
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;
Re: Police and SRT Speedtrap problems -
Babul - 13.01.2012
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?