[HELP] SPAWN
#1

I go on a account, login and i were in the sky. Zhe cordinates are okay, i realy dont know.
sorry very bad english :P

http://i.imgur.com/PYeQU.png

pawn Код:
public OnPlayerSpawn(playerid)
{
//------------------------------------------------------------------------------
        InitLockDoors(playerid);
        STDPlayer[playerid] = 0;
        if(IsPlayerNPC(playerid)) return 1;
//------------------------------------------------------------------------------

        if(PlayerInfo[playerid][pMember] == 0 || PlayerInfo[playerid][pLeader] == 0)
        {
            SetPlayerToTeamColor(playerid);
            SetPlayerInterior(playerid,0);
            SetPlayerPos(playerid, 1715.8232,-1931.6327,13.5680);
            SetPlayerFacingAngle(playerid, 180);
            PlayerInfo[playerid][pInt] = 0;
            return 1;
        }
        if (gTeam[playerid] == 4) //medic / criminal reset team
        {
                gTeam[playerid] = 3;
        }
        if(gPlayerLogged[playerid] == 0)
        {
        SendClientMessage(playerid, COLOR_LIGHTRED, "**Moras se logirati prije spawna **");
        KickPlayer[playerid] = 1;
        }
        if(gTeam[playerid] == 11 && PlayerInfo[playerid][pLeader] < 1)
        {
            MedicBill[playerid] = 0;
            new rand = random(sizeof(CIV));
                SendClientMessage(playerid, COLOR_LIGHTRED, "Ti nisi jedan lider ti si ponovo civil !");
                SetSpawnInfo(playerid, gTeam[playerid], CIV[rand],0.0,0.0,0.0,0,0,0,0,0,0,0);
                PlayerInfo[playerid][pModel] = CIV[rand];
                SpawnPlayer(playerid);
        }
        if(gTeam[playerid] == 5)
        {
            if(PlayerInfo[playerid][pMember] < 1)
            {
                MedicBill[playerid] = 0;
                new rand = random(sizeof(CIV));
                        SendClientMessage(playerid, COLOR_LIGHTRED, "Nisi clan Family-e, sada si Civil !");
            SetSpawnInfo(playerid, gTeam[playerid], CIV[rand],0.0,0.0,0.0,0,0,0,0,0,0,0);
                        PlayerInfo[playerid][pModel] = CIV[rand];
                        SpawnPlayer(playerid);
                }
        }
        if(gTeam[playerid] == 10)
        {
            if(PlayerInfo[playerid][pMember] != 8)
            {
                MedicBill[playerid] = 0;
                new rand = random(sizeof(CIV));
                        SendClientMessage(playerid, COLOR_LIGHTRED, "You are not a Member of this Agency, you are now a Civilian !");
            SetSpawnInfo(playerid, gTeam[playerid], CIV[rand],0.0,0.0,0.0,0,0,0,0,0,0,0);
                        PlayerInfo[playerid][pModel] = CIV[rand];
                        SpawnPlayer(playerid);
                }
        }
        if(gTeam[playerid] == 2 && PlayerInfo[playerid][pMember] > 3)
        {
            MedicBill[playerid] = 0;
                new rand = random(sizeof(CIV));
                SendClientMessage(playerid, COLOR_LIGHTRED, "You haven't applied for being an Officer / FBI / National Guard, you are now a Civilian !");
                SetSpawnInfo(playerid, gTeam[playerid], CIV[rand],0.0,0.0,0.0,0,0,0,0,0,0,0);
                PlayerInfo[playerid][pModel] = CIV[rand];
                SpawnPlayer(playerid);
        }

        if(PlayerInfo[playerid][pChar] > 0) { SetPlayerSkin(playerid, PlayerInfo[playerid][pChar]); }
        else { SetPlayerSkin(playerid, PlayerInfo[playerid][pModel]); }
        SetPlayerWeapons(playerid);
        SetPlayerSpawn(playerid);
        SetPlayerToTeamColor(playerid);
        for(new i = 0; i < sizeof(Turfs); i++)
        {
            GangZoneShowForPlayer(playerid, i, TurfInfo[i][zColor]);
        }
        return 1;
}



public CKLog(string[])
{
        new entry[256];
        format(entry, sizeof(entry), "%s\n",string);
        new File:hFile;
        hFile = fopen("ck.log", io_append);
        fwrite(hFile, entry);
        fclose(hFile);
}

