[Ajuda] Erro na OnPlayerSpawn
#1

Bem, estou com esse problemas a alguns dias, nгo achei nada no search, o problema й assim, quando adiciona qualquer coisa na onPlayerSpawn o char spawna no cйu, e sу vai pro seu spawn original apуs cair no chгo e morre, isso aconteceu na primeira vez quando eu fui adicionar os skills de armas para zero, e agora quando eu setei as as skins usando esse cуdigo:

pawn Код:
{
    if(PlayerInfo[playerid][pMembro] == 1)
{
    if(PlayerInfo[playerid][pSex] == 1)
    {
        if(PlayerInfo[playerid][pCargo] == 1)  SetPlayerSkin(playerid, 281);
        else if(PlayerInfo[playerid][pCargo] == 2) SetPlayerSkin(playerid, 281);
        else if(PlayerInfo[playerid][pCargo] == 3) SetPlayerSkin(playerid, 280);
        else if(PlayerInfo[playerid][pCargo] == 4) SetPlayerSkin(playerid, 267);
        else if(PlayerInfo[playerid][pCargo] == 5) SetPlayerSkin(playerid, 266);
    }
    else if(PlayerInfo[playerid][pSex] == 2)
    {
        if(PlayerInfo[playerid][pCargo] == 1) SetPlayerSkin(playerid, 192);
        else if(PlayerInfo[playerid][pCargo] == 2) SetPlayerSkin(playerid, 192);
        else if(PlayerInfo[playerid][pCargo] == 3) SetPlayerSkin(playerid, 192);
        else if(PlayerInfo[playerid][pCargo] == 4) SetPlayerSkin(playerid, 192);
        else if(PlayerInfo[playerid][pCargo] == 5) SetPlayerSkin(playerid, 192);
    }
}
    if(PlayerInfo[playerid][pLider] == 14)
{
    if(PlayerInfo[playerid][pSex] == 1) SetPlayerSkin(playerid, 270);
    else if(PlayerInfo[playerid][pSex] == 2) SetPlayerSkin(playerid, 270);
    return 1;
    }
segue a OnPlayerSpawn:

pawn Код:
public OnPlayerSpawn(playerid)
{
    if(PlayerInfo[playerid][pMembro] == 1)
{
    if(PlayerInfo[playerid][pSex] == 1)
    {
        if(PlayerInfo[playerid][pCargo] == 1)  SetPlayerSkin(playerid, 281);
        else if(PlayerInfo[playerid][pCargo] == 2) SetPlayerSkin(playerid, 281);
        else if(PlayerInfo[playerid][pCargo] == 3) SetPlayerSkin(playerid, 280);
        else if(PlayerInfo[playerid][pCargo] == 4) SetPlayerSkin(playerid, 267);
        else if(PlayerInfo[playerid][pCargo] == 5) SetPlayerSkin(playerid, 266);
    }
    else if(PlayerInfo[playerid][pSex] == 2)
    {
        if(PlayerInfo[playerid][pCargo] == 1) SetPlayerSkin(playerid, 192);
        else if(PlayerInfo[playerid][pCargo] == 2) SetPlayerSkin(playerid, 192);
        else if(PlayerInfo[playerid][pCargo] == 3) SetPlayerSkin(playerid, 192);
        else if(PlayerInfo[playerid][pCargo] == 4) SetPlayerSkin(playerid, 192);
        else if(PlayerInfo[playerid][pCargo] == 5) SetPlayerSkin(playerid, 192);
    }
}
    if(PlayerInfo[playerid][pLider] == 14)
{
    if(PlayerInfo[playerid][pSex] == 1) SetPlayerSkin(playerid, 270);
    else if(PlayerInfo[playerid][pSex] == 2) SetPlayerSkin(playerid, 270);
    return 1;
    }
    if(sincronizando[playerid] == 1)
    {
        return true;
    }
    gTeam[playerid] = PlayerInfo[playerid][pTeam]; //Set the Team
    if (gTeam[playerid] == 4) //medic / criminal reset team
    {
        gTeam[playerid] = 3;
    }
    if(gPlayerLogged[playerid] == 0)
    {
        SendClientMessage(playerid, COLOR_LIGHTRED, "AdmCmd: Vocк foi kickado por Chuck_Norris, Motivo: Spawn sem login");
        SendClientMessage(playerid, COLOR_LIGHTRED,"Chuck_Norris te kickou do servidor, e nгo o contrarie novamente");
        Kick(playerid);
        return 1;
    }
    CheckInfoOrg(playerid);
    if(gTeam[playerid] == 11 && PlayerInfo[playerid][pLider] < 1)
    {
        MedicBill[playerid] = 0;
        SendClientMessage(playerid, COLOR_LIGHTRED, "Vocк nгo foi aprovado pelo lнder, agora й um Civil !");
        PlayerInfo[playerid][pTeam] = 3;
        gTeam[playerid] = 3;
        if(PlayerInfo[playerid][pSex] == 1) { PlayerInfo[playerid][pSkin] = 293; } else { PlayerInfo[playerid][pSkin] = 12; }
        SetSpawnInfo(playerid, gTeam[playerid], PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0);
        SpawnPlayer(playerid);
    }
    if(gTeam[playerid] == 5)
    {
        if(PlayerInfo[playerid][pMembro] < 1)
        {
            MedicBill[playerid] = 0;
            SendClientMessage(playerid, COLOR_LIGHTRED, "Vocк nгo faz parte de uma familia, agora й um Civil !");
            PlayerInfo[playerid][pTeam] = 3;
            gTeam[playerid] = 3;
            if(PlayerInfo[playerid][pSex] == 1) { PlayerInfo[playerid][pSkin] = 293; } else { PlayerInfo[playerid][pSkin] = 12; }
            SetSpawnInfo(playerid, gTeam[playerid], PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0);
            SpawnPlayer(playerid);
        }
    }
    if(gTeam[playerid] == 10)
    {
        if(PlayerInfo[playerid][pMembro] != 8)
        {
            MedicBill[playerid] = 0;
            SendClientMessage(playerid, COLOR_LIGHTRED, "Vocк nгo faz parte de uma agencia, й um Civil !");
            PlayerInfo[playerid][pTeam] = 3;
            gTeam[playerid] = 3;
            if(PlayerInfo[playerid][pSex] == 1) { PlayerInfo[playerid][pSkin] = 293; } else { PlayerInfo[playerid][pSkin] = 12; }
            SetSpawnInfo(playerid, gTeam[playerid], PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0);
            SpawnPlayer(playerid);
        }
    }
    if(gTeam[playerid] == 2 && PlayerInfo[playerid][pMembro] > 3)
    {
        MedicBill[playerid] = 0;
        SendClientMessage(playerid, COLOR_LIGHTRED, "Vocк nгo й mais um oficial, й um Civil !");
        PlayerInfo[playerid][pTeam] = 3;
        gTeam[playerid] = 3;
        if(PlayerInfo[playerid][pSex] == 1) { PlayerInfo[playerid][pSkin] = 293; } else { PlayerInfo[playerid][pSkin] = 12; }
        SetSpawnInfo(playerid, gTeam[playerid], PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0);
        SpawnPlayer(playerid);
    }
    if(gTeam[playerid] == 3)
    {
     if(PlayerInfo[playerid][pMembro] > 0 || PlayerInfo[playerid][pLider] > 0)
        {
            MedicBill[playerid] = 0;
      if(PlayerInfo[playerid][pMembro] == 1) { SetSpawnInfo(playerid, 2, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 2; gTeam[playerid] = 2; }
            else if(PlayerInfo[playerid][pMembro] == 2) { SetSpawnInfo(playerid, 2, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 2; gTeam[playerid] = 2; }
            else if(PlayerInfo[playerid][pMembro] == 3) { SetSpawnInfo(playerid, 2, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 2; gTeam[playerid] = 2; }
            else if(PlayerInfo[playerid][pMembro] == 4) { SetSpawnInfo(playerid, 1, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 1; gTeam[playerid] = 1; }
            else if(PlayerInfo[playerid][pMembro] == 5) { SetSpawnInfo(playerid, 5, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5; gTeam[playerid] = 5; }
            else if(PlayerInfo[playerid][pMembro] == 6) { SetSpawnInfo(playerid, 5, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5; gTeam[playerid] = 5; }
            else if(PlayerInfo[playerid][pMembro] == 8) { SetSpawnInfo(playerid, 10, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 10; gTeam[playerid] = 10; }
            else if(PlayerInfo[playerid][pMembro] == 9) { SetSpawnInfo(playerid, 12, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 12; gTeam[playerid] = 12; }
            else if(PlayerInfo[playerid][pMembro] == 10) { SetSpawnInfo(playerid, 12, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 12; gTeam[playerid] = 12; }
            else if(PlayerInfo[playerid][pMembro] == 11) { SetSpawnInfo(playerid, 12, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 12; gTeam[playerid] = 12; }
            else if(PlayerInfo[playerid][pMembro] == 12) { SetSpawnInfo(playerid, 12, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 12; gTeam[playerid] = 22; }
            else if(PlayerInfo[playerid][pMembro] == 13) { SetSpawnInfo(playerid, 12, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 12; gTeam[playerid] = 20; }
            else if(PlayerInfo[playerid][pMembro] == 14) { SetSpawnInfo(playerid, 12, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 12; gTeam[playerid] = 15; }
            else if(PlayerInfo[playerid][pMembro] == 15) { SetSpawnInfo(playerid, 12, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 12; gTeam[playerid] = 16; }
            else if(PlayerInfo[playerid][pMembro] == 16) { SetSpawnInfo(playerid, 2, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 2; gTeam[playerid] = 2; }
            else if(PlayerInfo[playerid][pMembro] == 17) { SetSpawnInfo(playerid, 12, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 12; gTeam[playerid] = 18; }
            else if(PlayerInfo[playerid][pMembro] == 18) { SetSpawnInfo(playerid, 12, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 12; gTeam[playerid] = 19; }
            else if(PlayerInfo[playerid][pMembro] == 19) { SetSpawnInfo(playerid, 12, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 12; gTeam[playerid] = 19; }
            else if(PlayerInfo[playerid][pMembro] == 20) { SetSpawnInfo(playerid, 12, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 12; gTeam[playerid] = 19; }
            else if(PlayerInfo[playerid][pMembro] == 21) { SetSpawnInfo(playerid, 12, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 12; gTeam[playerid] = 19; }
            else if(PlayerInfo[playerid][pLider] == 1) { SetSpawnInfo(playerid, 11, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; }
            else if(PlayerInfo[playerid][pLider] == 2) { SetSpawnInfo(playerid, 11, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; }
            else if(PlayerInfo[playerid][pLider] == 3) { SetSpawnInfo(playerid, 11, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; }
            else if(PlayerInfo[playerid][pLider] == 4) { SetSpawnInfo(playerid, 11, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; }
            else if(PlayerInfo[playerid][pLider] == 5) { SetSpawnInfo(playerid, 11, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; }
            else if(PlayerInfo[playerid][pLider] == 6) { SetSpawnInfo(playerid, 11, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; }
            else if(PlayerInfo[playerid][pLider] == 7) { SetSpawnInfo(playerid, 11, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; }
            else if(PlayerInfo[playerid][pLider] == 8) { SetSpawnInfo(playerid, 11, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; }
            else if(PlayerInfo[playerid][pLider] == 9) { SetSpawnInfo(playerid, 11, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; }
            else if(PlayerInfo[playerid][pLider] == 10) { SetSpawnInfo(playerid, 11, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; }
            else if(PlayerInfo[playerid][pLider] == 11) { SetSpawnInfo(playerid, 11, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; }
            else if(PlayerInfo[playerid][pLider] == 12) { SetSpawnInfo(playerid, 11, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 22; }
            else if(PlayerInfo[playerid][pLider] == 13) { SetSpawnInfo(playerid, 11, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 20; }
            else if(PlayerInfo[playerid][pLider] == 14) { SetSpawnInfo(playerid, 11, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 15; }
            else if(PlayerInfo[playerid][pLider] == 15) { SetSpawnInfo(playerid, 11, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 16; }
            else if(PlayerInfo[playerid][pLider] == 16) { SetSpawnInfo(playerid, 2, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 2; gTeam[playerid] = 2; }
            else if(PlayerInfo[playerid][pLider] == 17) { SetSpawnInfo(playerid, 11, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 18; }
            else if(PlayerInfo[playerid][pLider] == 18) { SetSpawnInfo(playerid, 11, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 19; }
            else if(PlayerInfo[playerid][pLider] == 19) { SetSpawnInfo(playerid, 11, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 19; }
            else if(PlayerInfo[playerid][pLider] == 20) { SetSpawnInfo(playerid, 11, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 19; }
            else if(PlayerInfo[playerid][pLider] == 21) { SetSpawnInfo(playerid, 11, PlayerInfo[playerid][pSkin],0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 19; }
            SpawnPlayer(playerid);
        }
    }
    if(PlayerInfo[playerid][pSkin] > 0) { SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]); }
    else
    {
        if(PlayerInfo[playerid][pSex] == 1) { PlayerInfo[playerid][pSkin] = 293; SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]); }
        else { PlayerInfo[playerid][pSkin] = 12; SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]); }
    }
    SetPlayerWeapons(playerid);
    SetPlayerSpawn(playerid);
    SetPlayerToTeamColor(playerid);
    PlayerFixRadio(playerid);
    return 1;
}
Reply
#2

Quer uma dica? Troque de GM.
Esse spawn й um dos mais bugados possнveis.
Reply
#3

Consegui arrumar, bastou adcionar "SetPlayerSpawn" depois da parte que define as skins por cargo, agradeзo
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)