Engine on bikes :S
#1

Trying to make it that if the player is the driver but he is in vehicles 510,362,381 or 509 this message doesn't appear.

pawn Код:
new vehicleid = GetPlayerVehicleID(playerid);
    if(newstate == PLAYER_STATE_DRIVER && vehicleid != 510 || vehicleid != 462 || vehicleid != 481 || vehicleid != 509);
    {
        new engine, alarm, bonnet, boot, objective, lights, doors;
        GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
        if(engine == VEHICLE_PARAMS_OFF || engine == VEHICLE_PARAMS_UNSET)
        {
           SendClientMessage(playerid, COLOR_WHITE,"< To turn on the vehicle engine type {800040}/engine{FFFFFF} - to check radio commands type {800040}/radiohelp{FFFFFF} >");
        }
    }
Reply
#2

pawn Код:
new vehicleid = GetPlayerVehicleID(playerid), modelid = GetVehicleModel(vehicleid);
if((newstate == PLAYER_STATE_DRIVER) && (modelid != 510 || modelid != 462 || modelid != 481 || modelid != 509))
{
    new engine, alarm, bonnet, boot, objective, lights, doors;
    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
    if(engine == VEHICLE_PARAMS_OFF || engine == VEHICLE_PARAMS_UNSET)
    {
        SendClientMessage(playerid, COLOR_WHITE,"< To turn on the vehicle engine type {800040}/engine{FFFFFF} - to check radio commands type {800040}/radiohelp{FFFFFF} >");
    }
}
Reply
#3

pawn Код:
IsBike(vid)
{
    switch (GetVehicleModel(vid))
    {
        case 510,362,381,509: return 1;
        default: return 0;
     }
     return 0;
}
Then:
pawn Код:
if(newstate == PLAYER_STATE_DRIVER);
{
    new engine, alarm, bonnet, boot, objective, lights, doors;
    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
    if(!IsBike(GetPlayerVehicleID(playerid)))
    {
        if(engine == VEHICLE_PARAMS_OFF || engine == VEHICLE_PARAMS_UNSET)
        {
            SendClientMessage(playerid, COLOR_WHITE,"< To turn on the vehicle engine type {800040}/engine{FFFFFF} - to check radio commands type {800040}/radiohelp{FFFFFF} >");
        }
    }
}
Give that a go. Use the stock i provided anywhere, although i put them below where i need em. Usually at the bottom of the script.
Reply
#4

Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)