Spawning bug
#1

Okay, so let me show you what will happen if I spawn.



I will spawn in Las venturas, the place that you spawn if you haven't changed anything from the script, and a cigarette in my had. Wtf, never happened for me before.

But well, this is my 'OnPlayerDeath':

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    TogglePlayerSpectating(playerid, 1);
    PlayerSpectatePlayer(playerid, killerid);
    SendClientMessage(playerid, 0xFEFEFEFF, "Kill Cam: {FF0000}Press {FFFFFF}>> Crouch © << {FF0000}to get out of this Kill-Cam!");
   
    if(killerid != INVALID_PLAYER_ID) SetPlayerScore(killerid, GetPlayerScore(killerid) +1);
    GivePlayerMoney(killerid, 150);
    GameTextForPlayer(killerid, "Score +1~n~Money +125", 2000, 3);
   
    if(UsedCTeam[playerid] == 1)
    {
        IsTerrorist[playerid] = 0;
        IsRebel[playerid] = 0;
        IsSwat[playerid] = 0;
        IsGansta[playerid] = 0;
        IsMerc[playerid] = 0;
       
        TeamTestRebel -= 1;
        TeamTestSwat -= 1;
        TeamTestTerror -= 1;
        TeamTestGang -= 1;
        TeamTestMerc -= 1;
       
        IsInTerror[playerid] = false;
        IsInSwat[playerid] = false;
        IsInGang[playerid] = false;
        IsInRebel[playerid] = false;
    }

    if(IsRecon[playerid] == 1)
    {
        Update3DTextLabelText(Recon[playerid], 0xFFFA00FF, " ");
        Delete3DTextLabel(Recon[playerid]);
    }
    if(IsAssault[playerid] == 1)
    {
        Update3DTextLabelText(Assault[playerid], 0xFFFA00FF, " ");
        Delete3DTextLabel(Assault[playerid]);
    }
    if(IsMedic[playerid] == 1)
    {
        Update3DTextLabelText(Medic[playerid], 0xFFFA00FF, " ");
        Delete3DTextLabel(Medic[playerid]);
    }
    if(IsEngineer[playerid] == 1)
    {
        Update3DTextLabelText(Engineer[playerid], 0xFFFA00FF, " ");
        Delete3DTextLabel(Engineer[playerid]);
    }
    if(IsPilot[playerid] == 1)
    {
        Update3DTextLabelText(Pilot[playerid], 0xFFFA00FF, " ");
        Delete3DTextLabel(Pilot[playerid]);
    }  
   
    HealAg[playerid] = 0;
    FixAg[playerid] = 0;
    GiveAg[playerid] = 0;
   
    IsMedic[playerid] = 0;
    IsRecon[playerid] = 0;
    IsAssault[playerid] = 0;
    IsEngineer[playerid] = 0;
    IsPilot[playerid] = 0;
   
    PressJ[playerid] = 1;
   
    SendDeathMessage(killerid, playerid, reason);
    return 1;
}
And this is my 'OnPlayerSpawn':

