Was das fürn error??

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 Habe Heir ein Eroor denn ich net wegbekomme:
    C:\Users\Vitali\Desktop\GermanGameLife.pwn(2629) : error 010: invalid function or declaration



    Hier diese Zeile:
    return 1;


    Heir die zeileN Davor;
    if(GetVehicleModel(vehicleid) == 432 || GetVehicleModel(vehicleid) == 425 || GetVehicleModel(vehicleid) == 520)
    {
    if(IsPlayerInFrac(playerid,3) || PlayerInfo[playerid][pLeader] == 7) { }
    else
    {
    GameTextForPlayer(playerid,"~y~~h~Du hast keinen Schluessel fuer~n~~y~~h~ dieses Auto!", 3500, 1);
    FreezePlayer(playerid);
    }
    }


    Bitte helfen Danke :)

  • Versuchs mal so:
    if(GetVehicleModel(vehicleid) == 432 || GetVehicleModel(vehicleid) == 425 || GetVehicleModel(vehicleid) == 520)
    {
    if(IsPlayerInFrac(playerid,3) || PlayerInfo[playerid][pLeader] == 7) {
    else
    {
    GameTextForPlayer(playerid,"~y~~h~Du hast keinen Schluessel fuer~n~~y~~h~ dieses Auto!", 3500, 1);
    FreezePlayer(playerid);
    }
    }

  • hier is mehr:
    if(GetVehicleModel(vehicleid) == 432 || GetVehicleModel(vehicleid) == 425 || GetVehicleModel(vehicleid) == 520)
    {
    if(IsPlayerInFrac(playerid,3) || PlayerInfo[playerid][pLeader] == 7) { }
    else
    {
    GameTextForPlayer(playerid,"~y~~h~Du hast keinen Schluessel fuer~n~~y~~h~ dieses Auto!", 3500, 1);
    FreezePlayer(playerid);
    }
    }
    return 1;
    }


    public Drag(giveplayerid, playerid)
    {
    new Float:x, Float:y, Float:z;
    GetPlayerPos(giveplayerid, x, y, z);
    SetPlayerPos(playerid, x, y+1, z);
    SetPlayerInterior(playerid, GetPlayerInterior(giveplayerid));
    }
    public IsAnInstructor(playerid)
    {
    if(IsPlayerConnected(playerid))
    {
    new leader = PlayerInfo[playerid][pLeader];
    new member = PlayerInfo[playerid][pMember];
    if(member==11)
    {
    return 1;
    }
    if(leader==11)
    {
    return 1;
    }
    }
    return 0;
    }

  • stock GetGasMax(vehmodel)
    {
    if(vehmodel >= 400 && vehmodel <= 611)
    {
    return GasMax[(vehmodel-400)];
    }
    return 100;
    }



    stock right(source[], len)
    {
    new retval[MAX_STRING], srclen;
    srclen = strlen(source);
    strmid(retval, source, srclen - len, srclen, MAX_STRING);
    return retval;
    }
    public pfand(playerid)
    {
    pfanddurchsucht[playerid] = 0;
    }
    public Spectator()
    {
    new string[50];
    for(new i = 0; i <MAX_PLAYERS; i++)
    {
    if(IsPlayerConnected(i))
    {
    if(KickPlayer[i]==1) { Kick(i); }
    else if(KickPlayer[i]==2) { Ban(i); }
    //if(GetPlayerPing(i) >= 500 && PlayerInfo[i][pAdmin] < 1) { Kick(i); }
    if(Spectate[i] < 253 && Spectate[i] != 255)
    {
    FreezePlayer(i);
    new targetid = Spectate[i];
    if(IsPlayerConnected(targetid))
    {
    TogglePlayerSpectating(i, 1);
    if(PlayerInfo[i][pAdmin] >= 1)
    {
    new Float:health;
    new name[MAX_PLAYER_NAME];
    GetPlayerName(targetid, name, sizeof(name));
    GetPlayerHealth(targetid, health);
    format(string, sizeof(string), "~n~~n~~n~~n~~n~~n~~y~%s(ID:%d)~n~~y~Leben:%.1f",name,targetid,health);
    GameTextForPlayer(i, string, 2500, 3);
    }
    if(IsPlayerInAnyVehicle(targetid))
    {
    new carid = GetPlayerVehicleID(targetid);
    PlayerSpectateVehicle(i, carid);
    }
    else
    {
    PlayerSpectatePlayer(i, targetid);
    }
    if(GetPlayerInterior(targetid) == 0)
    {
    SetPlayerInterior(i,0);
    }
    else if(GetPlayerInterior(targetid) > 0)
    {
    SetPlayerInterior(i,GetPlayerInterior(targetid));
    }
    }//Targetid connected
    }
    if(Spectate[i] == 253)
    {
    UnFreezePlayer(i);
    TogglePlayerSpectating(i, 0);
    SetPlayerInterior(i,Unspec[i][sPint]);
    PlayerInfo[i][pInt] = Unspec[i][sPint];
    PlayerInfo[i][pLocal] = Unspec[i][sLocal];
    Unspec[i][sLocal] = 255;
    SetSpawnInfo(i, PlayerInfo[i][pTeam], PlayerInfo[i][pModel], Unspec[i][sPx], Unspec[i][sPy], Unspec[i][sPz]-1.0, 1.0, -1, -1, -1, -1, -1, -1);
    gTeam[i] = PlayerInfo[i][pTeam];
    SetPlayerToTeamColor(i);
    MedicBill[i] = 0;
    if(PlayerInfo[i][pDonateRank] > 0)
    {
    SetSpawnInfo(i, PlayerInfo[i][pTeam], PlayerInfo[i][pModel], Unspec[i][Coords][0], Unspec[i][Coords][1], Unspec[i][Coords][2], 10.0, -1, -1, -1, -1, -1, -1);
    SpawnPlayer(i);
    SetCameraBehindPlayer(i);
    }
    else
    {
    SpawnPlayer(i);
    }
    Spectate[i] = 255;
    }
    if(Spectate[i] == 254)
    {
    UnFreezePlayer(i);
    SetPlayerInterior(i,Unspec[i][sPint]);
    PlayerInfo[i][pInt] = Unspec[i][sPint];
    PlayerInfo[i][pLocal] = Unspec[i][sLocal];
    SetPlayerPos(i, Unspec[i][sPx], Unspec[i][sPy], Unspec[i][sPz]);
    Spectate[i] = 255;
    }
    if(Spectate[i] == 256)
    {
    SetPlayerToTeamColor(i);
    Spectate[i] = 255;
    }
    if(Spectate[i] == 257)
    {
    Spectate[i] = 254;
    }
    }
    }
    }
    public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)


    if(GetVehicleModel(vehicleid) == 432 || GetVehicleModel(vehicleid) == 425 || GetVehicleModel(vehicleid) == 520)
    {
    if(IsPlayerInFrac(playerid,3) || PlayerInfo[playerid][pLeader] == 7) { }
    else
    {
    GameTextForPlayer(playerid,"~y~~h~Du hast keinen Schluessel fuer~n~~y~~h~ dieses Auto!", 3500, 1);
    FreezePlayer(playerid);
    }
    }
    return 1;
    }
    das dasvor

  • public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
    {
    if(GetVehicleModel(vehicleid) == 432 || GetVehicleModel(vehicleid) == 425 || GetVehicleModel(vehicleid) == 520)
    {
    if(IsPlayerInFrac(playerid,3) || PlayerInfo[playerid][pLeader] == 7)
    { }
    else
    {
    GameTextForPlayer(playerid,"~y~~h~Du hast keinen Schluessel fuer~n~~y~~h~ dieses Auto!", 3500, 1);
    FreezePlayer(playerid);
    }
    }
    return 1;
    }


    OnPlayerEnterVehicle
    Müsste doch schonmal drinne sein?

  • Danke Es Geht kann mir eienr Sagen wie ich Autos ins Script Einfüge und dann so amceh dass Nur LSPD COPS rein können ja ich weiß ich soll die Sufu Benutzen aber finde was aber das ist zu kompliziert checke das nicht Kann mir dass ma eienr mit den Autos machen?



    AddStaticVehicle(596,1595.2025,-1711.1276,5.6139,0.4563,2,1); // car
    AddStaticVehicle(596,1591.2114,-1711.3737,5.6119,357.3305,2,1); // car1
    AddStaticVehicle(596,1587.7405,-1711.3241,5.6110,357.5441,2,1); // car 2
    AddStaticVehicle(596,1583.5559,-1711.4299,5.6126,353.3175,2,1); // car3
    AddStaticVehicle(596,1578.4377,-1710.6547,5.6138,352.9366,2,1); // car4
    AddStaticVehicle(596,1601.4883,-1684.5474,5.6125,88.5401,2,1); // car5
    AddStaticVehicle(596,1601.8562,-1687.8082,5.6119,90.4324,2,1); // car6
    AddStaticVehicle(596,1602.2754,-1692.4060,5.6126,84.8075,2,1); // car7
    AddStaticVehicle(596,1601.3491,-1696.2030,5.6119,92.9180,2,1); // car8
    AddStaticVehicle(596,1601.8846,-1699.9370,5.6100,89.0552,2,1); // car9
    AddStaticVehicle(596,1601.1055,-1704.0709,5.6154,85.0543,2,1); // car10
    AddStaticVehicle(596,1544.6152,-1684.7670,5.6113,89.8994,2,1); // car11
    AddStaticVehicle(596,1545.5334,-1680.8834,5.6130,88.7403,2,1); // car11
    AddStaticVehicle(596,1545.1321,-1675.7820,5.6104,89.7541,2,1); // car12
    AddStaticVehicle(427,1558.6499,-1710.0623,6.0225,0.9185,2,1); // p1
    AddStaticVehicle(427,1562.7114,-1711.2145,6.0235,357.3216,2,1); // p2
    AddStaticVehicle(523,1584.6368,-1675.3250,5.4669,277.8359,2,0); // m1
    AddStaticVehicle(523,1584.2273,-1680.5314,5.4712,272.7859,2,0); // m2
    AddStaticVehicle(523,1587.6326,-1677.7217,5.4680,271.3776,2,0); // m3
    AddStaticVehicle(523,1583.9202,-1677.8097,5.4632,271.3622,2,0); // m4
    AddStaticVehicle(599,1584.5901,-1668.0962,6.0904,269.8956,2,1); // r1
    AddStaticVehicle(599,1585.0504,-1671.5627,6.0872,269.5316,2,1); // r2
    AddStaticVehicle(601,1566.6270,-1711.7700,5.6495,3.3260,2,1); // 71
    AddStaticVehicle(601,1570.4503,-1710.8616,5.6494,359.9565,2,1); // 72
    AddStaticVehicle(497,1564.1327,-1655.7944,28.5801,10.9469,2,1); // h1
    AddStaticVehicle(497,1572.9270,-1692.5997,28.8847,117.8736,2,1); // h2


    wäre nett :)

  • So habe es wie in dem Tut gemacht aber Bekomme dann Pawno Compiler Funktioniert nicht mehr


    why Also so habe ich das Gemacht:


    Unter NEws:
    new PolizeiFahrzeuge[25];


    so dann unter OnGameModeInit:
    public OnGameModeInit()
    {
    PolizeiFahrzeuge[0] = AddStaticVehicleEx(596,1595.2025,-1711.1276,5.6139,0.4563,2,1,-1);
    PolizeiFahrzeuge[1] = AddStaticVehicleEx(596,1591.2114,-1711.3737,5.6119,357.3305,2,1,-1);
    PolizeiFahrzeuge[2] = AddStaticVehicleEx(596,1587.7405,-1711.3241,5.6110,357.5441,2,1,-1);
    PolizeiFahrzeuge[3] = AddStaticVehicleEx(596,1583.5559,-1711.4299,5.6126,353.3175,2,1,-1);
    PolizeiFahrzeuge[4] = AddStaticVehicleEx(596,1578.4377,-1710.6547,5.6138,352.9366,2,1,-1);
    PolizeiFahrzeuge[5] = AddStaticVehicleEx(596,1601.4883,-1684.5474,5.6125,88.5401,2,1,-1);
    PolizeiFahrzeuge[6] = AddStaticVehicleEx(596,1601.8562,-1687.8082,5.6119,90.4324,2,1,-1);
    PolizeiFahrzeuge[7] = AddStaticVehicleEx(596,1602.2754,-1692.4060,5.6126,84.8075,2,1,-1);
    PolizeiFahrzeuge[8] = AddStaticVehicleEx(596,1601.3491,-1696.2030,5.6119,92.9180,2,1,-1);
    PolizeiFahrzeuge[9] = AddStaticVehicleEx(596,1601.8846,-1699.9370,5.6100,89.0552,2,1,-1);
    PolizeiFahrzeuge[10] = AddStaticVehicleEx(596,1601.1055,-1704.0709,5.6154,85.0543,2,1,-1);
    PolizeiFahrzeuge[11] = AddStaticVehicleEx(596,1544.6152,-1684.7670,5.6113,89.8994,2,1,-1);
    PolizeiFahrzeuge[12] = AddStaticVehicleEx(596,1545.5334,-1680.8834,5.6130,88.7403,2,1,-1);
    PolizeiFahrzeuge[13] = AddStaticVehicleEx(596,1545.1321,-1675.7820,5.6104,89.7541,2,1,-1);
    PolizeiFahrzeuge[14] = AddStaticVehicleEx(427,1558.6499,-1710.0623,6.0225,0.9185,2,1,-1);
    PolizeiFahrzeuge[15] = AddStaticVehicleEx(427,1562.7114,-1711.2145,6.0235,357.3216,2,1,-1);
    PolizeiFahrzeuge[16] = AddStaticVehicleEx(523,1584.6368,-1675.3250,5.4669,277.8359,2,0,-1);
    PolizeiFahrzeuge[17] = AddStaticVehicleEx(523,1584.2273,-1680.5314,5.4712,272.7859,2,0,-1);
    PolizeiFahrzeuge[18] = AddStaticVehicleEx(523,1587.6326,-1677.7217,5.4680,271.3776,2,0,-1);
    PolizeiFahrzeuge[19] = AddStaticVehicleEx(523,1583.9202,-1677.8097,5.4632,271.3622,2,0,-1);
    PolizeiFahrzeuge[20] = AddStaticVehicleEx(599,1584.5901,-1668.0962,6.0904,269.8956,2,1,-1);
    PolizeiFahrzeuge[21] = AddStaticVehicleEx(599,1585.0504,-1671.5627,6.0872,269.5316,2,1,-1);
    PolizeiFahrzeuge[22] = AddStaticVehicleEx(601,1566.6270,-1711.7700,5.6495,3.3260,2,1,-1);
    PolizeiFahrzeuge[23] = AddStaticVehicleEx(601,1570.4503,-1710.8616,5.6494,359.9565,2,1,-1);
    PolizeiFahrzeuge[24] = AddStaticVehicleEx(497,1564.1327,-1655.7944,28.5801,10.9469,2,1,-1);
    PolizeiFahrzeuge[25] = AddStaticVehicleEx(497,1572.9270,-1692.5997,28.8847,117.8736,2,1,-1);


    dann das Forwardbei Forwards :
    forward PolizeiFahrzeug(vehicleid);


    Ganz unten ins Script das eingefügt:
    public PolizeiFahrzeug(vehicleid)
    {
    for(new i = 0; i < sizeof(PolizeiFahrzeuge); i++)//Nimmt die Anzahl die im new oben steht und gibt sie als i aus
    {
    if(vehicleid== PolizeiFahrzeuge[i])//falls das Fahrzeug diese ID hat (erstelltes Fahrzeug) ist es ein Polizei Fahrzeug
    {//und dann..
    return 1;//wird mit 1 returnt und ein Wert "True" wiedergegeben..
    }
    }
    return 0;
    }


    das habe ich nicht :OnPlayerStateChange
    Why?