SA-MP Forums Archive
[Ajuda] Skin por Cargo/Emprego - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Skin por Cargo/Emprego (/showthread.php?tid=325480)



[Ajuda] Skin por Cargo/Emprego - JuniorRiddle - 13.03.2012

Eu queria colocar um sistema no GM que setasse uma Skin pra cada membro de um determinado cargo de uma organizaзгo:

Exemplo: Jogador do Sexo Masculino Cargo 4 da Org 5 Vai logar com a skin 116
Exemplo: Jogador do Sexo Feminino Cargo 4 da Org 5 Vai logar com a skin 114

Eu tentei adicionar o mesmo sistema que usei no /batercartгo pra setar as fardas na OnPlayerSpawn, chegou a compilar, funcionou uma ъnica vez e logo depois, parou.

Segue o codigo que usei no /batercartгo.

pawn Code:
{
                        if(PlayerInfo[playerid][pMembro] == 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); }
                        }
                        if(PlayerInfo[playerid][pLider] == 1) { SetPlayerSkin(playerid, 265); }
                        }
                        {
                        if(PlayerInfo[playerid][pMembro] == 1)
                        {
                        if(PlayerInfo[playerid][pCargo] == 1 && PlayerInfo[playerid][pSex] == 2)  { SetPlayerSkin(playerid, 192); }
                        else if(PlayerInfo[playerid][pCargo] == 2 && PlayerInfo[playerid][pSex] == 2) { SetPlayerSkin(playerid, 192); }
                        else if(PlayerInfo[playerid][pCargo] == 3 && PlayerInfo[playerid][pSex] == 2) { SetPlayerSkin(playerid, 192); }
                        else if(PlayerInfo[playerid][pCargo] == 4 && PlayerInfo[playerid][pSex] == 2) { SetPlayerSkin(playerid, 192); }
                        else if(PlayerInfo[playerid][pCargo] == 5 && PlayerInfo[playerid][pSex] == 2) { SetPlayerSkin(playerid, 192); }
                        }
                        if(PlayerInfo[playerid][pLider] == 1 && PlayerInfo[playerid][pSex] == 2) { SetPlayerSkin(playerid, 192); }
                        }
Alguйm poderia me ajudar me passar um tutorial ou uma base pra fazer isso funcionar?


Re: [Ajuda] Skin por Cargo/Emprego - Kmatsu - 13.03.2012

Fiz uma base para vocк

pawn Code:
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] == 1)
{
    if(PlayerInfo[playerid][pSex] == 1) SetPlayerSkin(playerid, 265);
    else if(PlayerInfo[playerid][pSex] == 2) SetPlayerSkin(playerid, 192);
}



Re: [Ajuda] Skin por Cargo/Emprego - JuniorRiddle - 13.03.2012

Isso tem que ser adicionado na OnPlayerSpawn? Porque eu adiciono, compila, mas na pratica, nгo seta a skin


Essa й a OnPlayerSpawn sem o Codigo:
pawn Code:
public OnPlayerSpawn(playerid)
{
    if(sincronizando[playerid] == 1)
    {
        return 1;
    }
    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;
}