Quote:
Originally Posted by pasha97
Try this:
pawn Код:
// My code that displays for all vehicles, not just the ones listed public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { if(vehicleid == 596||597||598||427||523||599||601) { SendClientMessage(playerid, 0xFFFFFFFF, "Nice Police Vehicle!"); } return 1; }
|
Well the vehicle ID is just the number assigned by the server, so the first vehicle spawned would be 0, the second would be 1 and so on, and not the actual car model.
Quote:
Originally Posted by Romel
use OnPlayerStateChange.
|
I don't see how that would make a difference where I put the code.
EDIT:
Quote:
Originally Posted by iggy1
Ignore them^^
Your if statement is wrong. Here is switch, and also how an if statement should be. Use the switch though its better.
pawn Код:
switch( GetVehicleModel(vehicleid) ) { case 596, 597, 598, 427, 523, 599, 601: { SendClientMessage(playerid, 0xFFFFFFFF, "Nice Police Vehicle!"); } }
//Or an if statement
new vehiclemodel = GetVehicleModel( vehicleid );
if( vehiclemodel == 596 || vehiclemodel == 597 || vehiclemodel == 427 || vehiclemodel == 523 || vehiclemodel == 599 || vehiclemodel == 601 ) { SendClientMessage(playerid, 0xFFFFFFFF, "Nice Police Vehicle!"); }
|
This is exactly what I was looking for, thanks a ton!