public PayLog(string[])
{
        new entry[256];
        format(entry, sizeof(entry), "%s\n",string);
        new File:hFile;
        hFile = fopen("pay.log", io_append);
        fwrite(hFile, entry);
        fclose(hFile);
}

public KickLog(string[])
{
        new entry[256];
        format(entry, sizeof(entry), "%s\n",string);
        new File:hFile;
        hFile = fopen("kick.log", io_append);
        fwrite(hFile, entry);
        fclose(hFile);
}

public BanLog(string[])
{
        new entry[256];
        format(entry, sizeof(entry), "%s\n",string);
        new File:hFile;
        hFile = fopen("ban.log", io_append);
        fwrite(hFile, entry);
        fclose(hFile);
}

public AdmWarnLog(string[])
{
        new entry[256];
        format(entry, sizeof(entry), "%s\n",string);
        new File:hFile;
        hFile = fopen("admwarn.log", io_append);
        fwrite(hFile, entry);
        fclose(hFile);
}
Reply
#2

Try adding SetPlayerPos outside of any if.
Reply
#3

Maybe , you have reached the limit of the objects..
Try a plugin , like streamer from Ingognito
Reply
#4

What for objects ?
Reply
#5

Quote:
Originally Posted by farCry.xD
Посмотреть сообщение
Maybe , you have reached the limit of the objects..
Try a plugin , like streamer from Ingognito
What for limit of objects ?
I spawn in the sky, and not on a object -.-
Reply
#6

hmm... you maked a mistake that's because you setted to SetSpawnInfo co-ordonate to 0
replace this
pawn Код:
SetSpawnInfo(playerid, gTeam[playerid], CIV[rand],0.0,0.0,0.0,0,0,0,0,0,0,0);
to :
pawn Код:
SetSpawnInfo(playerid, gTeam[playerid], CIV[rand],1715.8232,-1931.6327,13.5680, 180,0,0,0,0,0,0);
in this zone
pawn Код:
if(gTeam[playerid] == 11 && PlayerInfo[playerid][pLeader] < 1)
        {
            MedicBill[playerid] = 0;
            new rand = random(sizeof(CIV));
                SendClientMessage(playerid, COLOR_LIGHTRED, "Ti nisi jedan lider ti si ponovo civil !");
                SetSpawnInfo(playerid, gTeam[playerid], CIV[rand],0.0,0.0,0.0,0,0,0,0,0,0,0);
                PlayerInfo[playerid][pModel] = CIV[rand];
                SpawnPlayer(playerid);
        }
        if(gTeam[playerid] == 5)
        {
            if(PlayerInfo[playerid][pMember] < 1)
            {
                MedicBill[playerid] = 0;
                new rand = random(sizeof(CIV));
                        SendClientMessage(playerid, COLOR_LIGHTRED, "Nisi clan Family-e, sada si Civil !");
            SetSpawnInfo(playerid, gTeam[playerid], CIV[rand],0.0,0.0,0.0,0,0,0,0,0,0,0);
                        PlayerInfo[playerid][pModel] = CIV[rand];
                        SpawnPlayer(playerid);
                }
        }
        if(gTeam[playerid] == 10)
        {
            if(PlayerInfo[playerid][pMember] != 8)
            {
                MedicBill[playerid] = 0;
                new rand = random(sizeof(CIV));
                        SendClientMessage(playerid, COLOR_LIGHTRED, "You are not a Member of this Agency, you are now a Civilian !");
            SetSpawnInfo(playerid, gTeam[playerid], CIV[rand],0.0,0.0,0.0,0,0,0,0,0,0,0);
                        PlayerInfo[playerid][pModel] = CIV[rand];
                        SpawnPlayer(playerid);
                }
        }
        if(gTeam[playerid] == 2 && PlayerInfo[playerid][pMember] > 3)
        {
            MedicBill[playerid] = 0;
                new rand = random(sizeof(CIV));
                SendClientMessage(playerid, COLOR_LIGHTRED, "You haven't applied for being an Officer / FBI / National Guard, you are now a Civilian !");
                SetSpawnInfo(playerid, gTeam[playerid], CIV[rand],0.0,0.0,0.0,0,0,0,0,0,0,0);
                PlayerInfo[playerid][pModel] = CIV[rand];
                SpawnPlayer(playerid);
        }
I suggest you creating co-ordonate
this spawn you in air because : the function don't know the co-ordonate
save zone with /save , and take from it only AddPlayerClass(playerid,x,y,z,Angle,...); rest don't cont and replace SetSpawnInfo(playerid,gTeam[playerid], CIV[rand],0,0,0,0,0,0,0) with your SetSpawnInfo(playerid,gTeam[playerid], CIV[rand],x,y,z,angle,0,0,0,0,0,0); for all your teams
Reply
#7

