SpawnFehler..

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 Leute ich hab nen Problem mit den Spawnen.
    Das Problem ist:
    Wenn man zum ersten mal Spawnt dann wird das OnPlayerSpawn und das SetPlayerSpawn 3 mal aufgerufen [Godfather]
    aber Spawnen tut man nicht..
    Hier mal mein SetPlayerSpawn:
    forward SetPlayerSpawn(playerid);
    public SetPlayerSpawn(playerid)
    {
    printf("Callback SetPlayerSpawn von Spieler %s [ID: %d]",SpielerName(playerid),playerid);
    if(IsPlayerConnected(playerid))
    {
    new rand;
    new house = SpielerInfo[playerid][pPhousekey];
    if(PlayerPaintballing[playerid] != 0)
    {
    ResetPlayerWeapons(playerid);
    GivePlayerWeapon(playerid, 29, 999);
    rand = random(sizeof(PaintballSpawns));
    SetPlayerPos(playerid, PaintballSpawns[rand][0], PaintballSpawns[rand][1], PaintballSpawns[rand][2]);
    return 1;
    }
    if(KnastTime[playerid] > 0)
    {
    SetPlayerToKnast(playerid,Knast[playerid]);
    SendClientMessage(playerid, COLOR_LIGHTRED, " Flüchten bringt nichts, zurück in die Zelle!");
    return 1;
    }
    if(SpielerInfo[playerid][pJailed] == 1)
    {
    SetPlayerInterior(playerid,3);
    SetPlayerPos(playerid,198.3396,162.2801,1003.0300);
    SendClientMessage(playerid, COLOR_LIGHTRED, " Polizist:Zurück in die Zelle es wird nicht ausgebrochen! ");
    return 1;
    }
    if(SpielerInfo[playerid][pJailed] == 2)
    {
    SetPlayerInterior(playerid,18);
    SetPlayerPos(playerid,-221.059051,1408.984008,27.773437);
    return 1;
    }
    if(SpielerInfo[playerid][pJailed] == 3)
    {
    SetPlayerInterior(playerid, 10);
    SetPlayerPos(playerid,223.9077,111.2334,999.0156);
    return 1;
    }
    if(MedicBill[playerid] == 1 && SpielerInfo[playerid][pJailed] == 0 && PlayerPaintballing[playerid] == 0)
    {
    MedicBill[playerid] = 0;
    MedicTime[playerid] = 0;
    NeedMedicTime[playerid] = 0;
    SpielerInfo[playerid][pDeaths] += 1;
    SetPlayerHealth(playerid, 25.0);
    }
    if(SpielerInfo[playerid][pLeader] >= 1 || SpielerInfo[playerid][pMember] >= 1)
    {
    if(SpawnChange[playerid] == 1)
    {
    GivePlayerWeapons(playerid);
    SetPlayerToTeamColor(playerid);
    SetPlayerInterior(playerid,HouseInfo[house][hInt]);
    SetPlayerPos(playerid, HouseInfo[house][hExitx], HouseInfo[house][hExity],HouseInfo[house][hExitz]);
    SpielerInfo[playerid][pLocal] = house;
    SpielerInfo[playerid][pInt] = HouseInfo[house][hInt];
    SetPlayerVirtualWorld(playerid,house);
    return 1;
    }
    else if(SpawnChange[playerid] == 0)
    {
    if (SpielerInfo[playerid][pMember] == 1 || SpielerInfo[playerid][pLeader] == 1)
    {
    SetPlayerToTeamColor(playerid);
    GivePlayerWeapons(playerid);
    rand = random(sizeof(gCopPlayerSpawns));
    SetPlayerPos(playerid, gCopPlayerSpawns[rand][0], gCopPlayerSpawns[rand][1], gCopPlayerSpawns[rand][2]);
    SetPlayerFacingAngle(playerid,random(360));
    SetPlayerInterior(playerid,3);
    SpielerInfo[playerid][pInt] = 0;
    return 1;
    }
    if (SpielerInfo[playerid][pMember] == 2 || SpielerInfo[playerid][pLeader] == 2) //SF Police spawn
    {
    SetPlayerToTeamColor(playerid);
    GivePlayerWeapons(playerid);
    SetPlayerPos(playerid, 218.4133,119.3318,1003.2188);
    SetPlayerInterior(playerid,10);
    SpielerInfo[playerid][pInt] = 10;
    return 1;
    }
    if (SpielerInfo[playerid][pMember] == 3 || SpielerInfo[playerid][pLeader] == 3)//Bundeswehr spawn
    {
    SetPlayerToTeamColor(playerid);
    GivePlayerWeapons(playerid);
    SetPlayerInterior(playerid, 0);
    SetPlayerPos(playerid, 213.6955,1866.9175,13.1406);
    SpielerInfo[playerid][pInt] = 0;
    return 1;
    }
    if (SpielerInfo[playerid][pMember] == 4 || SpielerInfo[playerid][pLeader] == 4)//Sanitäter spawn
    {
    SetPlayerToTeamColor(playerid);
    GivePlayerWeapons(playerid);
    SetPlayerInterior(playerid, 0);
    SetPlayerPos(playerid,2036.1694,-1404.6766,17.2533);
    SetPlayerFacingAngle(playerid,146.7247);
    SpielerInfo[playerid][pInt] = 0;
    SetPlayerArmour(playerid,100);
    return 1;
    }
    if (SpielerInfo[playerid][pMember] == 5 || SpielerInfo[playerid][pLeader] == 5)//LaCosaNostra spawn
    {
    SetPlayerToTeamColor(playerid);
    GivePlayerWeapons(playerid);
    SetPlayerInterior(playerid, 1);
    SetPlayerVirtualWorld(playerid,0);
    SetPlayerPos(playerid,2169.8943,1604.6152,999.9706);
    SpielerInfo[playerid][pInt] = 1;
    return 1;
    }
    if (SpielerInfo[playerid][pLeader] == 6 || SpielerInfo[playerid][pMember] == 6)//Yakuza spawn
    {
    SetPlayerToTeamColor(playerid);// fraktions farbe
    GivePlayerWeapons(playerid);// spawn waffen
    SetPlayerInterior(playerid, 1);
    SetPlayerVirtualWorld(playerid,0);// virtuelle welt
    SetPlayerPos(playerid,-2170.3164,645.4327,1057.5938);//spawn koordinaten
    SetPlayerFacingAngle(playerid,180.2845);
    SpielerInfo[playerid][pInt] = 1;
    return 1;
    }
    if(SpielerInfo[playerid][pLeader] == 7)//Präsident spawn
    {
    SetPlayerToTeamColor(playerid);
    GivePlayerWeapons(playerid);
    SetPlayerInterior(playerid, 0);
    SetPlayerPos(playerid,1256.7922,-781.0903,92.0302);
    SpielerInfo[playerid][pInt] = 0;
    return 1;
    }
    if(SpielerInfo[playerid][pMember] == 7)//Bodyguard spawn
    {
    SetPlayerToTeamColor(playerid);
    GivePlayerWeapons(playerid);
    SetPlayerInterior(playerid, 0);
    SetPlayerPos(playerid,1256.7922,-781.0903,92.0302);
    SpielerInfo[playerid][pInt] = 0;
    return 1;
    }
    if (SpielerInfo[playerid][pMember] == 8 || SpielerInfo[playerid][pLeader] == 8) //Hitman spawn
    {
    SetPlayerToTeamColor(playerid);
    GivePlayerWeapons(playerid);
    SetPlayerPos(playerid,2808.2705,-1169.3121,1025.5703);
    SetPlayerFacingAngle(playerid,222.2941);
    SetPlayerInterior(playerid,8);
    SpielerInfo[playerid][pInt] = 8;
    SetPlayerVirtualWorld(playerid,3);
    return 1;
    }
    if (SpielerInfo[playerid][pMember] == 9 || SpielerInfo[playerid][pLeader] == 9) //News spawn
    {
    SetPlayerToTeamColor(playerid);
    GivePlayerWeapons(playerid);
    SetPlayerPos(playerid, -2050.8962,460.0262,35.1719);
    SetPlayerInterior(playerid,0);
    SpielerInfo[playerid][pInt] = 0;
    return 1;
    }
    if (SpielerInfo[playerid][pMember] == 10 || SpielerInfo[playerid][pLeader] == 10) //Taxi spawn
    {
    SetPlayerToTeamColor(playerid);
    GivePlayerWeapons(playerid);
    SetPlayerPos(playerid, 1025.2363,-1358.8267,13.7266);
    SetPlayerFacingAngle(playerid,243.8503);
    SetPlayerInterior(playerid,0);
    SpielerInfo[playerid][pInt] = 0;
    return 1;
    }
    if (SpielerInfo[playerid][pMember] == 12 || SpielerInfo[playerid][pLeader] == 12) //LS.Bikers Spawn
    {
    SetPlayerToTeamColor(playerid);
    GivePlayerWeapons(playerid);
    SetPlayerPos(playerid,488.5065,-82.2111,998.7578);
    SetPlayerFacingAngle(playerid,1.3445);
    SetPlayerInterior(playerid,11);
    SpielerInfo[playerid][pInt] = 1;
    return 1;
    }
    if (SpielerInfo[playerid][pMember] == 13 || SpielerInfo[playerid][pLeader] == 13) //GROOVE STREET FAMILIY
    {
    SetPlayerToTeamColor(playerid);
    GivePlayerWeapons(playerid);
    SetPlayerPos(playerid,2808.2705,-1169.3121,1025.5703);
    SetPlayerInterior(playerid,8);
    SpielerInfo[playerid][pInt] = 8;
    SetPlayerVirtualWorld(playerid,4);
    return 1;
    }
    if (SpielerInfo[playerid][pMember] == 14 || SpielerInfo[playerid][pLeader] == 14) //BALLAS GANG
    {
    SetPlayerToTeamColor(playerid);
    GivePlayerWeapons(playerid);
    SetPlayerPos(playerid,2808.2705,-1169.3121,1025.5703);
    SetPlayerFacingAngle(playerid,281.6475);
    SetPlayerInterior(playerid,8);
    SpielerInfo[playerid][pInt] = 8;
    SetPlayerVirtualWorld(playerid,6);
    return 1;
    }
    if (SpielerInfo[playerid][pMember] == 15 || SpielerInfo[playerid][pLeader] == 15) //Fast and Furious
    {
    SetPlayerToTeamColor(playerid);
    GivePlayerWeapons(playerid);
    SetPlayerPos(playerid,2808.2705,-1169.3121,1025.5703);
    SetPlayerFacingAngle(playerid,238.9020);
    SetPlayerInterior(playerid,8);
    SpielerInfo[playerid][pInt] = 8;
    SetPlayerVirtualWorld(playerid,7);
    return 1;
    }
    if (SpielerInfo[playerid][pMember] == 16 || SpielerInfo[playerid][pLeader] == 16) //Los Santos Vagos
    {
    SetPlayerToTeamColor(playerid);
    GivePlayerWeapons(playerid);
    SetPlayerPos(playerid,2808.2705,-1169.3121,1025.5703);
    SetPlayerFacingAngle(playerid,88.9785);
    SetPlayerInterior(playerid,8);
    SpielerInfo[playerid][pInt] = 8;
    SetPlayerVirtualWorld(playerid,8);
    return 1;
    }
    if (SpielerInfo[playerid][pMember] == 17 || SpielerInfo[playerid][pLeader] == 17) //Varios Los Aztecas
    {
    SetPlayerToTeamColor(playerid);
    GivePlayerWeapons(playerid);
    SetPlayerPos(playerid,2808.2705,-1169.3121,1025.5703);
    SetPlayerFacingAngle(playerid,134.9023);
    SetPlayerInterior(playerid,8);
    SpielerInfo[playerid][pInt] = 8;
    SetPlayerVirtualWorld(playerid,9);
    return 1;
    }
    if (SpielerInfo[playerid][pMember] == 18 || SpielerInfo[playerid][pLeader] == 18) //San Fierro Rifa
    {
    SetPlayerToTeamColor(playerid);
    GivePlayerWeapons(playerid);
    SetPlayerPos(playerid,2808.2705,-1169.3121,1025.5703);
    SetPlayerFacingAngle(playerid,271.0359);
    SetPlayerInterior(playerid,8);
    SpielerInfo[playerid][pInt] = 8;
    SetPlayerVirtualWorld(playerid,10);
    return 1;
    }
    if (SpielerInfo[playerid][pMember] == 19 || SpielerInfo[playerid][pLeader] == 19) //W C Customs
    {
    SetPlayerToTeamColor(playerid);
    GivePlayerWeapons(playerid);
    SetPlayerPos(playerid,2808.2705,-1169.3121,1025.5703);
    SetPlayerFacingAngle(playerid,146.4443);
    SetPlayerInterior(playerid,8);
    SpielerInfo[playerid][pInt] = 8;
    SetPlayerVirtualWorld(playerid,11);
    return 1;
    }
    if (SpielerInfo[playerid][pMember] == 20 || SpielerInfo[playerid][pLeader] == 20) //Al Quaida
    {
    SetPlayerToTeamColor(playerid);
    SetPlayerPos(playerid,2808.2705,-1169.3121,1025.5703);
    SetPlayerFacingAngle(playerid,179.9684);
    SetPlayerInterior(playerid,8);
    SpielerInfo[playerid][pInt] = 8;
    SetPlayerVirtualWorld(playerid,12);
    GivePlayerWeapons(playerid);
    return 1;
    }
    if (SpielerInfo[playerid][pMember] == 21) //CIA Agenten spawn
    {
    SetPlayerToTeamColor(playerid);
    SetPlayerPos(playerid, 219.9247,69.6859,1005.0391);
    SetPlayerInterior(playerid,6);
    SpielerInfo[playerid][pInt] = 6;
    GivePlayerWeapons(playerid);
    return 1;
    }
    if (SpielerInfo[playerid][pLeader] == 21) //CIA Leader spawn
    {
    SetPlayerToTeamColor(playerid);
    SetPlayerPos(playerid, 219.9247,69.6859,1005.0391);
    SetPlayerInterior(playerid,6);
    SpielerInfo[playerid][pInt] = 6;
    GivePlayerWeapons(playerid);
    SetPlayerSkin(playerid,166);
    return 1;
    }
    if (SpielerInfo[playerid][pMember] == 22 || SpielerInfo[playerid][pLeader] == 22) //Feuerwehr spawn
    {
    SetPlayerToTeamColor(playerid);
    SetPlayerPos(playerid,1491.6892,1306.2329,1093.2964);
    SetPlayerFacingAngle(playerid,270.7357);
    SetPlayerInterior(playerid,3);
    SpielerInfo[playerid][pInt] = 3;
    GivePlayerWeapons(playerid);
    return 1;
    }
    if (SpielerInfo[playerid][pMember] == 23 || SpielerInfo[playerid][pLeader] == 23) //Russenmafia spawn
    {
    SetPlayerToTeamColor(playerid);
    SetPlayerPos(playerid,958.7915,2097.2166,1011.0226);
    SetPlayerFacingAngle(playerid,358.0643);
    SetPlayerInterior(playerid,1);
    SpielerInfo[playerid][pInt] = 1;
    GivePlayerWeapons(playerid);
    return 1;
    }
    if (SpielerInfo[playerid][pMember] == 24 || SpielerInfo[playerid][pLeader] == 24) //Oamt spawn
    {
    SetPlayerToTeamColor(playerid);
    SetPlayerPos(playerid,918.4708,-1252.2200,16.2109);
    SetPlayerInterior(playerid,0);
    SpielerInfo[playerid][pInt] = 0;
    GivePlayerWeapons(playerid);
    return 1;
    }
    if ((gTeam[playerid]) == 1)
    {
    SetPlayerToTeamColor(playerid);
    rand = random(sizeof(gMedPlayerSpawns));
    SetPlayerPos(playerid, gMedPlayerSpawns[rand][0], gMedPlayerSpawns[rand][1], gMedPlayerSpawns[rand][2]); // Warp the player
    SetPlayerFacingAngle(playerid, 270.0);
    SetPlayerInterior(playerid,0);
    SpielerInfo[playerid][pInt] = 0;
    return 1;
    }
    }
    else if(SpielerInfo[playerid][pMember] == 0 || SpielerInfo[playerid][pLeader] == 0)
    {
    SetPlayerToTeamColor(playerid);
    SetPlayerPos(playerid,1715.8221,-1912.2717,13.5664);
    SetPlayerFacingAngle(playerid, 24.6935);
    SetPlayerVirtualWorld(playerid, 0);
    SetPlayerInterior(playerid,0);
    return 1;
    }
    }
    }
    return 1;
    }

    Wenn man schon gespawnt ist und stirbt bzw. Spawnt dann geht es aber wenn man Disconnected und wieder Connected dann spawnt man wieder irgendwo im Himmel