[Ajuda] Teams
#1

Bom gente no meu game mode tdm, na versгo 0.1 por em quanto sу tem 3 times que sгo eles, Ricos, Cafetхes(Pimps), e Swats, mais eu faзo tudo certinho sem erros nenhum, e quando vou spwnar com swats ou pimps, cai sу no spawn dos ricos, poderiam me ajudar?

pawn Код:
// === Colors teams ===
#define COLOR_RICH 0xFFD1A8FF
#define COLOR_PIMP 0x9E1803FF
#define COLOR_SWAT 0x047015FF

// === Gangs ===
#define TEAM_RICHS 55
#define TEAM_PIMPS 66
#define TEAM_SWATS 77

// === -- ===
new Team[MAX_PLAYERS];

// ------------- Classes -----------------
    AddPlayerClassEx(TEAM_RICHS,295,-2665.7739,937.6157,79.7101,180.0000,27,200,31,250,24,80); // Rich Spawn
    AddPlayerClassEx(TEAM_PIMPS,296,-2654.5393,1387.2876,7.1529,270.0000,26,150,29,300,18,5); // Pimps Spawn
    AddPlayerClassEx(TEAM_SWATS,285,-1635.9564,664.8169,7.1875,270.0000,25,300,31,250,29,200); // Swat Spawn

public OnPlayerRequestClass(playerid, classid)
{
    if(classid == 0) //Richs
    {
        SetPlayerPos(playerid, -2664.8742, 935.6891, 79.7101);
        SetPlayerInterior(playerid,0);
        SetPlayerFacingAngle(playerid, 357.9516);
        SetPlayerCameraPos(playerid, -2668.3742, 939.6891, 81.2101);
        SetPlayerCameraLookAt(playerid, -2664.8742, 935.6891, 79.7101);
        //-------------------------------------------
        GameTextForPlayer(playerid,"~w~Ricos",1000,1);
    }
    if(classid == 1) //Pimps
    {
        SetPlayerPos(playerid, -2654.5393, 1387.2875, 7.1529);
        SetPlayerInterior(playerid, 0);
        SetPlayerFacingAngle(playerid, 270.0000);
        SetPlayerCameraPos(playerid, -2658.0393, 1391.2875, 8.6529);
        SetPlayerCameraLookAt(playerid, -2654.5393, 1387.2875, 7.1529);
        //-------------------------------------------
        GameTextForPlayer(playerid,"~r~Cafetoes",1000,1);
    }
    if(classid == 2) //Swats
    {
        SetPlayerPos(playerid, -1635.8666, 664.9107, 7.1875);
        SetPlayerInterior(playerid, 0);
        SetPlayerFacingAngle(playerid, 177.4210);
        SetPlayerCameraPos(playerid, -1639.3666, 668.9107, 8.6875);
        SetPlayerCameraLookAt(playerid, -1635.8666, 664.9107, 7.1875);
        //-------------------------------------------
        GameTextForPlayer(playerid,"~g~Swats",1000,1);
    }
    return 1;
}

public OnPlayerSpawn(playerid)
{
    switch(Team[playerid])
    {
        case 0:
        {
            SetPlayerPos(playerid,-2665.7739,937.6157,79.7101);
            GivePlayerWeapon(playerid,16,5);
            SetPlayerColor(playerid,COLOR_RICH);
            SetPlayerInterior(playerid,0);
            SetPlayerVirtualWorld(playerid,0);
            SetPlayerTeam(playerid,TEAM_RICHS);
        }
        case 1:
        {
            SetPlayerPos(playerid,-2654.5393,1387.2876,7.1529);
            GivePlayerWeapon(playerid,14,1);
            SetPlayerColor(playerid,COLOR_PIMP);
            SetPlayerInterior(playerid,0);
            SetPlayerVirtualWorld(playerid,0);
            SetPlayerTeam(playerid,TEAM_PIMPS);
        }
        case 2:
        {
            SetPlayerPos(playerid,-1635.9564,664.8169,7.1875);
            GivePlayerWeapon(playerid,16,5);
            SetPlayerColor(playerid,COLOR_SWAT);
            SetPlayerInterior(playerid,0);
            SetPlayerVirtualWorld(playerid,0);
            SetPlayerTeam(playerid,TEAM_SWATS);
        }
        }
                return 1;
}
Reply
#2

Algъem?
Reply
#3

Para que "switch"?