pawn Код:
public OnPlayerSpawn(playerid)
{
    new rand = random(sizeof(TSpawns));
    new rand1 = random(sizeof(GSpawns));
    new rand2 = random(sizeof(RSpawns));
    new rand3 = random(sizeof(SSpawns));
    new rand4 = random(sizeof(MSpawns));
   
    //GangZone Areas
    GangZoneShowForPlayer(playerid, TerroristZone, -16777017);
    GangZoneShowForPlayer(playerid, GanstasZone, 16711888);
    GangZoneShowForPlayer(playerid, RebelZone, -65332);
    GangZoneShowForPlayer(playerid, SwatZone, 65477);
   
    PressJ[playerid] = 0;
   
    if(TClassID[playerid] == 0)
    {
        if(TeamTestTerror < 6)
        {
            ResetPlayerWeapons(playerid);
            SetPlayerPos(playerid, TSpawns[rand][0], TSpawns[rand][1], TSpawns[rand][2]);
            SetPlayerHealth(playerid, 9999999.9);
            SetPlayerColor(playerid, 0xF50000FF);
            ShowPlayerDialog(playerid, TMENU, DIALOG_STYLE_LIST, "Choose what you want to be below:", "{FFA200}Recon\nMedic\n{FFA200}Assault\nEngineer\n{FFA200}Pilot", "Pick", "Cancel");
            IsTerrorist[playerid] = 1;
            IsInTerror[playerid] = true;
            if(FristSpawn[playerid] == 1)
            {
                TeamTestTerror += 1;
                FristSpawn[playerid] = 0;
            }
        }
        else if(TeamTestTerror == 6)
        {
            ForceClassSelection(playerid);
            SetPlayerHealth(playerid, 0);
        }
    }
    if(TClassID[playerid] == 1)
    {
        if(TeamTestSwat < 6)
        {
            ResetPlayerWeapons(playerid);
            SetPlayerHealth(playerid, 9999999.9);
            SetPlayerColor(playerid, 0x000FFFFF);
            SetPlayerPos(playerid, SSpawns[rand3][0], SSpawns[rand3][1], SSpawns[rand3][2]);
            ShowPlayerDialog(playerid, SMENU, DIALOG_STYLE_LIST, "Choose what you want to be below:", "{FFA200}Recon\nMedic\n{FFA200}Assault\nEngineer\n{FFA200}Pilot", "Pick", "Cancel");
            IsSwat[playerid] = 1;
            IsInSwat[playerid] = true;
            if(FristSpawn[playerid] == 1)
            {
                TeamTestSwat += 1;
                FristSpawn[playerid] = 0;
            }
        }
        else if(TeamTestSwat == 6)
        {
            ForceClassSelection(playerid);
            SetPlayerHealth(playerid, 0);
        }
    }
    if(TClassID[playerid] == 2)
    {
        if(TeamTestGang < 6)
        {
            ResetPlayerWeapons(playerid);
            SetPlayerHealth(playerid, 9999999.9);
            SetPlayerColor(playerid, 0x00FF14FF);
            SetPlayerPos(playerid, GSpawns[rand1][0], GSpawns[rand1][1], GSpawns[rand1][2]);
            ShowPlayerDialog(playerid, GMENU, DIALOG_STYLE_LIST, "Choose what you want to be below:", "{FFA200}Recon\nMedic\n{FFA200}Assault\nEngineer\n{FFA200}Pilot", "Pick", "Cancel");
            IsGansta[playerid] = 1;
            IsInGang[playerid] = true;
            if(FristSpawn[playerid] == 1)
            {
                TeamTestGang += 1;
                FristSpawn[playerid] = 0;
            }
        }
        else if(TeamTestGang == 6)
        {
            ForceClassSelection(playerid);
            SetPlayerHealth(playerid, 0);
        }
    }
    if(TClassID[playerid] == 3)
    {
        if(TeamTestRebel < 6)
        {
            ResetPlayerWeapons(playerid);
            SetPlayerHealth(playerid, 9999999.9);
            SetPlayerColor(playerid, 0xFFFA00FF);
            SetPlayerPos(playerid, RSpawns[rand2][0], RSpawns[rand2][1], RSpawns[rand2][2]);
            ShowPlayerDialog(playerid, RMENU, DIALOG_STYLE_LIST, "Choose what you want to be below:", "{FFA200}Recon\nMedic\n{FFA200}Assault\nEngineer\n{FFA200}Pilot", "Pick", "Cancel");
            IsRebel[playerid] = 1;
            IsInRebel[playerid] = true;
            if(FristSpawn[playerid] == 1)
            {
                TeamTestRebel += 1;
                FristSpawn[playerid] = 0;
            }
        }
        else if(TeamTestRebel == 6)
        {
            ForceClassSelection(playerid);
            SetPlayerHealth(playerid, 0);
        }
    }
    if(TClassID[playerid] == 4)
    {
        if(TeamTestMerc < 6)
        {
            ResetPlayerWeapons(playerid);
            SetPlayerHealth(playerid, 9999999.9);
            SetPlayerColor(playerid, 0xFF00FFFF);
            SetPlayerPos(playerid, MSpawns[rand4][0], MSpawns[rand4][1], MSpawns[rand4][2]);
            ShowPlayerDialog(playerid, MMENU, DIALOG_STYLE_LIST, "Choose what you want to be below:", "{FFA200}Recon\nMedic\n{FFA200}Assault\nEngineer\n{FFA200}Pilot", "Pick", "Cancel");
            IsMerc[playerid] = 1;
            IsInMerc[playerid] = true;
            TogglePlayerControllable(playerid, 0);
            GivePlayerWeapon(playerid, 46, 1);
            SetTimerEx("Freeze", 3000, 0, "i", playerid);
            if(FristSpawn[playerid] == 1)
            {
                TeamTestMerc += 1;
                FristSpawn[playerid] = 0;
            }
        }
        else if(TeamTestMerc == 6)
        {
            ForceClassSelection(playerid);
            SetPlayerHealth(playerid, 0);
        }
    }
    return 1;
}
Lol, any ideas?

(NOTE: This doesn't happen every time! I don't know how to explain when it happens, but I guess, that when you press C, witch takes you out of the kill-cam mode, so, if you press it like really fast after you died, it spawns you in LV. )
Reply
#2

Never noticed it, however you can try

pawn Код:
ClearAnimations(playerid);
after the player spawns.
Reply
#3

Thanks mate, it haven't happened anymore. And I hope that it won't happen anymore.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)