Bei Fahrzeug spawn gleich im car sein | ladmin

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
  • Guten Tag!


    Wie geht es, dass ich gleich im car spawne wenn ich ein Fahrzeug mit /v spawne.
    Gerade ist es so, dass das Fahrzeug vor einem erscheint.


    Hier der code:


    dcmd_v(playerid,params[]) {
    if(PlayerInfo[playerid][Level] >= 0) {
    new tmp[256], tmp2[256], tmp3[256], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index); tmp3 = strtok(params,Index);
    if(!strlen(tmp)) return SendClientMessage(playerid, red, "USAGE: /v [Modelid/Name] [Farbe1] [Farbe2]");
    new car, colour1, colour2, string[128];
    if(!IsNumeric(tmp)) car = GetVehicleModelIDFromName(tmp); else car = strval(tmp);
    if(car < 400 || car > 611) return SendClientMessage(playerid, red, "ERROR: Invalid Vehicle Model");
    if(!strlen(tmp2)) colour1 = random(126); else colour1 = strval(tmp2);
    if(!strlen(tmp3)) colour2 = random(126); else colour2 = strval(tmp3);
    if(PlayerInfo[playerid][pCar] != -1 && !IsPlayerAdmin(playerid) ) CarDeleter(PlayerInfo[playerid][pCar]);
    new LVehicleID,Float:X,Float:Y,Float:Z, Float:Angle,int1; GetPlayerPos(playerid, X,Y,Z); GetPlayerFacingAngle(playerid,Angle); int1 = GetPlayerInterior(playerid);
    LVehicleID = CreateVehicle(car, X+3,Y,Z, Angle, colour1, colour2, -1); LinkVehicleToInterior(LVehicleID,int1);
    PlayerInfo[playerid][pCar] = LVehicleID;
    CMDMessageToAdmins(playerid,"CAR");
    format(string, sizeof(string), "%s spawned a \"%s\" (Model:%d) colour (%d, %d), at %0.2f, %0.2f, %0.2f", pName(playerid), VehicleNames[car-400], car, colour1, colour2, X, Y, Z);
    SaveToFile("CarSpawns",string);
    format(string, sizeof(string), "Fahrzeug gespawnt. \"%s\" (Model:%d) colour (%d, %d)", VehicleNames[car-400], car, colour1, colour2);
    return SendClientMessage(playerid,lightblue, string);
    } else return SendClientMessage(playerid,red,"ERROR: You need to be level 3 to use this command");
    }

  • Mach doch das man gleich IM Auto sitzt.


    Das machste dann mit PutPlayerInVehicle

  • dcmd_v(playerid,params[]) {
    if(PlayerInfo[playerid][Level] >= 0) {
    new tmp[256], tmp2[256], tmp3[256], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index); tmp3 = strtok(params,Index);
    if(!strlen(tmp)) return SendClientMessage(playerid, red, "USAGE: /v [Modelid/Name] [Farbe1] [Farbe2]");
    new car, colour1, colour2, string[128];
    if(!IsNumeric(tmp)) car = GetVehicleModelIDFromName(tmp); else car = strval(tmp);
    if(car < 400 || car > 611) return SendClientMessage(playerid, red, "ERROR: Invalid Vehicle Model");
    if(!strlen(tmp2)) colour1 = random(126); else colour1 = strval(tmp2);
    if(!strlen(tmp3)) colour2 = random(126); else colour2 = strval(tmp3);
    if(PlayerInfo[playerid][pCar] != -1 && !IsPlayerAdmin(playerid) ) CarDeleter(PlayerInfo[playerid][pCar]);
    new LVehicleID,Float:X,Float:Y,Float:Z, Float:Angle,int1; GetPlayerPos(playerid, X,Y,Z); GetPlayerFacingAngle(playerid,Angle); int1 = GetPlayerInterior(playerid);
    LVehicleID = CreateVehicle(car, X+3,Y,Z, Angle, colour1, colour2, -1); LinkVehicleToInterior(LVehicleID,int1);
    PlayerInfo[playerid][pCar] = LVehicleID;
    PutPlayerInVehicle(playerid, LVehicleID, 0);
    CMDMessageToAdmins(playerid,"CAR");
    format(string, sizeof(string), "%s spawned a \"%s\" (Model:%d) colour (%d, %d), at %0.2f, %0.2f, %0.2f", pName(playerid), VehicleNames[car-400], car, colour1, colour2, X, Y, Z);
    SaveToFile("CarSpawns",string);
    format(string, sizeof(string), "Fahrzeug gespawnt. \"%s\" (Model:%d) colour (%d, %d)", VehicleNames[car-400], car, colour1, colour2);
    return SendClientMessage(playerid,lightblue, string);
    } else return SendClientMessage(playerid,red,"ERROR: You need to be level 3 to use this command");
    }

    The fact is, I am right. And if you think I'm wrong, you are wrong.