Its also the sam problem.
Im in the sky :S
Reply
#8

Try this please
pawn Код:
public OnPlayerSpawn(playerid)
{
//------------------------------------------------------------------------------
        InitLockDoors(playerid);
        STDPlayer[playerid] = 0;
        if(IsPlayerNPC(playerid)) return 1;
//------------------------------------------------------------------------------

            SetPlayerInterior(playerid,0);//setting interior for a player that doesn't match any criteria below
            SetPlayerPos(playerid, 1715.8232,-1931.6327,13.5680); //setting position for a player that doesn't match any criteria below
            SetPlayerFacingAngle(playerid, 180);//setting angle for a player that doesn't match any criteria below

        if(PlayerInfo[playerid][pMember] == 0 || PlayerInfo[playerid][pLeader] == 0)
        {
            SetPlayerToTeamColor(playerid);
            SetPlayerInterior(playerid,0);
            SetPlayerPos(playerid, 1715.8232,-1931.6327,13.5680);
            SetPlayerFacingAngle(playerid, 180);
            PlayerInfo[playerid][pInt] = 0;
            return 1;
        }
        if (gTeam[playerid] == 4) //medic / criminal reset team
        {
                gTeam[playerid] = 3;
        }
        if(gPlayerLogged[playerid] == 0)
        {
        SendClientMessage(playerid, COLOR_LIGHTRED, "**Moras se logirati prije spawna **");
        KickPlayer[playerid] = 1;
        }
        if(gTeam[playerid] == 11 && PlayerInfo[playerid][pLeader] < 1)
        {
            MedicBill[playerid] = 0;
            new rand = random(sizeof(CIV));
                SendClientMessage(playerid, COLOR_LIGHTRED, "Ti nisi jedan lider ti si ponovo civil !");
                SetSpawnInfo(playerid, gTeam[playerid], CIV[rand],0.0,0.0,0.0,0,0,0,0,0,0,0);
                PlayerInfo[playerid][pModel] = CIV[rand];
                SpawnPlayer(playerid);
        }
        if(gTeam[playerid] == 5)
        {
            if(PlayerInfo[playerid][pMember] < 1)
            {
                MedicBill[playerid] = 0;
                new rand = random(sizeof(CIV));
                        SendClientMessage(playerid, COLOR_LIGHTRED, "Nisi clan Family-e, sada si Civil !");
            SetSpawnInfo(playerid, gTeam[playerid], CIV[rand],0.0,0.0,0.0,0,0,0,0,0,0,0);
                        PlayerInfo[playerid][pModel] = CIV[rand];
                        SpawnPlayer(playerid);
                }
        }
        if(gTeam[playerid] == 10)
        {
            if(PlayerInfo[playerid][pMember] != 8)
            {
                MedicBill[playerid] = 0;
                new rand = random(sizeof(CIV));
                        SendClientMessage(playerid, COLOR_LIGHTRED, "You are not a Member of this Agency, you are now a Civilian !");
            SetSpawnInfo(playerid, gTeam[playerid], CIV[rand],0.0,0.0,0.0,0,0,0,0,0,0,0);
                        PlayerInfo[playerid][pModel] = CIV[rand];
                        SpawnPlayer(playerid);
                }
        }
        if(gTeam[playerid] == 2 && PlayerInfo[playerid][pMember] > 3)
        {
            MedicBill[playerid] = 0;
                new rand = random(sizeof(CIV));
                SendClientMessage(playerid, COLOR_LIGHTRED, "You haven't applied for being an Officer / FBI / National Guard, you are now a Civilian !");
                SetSpawnInfo(playerid, gTeam[playerid], CIV[rand],0.0,0.0,0.0,0,0,0,0,0,0,0);
                PlayerInfo[playerid][pModel] = CIV[rand];
                SpawnPlayer(playerid);
        }

        if(PlayerInfo[playerid][pChar] > 0) { SetPlayerSkin(playerid, PlayerInfo[playerid][pChar]); }
        else { SetPlayerSkin(playerid, PlayerInfo[playerid][pModel]); }
        SetPlayerWeapons(playerid);
        SetPlayerSpawn(playerid);
        SetPlayerToTeamColor(playerid);
        for(new i = 0; i < sizeof(Turfs); i++)
        {
            GangZoneShowForPlayer(playerid, i, TurfInfo[i][zColor]);
        }
        return 1;
}
Reply
#9

