Beiträge von Corvus

    Warum wird KM und 0 Untereinander geschrieben:
    Tacho7[i] = TextDrawCreate(143.999969, 379.555419, "~w~ 0 Km");
    TextDrawLetterSize(Tacho7[i], 0.212666, 1.807404);
    TextDrawTextSize(Tacho7[i], 31.999998, 14.933333);
    TextDrawAlignment(Tacho7[i], 1);
    TextDrawColor(Tacho7[i], -1);
    TextDrawSetShadow(Tacho7[i], 0);
    TextDrawSetOutline(Tacho7[i], 1);
    TextDrawBackgroundColor(Tacho7[i], 51);
    TextDrawFont(Tacho7[i], 2);
    TextDrawSetProportional(Tacho7[i], 1);

    Hier:
    if(TakingLesson[i] == 2)
    {
    if(value > 75)
    {
    SendClientMessage(i,COLOR_LIGHTRED,"Du Fährst zu schnell, Fahr langsamer sonst fällst du durch die Prüfung");
    }
    if(value >= 100)
    {
    SendClientMessage(i,COLOR_KNALLROT,"Du hast die Prüfung nicht bestanden.");
    RemovePlayerFromVehicle(i);
    SetVehicleToRespawn(GetPlayerVehicleID(i));
    SetPlayerPos(i,1215.3406,-1821.1357,13.5950);
    CP[i] = 0;
    DisablePlayerCheckpoint(i);
    TakingLesson[i] = 0;
    }
    }
    if(IsABoat(VID) || IsAFahrrad(VID))
    {
    format(string2,sizeof(string2),"~r~KM/H:~g~ %d",value);
    format(string,sizeof(string),"~r~%s",VehNames[GetVehicleModel(VID)-400]);
    TextDrawSetString(Tacho2[i], string);
    TextDrawSetString(Tacho4[i],string2);
    }
    else if(IsAPlane(VID))
    {
    new Float:cx,Float:cy,Float:cz;
    GetVehiclePos(VID,cx, cy, cz);
    format(string, sizeof(string), "%f",cz);
    format(string2,sizeof(string2),"~r~KM/H:~g~ %d",value);
    format(string,sizeof(string),"~r~%s",VehNames[GetVehicleModel(VID)-400]);
    TextDrawSetString(Tacho2[i], string);
    TextDrawSetString(Tacho4[i],string2);
    }
    else
    {
    new Speed[20];
    new Float:leben;
    if(value >= 0 && value <= 75){Speed = "~g~";}
    if(value > 75){Speed = "~r~";}
    new Tank[20];
    if(Gas[VID] > 10 && Gas[VID] <= 20){Tank = "~y~";}
    if(Gas[VID] <= 10){Tank = "~r~";}
    if(Gas[VID] > 20){Tank = "~g~";}
    VehSpeed[VID] = value;
    GetVehicleHealth(VID,leben);
    format(string,sizeof(string),"~r~%s",VehNames[GetVehicleModel(VID)-400]);
    format(string1,sizeof(string1),"~r~KM/H:~g~ %d",value);
    format(string2,sizeof(string2),"~r~Tank:~g~ %s %d", Tank, Gas[VID]);
    format(string4,sizeof(string4),"~r~Zustand:~g~ %.1f",leben/10);
    TextDrawSetString(Tacho2[i], string);
    TextDrawSetString(Tacho3[i], string);
    TextDrawSetString(Tacho4[i],string1);
    TextDrawSetString(Tacho5[i],string4);
    TextDrawSetString(Tacho6[i],string2);
    }

    Folgendes:
    new Kaufliste[45][ahModell] =
    Er sendet mir das:


    [19:38:21] carkey: 0
    [19:38:21] typ: 545
    [19:38:21] [debug] Run time error 4: "Array index out of bounds"
    [19:38:21] [debug] Accessing element at index 145 past array upper bound 44
    [19:38:21] [debug] AMX backtrace:
    [19:38:21] [debug] #0 000a97dc in public ocmdOnPlayerCommandText (0, 4233448) from irp(3).amx
    [19:38:21] [debug] #1 native CallLocalFunction () from samp03svr
    [19:38:21] [debug] #2 00002164 in public OnPlayerCommandText (0, 4233412) from irp(3).amx
    [19:38:31] Gas: 97.5 | playerid: 8 | veh: 221 Mehr aber auch nicht.

    Jetzt folgendes:
    [18:54:56] [debug] Run time error 4: "Array index out of bounds"
    [18:54:56] [debug] Accessing element at index 482 past array upper bound 44
    [18:54:56] [debug] AMX backtrace:
    [18:54:56] [debug] #0 000a9728 in public ocmdOnPlayerCommandText (0, 4233448) from irp(3).amx
    [18:54:56] [debug] #1 native CallLocalFunction () from samp03svr
    [18:54:56] [debug] #2 00002164 in public OnPlayerCommandText (0, 4233412) from irp(3).amx
    [18:54:59] [debug] Run time error 19: "File or function is not found"

    Ja da soll das Auto verkauft werden.
    Beim Connecten wird der wert auf 0 gesetzt und mit /carkey hoch gesetzt.
    if(strcmp("/carkey", cmd, true) == 0)
    {
    if(MaxVeh[playerid] > 1)
    {
    CarKey[playerid] += 1;
    if(CarKey[playerid] == MaxVeh[playerid])
    {
    CarKey[playerid] = 0;
    }
    if(Carlist[playerid][CarKey[playerid]][Typ] != -1)
    {
    new index = -1;
    for(new i=0; i<sizeof(Kaufliste); i++)
    {
    if(Kaufliste[i][Modelid] == Carlist[playerid][CarKey[playerid]][Typ])
    {
    index = i;
    break;
    }
    }
    if(index == -1) format(string, sizeof(string), "Du nimmst deinen %dten Auto-Schlüssel, für deinen <unbekannt> !", CarKey[playerid]+1);
    else format(string, sizeof(string), "Du nimmst deinen %dten Auto-Schlüssel, für deinen %s !", CarKey[playerid]+1, Kaufliste[index][Name]);
    }
    else
    {
    format(string, sizeof(string), "Du nimmst deinen %dten Auto-Schlüssel !",CarKey[playerid]+1);
    }
    SendClientMessage(playerid,COLOR_YELLOW,string);
    }
    return 1;
    }

    Habe es mit TextDrawHideForPlayer(playerid,Tacho9[playerid]); gelöst habs ganz vergessen das einzufügen der /carsell befehl bugt kommt immer Server Unknown Command:
    if(strcmp("/carsell", cmd, true) == 0)
    {
    if(Carlist[playerid][CarKey[playerid]][Typ] != -1)
    {
    if(Carlist[playerid][CarKey[playerid]][Carid] != -1)
    {
    new preis = (Kaufliste[Carlist[playerid][CarKey[playerid]][Typ]][Preis]/5)*4;
    GivePlayerMoneys(playerid, preis);
    DestroyVehicleSelfmade(Carlist[playerid][CarKey[playerid]][Carid]);
    Carlist[playerid][CarKey[playerid]][Typ]=-1;
    Carlist[playerid][CarKey[playerid]][pos_x]=0.0;
    Carlist[playerid][CarKey[playerid]][pos_y]=0.0;
    Carlist[playerid][CarKey[playerid]][pos_z]=0.0;
    Carlist[playerid][CarKey[playerid]][z_angle]=0.0;
    Carlist[playerid][CarKey[playerid]][Status]=0;
    Carlist[playerid][CarKey[playerid]][Lock]=0;
    Carlist[playerid][CarKey[playerid]][Carid]=-1;
    Carlist[playerid][CarKey[playerid]][Farbe1]=-1;
    Carlist[playerid][CarKey[playerid]][Farbe2]=-1;
    Carlist[playerid][CarKey[playerid]][mod1]=-1;
    Carlist[playerid][CarKey[playerid]][mod2]=-1;
    Carlist[playerid][CarKey[playerid]][mod3]=-1;
    Carlist[playerid][CarKey[playerid]][mod4]=-1;
    Carlist[playerid][CarKey[playerid]][mod5]=-1;
    Carlist[playerid][CarKey[playerid]][mod6]=-1;
    Carlist[playerid][CarKey[playerid]][mod7]=-1;
    Carlist[playerid][CarKey[playerid]][mod8]=-1;
    Carlist[playerid][CarKey[playerid]][mod9]=-1;
    Carlist[playerid][CarKey[playerid]][mod10]=-1;
    Carlist[playerid][CarKey[playerid]][mod11]=-1;
    Carlist[playerid][CarKey[playerid]][mod12]=-1;
    Carlist[playerid][CarKey[playerid]][mod13]=-1;
    Carlist[playerid][CarKey[playerid]][mod14]=-1;
    Carlist[playerid][CarKey[playerid]][mod15]=-1;
    Carlist[playerid][CarKey[playerid]][mod16]=-1;
    Carlist[playerid][CarKey[playerid]][mod17]=-1;
    Carlist[playerid][CarKey[playerid]][Paintjob]=-1;
    Carlist[playerid][CarKey[playerid]][OwnerID] = playerid;
    Carlist[playerid][CarKey[playerid]][SpawnSaveX]=0.0;
    Carlist[playerid][CarKey[playerid]][SpawnSaveY]=0.0;
    Carlist[playerid][CarKey[playerid]][SpawnSaveZ]=0.0;
    Carlist[playerid][CarKey[playerid]][SpawnSaveRot]=0.0;
    Carlist[playerid][CarKey[playerid]][TankVolumen]=0;
    Carlist[playerid][CarKey[playerid]][StandTime] = 0;
    Carlist[playerid][CarKey[playerid]][Neon]=0;
    Carlist[playerid][CarKey[playerid]][NeonType]=1;
    format(string, sizeof(string), "Du hast erfolgreich dein Auto für %s$ verkauft!",GetPoint(preis));
    SendClientMessage(playerid, COLOR_RED, string);
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(string, sizeof(string), "%s hat sein Auto verkauft!",sendername,preis);
    printf(string);
    }
    else
    {
    SendClientMessage(playerid, COLOR_ERRORTEXT, " Du besitzt zur Zeit kein Auto auf dem ausgewählten Schlüssel !");
    return 1;
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_ERRORTEXT, " Du besitzt kein Auto auf dem ausgewählten Schlüssel !");
    return 1;
    }
    return 1;
    }

    So:
    if(newstate == PLAYER_STATE_DRIVER){
    gLastCar[playerid] = GetPlayerVehicleID(playerid);
    new veh = GetPlayerVehicleID(playerid);
    new VID = GetPlayerVehicleID(playerid);
    new value,
    Float:xX,
    Float:yY,
    Float:zZ,
    Float:X,
    Float:Y,
    Float:Z;
    GetVehiclePos(VID, xX, yY, zZ);
    GetVehicleVelocity(VID, X, Y, Z);
    value = floatround(floatsqroot((X*X) + (Y*Y) + (Z*Z)) * 100 * 1.40);
    new Speed[20];
    new Float:leben;
    if(value >= 0 && value <= 75){Speed = "~g~";}
    if(value > 75){Speed = "~r~";}
    new Tank[20];
    if(Gas[VID] > 10 && Gas[VID] <= 20){Tank = "~y~";}
    if(Gas[VID] <= 10){Tank = "~r~";}
    if(Gas[VID] > 20){Tank = "~g~";}
    VehSpeed[VID] = value;
    GetVehicleHealth(VID,leben);
    format(string,sizeof(string),"~r~%s",VehNames[GetVehicleModel(VID)-400]);
    format(string1,sizeof(string1),"~r~KM/H:~g~ %d ",value);
    format(string2,sizeof(string2),"~r~Tank:~g~ %0.1f ", Tank, Gas[VID]);
    format(string4,sizeof(string4),"~r~Zustand:~g~ %",leben/10);
    format(string3,sizeof(string3),"~r~Kilometer:~g~ %d Km",floatround(Kilometer[veh]));
    TextDrawSetString(Tacho3[playerid], string);
    TextDrawSetString(Tacho4[playerid],string1);
    TextDrawSetString(Tacho6[playerid],string2);
    TextDrawSetString(Tacho5[playerid],string4);
    TextDrawSetString(Tacho7[playerid],string3);
    TextDrawShowForPlayer(playerid, Tacho[playerid]);
    TextDrawShowForPlayer(playerid, Tacho1[playerid]);
    TextDrawShowForPlayer(playerid, Tacho2[playerid]);
    TextDrawShowForPlayer(playerid, Tacho3[playerid]);
    TextDrawShowForPlayer(playerid, Tacho4[playerid]);
    TextDrawShowForPlayer(playerid, Tacho5[playerid]);
    TextDrawShowForPlayer(playerid,Tacho6[playerid]);
    TextDrawShowForPlayer(playerid, Tacho7[playerid]);
    TextDrawShowForPlayer(playerid, Tacho9[playerid]);
    new newcar = GetPlayerVehicleID(playerid);


    new Gas[MAX_VEHICLES];