He Keeps spawning under the ground
#1

when i connect to my server and i spawn, i spawn under the ground.
and the spawn skins are not right,
i am busy with my own GM,
you see it in my signature! i use the script from grandlarc,
but i changed the spawn places!
Reply
#2

Check your AddPlayerClass'es and OnPlayerSpawn for faulty coords
Reply
#3

OnPlayerSpawn is good,
AddPlayerClass is good to,
the skins is fixed now,
but the spawn just still doesn't work
Reply
#4

Check for onplayerspawn, for interior ID and make sure you put -> SetPlayerInterior(playerid, 0);
Reply
#5

If you spawn under the ground and at the farm then that's the center of the world (0, 0, 0), I would say that if you are using arrays or something then your slot is wrong.

Debug your script with printf to see what values you are being given.
Reply
#6

i already DEBUG my server
this is SetPlayerSpawn:
pawn Код:
public SetPlayerSpawn(playerid)
{  if(pdebug == 1){printf("[DEBUG] SetPlayerSpawn(%d)", playerid);}

  IsPlayerInHouse[playerid] = INVALID_HOUSE_ID;
  if(PlayerInfo[playerid][pJailedSec] > 0)
    {
      OnPlayerJailed(playerid);
      return 1;
    }
    if(PlayerInfo[playerid][pHouseKey] != INVALID_HOUSE_ID)
    {
      new houseid = PlayerInfo[playerid][pHouseKey];
        SetPlayerPos(playerid, HouseInfo[houseid][hExitx], HouseInfo[houseid][hExity], HouseInfo[houseid][hExitz]);
        SetPlayerInterior(playerid, HouseInfo[houseid][hInt]);
        SetPlayerVirtualWorld(playerid, HouseInfo[houseid][hWorld]);
        IsPlayerInHouse[playerid] = houseid;
        SetPlayerTeamColor(playerid);
        return 1;
    }
    /*
    if(PlayerInfo[playerid][pPosX] != RandomPlayerSpawns[0][0] && PlayerInfo[playerid][pPosY] != RandomPlayerSpawns[0][1] && PlayerInfo[playerid][pPosZ] != RandomPlayerSpawns[0][2])
    {
        SetPlayerPos(playerid, PlayerInfo[playerid][pPosX], PlayerInfo[playerid][pPosY], PlayerInfo[playerid][pPosZ]);
        SetPlayerInterior(playerid, PlayerInfo[playerid][pInt]);
        SetPlayerVirtualWorld(playerid, PlayerInfo[playerid][pVir]);
      return 1;
    }
    */

    if(gTeam[playerid] == TEAM_ARMY)
    {
      if(PlayerInfo[playerid][pRank] == 2)
    {
           new rand = random(sizeof(RandomArmySpawns));
          SetPlayerPos(playerid, RandomArmySpawns[rand][0], RandomArmySpawns[rand][1], RandomArmySpawns[rand][2]);
          SetPlayerFacingAngle(playerid, RandomArmySpawns[rand][3]);
            SetPlayerInterior(playerid, armint);
            SetPlayerVirtualWorld(playerid, armvir);
            SetPlayerTeamColor(playerid);
            return 1;
        }
        else
        {
            SendClientMessage(playerid, COLOR_RED, "You are not allowed to be a soldier, go to our site | topic: army recruiting.");
            gTeam[playerid] = TEAM_NORMAL;
            PlayerInfo[playerid][pTeam] = gTeam[playerid];
            PlayerInfo[playerid][pSkin] = Skins[0][0];
            SetPlayerSkin(playerid, Skins[0][0]);
            SetPlayerSpawn(playerid);
            SetPlayerColor(playerid, TEAMCOLOR_NORMAL);
            return 1;
        }
    }
    if(gTeam[playerid] == TEAM_COP)
    {
      if(PlayerInfo[playerid][pRank] == 1)
    {
          new rand = random(sizeof(RandomCopsSpawns));
          SetPlayerPos(playerid, RandomCopsSpawns[rand][0], RandomCopsSpawns[rand][1], RandomCopsSpawns[rand][2]);
          SetPlayerFacingAngle(playerid, RandomCopsSpawns[rand][3]);
            SetPlayerInterior(playerid, copint);
            SetPlayerVirtualWorld(playerid, copvir);
            SetPlayerTeamColor(playerid);
            return 1;
        }
        else
        {
            SendClientMessage(playerid, COLOR_BLUE, "You are not allowed to be a cop, go to our site | topic: cop recruiting.");
            gTeam[playerid] = TEAM_NORMAL;
            PlayerInfo[playerid][pTeam] = gTeam[playerid];
            PlayerInfo[playerid][pSkin] = Skins[0][0];
            SetPlayerSkin(playerid, Skins[0][0]);
            SetPlayerSpawn(playerid);
            SetPlayerColor(playerid, TEAMCOLOR_NORMAL);
            return 1;
        }
    }
    if(gTeam[playerid] == TEAM_MEDIC)
    {
      new rand = random(sizeof(RandomMedicSpawns));
      SetPlayerPos(playerid, RandomMedicSpawns[rand][0], RandomMedicSpawns[rand][1], RandomMedicSpawns[rand][2]);
      SetPlayerFacingAngle(playerid, RandomMedicSpawns[rand][3]);
        SetPlayerInterior(playerid, medint);
        SetPlayerVirtualWorld(playerid, medvir);
        SetPlayerTeamColor(playerid);
      return 1;
    }
    if(gTeam[playerid] == TEAM_NEWS)
    {
      new rand = random(sizeof(RandomNewsrSpawns));
        SetPlayerPos(playerid, RandomNewsrSpawns[rand][0], RandomNewsrSpawns[rand][1], RandomNewsrSpawns[rand][2]);
        SetPlayerFacingAngle(playerid, RandomNewsrSpawns[rand][3]);
        SetPlayerInterior(playerid, newsrint);
        SetPlayerVirtualWorld(playerid, newsrvir);
        SetPlayerTeamColor(playerid);
        return 1;
    }
    if(gTeam[playerid] == TEAM_FIREMAN)
    {
      new rand = random(sizeof(RandomFiremanSpawns));
      SetPlayerPos(playerid, RandomFiremanSpawns[rand][0], RandomFiremanSpawns[rand][1], RandomFiremanSpawns[rand][2]);
      SetPlayerFacingAngle(playerid, RandomFiremanSpawns[rand][3]);
        SetPlayerInterior(playerid, firint);
        SetPlayerVirtualWorld(playerid, firvir);
        SetPlayerTeamColor(playerid);
      return 1;
    }
    else
    {
        new rand = random(sizeof(RandomPlayerSpawns));
      SetPlayerPos(playerid, RandomPlayerSpawns[rand][0], RandomPlayerSpawns[rand][1], RandomPlayerSpawns[rand][2]);
      SetPlayerFacingAngle(playerid, RandomPlayerSpawns[rand][3]);
        SetPlayerInterior(playerid, norint);
        SetPlayerVirtualWorld(playerid, norvir);
        SetPlayerTeamColor(playerid);
    }
    return 1;
}
Reply
#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
#8

so where did you changed the spawn point?

You have some file like spawns.cfg what you should open and change RandomPlayerSpawn.
Reply
#9

this is randomplayerspawns:
pawn Код:
new Float:RandomPlayerSpawns[1][4] = {
{1753.1827,-1930.0162,13.5764,270.0}
};
Reply
#10

Please guy's i really need it!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)