SA-MP Forums Archive
Entering vehicle problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Entering vehicle problem (/showthread.php?tid=357292)



Entering vehicle problem - Euan Hughes - 06.07.2012

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


Re: Entering vehicle problem - Steven82 - 06.07.2012

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


Re: Entering vehicle problem - Euan Hughes - 06.07.2012

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


Re: Entering vehicle problem - Steven82 - 06.07.2012

Try using return 1; at the end of the callback.


Re: Entering vehicle problem - Euan Hughes - 06.07.2012

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


Re: Entering vehicle problem - Steven82 - 06.07.2012

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;
}



Re: Entering vehicle problem - Euan Hughes - 06.07.2012

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


Re: Entering vehicle problem - Steven82 - 06.07.2012

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?


Re: Entering vehicle problem - Euan Hughes - 06.07.2012

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


Re: Entering vehicle problem - Steven82 - 06.07.2012

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.