Warum Spawned spieler Falsch

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
    Eigentlich sollte nun der Spieler wenn er in einem der Teams ist in der Base spawnen jedoch Spawned er am Zivi Spawn immer.
    public SetPlayerSpawn(playerid)
    {
    new playername[MAX_PLAYER_NAME];
    if(IsPlayerConnected(playerid))
    {
    GetPlayerName(playerid, playername, sizeof(playername));
    SetPlayerHealth(playerid, PlayerInfo[playerid][pSHealth]);
    if(PlayerInfo[playerid][pAdminOnDuty] == 1)
    {
    SetPlayerColor(playerid, COLOR_SUPPORTER);
    if(PlayerInfo[playerid][pAdmin] >= 5)
    {
    SetPlayerArmour(playerid, 100);
    SetPlayerHealth(playerid, 100);
    }
    }
    if(PlayerInfo[playerid][pChar] != 0)
    {
    if(IsACop(playerid) && OnDuty[playerid] == 1)
    {
    SetPlayerSkin(playerid, PlayerInfo[playerid][pOnDutySkin]);
    }
    else
    {
    SetPlayerSkin(playerid, PlayerInfo[playerid][pChar]);
    }
    }
    else
    {
    Kleidungsshop[playerid] = 1;
    SendClientMessage(playerid, COLOR_WHITE, "Du hast einen ungültigen Skin, bitte wähle einen neuen !");
    JoinSkinAuswahl(playerid);
    return 1;
    }
    if(PlayerInfo[playerid][pTut] == 0 && PlayerInfo[playerid][pConnectTime] == 0)
    {
    gOoc[playerid] = 1; gNews[playerid] = 1; gFam[playerid] = 1;
    TogglePlayerControllable(playerid, 0);
    RegistrationStep[playerid] = 1;
    PlayerInfo[playerid][pLocal] = -1;
    SendClientMessage(playerid, COLOR_YELLOW, " ");
    SendClientMessage(playerid, COLOR_YELLOW, " ");
    SendClientMessage(playerid, COLOR_YELLOW, " ");
    SendClientMessage(playerid, COLOR_YELLOW, " ");
    SendClientMessage(playerid, COLOR_YELLOW, " ");
    SendClientMessage(playerid, COLOR_YELLOW, " ");
    SendClientMessage(playerid, COLOR_YELLOW, " ");
    SendClientMessage(playerid, COLOR_YELLOW, "Herzlich Willkommen !");
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Von wem wurdest du geworben? (Wenn dich niemand geworben hat, gib 'Niemand' ein.)");
    }
    if(PlayerPaintballing[playerid] == 1)
    {
    new rand = random(sizeof(PaintballSpawns));
    SetPlayerVirtualWorld(playerid, 20);
    //SetPlayerInterior(playerid, 10);
    SetPlayerHealth(playerid, 100);
    SetPlayerPos(playerid, PaintballSpawns[rand][0], PaintballSpawns[rand][1], PaintballSpawns[rand][2]);
    return 1;
    }
    if(PlayerTeamPaintballing[playerid] != 0)
    {
    if(PlayerTeamPaintballing[playerid] == 1)
    {
    SetPlayerInterior(playerid, 10);
    new Zufall;
    Zufall = random(7);
    SetPlayerPos(playerid,TeamDM2[Zufall][0],TeamDM2[Zufall][1],TeamDM2[Zufall][2]);
    GivePlayerWeapons(playerid,24,9999);
    GivePlayerWeapons(playerid,25,9999);
    SetPlayerColor(playerid,SHOWME_COLOR_GRUEN);
    SetPlayerHealth(playerid, 100);
    SetPlayerArmour(playerid, 0);
    SetCameraBehindPlayer(playerid);
    return 1;
    }
    else if(PlayerTeamPaintballing[playerid] == 2)
    {
    SetPlayerInterior(playerid, 10);
    new Zufall;
    Zufall = random(7);
    SetPlayerPos(playerid,TeamDM2[Zufall][0],TeamDM2[Zufall][1],TeamDM2[Zufall][2]);
    GivePlayerWeapons(playerid,24,9999);
    GivePlayerWeapons(playerid,25,9999);
    SetPlayerColor(playerid,SHOWME_COLOR_BLAU);
    SetPlayerHealth(playerid, 100);
    SetPlayerArmour(playerid, 0);
    SetCameraBehindPlayer(playerid);
    return 1;
    }
    }
    if(PlayerInfo[playerid][pJailed] != 0)
    {
    if(PlayerInfo[playerid][pJailed] == 1)
    {
    SetPlayerInterior(playerid, 3);
    SetPlayerPos(playerid,198.8241,161.8588,1003.0300);
    SendClientMessage(playerid, COLOR_LIGHTRED, " Strafe noch nicht komplett abgesessen, zurück ins Gefängnis.");
    }
    if(PlayerInfo[playerid][pJailed] == 2)
    {
    //SetTimerEx("PrisonChecker",20000,0,"i",playerid);
    CopPrison(playerid);
    SetPlayerInterior(playerid, 1);
    PlayerInfo[playerid][pLocal] = -1;
    SetPlayerPos(playerid, 2144.1943,1617.5361,993.6882);
    SetPlayerFacingAngle(playerid, 270);
    SetPlayerSkin(playerid, 206);
    }
    if(PlayerInfo[playerid][pJailed] == 3)
    {
    SetPlayerInterior(playerid, 6);
    new zufall = random(3);
    if(zufall == 1)
    {
    SetPlayerPos(playerid, 264.3521,82.2144,1001.0391);
    }
    else if(zufall == 2)
    {
    SetPlayerPos(playerid, 264.1788,86.7012,1001.0391);
    }
    else
    {
    SetPlayerPos(playerid, 264.7485,77.6824,1001.0391);
    }
    PlayerInfo[playerid][pLocal] = -1;
    SendClientMessage(playerid, COLOR_LIGHTRED, " Strafe noch nicht komplett abgesessen, zurück ins Gefängnis.");
    SetCameraBehindPlayer(playerid);
    }
    if(PlayerInfo[playerid][pJailed] == 5)
    {
    SetPlayerInterior(playerid, 0);
    SetPlayerPos(playerid,-366.9173,-1426.9307,25.7266);
    }
    ResetPlayerWeapon(playerid);
    return 1;
    }
    if(MedicBill[playerid] > 0 && PlayerInfo[playerid][pJailed] == 0 && PlayerPaintballing[playerid] == 0 && PlayerTeamPaintballing[playerid] == 0 && PlayerInfo[playerid][pAdminOnDuty] == 0 && FirstSpawnAfterLogin[playerid] == 0 && Logintime[playerid] > 5)
    {
    if(MedicBill[playerid] == 1) // LS
    {
    SetPlayerCameraPos(playerid, 1223.379028, -1333.354126, 35.0000);
    SetPlayerCameraLookAt(playerid, 1178.824829, -1325.804077, 14.0000);
    SetPlayerPos(playerid, 1172.7855,-1323.1859,12.0000);
    SetPlayerInterior(playerid, 0);
    }
    if(MedicBill[playerid] == 2) // SF
    {
    SetPlayerCameraPos(playerid, -2534.5190,544.7918,67.0804);
    SetPlayerCameraLookAt(playerid, -2655.0188,664.8013,27.3573);
    SetPlayerPos(playerid, -2655.0188,664.8013,27.3573);
    SetPlayerInterior(playerid, 0);
    }
    if(MedicBill[playerid] == 3) // LV
    {
    SetPlayerCameraPos(playerid, 1584.8676,1861.9952,29.6722);
    SetPlayerCameraLookAt(playerid, 1605.9807,1792.4591,16.3813);
    SetPlayerPos(playerid, 1605.9807,1792.4591,16.3813);
    SetPlayerInterior(playerid, 0);
    }
    PlayerStoned[playerid] = 0;
    STDPlayer[playerid] = 0;
    TogglePlayerControllable(playerid, 0);
    SetPlayerHealth(playerid, 100);
    MedicBillTimer[playerid] = SetTimerEx("Krankenhaus",26000,0,"i",playerid);
    GameTextForPlayer(playerid, "~r~In Krankenhausbehandlung ~n~~y~Ca. 30 Sekunden", 30000, 3);
    return 1;
    }
    if(Kleidungsshop[playerid] == 0)
    {
    SetPlayerInterior(playerid, 15);
    SetPlayerPos(playerid,207.7160,-101.7301,1005.2578);
    SetPlayerVirtualWorld(playerid, Kleidungsshop[playerid]);
    Kleidungsshop[playerid] = -1;
    return 1;
    }
    if(Kleidungsshop[playerid] == 2)
    {
    SetPlayerInterior(playerid, 15);
    SetPlayerPos(playerid,207.7160,-101.7301,1005.2578);
    SetPlayerVirtualWorld(playerid, Kleidungsshop[playerid]);
    Kleidungsshop[playerid] = -1;
    return 1;
    }
    else if(Kleidungsshop[playerid] == 1){Kleidungsshop[playerid] = -1;}
    SetSpawnKill(playerid);
    new house = PlayerInfo[playerid][pPhousekey];
    if(house != -1)
    {
    if(PlayerInfo[playerid][pSpawn] == 1)
    {
    SetPlayerInterior(playerid,HouseInfo[house][hInt]);
    SetPlayerPos(playerid, HouseInfo[house][hExitx], HouseInfo[house][hExity],HouseInfo[house][hExitz]);
    new house2 = house + 300;
    PlayerInfo[playerid][pLocal] = house2;
    SetPlayerVirtualWorld(playerid,house2);
    return 1;
    }
    }
    if(PlayerInfo[playerid][pMember] != -1 || PlayerInfo[playerid][pLeader] != -1)
    {
    for(new i = 0; i < sizeof(GangHausInfo); i++){
    if(GangHausInfo[i][GHGangID] == PlayerInfo[playerid][pLeader] || GangHausInfo[i][GHGangID] == PlayerInfo[playerid][pMember]){
    SetPlayerVirtualWorld(playerid, GangHausInfo[i][GHVirtualWorld]);
    SetPlayerInterior(playerid, GangHausInfo[i][GHInterior]);
    SetPlayerPos(playerid, GangHausInfo[i][GHAusgangX], GangHausInfo[i][GHAusgangY], GangHausInfo[i][GHAusgangZ]);
    PlayerInfo[playerid][pLocal] = i+200;
    return 1;
    }
    }
    }
    else if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)// LV-PD Spawn
    {
    SetPlayerInterior(playerid, 0);
    SetPlayerPos(playerid, 2281.363,2429.482,2.844);
    SetCameraBehindPlayer(playerid);
    return 1;
    }
    else if(PlayerInfo[playerid][pMember] == 7 || PlayerInfo[playerid][pLeader] == 7)// FBI Spawn
    {
    SetPlayerInterior(playerid, 0);
    SetPlayerPos(playerid, 610.4819,-590.9386,17.2266);
    SetCameraBehindPlayer(playerid);
    return 1;
    }
    else if(PlayerInfo[playerid][pMember] == 4 || PlayerInfo[playerid][pLeader] == 4)// Medic Spawn
    {
    SetPlayerInterior(playerid, 0);
    SetPlayerPos(playerid, 1827.3783,-1063.4382,24.1942);
    SetCameraBehindPlayer(playerid);
    return 1;
    }
    else if(PlayerInfo[playerid][pMember] == 13 || PlayerInfo[playerid][pLeader] == 13)// Oamt Spawn SAED von Toby_Fruit :D
    {
    SetPlayerInterior(playerid, 0);
    SetPlayerPos(playerid, 1827.3783,-1063.4382,24.1942);
    SetCameraBehindPlayer(playerid);
    return 1;
    }
    else if(PlayerInfo[playerid][pMember] == 14 || PlayerInfo[playerid][pLeader] == 14)// LSPD Spawn
    {
    SetPlayerInterior(playerid, 0);
    SetPlayerPos(playerid, 1528.456,-1678.284,5.464);
    SetCameraBehindPlayer(playerid);
    return 1;
    }
    else if(PlayerInfo[playerid][pMember] == 11 || PlayerInfo[playerid][pLeader] == 11)//Fahrschule Spawn
    {
    SetPlayerInterior(playerid, 0);
    SetPlayerPos(playerid, -2028.5530,-121.4660,39.0266);
    SetCameraBehindPlayer(playerid);
    return 1;
    }
    else if(PlayerInfo[playerid][pMember] == 16 || PlayerInfo[playerid][pLeader] == 16)// SFPD Spawn
    {
    SetPlayerInterior(playerid, 0);
    SetPlayerFacingAngle(playerid, 0);
    SetPlayerPos(playerid, -1605.8334,675.3344,-5.2422);
    SetCameraBehindPlayer(playerid);
    return 1;
    }
    else
    {
    if(PlayerInfo[playerid][pOrigin] == 1)//Los Santos
    {
    SetPlayerPos(playerid,370.3586,-2064.7393,7.8359);
    SetPlayerFacingAngle(playerid,0.0);
    SetPlayerInterior(playerid,0);
    SetCameraBehindPlayer(playerid);
    }
    else if(PlayerInfo[playerid][pOrigin] == 2)//San Fierro
    {
    SetPlayerPos(playerid,-1968.8335,137.8044,27.6875);
    SetPlayerFacingAngle(playerid,90.0);
    SetPlayerInterior(playerid,0);
    SetCameraBehindPlayer(playerid);
    }
    else if(PlayerInfo[playerid][pOrigin] == 3)//Las Venturas
    {
    SetPlayerPos(playerid,2226.127,1840.507,10.384);
    SetPlayerFacingAngle(playerid,90.0);
    SetPlayerInterior(playerid,0);
    SetCameraBehindPlayer(playerid);
    }
    else
    {
    SetPlayerPos(playerid,1110.1477,-1796.8231,16.5938);
    SetPlayerFacingAngle(playerid,0.0);
    SetPlayerInterior(playerid,0);
    SetCameraBehindPlayer(playerid);
    }
    return 1;
    }
    }
    return 1;
    }

  • Welche beiden Teams meinst du? Kannst du das in deinem Code mal per Kommentar markieren?


    Das hier
    if(PlayerInfo[playerid][pMember] != -1 || PlayerInfo[playerid][pLeader] != -1)
    {
    for(new i = 0; i < sizeof(GangHausInfo); i++){
    if(GangHausInfo[i][GHGangID] == PlayerInfo[playerid][pLeader] || GangHausInfo[i][GHGangID] == PlayerInfo[playerid][pMember]){
    SetPlayerVirtualWorld(playerid, GangHausInfo[i][GHVirtualWorld]);
    SetPlayerInterior(playerid, GangHausInfo[i][GHInterior]);
    SetPlayerPos(playerid, GangHausInfo[i][GHAusgangX], GangHausInfo[i][GHAusgangY], GangHausInfo[i][GHAusgangZ]);
    PlayerInfo[playerid][pLocal] = i+200;
    return 1;
    }
    }
    }
    else if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)// LV-PD Spawn
    {
    SetPlayerInterior(playerid, 0);
    SetPlayerPos(playerid, 2281.363,2429.482,2.844);
    SetCameraBehindPlayer(playerid);
    return 1;
    }
    else if(PlayerInfo[playerid][pMember] == 7 || PlayerInfo[playerid][pLeader] == 7)// FBI Spawn
    {
    SetPlayerInterior(playerid, 0);
    SetPlayerPos(playerid, 610.4819,-590.9386,17.2266);
    SetCameraBehindPlayer(playerid);
    return 1;
    }
    else if(PlayerInfo[playerid][pMember] == 4 || PlayerInfo[playerid][pLeader] == 4)// Medic Spawn
    {
    SetPlayerInterior(playerid, 0);
    SetPlayerPos(playerid, 1827.3783,-1063.4382,24.1942);
    SetCameraBehindPlayer(playerid);
    return 1;
    }
    else if(PlayerInfo[playerid][pMember] == 13 || PlayerInfo[playerid][pLeader] == 13)// Oamt Spawn SAED von Toby_Fruit :D
    {
    SetPlayerInterior(playerid, 0);
    SetPlayerPos(playerid, 1827.3783,-1063.4382,24.1942);
    SetCameraBehindPlayer(playerid);
    return 1;
    }
    else if(PlayerInfo[playerid][pMember] == 14 || PlayerInfo[playerid][pLeader] == 14)// LSPD Spawn
    {
    SetPlayerInterior(playerid, 0);
    SetPlayerPos(playerid, 1528.456,-1678.284,5.464);
    SetCameraBehindPlayer(playerid);
    return 1;
    }
    else if(PlayerInfo[playerid][pMember] == 11 || PlayerInfo[playerid][pLeader] == 11)//Fahrschule Spawn
    {
    SetPlayerInterior(playerid, 0);
    SetPlayerPos(playerid, -2028.5530,-121.4660,39.0266);
    SetCameraBehindPlayer(playerid);
    return 1;
    }
    else if(PlayerInfo[playerid][pMember] == 16 || PlayerInfo[playerid][pLeader] == 16)// SFPD Spawn
    {
    SetPlayerInterior(playerid, 0);
    SetPlayerFacingAngle(playerid, 0);
    SetPlayerPos(playerid, -1605.8334,675.3344,-5.2422);
    SetCameraBehindPlayer(playerid);
    return 1;
    }
    else