Kann jemand bei 2 errors helfen?

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,


    Kann jemand sagen was da falsch ist bitte?



    C:\Users\Hendo\Desktop\SAMP HERZ\gamemodes\Hayfun.pwn(1255) : error 029: invalid expression, assumed zero
    C:\Users\Hendo\Desktop\SAMP HERZ\gamemodes\Hayfun.pwn(1255 -- 1256) : warning 215: expression has no effect
    C:\Users\Hendo\Desktop\SAMP HERZ\gamemodes\Hayfun.pwn(1256) : error 001: expected token: ";", but found "new"
    C:\Users\Hendo\Desktop\SAMP HERZ\gamemodes\Hayfun.pwn(1250) : warning 204: symbol is assigned a value that is never used: "vehicleid"
    Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase



    2 Errors.



    GetPlayerPos(i, x, y, z); GetVehicleHealth(GetPlayerVehicleID(i), health); new vehicleid = GetPlayerVehicleID(i); [b]Zeile: 1250[/b]
    new VehicleModel = GetVehicleModel(GetPlayerVehicleID(i));
    Dis = floatsqroot(floatpower(floatabs(floatsub(OldCoordsX[i],x)),2) + floatpower(floatabs(floatsub(OldCoordsY[i],y)),2));


    if(VehicleModel==509||VehicleModel==481||VehicleModel==510) {SetVehicleHealth(GetPlayerVehicleID(i), 1000); }
    if(VehicleModel==520||VehicleModel==476||VehicleModel==593||VehicleModel==553||VehicleModel==513||VehicleModel==512||VehicleModel==577||VehicleModel==592||VehicleModel==511||VehicleModel==539||VehicleModel==464||VehicleModel==519)} [b]Zeile: 1255[/b]
    new speed = (floatround(Dis)*MULTIPLY_SPEED); [b]Zeile: 1256 [/b]


    Danke

    < Beatboxen ist leicht > Beatboxen & Singen/Rappen ist schwerer >

  • if(VehicleModel==520||VehicleModel==476||VehicleModel==593||VehicleModel==553||VehicleModel==513||VehicleModel==512||VehicleModel==577||VehicleModel==592||VehicleModel==511||VehicleModel==539||VehicleModel==464||VehicleModel==519)
    {

    Dies bitte mit Zeile 1255 ersetzen.

  • Bekomem viele errors muss das hier machen



    if(VehicleModel==520||VehicleModel==476||VehicleModel==593||VehicleModel==553||VehicleModel==513||VehicleModel==512||VehicleModel==577||VehicleModel==592||VehicleModel==511||VehicleModel==539||VehicleModel==464||VehicleModel==519)}


    Hier mal der ganze code:



    public Speedometer()
    {
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
    if(IsPlayerConnected(i) && IsPlayerInAnyVehicle(i))
    {
    if(ShowSpeed[i] == 1)
    {
    #define MULTIPLY_SPEED 4
    new Float:x, Float:y, Float:z, Float:Dis, Float:health, string[256];TextDrawDestroy(black[i]); TextDrawDestroy(Speedom[i]);
    GetPlayerPos(i, x, y, z); GetVehicleHealth(GetPlayerVehicleID(i), health); new vehicleid = GetPlayerVehicleID(i);
    new VehicleModel = GetVehicleModel(GetPlayerVehicleID(i));
    Dis = floatsqroot(floatpower(floatabs(floatsub(OldCoordsX[i],x)),2) + floatpower(floatabs(floatsub(OldCoordsY[i],y)),2));


    if(VehicleModel==509||VehicleModel==481||VehicleModel==510) {SetVehicleHealth(GetPlayerVehicleID(i), 1000); }
    if(VehicleModel==520||VehicleModel==476||VehicleModel==593||VehicleModel==553||VehicleModel==513||VehicleModel==512||VehicleModel==577||VehicleModel==592||VehicleModel==511||VehicleModel==539||VehicleModel==464||VehicleModel==519)}
    new speed = (floatround(Dis)*MULTIPLY_SPEED);


    if( speed == 0 ){
    format(string,sizeof(string),"~B~Vehicle:~n~~w~%s~n~~B~Speed: ~W~%.1f~n~~B~Health: ~W~%.0f%",VehiclesName[GetVehicleModel(GetPlayerVehicleID(i))-400],speed,health/10);
    } else if( speed >= 1 && speed <= 60 ){
    format(string,sizeof(string),"~B~Vehicle:~n~~w~%s~n~~B~Speed: ~W~%.1f~n~~B~Health: ~W~%.0f%",VehiclesName[GetVehicleModel(GetPlayerVehicleID(i))-400],speed,health/10);
    } else if( speed >= 61 && speed <= 120 ){
    format(string,sizeof(string),"~B~Vehicle:~n~~w~%s~n~~B~Speed: ~W~%.1f~n~~B~Health: ~W~%.0f%",VehiclesName[GetVehicleModel(GetPlayerVehicleID(i))-400],speed,health/10);
    } else {
    format(string,sizeof(string),"~B~Vehicle:~n~~w~%s~n~~B~Speed: ~W~%.1f~n~~B~Health: ~W~%.0f%",VehiclesName[GetVehicleModel(GetPlayerVehicleID(i))-400],speed,health/10);
    }


    black[i] = TextDrawCreate(504.000000,379.000000,"_");
    TextDrawUseBox(black[i],1);
    TextDrawBoxColor(black[i],0x00000085);
    TextDrawTextSize(black[i],621.000000,0.000000);
    TextDrawAlignment(black[i],0);
    TextDrawBackgroundColor(black[i],0x000000FF);
    TextDrawFont(black[i],2);
    TextDrawLetterSize(black[i],1.700000,5.250000);
    TextDrawColor(black[i],0xFFFFFFFF);
    TextDrawSetOutline(black[i],1);
    TextDrawSetProportional(black[i],1);
    TextDrawSetShadow(black[i],1);


    Speedom[i] = TextDrawCreate(505.000000,380.000000,string);
    TextDrawUseBox(Speedom[i],1);
    TextDrawBoxColor(Speedom[i],0xFFFFFF85);
    TextDrawTextSize(Speedom[i],620.000000,0.000000);
    TextDrawAlignment(Speedom[i],0);
    TextDrawBackgroundColor(Speedom[i],0x000000FF);
    TextDrawFont(Speedom[i],2);
    TextDrawLetterSize(Speedom[i],0.299999,1.000000);
    TextDrawColor(Speedom[i],0xFFFFFFFF);
    TextDrawSetOutline(Speedom[i],1);
    TextDrawSetProportional(Speedom[i],1);
    TextDrawSetShadow(Speedom[i],1);


    TextDrawShowForPlayer(i, black[i]);
    TextDrawShowForPlayer(i, Speedom[i]);
    OldCoordsX[i] = x; OldCoordsY[i] = y;
    } else { TextDrawDestroy(black[i]); TextDrawDestroy(Speedom[i]); }
    }
    }
    return true;
    }

    < Beatboxen ist leicht > Beatboxen & Singen/Rappen ist schwerer >