Why it doesn't remove him?
#1

Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
	if (newstate==PLAYER_STATE_DRIVER)
	{
	    new vehID=GetPlayerVehicleID(playerid);
	    if (vehID==420)
	    {
	        RemovePlayerFromVehicle(playerid);
	        SendClientMessage(playerid, COLOUR_GRAY, "You must be a taxi driver to use this car.");
	    }
	}

	return 1;
}
It doesn't remove the player from the car when he enters a taxi vehicle.
Reply
#2

Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
	if (newstate==PLAYER_STATE_DRIVER)
	{
	    new vehID=GetPlayerVehicleID(playerid);
	    new vehModel=GetVehicleModel(vehID);
	    if (vehModel==420)
	    {
	        RemovePlayerFromVehicle(playerid);
	        SendClientMessage(playerid, COLOUR_GRAY, "You must be a taxi driver to use this car.");
	    }
	}

	return 1;
}
Reply
#3

Thank you,i didn't know about GetVehicleModel() function at all,i thought GetPlayerVehicleID() does the thing that
GetVehicleModel() is doing.
Reply
#4

no biggie you still need GetPlayerVehicleId in order to check the correct vehicle Model ID.

BTW: If you don't add anything else to "if (vehModel==420)" then even the cab drivers wont be able to enter
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)