Porque nгo usa logo um if?
pawn Код:
if(Team[playerid] == IDGANG) {
Reply
#4

Post sem nexo cara ^^

@Topic

Vc nгo estб setando a equipe que o Player й por isso neh...

pawn Код:
if(classid == 0) //Richs
{
    SetPlayerPos(playerid, -2664.8742, 935.6891, 79.7101);
    SetPlayerInterior(playerid,0);
    SetPlayerFacingAngle(playerid, 357.9516);
    SetPlayerCameraPos(playerid, -2668.3742, 939.6891, 81.2101);
    SetPlayerCameraLookAt(playerid, -2664.8742, 935.6891, 79.7101);
    //-------------------------------------------
    GameTextForPlayer(playerid,"~w~Ricos",1000,1);
    Team[playerid] = 0; //Isso Aki.
}
Reply
#5

@Edit

Deu certo aque valeu paulor e richar +rep para os dois
Reply
#6

pawn Код:
#include <a_samp>

// === Gangs ===
#define TEAM_RICHS 55
#define TEAM_PIMPS 66
#define TEAM_SWATS 77

new Team[MAX_PLAYERS];

main()
{
    print("\n----------------------------------");
    print(" [GM] Teams");
    print("----------------------------------\n");
}

public OnGameModeInit()
{
    SetGameModeText("Teams");
    AddPlayerClassEx(TEAM_RICHS,295,-2665.7739,937.6157,79.7101,180.0000,27,200,31,250,24,80); // Rich Spawn
    AddPlayerClassEx(TEAM_PIMPS,296,-2654.5393,1387.2876,7.1529,270.0000,26,150,29,300,18,5); // Pimps Spawn
    AddPlayerClassEx(TEAM_SWATS,285,-1635.9564,664.8169,7.1875,270.0000,25,300,31,250,29,200); // Swat Spawn
    return 1;
}

public OnPlayerRequestClass(playerid, classid)
{

    if(classid == 0) //Richs
    {
        SetPlayerPos(playerid, -2664.8742, 935.6891, 79.7101);
        SetPlayerInterior(playerid,0);
        SetPlayerFacingAngle(playerid, 357.9516);
        SetPlayerCameraPos(playerid, -2668.3742, 939.6891, 81.2101);
        SetPlayerCameraLookAt(playerid, -2664.8742, 935.6891, 79.7101);
        //-------------------------------------------
        GameTextForPlayer(playerid,"~w~Ricos",1000,1);
        Team[playerid] = 0;
    }
    if(classid == 1) //Pimps
    {
        SetPlayerPos(playerid, -2654.5393, 1387.2875, 7.1529);
        SetPlayerInterior(playerid, 0);
        SetPlayerFacingAngle(playerid, 270.0000);
        SetPlayerCameraPos(playerid, -2658.0393, 1391.2875, 8.6529);
        SetPlayerCameraLookAt(playerid, -2654.5393, 1387.2875, 7.1529);
        //-------------------------------------------
        GameTextForPlayer(playerid,"~r~Cafetoes",1000,1);
        Team[playerid] = 1;
    }
    if(classid == 2) //Swats
    {
        SetPlayerPos(playerid, -1635.8666, 664.9107, 7.1875);
        SetPlayerInterior(playerid, 0);
        SetPlayerFacingAngle(playerid, 177.4210);
        SetPlayerCameraPos(playerid, -1639.3666, 668.9107, 8.6875);
        SetPlayerCameraLookAt(playerid, -1635.8666, 664.9107, 7.1875);
        //-------------------------------------------
        GameTextForPlayer(playerid,"~g~Swats",1000,1);
        Team[playerid] = 2;
    }
    return 1;
}
Reply
#7

Quote:
Originally Posted by Rhayziin
Посмотреть сообщение
pawn Код:
#include <a_samp>

// === Gangs ===
#define TEAM_RICHS 55
#define TEAM_PIMPS 66
#define TEAM_SWATS 77

new Team[MAX_PLAYERS];

main()
{
    print("\n----------------------------------");
    print(" [GM] Teams");
    print("----------------------------------\n");
}

public OnGameModeInit()
{
    SetGameModeText("Teams");
    AddPlayerClassEx(TEAM_RICHS,295,-2665.7739,937.6157,79.7101,180.0000,27,200,31,250,24,80); // Rich Spawn
    AddPlayerClassEx(TEAM_PIMPS,296,-2654.5393,1387.2876,7.1529,270.0000,26,150,29,300,18,5); // Pimps Spawn
    AddPlayerClassEx(TEAM_SWATS,285,-1635.9564,664.8169,7.1875,270.0000,25,300,31,250,29,200); // Swat Spawn
    return 1;
}

public OnPlayerRequestClass(playerid, classid)
{

    if(classid == 0) //Richs
    {
        SetPlayerPos(playerid, -2664.8742, 935.6891, 79.7101);
        SetPlayerInterior(playerid,0);
        SetPlayerFacingAngle(playerid, 357.9516);
        SetPlayerCameraPos(playerid, -2668.3742, 939.6891, 81.2101);
        SetPlayerCameraLookAt(playerid, -2664.8742, 935.6891, 79.7101);
        //-------------------------------------------
        GameTextForPlayer(playerid,"~w~Ricos",1000,1);
        Team[playerid] = 0;
    }
    if(classid == 1) //Pimps
    {
        SetPlayerPos(playerid, -2654.5393, 1387.2875, 7.1529);
        SetPlayerInterior(playerid, 0);
        SetPlayerFacingAngle(playerid, 270.0000);
        SetPlayerCameraPos(playerid, -2658.0393, 1391.2875, 8.6529);
        SetPlayerCameraLookAt(playerid, -2654.5393, 1387.2875, 7.1529);
        //-------------------------------------------
        GameTextForPlayer(playerid,"~r~Cafetoes",1000,1);
        Team[playerid] = 1;
    }
    if(classid == 2) //Swats
    {
        SetPlayerPos(playerid, -1635.8666, 664.9107, 7.1875);
        SetPlayerInterior(playerid, 0);
        SetPlayerFacingAngle(playerid, 177.4210);
        SetPlayerCameraPos(playerid, -1639.3666, 668.9107, 8.6875);
        SetPlayerCameraLookAt(playerid, -1635.8666, 664.9107, 7.1875);
        //-------------------------------------------
        GameTextForPlayer(playerid,"~g~Swats",1000,1);
        Team[playerid] = 2;
    }
    return 1;
}
Ei, leia o Tуpico antes de pastar bobagens...
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)