Start Engine command GTA: SAMP

GTA: SAMP how to start car engine from command using Pawno script check the following piece of code. 🙂

But at first lets check the function we will use:
GetVehicleModel https://wiki.sa-mp.com/wiki/GetVehicleModel
GetPlayerVehicleID https://wiki.sa-mp.com/wiki/GetPlayerVehicleID
GetVehicleParamsEx https://wiki.sa-mp.com/wiki/GetVehicleParamsEx
GetPlayerState https://wiki.sa-mp.com/wiki/GetPlayerState
SetVehicleParamsEx https://wiki.sa-mp.com/wiki/SetVehicleParamsEx

CMD:engine(playerid, params[])
{
    if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 481 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 509 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 510) return SendClientMessage(playerid,-1,"Iaaiionoeiue o?ainii?o");
    if(GetPlayerVehicleID(playerid) == INVALID_VEHICLE_ID) return true;
    if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return true;
    GetVehicleParamsEx(GetPlayerVehicleID(playerid),engine,lights,alarm,doors,bonnet,boot,objective);
    if(!engine)
    {
        if(CarHealth[GetPlayerVehicleID(playerid)] < 400) return GameTextForPlayer(playerid,"~r~ENGINE HAS BROKENED", 5000, 3);
        GetVehicleParamsEx(GetPlayerVehicleID(playerid),engine,lights,alarm,doors,bonnet,boot,objective);
        SetVehicleParamsEx(GetPlayerVehicleID(playerid),true,true,alarm,doors,bonnet,boot,objective);
    }
    else
    {

        GetVehicleParamsEx(GetPlayerVehicleID(playerid),engine,lights,alarm,doors,bonnet,boot,objective);
        SetVehicleParamsEx(GetPlayerVehicleID(playerid),false,false,alarm,doors,bonnet,boot,objective);
    }
    return true;
}