Also the same problem. Iґm in the sky.

I really dont know.
Reply
#10

Just debug them one by one and see where is crashing start by commenting them all and use simple setplayerpos
pawn Код:
public OnPlayerSpawn(playerid)
{
//------------------------------------------------------------------------------
      /*  InitLockDoors(playerid);
        STDPlayer[playerid] = 0;
        if(IsPlayerNPC(playerid)) return 1;*/

//------------------------------------------------------------------------------

            SetPlayerInterior(playerid,0);//setting interior for a player that doesn't match any criteria below
            SetPlayerPos(playerid, 1715.8232,-1931.6327,13.5680); //setting position for a player that doesn't match any criteria below
            SetPlayerFacingAngle(playerid, 180);//setting angle for a player that doesn't match any criteria below
        /*
        if(PlayerInfo[playerid][pMember] == 0 || PlayerInfo[playerid][pLeader] == 0)
        {
            SetPlayerToTeamColor(playerid);
            SetPlayerInterior(playerid,0);
            SetPlayerPos(playerid, 1715.8232,-1931.6327,13.5680);
            SetPlayerFacingAngle(playerid, 180);
            PlayerInfo[playerid][pInt] = 0;
            return 1;
        }
        if (gTeam[playerid] == 4) //medic / criminal reset team
        {
                gTeam[playerid] = 3;
        }
        if(gPlayerLogged[playerid] == 0)
        {
        SendClientMessage(playerid, COLOR_LIGHTRED, "**Moras se logirati prije spawna **");
        KickPlayer[playerid] = 1;
        }
        if(gTeam[playerid] == 11 && PlayerInfo[playerid][pLeader] < 1)
        {
            MedicBill[playerid] = 0;
            new rand = random(sizeof(CIV));
                SendClientMessage(playerid, COLOR_LIGHTRED, "Ti nisi jedan lider ti si ponovo civil !");
                SetSpawnInfo(playerid, gTeam[playerid], CIV[rand],0.0,0.0,0.0,0,0,0,0,0,0,0);
                PlayerInfo[playerid][pModel] = CIV[rand];
                SpawnPlayer(playerid);
        }
        if(gTeam[playerid] == 5)
        {
            if(PlayerInfo[playerid][pMember] < 1)
            {
                MedicBill[playerid] = 0;
                new rand = random(sizeof(CIV));
                        SendClientMessage(playerid, COLOR_LIGHTRED, "Nisi clan Family-e, sada si Civil !");
            SetSpawnInfo(playerid, gTeam[playerid], CIV[rand],0.0,0.0,0.0,0,0,0,0,0,0,0);
                        PlayerInfo[playerid][pModel] = CIV[rand];
                        SpawnPlayer(playerid);
                }
        }
        if(gTeam[playerid] == 10)
        {
            if(PlayerInfo[playerid][pMember] != 8)
            {
                MedicBill[playerid] = 0;
                new rand = random(sizeof(CIV));
                        SendClientMessage(playerid, COLOR_LIGHTRED, "You are not a Member of this Agency, you are now a Civilian !");
            SetSpawnInfo(playerid, gTeam[playerid], CIV[rand],0.0,0.0,0.0,0,0,0,0,0,0,0);
                        PlayerInfo[playerid][pModel] = CIV[rand];
                        SpawnPlayer(playerid);
                }
        }
        if(gTeam[playerid] == 2 && PlayerInfo[playerid][pMember] > 3)
        {
            MedicBill[playerid] = 0;
                new rand = random(sizeof(CIV));
                SendClientMessage(playerid, COLOR_LIGHTRED, "You haven't applied for being an Officer / FBI / National Guard, you are now a Civilian !");
                SetSpawnInfo(playerid, gTeam[playerid], CIV[rand],0.0,0.0,0.0,0,0,0,0,0,0,0);
                PlayerInfo[playerid][pModel] = CIV[rand];
                SpawnPlayer(playerid);
        }

        if(PlayerInfo[playerid][pChar] > 0) { SetPlayerSkin(playerid, PlayerInfo[playerid][pChar]); }
        else { SetPlayerSkin(playerid, PlayerInfo[playerid][pModel]); }
        SetPlayerWeapons(playerid);
        SetPlayerSpawn(playerid);
        SetPlayerToTeamColor(playerid);
        for(new i = 0; i < sizeof(Turfs); i++)
        {
            GangZoneShowForPlayer(playerid, i, TurfInfo[i][zColor]);
        }*/

        return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)