Car commands on bicycles
#1

I already asked that a few days ago, someone answered me.. I asked about making that you wont have to type /engine to drive bicycles..but right now.. I'm trying to make that if you're driving a bicycles you wont have the option to use this commands: /engine , /boot , /bonnet , /lights

here is one of them.. they are all works the same..

pawn Код:
if(strcmp(cmd, "/engine", true) == 0)
    {
        new vehicleid = GetPlayerVehicleID(playerid);
        new engine, lights, alarm, doors, bonnet, boot, objective;
        GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
        if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
            if(GetVehicleModel(vehicleid) != 481 || GetVehicleModel(vehicleid) != 509 || GetVehicleModel(vehicleid) != 510)
            {
                GetPlayerName(playerid, sendername, sizeof(sendername));
                format(string, sizeof(string), "* %s puts the keys and turn on the engine.", sendername);
                ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                if(engine == 1)
                {
                    SetVehicleParamsEx(vehicleid, 0, lights, alarm, doors, bonnet, boot, objective);
                    GetPlayerName(playerid, sendername, sizeof(sendername));
                    format(string, sizeof(string), "* %s Turn off the engine and take the keys.", sendername);
                    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                }
                else
                {
                    SetVehicleParamsEx(vehicleid, 1, lights, alarm, doors, bonnet, boot, objective);
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD5, "   You riding a bicycles!");
            }
        }
        return 1;
    }
What is wrong with it?
Reply
#2

pawn Код:
stock IsABike(vehicleid)
{
    new result, model = GetVehicleModel(vehicleid);
    switch(model)
    {
        case //bike model ids here: result = model;
    }
    return result;
}
And use in the command:
pawn Код:
if(IsABike(vehicleid))
{
 // code here
}
Reply
#3

Thanks, I'll try it but didnt really got what to put under the case?
like dialog responde?
Reply
#4

Yes, you need to insert all the Bike Model IDs

pawn Код:
stock IsABicycle(vehicleid)
{
    switch(GetVehicleModel(vehicleid))
    {
        case 481, 509, 510: return true;
    }
    return false;
}
Reply
#5

Quote:
Originally Posted by iPLEOMAX
Посмотреть сообщение
Yes, you need to insert all the Bike Model IDs

pawn Код:
stock IsABicycle(vehicleid)
{
    switch(GetVehicleModel(vehicleid))
    {
        case 481, 509, 510: return true;
    }
    return false;
}
Thank you. Sorry i didn't explain it very well.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)