komme in keine gebäude rein ???(selfmade)

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
  • Hi



    wenn ich alleine spiele komme ich in die gebäude rein wenn jemand connectet auf mein server(samp-server) komme ich in die gebäude nicht rein alle anderen schon woran kann das liegen


    public Ports(playerid)
    {
    if (PlayerToPoint(1, playerid, -1550.2698,1171.9686,7.1875)) // PD Eingang // if (PlayerToPoint(Radius, playerid, Float:X, Float:Y, Float:Z)) // Wo der Spieler Stehen soll
    {
    SetPlayerInterior(playerid, 15);
    SetPlayerPos(playerid, 2215.454833,-1147.475585,1025.796875); // Wo der Spieler hin kommen soll
    SetPlayerFacingAngle(playerid, 0.0);
    }
    else if (PlayerToPoint(1, playerid, 2214.6890,-1150.6292,1025.7969)) // PD Ausgang
    {
    SetPlayerInterior(playerid, 0);
    SetPlayerPos(playerid, -1550.2698,1171.9686,7.1875);
    SetPlayerFacingAngle(playerid, 90.0);
    }
    else if (PlayerToPoint(1, playerid, 1216.4534,-1812.2626,16.5938)) // SH EINGANG 1
    {
    SetPlayerInterior(playerid, 3);
    SetPlayerPos(playerid, 384.808624,173.804992,1008.382812);
    SetPlayerFacingAngle(playerid, 0.0);
    }
    else if (PlayerToPoint(1, playerid, 1219.0143,-1812.4454,16.5938)) // SH EINGANG 2
    {
    SetPlayerInterior(playerid, 3);
    SetPlayerPos(playerid, 384.808624,173.804992,1008.382812);
    SetPlayerFacingAngle(playerid, 0.0);
    }
    else if (PlayerToPoint(1, playerid, 1221.9073,-1812.2217,16.5938)) // SH EINGANG 3
    {
    SetPlayerInterior(playerid, 3);
    SetPlayerPos(playerid, 384.808624,173.804992,1008.382812);
    SetPlayerFacingAngle(playerid, 0.0);
    }
    else if (PlayerToPoint(1, playerid, 389.9756,175.2468,1008.3828)) // SH EINGANG 3
    {
    SetPlayerInterior(playerid, 0);
    SetPlayerPos(playerid, 1216.4534,-1812.2626,16.5938);
    SetPlayerFacingAngle(playerid, 0.0);
    }
    else if (PlayerToPoint(1, playerid, 390.2650,173.7695,1008.3828)) // SH EINGANG 3
    {
    SetPlayerInterior(playerid, 0);
    SetPlayerPos(playerid, 1219.0143,-1812.4454,16.5938);
    SetPlayerFacingAngle(playerid, 0.0);
    }
    else if (PlayerToPoint(1, playerid, 390.0074,172.3341,1008.3828)) // SH EINGANG 3
    {
    SetPlayerInterior(playerid, 0);
    SetPlayerPos(playerid, 1221.9073,-1812.2217,16.5938);
    SetPlayerFacingAngle(playerid, 0.0);
    }
    else if (PlayerToPoint(1, playerid, 1470.5621,-1177.1328,23.9256)) // Gewandgeschäft eingang
    {
    SetPlayerInterior(playerid, 14);
    SetPlayerPos(playerid, 204.332992,-166.694992,1000.523437);
    SetPlayerFacingAngle(playerid, 0.0);
    }
    else if (PlayerToPoint(1, playerid, 204.1953,-168.1230,1000.5234)) // Gewandgeschäft eingang rausgang
    {
    SetPlayerInterior(playerid, 0);
    SetPlayerPos(playerid, 1469.6553,-1175.6893,23.9424);
    SetPlayerFacingAngle(playerid, 0.0);
    }
    else if (PlayerToPoint(1, playerid, 1554.5033,-1675.5642,16.1953)) // Polizei eingang
    {
    SetPlayerInterior(playerid, 3);
    SetPlayerPos(playerid, 288.745971,169.350997,1007.171875);
    SetPlayerFacingAngle(playerid, 0.0);
    }
    else if (PlayerToPoint(1, playerid, 288.6872,167.5991,1007.1719)) // Polizei Ausgang
    {
    SetPlayerInterior(playerid, 0);
    SetPlayerPos(playerid, 1553.2699,-1674.8439,16.1953);
    SetPlayerFacingAngle(playerid, 0.0);
    }
    else if (PlayerToPoint(1, playerid, 1568.6813,-1690.3995,5.8906)) // Polizei Garaga eingang
    {
    SetPlayerInterior(playerid, 3);
    SetPlayerPos(playerid, 238.6441,139.3220,1003.0234);
    SetPlayerFacingAngle(playerid, 0.0);
    }
    else if (PlayerToPoint(1, playerid, 238.6441,139.3220,1003.0234)) // Polizei Garaga ausgang
    {
    SetPlayerInterior(playerid, 0);
    SetPlayerPos(playerid, 1568.4736,-1691.6630,5.8906);
    SetPlayerFacingAngle(playerid, 0.0);
    }
    return 1;
    }
    woran kann das liegen ??

    Einmal editiert, zuletzt von Optiimal ()

  • public doPort()
    {
    for(new i = 0;i<MAX_PLAYERS;i++)
    {
    if(!IsPlayerConnected(i) ||IsPlayerNPC(i))continue;
    Ports(i);
    }
    return 1;
    }

    [ Kannst es auch Direkt in deine Klasse verpflanzen das spart dir noch eine Klasse]


    dann noch den Timer setzen, ansonsten möchte ich fragen... wird deins per Kommando bestätigt oder wolltest du es per Timer ?

    Mfg. BlackFoX_UD_ alias [BFX]Explosion


  • jo aber das ist eine Klasse die einen Parameter braucht der übergeben werden muss so hat der Parameter imm den Wert 0
    also müsstest du für jeden Spieler SetTimerEx durchführen um die Parameter festzulegen die übergeben werden müssen jedoch wäre
    dies ein unnötiger verbrauch der Ressourcen , du solltest einen Timer erstellen der eine Klasse aufruft die eine Schleife für jeden durchgeht &
    gleichzeitig für alle Nummern einen Check macht

    Mfg. BlackFoX_UD_ alias [BFX]Explosion


  • also so


    PortTimer = SetTimer("doPort", 1000, 1);
    public doPort(playerid)
    {
    for(new i = 0;i<MAX_PLAYERS;i++)
    {
    if(!IsPlayerConnected(i) ||IsPlayerNPC(i))continue;
    Ports(i);
    }
    return 1;
    }
    und was passiert mit dem ??


    public Ports(playerid)
    {
    if (PlayerToPoint(1, playerid, -1550.2698,1171.9686,7.1875)) // PD Eingang // if (PlayerToPoint(Radius, playerid, Float:X, Float:Y, Float:Z)) // Wo der Spieler Stehen soll
    {
    SetPlayerInterior(playerid, 15);
    SetPlayerPos(playerid, 2215.454833,-1147.475585,1025.796875); // Wo der Spieler hin kommen soll
    SetPlayerFacingAngle(playerid, 0.0);
    }
    else if (PlayerToPoint(1, playerid, 2214.6890,-1150.6292,1025.7969)) // PD Ausgang
    {
    SetPlayerInterior(playerid, 0);
    SetPlayerPos(playerid, -1550.2698,1171.9686,7.1875);
    SetPlayerFacingAngle(playerid, 90.0);
    }
    else if (PlayerToPoint(1, playerid, 1216.4534,-1812.2626,16.5938)) // SH EINGANG 1
    {
    SetPlayerInterior(playerid, 3);
    SetPlayerPos(playerid, 384.808624,173.804992,1008.382812);
    SetPlayerFacingAngle(playerid, 0.0);
    }
    else if (PlayerToPoint(1, playerid, 1219.0143,-1812.4454,16.5938)) // SH EINGANG 2
    {
    SetPlayerInterior(playerid, 3);
    SetPlayerPos(playerid, 384.808624,173.804992,1008.382812);
    SetPlayerFacingAngle(playerid, 0.0);
    }
    else if (PlayerToPoint(1, playerid, 1221.9073,-1812.2217,16.5938)) // SH EINGANG 3
    {
    SetPlayerInterior(playerid, 3);
    SetPlayerPos(playerid, 384.808624,173.804992,1008.382812);
    SetPlayerFacingAngle(playerid, 0.0);
    }
    else if (PlayerToPoint(1, playerid, 389.9756,175.2468,1008.3828)) // SH EINGANG 3
    {
    SetPlayerInterior(playerid, 0);
    SetPlayerPos(playerid, 1216.4534,-1812.2626,16.5938);
    SetPlayerFacingAngle(playerid, 0.0);
    }
    else if (PlayerToPoint(1, playerid, 390.2650,173.7695,1008.3828)) // SH EINGANG 3
    {
    SetPlayerInterior(playerid, 0);
    SetPlayerPos(playerid, 1219.0143,-1812.4454,16.5938);
    SetPlayerFacingAngle(playerid, 0.0);
    }
    else if (PlayerToPoint(1, playerid, 390.0074,172.3341,1008.3828)) // SH EINGANG 3
    {
    SetPlayerInterior(playerid, 0);
    SetPlayerPos(playerid, 1221.9073,-1812.2217,16.5938);
    SetPlayerFacingAngle(playerid, 0.0);
    }
    else if (PlayerToPoint(1, playerid, 1470.5621,-1177.1328,23.9256)) // Gewandgeschäft eingang
    {
    SetPlayerInterior(playerid, 14);
    SetPlayerPos(playerid, 204.332992,-166.694992,1000.523437);
    SetPlayerFacingAngle(playerid, 0.0);
    }
    else if (PlayerToPoint(1, playerid, 204.1953,-168.1230,1000.5234)) // Gewandgeschäft eingang rausgang
    {
    SetPlayerInterior(playerid, 0);
    SetPlayerPos(playerid, 1469.6553,-1175.6893,23.9424);
    SetPlayerFacingAngle(playerid, 0.0);
    }
    else if (PlayerToPoint(1, playerid, 1554.5033,-1675.5642,16.1953)) // Polizei eingang
    {
    SetPlayerInterior(playerid, 3);
    SetPlayerPos(playerid, 288.745971,169.350997,1007.171875);
    SetPlayerFacingAngle(playerid, 0.0);
    }
    else if (PlayerToPoint(1, playerid, 288.6872,167.5991,1007.1719)) // Polizei Ausgang
    {
    SetPlayerInterior(playerid, 0);
    SetPlayerPos(playerid, 1553.2699,-1674.8439,16.1953);
    SetPlayerFacingAngle(playerid, 0.0);
    }
    else if (PlayerToPoint(1, playerid, 1568.6813,-1690.3995,5.8906)) // Polizei Garaga eingang
    {
    SetPlayerInterior(playerid, 3);
    SetPlayerPos(playerid, 238.6441,139.3220,1003.0234);
    SetPlayerFacingAngle(playerid, 0.0);
    }
    else if (PlayerToPoint(1, playerid, 238.6441,139.3220,1003.0234)) // Polizei Garaga ausgang
    {
    SetPlayerInterior(playerid, 0);
    SetPlayerPos(playerid, 1568.4736,-1691.6630,5.8906);
    SetPlayerFacingAngle(playerid, 0.0);
    }
    return 1;
    }