how to check whether the vehicle is a player?
#6

Quote:
Originally Posted by iFarbod
Посмотреть сообщение
Want to prevent the player from entering a car/vehicle? Then use OnPlayerEnterVehicle.

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    new Float:pos[4];
    GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
    GetPlayerFacingAngle(playerid, pos[3]);
    SetPlayerPos(playerid, pos[0], pos[1], pos[2]);
    SetPlayerFacingAngle(playerid, pos[3]);
    return 1;
}
..

GetPlayerVehicleID. Returns 0 if player isn't in a vehicle. Returns the vehicle ID That the player is in it.
It can be but it's more easy RemovePlayerFromVehicle
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(// if vehicle isn't of the player)
    {
        RemovePlayerFromVehicle(playerid);
        ShowPlayerLangDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "Prywatny Pojazd", "Private Vehicle", "To nie twoj pojazd!\nMozesz kupic wlasny pod komenda /sklep", "This is not your vehicle\nBuy vehicles in /sklep", "Wyjdz", "Exit", "","");
        ClearAnimations(playerid);
    }
    return 1;
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 3 Guest(s)