/vehicle Command

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
  • Hallo,


    Was muss ich wo einsetzen damit ich im Auto gemacht werde, wenn ich mir ein respawne.



    dcmd_vehicle(playerid,params[])
    {
    if(Player[playerid][admin] < 1){
    return SendClientMessage (playerid,WEIS,"SERVER: Unknown command.");
    }
    new veh,color1,color2;
    if(sscanf(params,"ddd",veh,color1,color2)){
    return SendClientMessage(playerid,WEIS,"Usage: /vehicle [vehicleID] [color1] [color2]");
    }
    if(veh < 400){
    return SendClientMessage(playerid,WEIS,"INVALID vehID![400-611]");
    }
    if(veh > 611){
    return SendClientMessage(playerid,WEIS,"INVALID vehID![400-611]");
    }
    if(color1 < 0){
    return SendClientMessage(playerid,WEIS,"INVALID color1ID![0-126]");
    }
    if(color1 > 126){
    return SendClientMessage(playerid,WEIS,"INVALID color1ID![0-126]");
    }
    if(color2 < 0){
    return SendClientMessage(playerid,WEIS,"INVALID color2ID![0-126]");
    }
    if(color2 > 126){
    return SendClientMessage(playerid,WEIS,"INVALID color2ID![0-126]");
    }
    new Float:x , Float:y , Float: z;
    GetPlayerPos(playerid,x,y,z);
    CreateVehicle(veh, x, y, z, 0, color1, color2, 123456789);
    SetPlayerPos(playerid,x,y,z);
    SetVehiclePos(veh,x,y,z);
    return 1;
    }



    MFG.

  • dcmd_vehicle(playerid,params[])
    {
    if(Player[playerid][admin] < 1){
    return SendClientMessage (playerid,WEIS,"SERVER: Unknown command.");
    }
    new veh,color1,color2;
    if(sscanf(params,"ddd",veh,color1,color2)){
    return SendClientMessage(playerid,WEIS,"Usage: /vehicle [vehicleID] [color1] [color2]");
    }
    if(veh < 400){
    return SendClientMessage(playerid,WEIS,"INVALID vehID![400-611]");
    }
    if(veh > 611){
    return SendClientMessage(playerid,WEIS,"INVALID vehID![400-611]");
    }
    if(color1 < 0){
    return SendClientMessage(playerid,WEIS,"INVALID color1ID![0-126]");
    }
    if(color1 > 126){
    return SendClientMessage(playerid,WEIS,"INVALID color1ID![0-126]");
    }
    if(color2 < 0){
    return SendClientMessage(playerid,WEIS,"INVALID color2ID![0-126]");
    }
    if(color2 > 126){
    return SendClientMessage(playerid,WEIS,"INVALID color2ID![0-126]");
    }
    new Float:x , Float:y , Float: z;
    GetPlayerPos(playerid,x,y,z);
    CreateVehicle(veh, x, y, z, 0, color1, color2, 123456789);
    SetPlayerPos(playerid,x,y,z);
    SetVehiclePos(veh,x,y,z);
    PutPlayerInVehicle(playerid,veh,1);
    return 1;
    }



    Musste funktionieren!

  • dcmd_vehicle(playerid,params[])
    {
    if(Player[playerid][admin] < 1){
    return SendClientMessage (playerid,WEIS,"SERVER: Unknown command.");
    }
    new veh,color1,color2;
    if(sscanf(params,"ddd",veh,color1,color2)){
    return SendClientMessage(playerid,WEIS,"Usage: /vehicle [vehicleID] [color1] [color2]");
    }
    if(veh < 400){
    return SendClientMessage(playerid,WEIS,"INVALID vehID![400-611]");
    }
    if(veh > 611){
    return SendClientMessage(playerid,WEIS,"INVALID vehID![400-611]");
    }
    if(color1 < 0){
    return SendClientMessage(playerid,WEIS,"INVALID color1ID![0-126]");
    }
    if(color1 > 126){
    return SendClientMessage(playerid,WEIS,"INVALID color1ID![0-126]");
    }
    if(color2 < 0){
    return SendClientMessage(playerid,WEIS,"INVALID color2ID![0-126]");
    }
    if(color2 > 126){
    return SendClientMessage(playerid,WEIS,"INVALID color2ID![0-126]");
    }
    new Float:x , Float:y , Float: z, Car;
    GetPlayerPos(playerid,x,y,z);
    Car = CreateVehicle(veh, x, y, z, 0, color1, color2, 123456789);
    SetPlayerPos(playerid,x,y,z);
    SetVehiclePos(veh,x,y,z);
    PutPlayerInVehicle(playerid, car, 0);
    return 1;
    }
    @ Freakyboy, die Variable "veh" enthält die Modelid des Autos, also wenn ich eingeben würde /vehicle 123 würde ich in das Auto mit der Vehicleid 123 gesetzt werden, und nicht in das eben gespawnte ;)

  • ok danke, beide schreiben was anderes? oO Was soll ich nun nehmen :P


    //edit: Danke an euch beiden ich nehme HP´s seines


    //edit2:

    Zitat

    : error 017: undefined symbol "car"
    warning 204: symbol is assigned a value that is never used: "Car"


    Car = CreateVehicle(veh, x, y, z, 0, color1, color2, 123456789);

    PutPlayerInVehicle(playerid, car, 0);
    Die Zeilen


    //edit3: Rechtschreibung

    2 Mal editiert, zuletzt von CompleXx95 ()

  • Joo..



    Zitat

    : error 017: undefined symbol "car"
    warning 204: symbol is assigned a value that is never used: "Car"


    Car = CreateVehicle(veh, x, y, z, 0, color1, color2, 123456789);

    PutPlayerInVehicle(playerid, car, 0);
    Die Zeilen


    //e2: Wie muss ich es definen"?

  • Du hast car geschrieben, du musst das C aber groß schreiben also Car