Spawn Bug

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
  • Hey,
    Ich habe folgendes Problem.
    Ich bin in einer fraktion(15) und komme immer zum hauptspawn(0).
    Warum?


    CODE:
    if(pInfo[playerid][fraktion]==0)
    {
    SetPlayerPos(playerid,1674.2616,-1915.5049,21.9542);
    SetPlayerSkin(playerid,pInfo[playerid][skin]);
    }
    else if(pInfo[playerid][fraktion]==1)
    {
    SetPlayerPos(playerid,1580.1251,-1635.4674,13.5604);
    SetPlayerSkin(playerid,pInfo[playerid][skin]);
    }
    else if(pInfo[playerid][fraktion]==2)
    {
    SetPlayerPos(playerid,-1616.4448,685.6295,7.1875);
    SetPlayerSkin(playerid,pInfo[playerid][skin]);
    }
    else if(pInfo[playerid][fraktion]==3)
    {
    SetPlayerPos(playerid,-2557.4812,662.7305,14.4531);
    SetPlayerSkin(playerid,pInfo[playerid][skin]);
    }
    else if(pInfo[playerid][fraktion]==4)
    {
    SetPlayerPos(playerid,2034.1553,-1403.5601,17.2816);
    SetPlayerSkin(playerid,pInfo[playerid][skin]);
    }
    else if(pInfo[playerid][fraktion]==5)
    {
    SetPlayerPos(playerid,-1616.4448,685.6295,7.1875);
    SetPlayerSkin(playerid,pInfo[playerid][skin]);
    }
    else if(pInfo[playerid][fraktion]==6)
    {
    SetPlayerPos(playerid,-2452.0681,503.3803,30.0827);
    SetPlayerSkin(playerid,pInfo[playerid][skin]);
    }
    else if(pInfo[playerid][fraktion]==7)
    {
    SetPlayerPos(playerid,-1521.9054,481.5855,7.1875);
    SetPlayerSkin(playerid,pInfo[playerid][skin]);
    }
    else if(pInfo[playerid][fraktion]==8)
    {
    SetPlayerPos(playerid,2256.7405,-1408.8368,24.0000);
    SetPlayerSkin(playerid,pInfo[playerid][skin]);
    }
    else if(pInfo[playerid][fraktion]==9)
    {
    SetPlayerPos(playerid,2499.5959,-1684.8195,13.4340);
    SetPlayerSkin(playerid,pInfo[playerid][skin]);
    }
    else if(pInfo[playerid][fraktion]==10)
    {
    SetPlayerPos(playerid,-2106.6504,-195.4614,35.3203);
    SetPlayerSkin(playerid,pInfo[playerid][skin]);
    }
    else if(pInfo[playerid][fraktion]==11)
    {
    SetPlayerPos(playerid,-2200.4988,646.3664,49.4375);
    SetPlayerSkin(playerid,pInfo[playerid][skin]);
    }
    else if(pInfo[playerid][fraktion]==12)
    {
    SetPlayerPos(playerid,2584.2241,-1104.3000,66.6413);
    SetPlayerSkin(playerid,pInfo[playerid][skin]);
    }
    else if(pInfo[playerid][fraktion]==13)
    {
    SetPlayerPos(playerid,-535.9175,-504.5012,25.5178);
    SetPlayerSkin(playerid,pInfo[playerid][skin]);
    }
    else if(pInfo[playerid][fraktion]==14)
    {
    SetPlayerPos(playerid,329.6980,-1511.2147,36.0391);
    SetPlayerSkin(playerid,pInfo[playerid][skin]);
    }
    else if(pInfo[playerid][fraktion]==15)
    {
    SetPlayerPos(playerid,-1876.4185,-150.8452,11.8984);
    SetPlayerSkin(playerid,pInfo[playerid][skin]);
    }
    else if(pInfo[playerid][fraktion]==16)
    {
    SetPlayerPos(playerid,2791.9575,-1427.7181,36.0938);
    SetPlayerSkin(playerid,pInfo[playerid][skin]);
    }
    else if(pInfo[playerid][fraktion]==17)
    {
    SetPlayerPos(playerid,-1026.1521,-714.3414,32.0078);
    SetPlayerSkin(playerid,pInfo[playerid][skin]);
    }


    MFG
    T_H_U_G


    Zitat von Dj G4bby

    It`s nice, to be important, but it`s more important to be nice!



  • vllt. kann mir ja jemand helfen also ich will z.b. wenn ich Fraktion 15 bin auch in der base der fraktion 15 spawnen, aber ich spawne immer am New spawn.


    public OnPlayerSpawn(playerid)
    {
    if(pInfo[playerid][fraktion]==0)
    {
    SetPlayerPos(playerid,1674.2616,-1915.5049,21.9542);
    SetPlayerSkin(playerid,pInfo[playerid][skin]);
    }
    else if(pInfo[playerid][fraktion]==1)
    {
    SetPlayerPos(playerid,1580.1251,-1635.4674,13.5604);
    SetPlayerSkin(playerid,pInfo[playerid][skin]);
    }
    else if(pInfo[playerid][fraktion]==2)
    {
    SetPlayerPos(playerid,-1616.4448,685.6295,7.1875);
    SetPlayerSkin(playerid,pInfo[playerid][skin]);
    }
    else if(pInfo[playerid][fraktion]==3)
    {
    SetPlayerPos(playerid,-2557.4812,662.7305,14.4531);
    SetPlayerSkin(playerid,pInfo[playerid][skin]);
    }
    else if(pInfo[playerid][fraktion]==4)
    {
    SetPlayerPos(playerid,2034.1553,-1403.5601,17.2816);
    SetPlayerSkin(playerid,pInfo[playerid][skin]);
    }
    else if(pInfo[playerid][fraktion]==5)
    {
    SetPlayerPos(playerid,-1616.4448,685.6295,7.1875);
    SetPlayerSkin(playerid,pInfo[playerid][skin]);
    }
    else if(pInfo[playerid][fraktion]==6)
    {
    SetPlayerPos(playerid,-2452.0681,503.3803,30.0827);
    SetPlayerSkin(playerid,pInfo[playerid][skin]);
    }
    else if(pInfo[playerid][fraktion]==7)
    {
    SetPlayerPos(playerid,-1521.9054,481.5855,7.1875);
    SetPlayerSkin(playerid,pInfo[playerid][skin]);
    }
    else if(pInfo[playerid][fraktion]==8)
    {
    SetPlayerPos(playerid,2256.7405,-1408.8368,24.0000);
    SetPlayerSkin(playerid,pInfo[playerid][skin]);
    }
    else if(pInfo[playerid][fraktion]==9)
    {
    SetPlayerPos(playerid,2499.5959,-1684.8195,13.4340);
    SetPlayerSkin(playerid,pInfo[playerid][skin]);
    }
    else if(pInfo[playerid][fraktion]==10)
    {
    SetPlayerPos(playerid,-2106.6504,-195.4614,35.3203);
    SetPlayerSkin(playerid,pInfo[playerid][skin]);
    }
    else if(pInfo[playerid][fraktion]==11)
    {
    SetPlayerPos(playerid,-2200.4988,646.3664,49.4375);
    SetPlayerSkin(playerid,pInfo[playerid][skin]);
    }
    else if(pInfo[playerid][fraktion]==12)
    {
    SetPlayerPos(playerid,2584.2241,-1104.3000,66.6413);
    SetPlayerSkin(playerid,pInfo[playerid][skin]);
    }
    else if(pInfo[playerid][fraktion]==13)
    {
    SetPlayerPos(playerid,-535.9175,-504.5012,25.5178);
    SetPlayerSkin(playerid,pInfo[playerid][skin]);
    }
    else if(pInfo[playerid][fraktion]==14)
    {
    SetPlayerPos(playerid,329.6980,-1511.2147,36.0391);
    SetPlayerSkin(playerid,pInfo[playerid][skin]);
    }
    else if(pInfo[playerid][fraktion]==15)
    {
    SetPlayerPos(playerid,-1876.4185,-150.8452,11.8984);
    SetPlayerSkin(playerid,pInfo[playerid][skin]);
    }
    else if(pInfo[playerid][fraktion]==16)
    {
    SetPlayerPos(playerid,2791.9575,-1427.7181,36.0938);
    SetPlayerSkin(playerid,pInfo[playerid][skin]);
    }
    else if(pInfo[playerid][fraktion]==17)
    {
    SetPlayerPos(playerid,-1026.1521,-714.3414,32.0078);
    SetPlayerSkin(playerid,pInfo[playerid][skin]);
    }
    return 1;
    }


    edit:// pawn code verbessert
    //Edit INk
    Doppelpost ist Verboten! Nutz die editier Funktion! Beim nächstenmal haste ne Verwarnung!


    Zitat von Dj G4bby

    It`s nice, to be important, but it`s more important to be nice!



    Einmal editiert, zuletzt von InternetInk aka Benjamin ()

  • Höchstwahrscheinlich ist er auch nicht 17, jedoch um dies zu testen kannst du deinen obigen Code mit folgendem ersetzen


    printf("DEBUG Spieler %d spawnt mit Fraktion´s ID: %d", playerid, pInfo[playerid][fraktion]); //Wiedergibt nen Debug Text im Log
    switch(pInfo[playerid][fraktion]) //Überprüft welche Fraktion Spieler ist
    {
    case 1: SetPlayerPos(playerid,1580.1251,-1635.4674,13.5604);
    case 2: SetPlayerPos(playerid,-1616.4448,685.6295,7.1875);
    case 3: SetPlayerPos(playerid,-2557.4812,662.7305,14.4531);
    case 4: SetPlayerPos(playerid,2034.1553,-1403.5601,17.2816);
    case 5: SetPlayerPos(playerid,-1616.4448,685.6295,7.1875);
    case 6: SetPlayerPos(playerid,-2452.0681,503.3803,30.0827);
    case 7: SetPlayerPos(playerid,-1521.9054,481.5855,7.1875);
    case 8: SetPlayerPos(playerid,2256.7405,-1408.8368,24.0000);
    case 9: SetPlayerPos(playerid,2499.5959,-1684.8195,13.4340);
    case 10: SetPlayerPos(playerid,-2106.6504,-195.4614,35.3203);
    case 11: SetPlayerPos(playerid,-2200.4988,646.3664,49.4375);
    case 12: SetPlayerPos(playerid,2584.2241,-1104.3000,66.6413);
    case 13: SetPlayerPos(playerid,-535.9175,-504.5012,25.5178);
    case 14: SetPlayerPos(playerid,329.6980,-1511.2147,36.0391);
    case 15: SetPlayerPos(playerid,-1876.4185,-150.8452,11.8984);
    case 16: SetPlayerPos(playerid,2791.9575,-1427.7181,36.0938);
    case 17: SetPlayerPos(playerid,-1026.1521,-714.3414,32.0078);
    default: SetPlayerPos(playerid,1674.2616,-1915.5049,21.9542); //Wird aufgerufen, wenn Spieler nicht in der Fraktion von 1 bis 17 in dem Fall...
    }
    SetPlayerSkin(playerid,pInfo[playerid][skin]); //Setzt den Spielerskin

    Sofern du gespawnt bist, schaust du in der server_log.txt nach, was im Debug Text steht und wenn dort die FraktionsID 0 ist, dann hast du irgendwo mit der Variable pInfo[playerid][fraktion] einen Fehler...

    Mfg Templer


    >>Dein Breadfish-Thema im Unterforum ScriptingBase / Scriptingwünsche wurde nicht richtig beantworter?<<
    >>Es handelt sich um ein Programmier Problem und du nicht einfach weiter kommst wo der Fehler sein könnte?<<
    Dann melde dich bei mir über die PN-Funktion indem du den Link zu deinem Breadfish-Themen Problem schickst.
    Voraussetzung:
    Thema älter als 1 Tag und im Breadfish Forum gespostet!

  • versuch mal ohne else if sonder einfach nur


    if()
    {
    }
    if()
    {
    }




    So ;) hoffe du hast es gecheckt wie ich es meine