Run time error 10: "Native function failed"

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
  • [17:57:55] [chat] [WERISTGAYFREEGAY]: twest
    [17:58:05] ID vom naechsten Rennen: 1
    [17:58:05] [debug] Run time error 10: "Native function failed"
    [17:58:05] [debug] strmid
    [17:58:05] [debug] AMX backtrace:
    [17:58:05] [debug] #0 001a2e44 in ?? (0x002dbc38, 0x002dbe90, 0x0000002a) from backup.amx
    [17:58:05] [debug] #1 0019c310 in public LoadARace () from backup.amx
    [17:58:05] [debug] #2 00129ae0 in public OnPlayerCommandPerformed (0x00000003, 0x002d886c, 0x00000000) from backup.amx
    [17:58:05] [debug] #3 native CallLocalFunction () [080d2960] from samp03svr4153
    [17:58:05] [debug] #4 00000810 in public OnPlayerCommandText (0x00000003, 0x002d8850) from backup.amx
    [17:58:05] [debug] Run time error 10: "Native function failed"
    [17:58:05] [debug] strmid
    [17:58:05] [debug] AMX backtrace:
    [17:58:05] [debug] #0 001a2e44 in public OnPlayerCommandText (0x00000003, 0x002d8850) from backup.amx
    [17:58:13] [chat] [WERISTGAYFREEGAY]: Server: Unknown Command
    [17:58:15] OnPlayerUpdateAccount wird aufgerufen
    [17:58:15] Passwort: 912EC803B2CE49E4A541068D495AB570
    [17:58:15] [part] WERISTGAYFREEGAY has left the server (3:1)
    [17:59:46] [chat] [Fred]: Hannah mein Schatz <333


    if(strcmp(cmd, "/rennen", true) == 0 || strcmp(cmd, "/race", true) == 0)
    {
    if(!InFree[playerid] && !InAFK[playerid] && !paketman[playerid][pmi_bAktiv] && !bauer[playerid][gmi_bAktiv] && !pizzaman[playerid][pimi_bAktiv] && !getraenkeman[playerid][gmi_bAktiv])
    {
    if(IsPlayerInInvalidRaceVehicle(playerid,GetPlayerVehicleID(playerid)))
    {
    SendErrorMessage(playerid,"{FFFFFF}Dieses Fahrzeug kann nicht am Rennen teilnehmen.","{FFFFFF}This vehicle can't participate in the race.");
    return 1;
    }
    if(RaceInfo[RacePlayers] >= RaceInfo[MaxRacePlayers]) return SendErrorMessage(playerid,"{FFFFFF}Das Rennen ist voll.","{FFFFFF}The race is full.");
    if(JoinedRace[playerid] == 1) return SendErrorMessage(playerid,"{FFFFFF}Du bist schon im Rennen.","{FFFFFF}You're already in race.");
    if(rennengestartet == 1) return SendErrorMessage(playerid,"{FFFFFF}Das Rennen ist schon gestartet.","{FFFFFF}The race is already started.");
    if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendErrorMessage(playerid,"{FFFFFF}Du musst in einem Fahrzeug sein.","{FFFFFF}You must be in a vehicle.");
    if(racelist > 0)
    {
    racelist = 0;
    LoadARace();
    }
    if(RaceInfo[CheckpointModell][MotoGate[playerid]] > 1)
    {
    new Float:pvPos[4],Float:Speed[3];
    if(GetPlayerVehicleID(playerid) == SpezialFahrzeug[playerid])
    {
    Autowechsel[playerid] = true;
    GetVehiclePos(SpezialFahrzeug[playerid],pvPos[0],pvPos[1],pvPos[2]);
    GetVehicleZAngle(SpezialFahrzeug[playerid],pvPos[3]);
    GetVehicleVelocity(SpezialFahrzeug[playerid],Speed[0],Speed[1],Speed[2]);


    DestroyVehicle(SpezialFahrzeug[playerid]);
    SpezialFahrzeug[playerid] = CreateVehicle(RaceInfo[CheckpointModell][MotoGate[playerid]],pvPos[0],pvPos[1],pvPos[2],pvPos[3]+2.0,-1,-1,-1);
    SetVehicleVirtualWorld(SpezialFahrzeug[playerid],66);
    printf("RL: VehicleID: %d,ModelID: %d ,X: %f,Y: %f,Z: %f",SpezialFahrzeug[playerid],RaceInfo[CheckpointModell][MotoGate[playerid]],pvPos[0],pvPos[1],pvPos[2]);
    PutPlayerInVehicle(playerid,SpezialFahrzeug[playerid],0);
    SetVehicleVelocity(SpezialFahrzeug[playerid],Speed[0],Speed[1],Speed[2]);
    Autowechsel[playerid] = false;
    }
    else
    {
    Autowechsel[playerid] = true;
    GetVehiclePos(GetPlayerVehicleID(playerid),pvPos[0],pvPos[1],pvPos[2]);
    GetVehicleZAngle(GetPlayerVehicleID(playerid),pvPos[3]);
    GetVehicleVelocity(GetPlayerVehicleID(playerid),Speed[0],Speed[1],Speed[2]);


    SetVehicleToRespawn(GetPlayerVehicleID(playerid));
    SpezialFahrzeug[playerid] = CreateVehicle(RaceInfo[CheckpointModell][MotoGate[playerid]],pvPos[0],pvPos[1],pvPos[2],pvPos[3]+2.0,-1,-1,-1);
    SetVehicleVirtualWorld(SpezialFahrzeug[playerid],66);
    printf("VehicleID: %d,ModelID: %d ,X: %f,Y: %f,Z: %f",SpezialFahrzeug[playerid],RaceInfo[CheckpointModell][MotoGate[playerid]],pvPos[0],pvPos[1],pvPos[2]);
    PutPlayerInVehicle(playerid,SpezialFahrzeug[playerid],0);
    SetVehicleVelocity(SpezialFahrzeug[playerid],Speed[0],Speed[1],Speed[2]);
    Autowechsel[playerid] = false;
    }
    }


    StartingAFK[playerid] = false;
    TextDrawHideForPlayer(playerid,Leiste1);
    HideAllMenusForPlayer(playerid);
    RaceInfo[RacePlayers]++;


    new tmpcar = GetPlayerVehicleID(playerid);
    SetPlayerInterior(playerid,0);
    LinkVehicleToInterior(tmpcar, 0);
    SetVehiclePos(tmpcar,RaceInfo[SpawnpointX][RaceID],RaceInfo[SpawnpointY][RaceID],RaceInfo[SpawnpointZ][RaceID]);
    SetVehicleZAngle(tmpcar,RaceInfo[SpawnpointA][RaceID]);
    RepairVehicle(tmpcar);
    SetCameraBehindPlayer(playerid);
    RaceID++;


    MotoGate[playerid] = 0;


    format(string,sizeof(string),""#RACE"{1C9416}%s{FFFFFF} faehrt nun beim Rennen '%s' erstellt von %s mit. (Fahrer: %d/%d)",GetPlayerNameEx(playerid),CurrentRace,RaceInfo[rErsteller],RaceInfo[RacePlayers],RaceInfo[MaxRacePlayers]);
    format(string2,sizeof(string2),""#RACE"{1C9416}%s{FFFFFF} takes part on the race '%s' by %s. (Fahrer: %d/%d)",GetPlayerNameEx(playerid),CurrentRace,RaceInfo[rErsteller],RaceInfo[RacePlayers],RaceInfo[MaxRacePlayers]);
    SendLanguageMessageToAll(rennf,string,string2);


    SendRaceMessage(playerid,"Du kannst das Rennen verlassen mit /RaceExit.","You can leave the race with /Raceexit.");
    RaceStatus[playerid] = RACEWAIT;
    format(stringfa,sizeof(stringfa),"_____ ( Top 5 ) _____",CurrentRace);
    SendClientMessage(playerid,weiss,stringfa);
    ConvertTicks(RaceInfo[Bestzeit][0]);
    format(stringfa,sizeof(stringfa),"Platz: 1 | %s | Zeit: %d:%02d:%02d0",RaceBestName[0],cmins,csecs,cmils);
    SendClientMessage(playerid,rennf,stringfa);
    ConvertTicks(RaceInfo[Bestzeit][1]);
    format(stringfa,sizeof(stringfa),"Platz: 2 | %s | Zeit: %d:%02d:%02d0",RaceBestName[1],cmins,csecs,cmils);
    SendClientMessage(playerid,rennf,stringfa);
    ConvertTicks(RaceInfo[Bestzeit][2]);
    format(stringfa,sizeof(stringfa),"Platz: 3 | %s | Zeit: %d:%02d:%02d0",RaceBestName[2],cmins,csecs,cmils);
    SendClientMessage(playerid,rennf,stringfa);
    ConvertTicks(RaceInfo[Bestzeit][3]);
    format(stringfa,sizeof(stringfa),"Platz: 4 | %s | Zeit: %d:%02d:%02d0",RaceBestName[3],cmins,csecs,cmils);
    SendClientMessage(playerid,rennf,stringfa);
    ConvertTicks(RaceInfo[Bestzeit][4]);
    format(stringfa,sizeof(stringfa),"Platz: 5 | %s | Zeit: %d:%02d:%02d0",RaceBestName[4],cmins,csecs,cmils);
    SendClientMessage(playerid,rennf,stringfa);
    format(stringfa,sizeof(stringfa),"_____ ( Top 5 ) _____",CurrentRace);
    SendClientMessage(playerid,weiss,stringfa);
    SetPlayerRaceCheckpoint(playerid,0,RaceInfo[CheckpointX][MotoGate[playerid]],RaceInfo[CheckpointY][MotoGate[playerid]],RaceInfo[CheckpointZ][MotoGate[playerid]],RaceInfo[CheckpointX][MotoGate[playerid]+1],RaceInfo[CheckpointY][MotoGate[playerid]+1],RaceInfo[CheckpointZ][MotoGate[playerid]+1],13.0);
    format(LeistenString[1],200,DMLEISTENTEXT2,RaceInfo[RacePlayers],DerbyPlayers,sstats[8],ParkourPlayers,g_PLAYERS_TOTAL,FalloutPlayers,sstats[12],sstats[13],TrackPlayers);
    RaceVehicleID[playerid] = GetPlayerVehicleID(playerid);
    RaceJoin(playerid);
    JoinedRace[playerid] = 1;
    TogglePlayerControllable(playerid, false);
    SetPlayerArmedWeapon(playerid, 0);
    for(new i=0; i<players; i++)
    {
    if(IsPlayerConnected(i) && !IsPlayerNPC(i))
    {
    if(JoinedRace[i] == 1 && RaceStatus[i] == RACEWAIT)
    {
    if(GetPlayerLanguage(i) == LANG_DE)
    {
    format(racetstring,sizeof(racetstring),"~w~Rennen: ~b~%s~n~~w~Zeit: ~b~000:000:000~n~~w~Checkpoint: ~b~%d/%d~n~~w~Ersteller: ~b~%s~n~~w~Spieler: ~b~%d/%d",CurrentRace,MotoGate[i],RaceInfo[MaxCheckpoints],RaceInfo[rErsteller],RaceInfo[RacePlayers],RaceInfo[MaxRacePlayers]);
    TextDrawSetString(racetext[i],racetstring);
    }
    else
    {
    format(racetstring,sizeof(racetstring),"~w~Race: ~b~%s~n~~w~Time: ~b~000:000:000~n~~w~Checkpoint: ~b~%d/%d~n~~w~Creator: ~b~%s~n~~w~Players: ~b~%d/%d",CurrentRace,MotoGate[i],RaceInfo[MaxCheckpoints],RaceInfo[rErsteller],RaceInfo[RacePlayers],RaceInfo[MaxRacePlayers]);
    TextDrawSetString(racetext[i],racetstring);
    }
    }
    }
    }
    if(RaceInfo[RacePlayers] == 1)
    {
    SendLanguageMessageToAll(rennf,""#RACE"Das Rennen startet in 30 Sekunden.",""#RACE"The race starts in 30 seconds.");
    KillTimer(RennStart);
    RennStart = SetTimerEx("StartRace", 30000, 0, "d", playerid);
    }
    }
    else
    {
    SendErrorMessage(playerid,"{FFFFFF}Du kannst diesen Command zurzeit nicht benutzen.","{FFFFFF}You can't use this command at the moment.");
    }
    return 1;
    }
    public LoadARace()
    {
    new Ausgabe[100][100];
    new AusgabeC[100][100];
    new ZwischenSpeicher[100];


    mysql_free_result();
    mysql_query("SELECT * FROM `Rennen`");
    mysql_store_result();


    if(mysql_num_rows() > NextRace)
    {
    NextRace++;
    }
    else
    {
    NextRace = 1;
    }
    printf("ID vom naechsten Rennen: %d",NextRace);


    mysql_free_result();
    format(query,sizeof(query),"SELECT * FROM `Rennen` WHERE `ID` = '%d'",NextRace);
    mysql_query(query);
    mysql_store_result();
    new result[50];

    if(mysql_num_rows())
    {
    if(mysql_retrieve_row())
    {
    mysql_fetch_field_row(result,"Ersteller");
    format(RaceInfo[rErsteller],MAX_PLAYER_NAME,result);


    mysql_fetch_field_row(result,"Kartenname");
    format(CurrentRace,sizeof(CurrentRace),result);


    mysql_fetch_field_row(result,"PlatzA");
    split(result,Ausgabe,'|');
    format(RaceBestName[0],MAX_PLAYER_NAME,Ausgabe[0]);
    RaceInfo[Bestzeit][0] = strval(Ausgabe[1]);




    mysql_fetch_field_row(result,"PlatzB");
    split(result,Ausgabe,'|');
    format(RaceBestName[1],MAX_PLAYER_NAME,Ausgabe[0]);
    RaceInfo[Bestzeit][1] = strval(Ausgabe[1]);


    mysql_fetch_field_row(result,"PlatzC");
    split(result,Ausgabe,'|');
    format(RaceBestName[2],MAX_PLAYER_NAME,Ausgabe[0]);
    RaceInfo[Bestzeit][2] = strval(Ausgabe[1]);


    mysql_fetch_field_row(result,"PlatzD");
    split(result,Ausgabe,'|');
    format(RaceBestName[3],MAX_PLAYER_NAME,Ausgabe[0]);
    RaceInfo[Bestzeit][3] = strval(Ausgabe[1]);


    forEx(i,sizeof(Ausgabe)) format(Ausgabe[i],100," ");
    mysql_fetch_field_row(result,"PlatzE");
    split(result,Ausgabe,'|');
    format(RaceBestName[4],MAX_PLAYER_NAME,Ausgabe[0]);
    RaceInfo[Bestzeit][4] = strval(Ausgabe[1]);


    forEx(i,sizeof(AusgabeC)) format(AusgabeC[i],100," ");
    mysql_fetch_field_row(result,"Checkpoint");
    split(result,AusgabeC,'*');


    RaceInfo[MaxCheckpoints] = 0;
    forEx(i,100)
    {
    format(ZwischenSpeicher,100,"%s",AusgabeC[i]);


    if(strlen(ZwischenSpeicher) == 0) continue;
    format(Ausgabe[3],100,"-1");
    split(ZwischenSpeicher,Ausgabe,'|');
    RaceInfo[CheckpointX][i] = floatstr(Ausgabe[0]);
    RaceInfo[CheckpointY][i] = floatstr(Ausgabe[1]);
    RaceInfo[CheckpointZ][i] = floatstr(Ausgabe[2]);
    RaceInfo[CheckpointModell][i] = strval(Ausgabe[3]);
    strdel(ZwischenSpeicher, 0, sizeof(ZwischenSpeicher));
    RaceInfo[MaxCheckpoints]++;
    }



    forEx(i,sizeof(AusgabeC)) format(AusgabeC[i],100," ");
    mysql_fetch_field_row(result,"Spawnpunkt");
    split(result,AusgabeC,'*');


    RaceInfo[MaxRacePlayers] = 0;
    forEx(i,100)
    {
    format(ZwischenSpeicher,100,"%s",AusgabeC[i]);


    if(strlen(ZwischenSpeicher) <= 1) continue;
    format(Ausgabe[4],100,"-1");
    split(ZwischenSpeicher,Ausgabe,'|');
    RaceInfo[SpawnpointX][i] = floatstr(Ausgabe[0]);
    RaceInfo[SpawnpointY][i] = floatstr(Ausgabe[1]);
    RaceInfo[SpawnpointZ][i] = floatstr(Ausgabe[2]);
    RaceInfo[SpawnpointA][i] = floatstr(Ausgabe[3]);
    RaceInfo[CheckpointModell][i] = strval(Ausgabe[4]);
    strdel(ZwischenSpeicher, 0, sizeof(ZwischenSpeicher));
    RaceInfo[MaxRacePlayers]++;
    }
    }
    }
    mysql_free_result();//WICHTIG nicht vergessen!!
    return true;
    }