Why is this not working
#1

Why does this still let me get into the passenger seat of this truck

pawn Код:
if(vehicleid == 403 || vehicleid == 591)
    {
        if(ispassenger == 1)
        {
            ClearAnimations(playerid);
        }
    }
If you need any more code just ask

Please help

Thanks
Reply
#2

Because you say program if someone is attempting to enter the Vehicles with ids 403,591 as a passanger to stop dooing that. Clean that part of code if you want to allow othes to enter the car as passangers
Reply
#3

Quote:
Originally Posted by Roko_foko
Посмотреть сообщение
Because you say program if someone is attempting to enter the Vehicles with ids 403,591 as a passanger to stop dooing that. Clean that part of code if you want to allow othes to enter the car as passangers
I dont understand

I dont want people to be able to enter the vehicle as a passenger

If you need any more code just ask

Please help

Thanks
Reply
#4

pawn Код:
if(vehicleid == 403 || vehicleid == 591)
{
        if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
        {
            ClearAnimations(playerid);
        }
}
Try this.
Reply
#5

Quote:
Originally Posted by Euan Hughes
Посмотреть сообщение
I dont understand

I dont want people to be able to enter the vehicle as a passenger

If you need any more code just ask

Please help

Thanks
Oh I didn't read well.
Sorry.
I would change ClearAnimations(playerid); with
TogglePlayerControllable(playerid,0);
TogglePlayerControllable(playerid,1);
Reply
#6

Quote:
Originally Posted by .FuneraL.
Посмотреть сообщение
pawn Код:
if(vehicleid == 403 || vehicleid == 591)
{
        if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
        {
            ClearAnimations(playerid);
        }
}
Try this.
Did not work

If you need any more code just ask

Please help

Thanks
Reply
#7

vehicleid != modelid
https://sampwiki.blast.hk/wiki/GetVehicleModel
Reply
#8

Quote:
Originally Posted by Vince
Посмотреть сообщение
Well the trucks are Static vehicles added on game mode in it and this part is stopping me from entering it as a driver now.. How can i fix this

pawn Код:
if(Vehicles[vehicleid][CarGroup] != 0 && Vehicles[vehicleid][CarGroup] != Player[playerid][Group])
    {
        if(ispassenger == 0)
        {
            ClearAnimations(playerid);
        }
    }
If you need any more code just ask

Please help

Thanks
Reply
#9

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    new model = GetVehicleModel(vehicleid);
    if(model == 403 || model == 591)
    {
        if(ispassenger)
        {
            ClearAnimations(playerid);
        }
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)