Entering vehicle problem
#1

Well i have a problem entering a vehicle pretty much i have a few Trucks that are static vehicles and when i go to enter them it dont let me im pretty sure its because of this code..

How can i make it so i can enter it and still have that code ?

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    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
#2

Are you using "return 1;" at the end of the callback?
Reply
#3

Quote:
Originally Posted by Steven82
Посмотреть сообщение
Are you using "return 1;" at the end of the callback?
No

If you need any more code just ask

Please help

Thanks
Reply
#4

Try using return 1; at the end of the callback.
Reply
#5

Quote:
Originally Posted by Steven82
Посмотреть сообщение
Try using return 1; at the end of the callback.
I dont think you know what i mean

I think that code in my post is stopping me from getting in a truck with is a static vehicle

If you need any more code just ask

Please help

Thanks
Reply
#6

Quote:
Originally Posted by Euan Hughes
Посмотреть сообщение
I dont think you know what i mean

I think that code in my post is stopping me from getting in a truck with is a static vehicle

If you need any more code just ask

Please help

Thanks
How in the hell are you scripting a gamemode if you don't know what I mean about returning true or false at the end of a callback. I swear this community is becoming more dependent on OTHER people coding their gamemodes. Anyways I've changed the top coding a little, try using what I provided. From "&&" to "||".

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(Vehicles[vehicleid][CarGroup] != 0 || Vehicles[vehicleid][CarGroup] != Player[playerid][Group])
    {
        if(ispassenger == 0)
        {
            ClearAnimations(playerid);
        }
    }
    return 1;
}
Reply
#7

Quote:
Originally Posted by Steven82
Посмотреть сообщение
How in the hell are you scripting a gamemode if you don't know what I mean about returning true or false at the end of a callback. WOW! I swear this community is becoming more dependent on OTHER people coding their gamemodes. Anyways I've changed the top coding a little, try using what I provided. From "&&" to "||".

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(Vehicles[vehicleid][CarGroup] != 0 || Vehicles[vehicleid][CarGroup] != Player[playerid][Group])
    {
        if(ispassenger == 0)
        {
            ClearAnimations(playerid);
        }
    }
    return 1;
}
That did not work.. Do i need to make the static vehicle car group 0 ?

Thanks
Reply
#8

That's weird. Are you SURE you're setting the vehicles car groups? And what is the coding with the Car Groups, did you script it, someone else, edited or what?
Reply
#9

Quote:
Originally Posted by Steven82
Посмотреть сообщение
That's weird. Are you SURE you're setting the vehicles car groups? And what is the coding with the Car Groups, did you script it, someone else, edited or what?
Yes im sure i am getting group vehicles

Let me try explain it a little bit more

The truck i am attempting to get in is a static vehicle ( I assume i goes to cargroup 0 i may be wrong ) and when i try to get in it it clears my animations and i dont think it should because its a static vehicle... I dont know how to fix it.. Please help me..

If you need any more code just ask

Please help

Thanks
Reply
#10

Quote:
Originally Posted by Euan Hughes
Посмотреть сообщение
Yes im sure i am getting group vehicles

Let me try explain it a little bit more

The truck i am attempting to get in is a static vehicle ( I assume i goes to cargroup 0 i may be wrong ) and when i try to get in it it clears my animations and i dont think it should because its a static vehicle... I dont know how to fix it.. Please help me..

If you need any more code just ask

Please help

Thanks
You need to actually set the static vehicles to car group 0.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)