All pastes #582947 Raw Edit

Anonymous

public text v1 · immutable
·published 2007-06-22 04:33 UTC
rendered paste body
public OnPlayerStateChange(playerid, newstate, oldstate)
{
	new string[256];
	if(newstate == 1) {
	    TextDrawDestroy(showspeed[playerid]);
	}
	if(newstate == 2) {
		#if DEBUG_MODE == true
		format(string,sizeof(string),"You have entered a vehicle (ID: %i Model: %i)",GetPlayerVehicleID(playerid),GetPlayerVehicleModelID(playerid));
		SendClientMessage(playerid,COLOR_YELLOW,string);
		#endif
		if(IsVehicleCar(GetPlayerVehicleModelID(playerid))) {
			SendClientMessage(playerid,COLOR_YELLOW,"Type /lock to lock the car doors");
			SendClientMessage(playerid,COLOR_YELLOW,"Type /unlock to unlock the car doors");
		} else if(IsVehicleBoat(GetPlayerVehicleModelID(playerid))) {
			SendClientMessage(playerid,COLOR_YELLOW,"Type /fish to go fishing.");
			SendClientMessage(playerid,COLOR_YELLOW,"Type /lock to lock the boat doors");
			SendClientMessage(playerid,COLOR_YELLOW,"Type /unlock to unlock the boat doors");
		}
	}
	return 1;
}

Why does that work only with the IsVehicle that is first?