He Keeps spawning under the ground
#7

This is OnPlayerSpawn: (it doesn't fit in 1 replay )
pawn Код:
public OnPlayerSpawn(playerid)
{  if(pdebug == 1){printf("[DEBUG] OnPlayerSpawn(%d)", playerid);}

    // Spectate shit:
  if(PlayerMaySpectate[playerid] == 1)
    {
        if(PlayersOnline > 1)
        {
          new found = 0;
          for(new i = 0; i < MAX_SLOTS; i++)
            {
              if(found == 0)
              {
                  if(IsPlayerConnected(i))
                  {
                        if(PlayerAvailableToSpectate[i] == 1)
                        {
                          if(IsPlayerSpawned[i] == 1) // Is the spectateid player spawned?
                          {
                            found = 1;

                            new string[36];
                                format(string, sizeof(string),"Player: %s [%d]", PlayerName[i], i);
                                GameTextForPlayer(playerid, string, 3000, 4);

                            TogglePlayerSpectating(playerid, true);
                            KillTimer(CountdownTimer[playerid]);

                            CheckPlayerSpectating(playerid, i);
                            CountdownTimer[playerid] = SetTimerEx("CheckPlayerSpectating", 1000, true, "dd", playerid, i);
                            TextDrawShowForPlayer(playerid, CountdownTextdraw[playerid]);

                            SetPlayerInterior(playerid, GetPlayerInterior(i));
                            SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(i));

                PlayerMaySpectate[playerid] = 0;
                PlayerAvailableToSpectate[playerid] = 0;
                GettingSpectatedID[i] = playerid;
                            if(IsPlayerInAnyVehicle(i) == 1) // Is the spectateid player in a vehicle?
                            {
                                PlayerSpectateVehicle(playerid, GetPlayerVehicleID(i));
                                SpectateType[playerid] = 1;
                            }
                            else // Is the spectateid player on foot?
                            {
                                PlayerSpectatePlayer(playerid, i);
                                SpectateType[playerid] = 2;
                            }
                            return 1;
                          }
                        }
                  }
              }
            }
            if(found == 0) // Nobody was spawned or 'AvailableToSpectate'.
            {
        IsPlayerSpawned[playerid] = 1;
        PlayerAvailableToSpectate[playerid] = 1;
        PlayerMaySpectate[playerid] = 1;
        GettingSpectatedID[playerid] = INVALID_PLAYER_ID;
        // Player get's spawned...
            }
        }
        else // There are not enough players to spectate.
        {
            IsPlayerSpawned[playerid] = 1;
            PlayerAvailableToSpectate[playerid] = 1;
            PlayerMaySpectate[playerid] = 1;
            GettingSpectatedID[playerid] = INVALID_PLAYER_ID;
            // Player get's spawned...
        }
    }
    else // Player already did a spectate last time.
    {
      IsPlayerSpawned[playerid] = 1;
        PlayerAvailableToSpectate[playerid] = 1;
        PlayerMaySpectate[playerid] = 1;
        GettingSpectatedID[playerid] = INVALID_PLAYER_ID;
        // Player get's spawned...
    }

    // Normal stuff:
  SetPlayerHealth(playerid, PlayerInfo[playerid][pHealth]);
  SetPlayerArmour(playerid, PlayerInfo[playerid][pArmour]);

  StopSoundForPlayer(playerid);

    gTeam[playerid] = PlayerInfo[playerid][pTeam]; // Set the player in a team.

    SetPlayerSpawn(playerid); // Set the player's spawn place.
    SetPlayerWeapons(playerid); // Set the player's spawn weapons.
    SetPlayerTeamColor(playerid); // Set the player's spawn color.

    SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);

  // To sync mission checkpoints.
    if(CheckpointBusyX != 0.0 && CheckpointBusyY != 0.0 && CheckpointBusyZ != 0.0){SetPlayerCheckpoint(playerid, CheckpointBusyX, CheckpointBusyY, CheckpointBusyZ, CheckpointBusyS);}

  // To sync mission vehicles.
    if(SearchedVehicle != 0){SetVehicleParamsForPlayer(SearchedVehicle, playerid, 1, 0);}

    if(PlayerLoggedIn[playerid] == 0){GameTextForPlayer(playerid, "~w~Welcome,~n~In order to play you need to create an account, type ~n~~r~/register (password)~w~ to register.", 20000, 4);}
    return 1;
}
Reply


Messages In This Thread
He Keeps spawning under the ground - by breakpaper - 24.11.2009, 14:05
Re: He Keeps spawning under the ground - by dice7 - 24.11.2009, 14:22
Re: He Keeps spawning under the ground - by breakpaper - 24.11.2009, 14:35
Re: He Keeps spawning under the ground - by [DDC]Delight - 25.11.2009, 11:49
Re: He Keeps spawning under the ground - by Donny_k - 25.11.2009, 12:07
Re: He Keeps spawning under the ground - by breakpaper - 25.11.2009, 14:26
Re: He Keeps spawning under the ground - by breakpaper - 25.11.2009, 14:27
Re: He Keeps spawning under the ground - by kukars22 - 25.11.2009, 14:37
Re: He Keeps spawning under the ground - by breakpaper - 25.11.2009, 14:40
Re: He Keeps spawning under the ground - by breakpaper - 25.11.2009, 15:47

Forum Jump:


Users browsing this thread: 1 Guest(s)