Beiträge von Jeffry

    Bei dir muss das dann so aussehen:
    stock ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
    {
    new Float:posx, Float:posy, Float:posz;
    GetPlayerPos(playerid, posx, posy, posz);
    foreach(new i :Player)
    {
    if(IsPlayerInRangeOfPoint(i, radi/16, posx, posy, posz))
    {
    SendClientMessage(i, col1, string);
    }
    else if(IsPlayerInRangeOfPoint(i, radi/8, posx, posy, posz))
    {
    SendClientMessage(i, col2, string);
    }
    else if(IsPlayerInRangeOfPoint(i, radi/4, posx, posy, posz))
    {
    SendClientMessage(i, col3, string);
    }
    else if(IsPlayerInRangeOfPoint(i, radi/2, posx, posy, posz))
    {
    SendClientMessage(i, col4, string);
    }
    else if(IsPlayerInRangeOfPoint(i, radi, posx, posy, posz))
    {
    SendClientMessage(i, col5, string);
    }
    }
    return 1;
    }

    public ProxDetector(Float:radi, playerid, string[], col1)
    {
    new Float:posx, Float:posy, Float:posz;
    GetPlayerPos(playerid, posx, posy, posz);
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
    if(IsPlayerInRangeOfPoint(i, radi, posx, posy, posz))
    {
    SendClientMessage(i, col1, string);
    }
    }
    return 1;
    }


    So sollte es reichen, die Berechnungen sind nicht mehr notwendig.

    Ändert der Spieler der spectated wird auch seine Position? Es ist nämlich ein bekannter Fehler, dass der Spectator Modus in den Himmel geht, wenn der Spieler die Position ändert, zu einem Punkt weiters weg.


    Starte mal dort einen kurzen SetTimerEx von einer Sekunde und starte dann den Spectator Modus für den Spieler neu, im public des Timers, das sollte den Fehler zumindest größtenteils automatisch beheben.

    Versuche es so, möglicherweise reicht das schon.
    public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
    {
    if(IsBeingSpeced[playerid] == 1){
    for(new i=0;i<MAX_PLAYERS;i++){
    if(spectatorid[i] == playerid){
    SetPlayerInterior(i,newinteriorid);
    SetPlayerVirtualWorld(i,GetPlayerVirtualWorld(playerid));
    }
    }
    }
    return 1;
    }
    Wenn nicht, dann muss der Code debuggt werden.

    Was steht im Server Log, wenn du es so schreibst?
    for(new ctf=0;ctf<MAX_CTF_GEBIETE;ctf++)
    {
    new ctfstring[250],ctfstring2[250],string2[25];
    if(IsPlayerInRangeOfPoint(playerid,3.0,CTFInfo[ctf][flPosX2],CTFInfo[ctf][flPosY2],CTFInfo[ctf][flPosZ2]))
    {
    if(Spieler[playerid][pFraktion] == 0) return SendClientMessage(playerid,ROT,"Du bist Zivilist, daher ist es nicht möglich das System zu starten!");
    if(CTFInfo[ctf][ctfgestartet] == 1) return SendClientMessage(playerid,-1,"Dieses Gebiet wird bereits angegriffen");
    if(IstSpielerInFraktion(playerid,7) || IstSpielerInFraktion(playerid,8) || IstSpielerInFraktion(playerid,9) || IstSpielerInFraktion(playerid,10) || IstSpielerInFraktion(playerid,11) || IstSpielerInFraktion(playerid,12))
    {
    if(CTFInfo[ctf][gwzeit] > gettime()) return SendClientMessage(playerid,ROT,"Das Gebiet kann noch nicht bekämpft werden!");
    else if(CTFInfo[ctf][ctffid] == Spieler[playerid][pFraktion]) return SendClientMessage(playerid,ROT,"Das Gebiet gehört bereits euch!");

    format(string,sizeof(string),""#HTML_RED"Gebiet: "#HTML_WHITE" Euer Gebiet (%s) wird von der Fraktion %s angegriffen.",CTFInfo[ctf][gebietsname],Fraktionsname(playerid));
    FraktionsChat(CTFInfo[ctf][ctffid],WEISS,string);

    format(string,sizeof(string),""#HTML_LOGIN"Gebiet: "#HTML_WHITE"Ihr habt das Gebiet %s angegriffen! Macht euch bereit!",CTFInfo[ctf][gebietsname]);
    FraktionsChat(Spieler[playerid][pFraktion],WEISS,string);

    Delete3DTextLabel(CTFSystem3DText[ctf]);
    Delete3DTextLabel(CTFSystem3DText2[ctf]);

    format(ctfstring2,sizeof(ctfstring2),""#HTML_RED"Flagge der Angreifer\n"#HTML_WHITE"Angreifer: %s",Fraktionsname(playerid));
    CTFSystem3DText2[ctf] = Create3DTextLabel(ctfstring2,WEISS,CTFInfo[ctf][flPosX2],CTFInfo[ctf][flPosY2],CTFInfo[ctf][flPosZ2]+1,15.0,0,0);

    format(ctfstring,sizeof(ctfstring),""#HTML_GREEN"Flagge der Verteidiger\n"#HTML_WHITE"Verteidiger: %s",FraktionsCTFName(CTFInfo[ctf][ctffid]));
    CTFSystem3DText[ctf] = Create3DTextLabel(ctfstring,WEISS,CTFInfo[ctf][flPosX1],CTFInfo[ctf][flPosY1],CTFInfo[ctf][flPosZ1]+1,15.0,0,0);

    CTFInfo[ctf][angreifer] = Spieler[playerid][pFraktion];
    CTFInfo[ctf][flaggeverteidiger] = 0;
    CTFInfo[ctf][flaggeangreifer] = 0;
    CTFInfo[ctf][kampfzeit] = 0;
    CTFInfo[ctf][angreiferflaggeerobert] = 0;
    CTFInfo[ctf][verteidigerflaggeerobert] = 0;
    CTFInfo[ctf][angreiferpunkte] = 0;
    CTFInfo[ctf][verteidigerpunkte] = 0;
    CTFInfo[ctf][ctfgestartet] = 1;
    CTFInfo[ctf][flaggeangreiferliegen] = 0;
    CTFInfo[ctf][flaggeverteidigerliegen] = 0;

    for(new i=0;i<MAX_PLAYERS;i++)
    {
    if(IsPlayerConnected(i) && !IsPlayerNPC(i))
    {
    printf("playerid: %d | %d / %d / %d", IstSpielerInFraktion(i,CTFInfo[ctf][angreifer]), IstSpielerInFraktion(i,CTFInfo[ctf][ctffid]), Spieler[i][pFraktion]);
    if(IstSpielerInFraktion(i,CTFInfo[ctf][angreifer]) && Spieler[i][pFraktion] != 0)
    {
    printf("Show.");
    PlayerTextDrawShow(i,CTFSystem2[i][0]); //box
    PlayerTextDrawShow(i,CTFSystem2[i][1]); //Capture The Flag Text
    PlayerTextDrawShow(i,CTFSystem2[i][2]); // Strich
    PlayerTextDrawShow(i,CTFSystem2[i][6]); //Eure Punkte
    PlayerTextDrawShow(i,CTFSystem2[i][7]); //Gegner Punkte
    PlayerTextDrawShow(i,CTFSystem2[i][10]); // Pkt Gesamt (Eure Punkte)
    PlayerTextDrawShow(i,CTFSystem2[i][11]); //Pkt Gesamt (Gegner Punkte)

    PlayerTextDrawShow(i,CTFSystem2[i][12]); //Pkt Anzahl
    PlayerTextDrawShow(i,CTFSystem2[i][13]); //Gegner Punkte

    format(string2,sizeof(string2),"%i",CTFInfo[ctf][verteidigerpunkte]);
    PlayerTextDrawSetString(i,CTFSystem2[i][13],string2);

    format(string2,sizeof(string2),"%i",CTFInfo[ctf][angreiferpunkte]);
    PlayerTextDrawSetString(i,CTFSystem2[i][12],string2);

    GangZoneFlashForPlayer(i,CTFInfo[ctf][CTFGangZone],CTFZoneFarbe(CTFInfo[ctf][angreifer]));
    }
    else if(IstSpielerInFraktion(i,CTFInfo[ctf][ctffid]) && Spieler[i][pFraktion] != 0) //Verteidiger
    {
    printf("Show");
    PlayerTextDrawShow(i,CTFSystem[i][0]); //box
    PlayerTextDrawShow(i,CTFSystem[i][1]); //Capture The Flag Text
    PlayerTextDrawShow(i,CTFSystem[i][2]); // Strich
    PlayerTextDrawShow(i,CTFSystem[i][6]); //Eure Punkte
    PlayerTextDrawShow(i,CTFSystem[i][7]); //Gegner Punkte
    PlayerTextDrawShow(i,CTFSystem[i][10]); // Pkt Gesamt (Eure Punkte)
    PlayerTextDrawShow(i,CTFSystem[i][11]); //Pkt Gesamt (Gegner Punkte)

    PlayerTextDrawShow(i,CTFSystem[i][12]); //Pkt Anzahl
    PlayerTextDrawShow(i,CTFSystem[i][13]); //Gegner Punkte

    format(string2,sizeof(string2),"%i",CTFInfo[ctf][angreiferpunkte]);
    PlayerTextDrawSetString(i,CTFSystem[i][13],string2);

    format(string2,sizeof(string2),"%i",CTFInfo[ctf][verteidigerpunkte]);
    PlayerTextDrawSetString(i,CTFSystem[i][12],string2);

    GangZoneFlashForPlayer(i,CTFInfo[ctf][CTFGangZone],CTFZoneFarbe(CTFInfo[ctf][angreifer]));
    }
    }
    }
    return true;
    }
    else return SendClientMessage(playerid,ROT,"Du bist nicht in der richtigen Fraktion dafür!");
    }
    }