22.06.2014, 17:43
I've made a vehicle system where you can select whether it's a Rental, Faction vehicle or a Job vehicle.
However, when you enter the vehicle, nothing comes up. This is my code
However, when you enter the vehicle, nothing comes up. This is my code
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER)
{
new veh = GetPlayerVehicleID(playerid);
if(RentalInfo[veh][isJob] >= 1)
{
if(PlayerInfo[playerid][JobID] == RentalInfo[veh][isJob])
{
SendClientMessage(playerid, COLOR_GREEN, "The company you work for owns this vehicle!");
}
else
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_ORANGE, "You don't have the keys!");
}
}
if(RentalInfo[veh][isRental] >= 1)
{
ShowPlayerDialog(playerid, DIALOG_RENTAL, DIALOG_STYLE_MSGBOX, "Rental", ""COL_WHITE"This vehicle is available to rent for "COLGREEN"$200."COL_WHITE"\nDo you wish to rent this vehicle?", "Rent", "Cancel");
}
}
return true;
}