Very big problem please help me
#1

Ok so i am going to try and explain this aswell as i can

At the top of my script i have this

pawn Код:
new truck;
So i have a truck that i that is made in "InGameModeInInt" like this "truck = AddStaticVehicle(.....)

Well i try to get in the vehicle and it just wont let me i assume as soon as it spawns it sets the vehicle to CarGroup 0 and i have this in "OnPlayerEnterVehicle"

pawn Код:
if(Vehicles[vehicleid][CarGroup] != 0 && Vehicles[vehicleid][CarGroup] != Player[playerid][Group])
    {
        if(ispassenger == 0)
        {
            ClearAnimations(playerid);
        }
    }
That bit of code there makes it so if your not in a faction you cant get in a faction vehicle

It wont let me get into the truck atall even though its a static vehicle i have tried adding

pawn Код:
Vehicles[truck][CarGroup] = 0;
In "OnGameModeInIt" but it still did not work

If you need any more code just ask

Please help

Thanks

What im asking is how can i make it so i can enter the vehicle...
Reply
#2

Stop making new topics!
Reply
#3

Quote:
Originally Posted by Steven82
Посмотреть сообщение
Stop making new topics!
Why wont no one help me

Thanks
Reply
#4

Try using: if(GetPlayerVehicleID(playerid) == truck)

Then work off that?
Reply
#5

Quote:
Originally Posted by iGetty
Посмотреть сообщение
Try using: if(GetPlayerVehicleID(playerid) == truck)

Then work off that?
Would something like this work


pawn Код:
if(GetPlayerVehicleID(playerid) == truck)
{
       continue;
}
Would that make it carry on attempting to get in the truck

Thanks
Reply
#6

Please help

Thanks
Reply
#7

I think continue; is used for loops ... to carry on entering the truck you should simply use return 1;
Reply
#8

If it's in OnPlayerEnterVehicle It would simply be:

pawn Код:
if(vehicleid == truck && !ispassenger)//Entering truck, and not entering as a passenger.
{
//Code
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)