SA-MP Forums Archive
Not with bikes - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Not with bikes (/showthread.php?tid=264822)



Not with bikes - Tachibana - 27.06.2011

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


Re: Not with bikes - BizzyD - 27.06.2011

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


Re: Not with bikes - randomkid88 - 27.06.2011

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



Re: Not with bikes - Tachibana - 27.06.2011

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


Re: Not with bikes - Luis- - 27.06.2011

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


Re: Not with bikes - Tachibana - 27.06.2011

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


Re: Not with bikes - Wesley221 - 27.06.2011

Change vid with vehicleid


Re: Not with bikes - Tachibana - 27.06.2011

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


Re: Not with bikes - Mean - 27.06.2011

Full code? You've probbably placed it wrong.


Re: Not with bikes - Tachibana - 27.06.2011

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