Not with bikes
#1

Heyoh!

I just need a small help, I got an vehicle sys in dialogs however I dont want to turn on the engine on a bicycle (from when do u turn on engine there?!) so the bike will be able to be driven without doing /vc choosing Engine

Is it something like Ifisbike or wtf lol

Thanks!
Big Regards Tachiaban
Reply
#2

You have to find the id's for the bikes, and then make a if(IsaBike) something like that :P
Reply
#3

Something like this:
pawn Код:
stock IsABike(vid)
{
    new modelid = GetVehicleModel(vid);
    if(modelid == 509||modelid ==510||modelid ==581||modelid ==522||modelid ==521||modelid ==523||modelid ==586||modelid ==481||modelid ==462||modelid ==448||modelid ==461||modelid ==463||modelid ==468||modelid ==471) return 1;
    else return 0;
}
To use:
pawn Код:
if(IsABike(vid)) //checks to see if the given vehicle ID is a bike
Reply
#4

Quote:
Originally Posted by randomkid88
Посмотреть сообщение
Something like this:
pawn Код:
stock IsABike(vid)
{
    new modelid = GetVehicleModel(vid);
    if(modelid == 509||modelid ==510||modelid ==581||modelid ==522||modelid ==521||modelid ==523||modelid ==586||modelid ==481||modelid ==462||modelid ==448||modelid ==461||modelid ==463||modelid ==468||modelid ==471) return 1;
    else return 0;
}
To use:
pawn Код:
if(IsABike(vid)) //checks to see if the given vehicle ID is a bike
Just when I was about to post my one with errors xD

however from your one I get
pawn Код:
error 017: undefined symbol "vid"
when put on engine choice

Thanks btw ;]
Reply
#5

Try something like:
pawn Код:
new vid = GetPlayerVehicleID(playerid);
And add it to your engine code.
Reply
#6

Quote:
Originally Posted by -Luis
Посмотреть сообщение
Try something like:
pawn Код:
new vid = GetPlayerVehicleID(playerid);
And add it to your engine code.
Quote:

: error 017: undefined symbol "vid"
: error 003: declaration of a local variable must appear in a compound block
: error 017: undefined symbol "vid"
: error 017: undefined symbol "vid"
: error 003: declaration of a local variable must appear in a compound block
: error 017: undefined symbol "vid"

Gives some errors
Reply
#7

Change vid with vehicleid
Reply
#8

Quote:
Originally Posted by Wesley221
Посмотреть сообщение
Change vid with vehicleid
Still says undefined
Reply
#9

Full code? You've probbably placed it wrong.
Reply
#10

Quote:
Originally Posted by Mean
Посмотреть сообщение
Full code? You've probbably placed it wrong.
pawn Код:
case 4:
            {
                if(GetPVarInt(playerid, "Engine") == 0)
                {
                    GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(veh,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
                    if(IsABike(vehicleid))
                    SetPVarInt(playerid, "Engine", 1);
                }
                else if(GetPVarInt(playerid, "Engine") == 1)
                {
                    GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(veh,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
                    if(IsABike(vehicleid))
                    SetPVarInt(playerid, "Engine", 0);
                }
?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)