[HElP]Probleme mit /engine

Wichtiger Hinweis: Bitte ändert nicht manuell die Schriftfarbe auf schwarz sondern belasst es bei der Standardeinstellung. Somit tragt ihr dazu bei dass euer Text auch bei Verwendung unseren dunklen Forenstils noch lesbar ist!

Tipp: Ihr wollt längere Codeausschnitte oder Logfiles bereitstellen? Benutzt unseren eigenen PasteBin-Dienst Link
  • Help der motor soll net gestartet werden er in einem Autohaus oder Fraktionsautohaus car ist hir der Code:


    ocmd:engine(playerid, params[])
    {
    if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER)return SendClientMessage(playerid,Rot,"Du musst der Fahrer sein um das Fahrzeug zu starten!");
    new vehicleid = GetPlayerVehicleID(playerid);
    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
    for(new i=0; i<sizeof(FrakAutoHaus); i++) { //Fraktions Autohaus
    for(new a=0; a<sizeof(autokauf); a++){// autohaus
    if(GetVehicleModel(vehicleid) == FrakAutoHaus[i][FahrzeugID] || GetVehicleModel(vehicleid) == autokauf[a][ModelID]){ SendClientMessage(playerid,Grau,"Du hast keinen Schlüssel.!");}// der Motor soll net gestartet werden wird aber gestartet ;(
    else if(GetVehicleModel(vehicleid) == 509 || GetVehicleModel(vehicleid) == 481 || GetVehicleModel(vehicleid) == 510){return 1;}
    else
    {
    if(Motor[vehicleid] == false)
    {
    SetTimerEx("Motortimer",1000,false,"d",playerid);
    SendClientMessage(playerid,Grau,"Der Motor wird gestartet ....");
    }
    else
    {
    SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
    SendClientMessage(playerid,Grau,"Motor wird ausgeschaltet...");
    Motor[vehicleid] = false;
    }
    }}}
    return 1;
    }

    Mit freundlichen Grüßen,


    Fabi.StaR :love::saint:


  • Habe es so:


    ocmd:engine(playerid, params[])
    {
    if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER)return SendClientMessage(playerid,Rot,"Du musst der Fahrer sein um das Fahrzeug zu starten!");
    new vehicleid = GetPlayerVehicleID(playerid);
    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
    for(new i=0; i<sizeof(FrakAutoHaus); i++) {
    for(new a=0; a<sizeof(autokauf); a++){
    if(GetPlayerVehicleID(playerid) == FrakAutoHaus[i][FahrzeugID] || GetPlayerVehicleID(playerid) == autokauf[a][ModelID])return SendClientMessage(playerid,Grau,"Du hast keinen Schlüssel.!");
    else if(GetVehicleModel(vehicleid) == 509 || GetVehicleModel(vehicleid) == 481 || GetVehicleModel(vehicleid) == 510){return 1;}
    else
    {
    if(Motor[vehicleid] == false)
    {
    SetTimerEx("Motortimer",1000,false,"d",playerid);
    SendClientMessage(playerid,Grau,"Der Motor wird gestartet ....");
    }
    else
    {
    SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
    SendClientMessage(playerid,Grau,"Motor wird ausgeschaltet...");
    Motor[vehicleid] = false;
    }
    }}}
    return 1;
    }


    geht aber net ;(

    Mit freundlichen Grüßen,


    Fabi.StaR :love::saint:


  • new veh = GetPlayerVehicleID(playerid);
    GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
    if(Motor[veh] == 0)
    {
    SetVehicleParamsEx(veh,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);

    //GameTextForPlayer(playerid, "~w~Motor ~r~gestartet", 3000, 6);
    Motor[veh] = 1;
    }
    else
    {
    SetVehicleParamsEx(veh,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);

    //GameTextForPlayer(playerid, "~w~Motor ~g~gestoppt", 3000, 6);
    Motor[veh] = 0;
    }



    Zeig mal deinen Timer.
    /edit
    PS: was genau geht nicht?? -.-

  • enum autoverkaufInfo
    {
    Autohaus,
    FahrzeugName[128],
    ModelID,
    CarPreis,
    RepPreis,
    Float:AUTOPoS_X,
    Float:AUTOPoS_Y,
    Float:AUTOPoS_Z,
    Float:AUTOPoS_A,
    VEHID
    }
    new autokauf[38][autoverkaufInfo] = {
    {0,"ZR-350",477,750000,2000,741.2859,-1333.7813,13.3365,209.3625,-1},
    {0,"Banshee",429,1000000,5500,746.0001,-1333.0009,13.2095,211.0988,-1},
    {0,"Alpha",602,23000,2000,750.9999,-1333.0048,13.3561,211.1028,-1},
    {0,"Tampa",549,100000,1000,756.0007,-1333.0009,13.2672,211.1014,-1},
    {0,"Glendale Shit",604,5000,50,761.0410,-1333.0162,13.3218,210.5058,-1},
    {0,"Sultan",560,1500000,10000,766.0532,-1333.0228,13.1912,211.2380,-1},
    {0,"Flash",565,1500000,7000,770.1692,-1333.5298,13.1734,209.6754,-1},
    {0,"Cadrona",527,80000,800,782.9988,-1334.9996,13.2555,121.1070,-1},
    {0,"Feltzer",533,500000,3000,783.0123,-1340.0615,13.2713,119.7727,-1},
    {0,"Buccaneer",518,580000,5800,783.0063,-1345.0187,13.2394,120.6961,-1},
    {0,"Bobcat",422,260000,2600,783.0119,-1350.0835,13.5442,121.3923,-1},
    {0,"Remington",534,500000,3000,783.0036,-1355.0020,13.2813,120.9581,-1},
    {0,"Savanna",567,350000,3000,783.0142,-1360.0333,13.4096,120.6085,-1},
    {0,"Slamvan",535,500000,5000,783.0092,-1365.0315,13.3097,120.1563,-1},
    {0,"Landstalker",400,250000,2500,783.0126,-1370.0470,13.6409,119.0777,-1},
    {0,"Huntley",579,200000,1000,782.9914,-1375.0028,13.5639,121.1103,-1},
    {0,"Stratum",561,1500000,15000,783.0280,-1380.0638,13.4564,118.4855,-1},
    {0,"Picador",600,200000,2000,765.0041,-1379.9939,13.3950,301.0952,-1},
    {0,"Patriot",470,650000,6500,764.9874,-1374.9368,13.5543,299.7244,-1},
    {0,"Elegy",562,1500000,10000,765.0035,-1369.9968,13.1293,301.0979,-1},
    {0,"Elegant",507,40000,650,765.0021,-1364.9957,13.3855,300.9562,-1},
    {0,"Clover",542,35000,500,764.5659,-1359.4191,13.2437,301.4634,-1},
    {0,"Sanchez",468,100000,2000,750.7290,-1358.3871,13.1730,273.7726,-1},
    {0,"Freeway",463,200000,10000,744.0961,-1358.6742,13.0390,269.9220,-1},
    {1,"Faggio",462,10000,100,-1674.3512,1216.8027,6.8678,288.0854,-1},
    {1,"Washington",421,4500000,45000,-1660.7256,1217.6407,13.5392,283.1553,-1},
    {1,"Club",589,70000,750,-1665.7789,1222.4406,13.3043,279.6459,-1},
    {1,"Infernus",411,1700000,7000,-1651.4218,1209.5952,13.3990,274.0950,-1},
    {1,"Cheetah",415,115000,10000,-1677.3560,1207.8099,13.4461,208.2602,-1},
    {1,"Jester",559,1500000,10000,-1676.0139,1207.1642,20.8412,261.5085,-1},
    {1,"Phönix",603,600000,4000,-1664.4376,1206.8243,20.9268,332.6265,-1},
    {1,"SUPER-GT",506,12500000,20000,-1651.6368,1208.2538,20.8447,305.1017,-1},
    {1,"Premier",426,750000,18000,-1654.3116,1214.8104,20.9259,173.5713,-1},
    {1,"Uranus",558,85000,10000,-1661.1927,1217.9641,20.8001,286.1666,-1},
    {1,"Turismo",451,13000000,20000,-1665.1251,1222.7295,21.1744,268.0075,-1},
    {1,"Buffalo",402,500000,3000,-1663.6698,1215.2883,7.0461,274.9876,-1},
    {1,"Bullet",541,7500000,17500,-1651.3835,1210.3475,6.8957,281.3334,-1},
    {1,"Blista Compact",496,350000,2500,-1668.6449,1207.0300,6.9655,309.3837,-1}
    };

    Mit freundlichen Grüßen,


    Fabi.StaR :love::saint:


  • do.de - Domain-Offensive - Domains für alle und zu super Preisen
  • ich möchte das man denn motor von Autohäusern nicht starten kann aber es geht nur bei einem hir der code:


    ocmd:engine(playerid, params[])
    {
    if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER)return SendClientMessage(playerid,Rot,"Du musst der Fahrer sein um das Fahrzeug zu starten!");
    new vehicleid = GetPlayerVehicleID(playerid);
    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
    for(new i=0; i<sizeof(FrakAutoHaus); i++)
    {
    for(new a=0; a<sizeof(autokauf); a++)
    {
    if(GetPlayerVehicleID(playerid)==FrakAutoHaus[i][vehid]){ SendClientMessage(playerid,Grau,"Du besitzt keinen schlüssel für das Fahrzeug"); return 1;}// hir geht es
    else if(GetPlayerVehicleID(playerid)==autokauf[a][VEHID]){ SendClientMessage(playerid,Grau,"Du besitzt keinen schlüssel für das Fahrzeug"); return 1;}//hir geht es net
    else if(GetVehicleModel(vehicleid) == 509 || GetVehicleModel(vehicleid) == 481 || GetVehicleModel(vehicleid) == 510){return 1;}
    else
    {
    if(Motor[vehicleid] == false)
    {
    SetTimerEx("Motortimer",1000,false,"d",playerid);
    SendClientMessage(playerid,Grau,"Der Motor wird gestartet ....");
    }
    else
    {
    SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
    SendClientMessage(playerid,Grau,"Motor wird ausgeschaltet...");
    Motor[vehicleid] = false;
    }
    }
    }
    }
    return 1;
    }

    Mit freundlichen Grüßen,


    Fabi.StaR :love::saint: