[Ajuda] Bloqueando x1 e Times
#1

Queria saber como bloquear comandos no x1 e como bloquear times para entra com tanto de score
exemplo: "Para entra no time Prefer precisa ter 500 de score" se alguem me disser alguma informaзгo sobre isso eu ficaria muito grato.

Obrigado pela Atenзгo.
Reply
#2

Use a variavel que armazena os scores do jogador ..

Exemplo:

pawn Код:
//if(GetPlayerScore(playerid) < 500)  ou
if (PlayerInfo[playerid][VariavelScore] < 500)
{
    SendClientMenssage(playerid, -1, "Voce precisa ter 500 de score para entrar nessa time");
    return 0;
}
Reply
#3

Para bloquear times ...

Ta em dialog seu sistema?

Se for em dialog Tente colocar um return ShowPlayerDialog caso o player nгo tive o score ele voltarб para seleзгo novamente..

Exemplo..
pawn Код:
if(GetPlayerScore(playerid) < 200)
    {
            SendClientMessage(playerid, -1, "[Erro] Vocк nгo tem 200 pontos de score");
            return ShowPlayerDialog(playerid,id de sua dialog,DIALOG_STYLE_LIST,"{FF0000}Seleзгo de classes","Soldado\nCabo\nSargento\nTenente\nCapitгo\nMajor\nCoronel\nMarechal","Ok","");
    }

Bloqueando comandos...

pawn Код:
new bool:arena[MAX_PLAYERS];

if(strcmp(cmdtext, "/comando",true ) ==0)
{
    if(arena[playerid] == true)
        return SendClientMessage (playerid ,-1, "Vocк nгo pode usar comandos na arena. Use /sairdm para usar seu comando");
    return true;
}

if(strcmp(cmdtext ,"/sairdm",true) == 0)
{
    arena[playerid] = false;
    SpawnPlayer(playerid);
    return true;
}
Faзa um test e veja se pega

@Abraзos
Reply
#4

й So por um get player score no request axo ke e assim
Reply
#5

Meu sistema de Teams й assim!
pawn Код:
//---------- Topo do GM ----------
new gTeam[MAX_PLAYERS];

#define TEAM_COPS 0
#define TEAM_CIVIS 1
#define TEAM_TERRORIST 2
#define TEAM_OFF 3000

// public OnPlayerSpawn
   
if(gTeam[playerid] == TEAM_COPS)
    {
        if(GetPlayerScore(playerid) >= 250)
        {
        gTeam[playerid] = TEAM_COPS;
        }
        new rand = random(sizeof(gCopPlayerSpawns));
        SetPlayerPos(playerid, gCopPlayerSpawns[rand][0], gCopPlayerSpawns[rand][1], gCopPlayerSpawns[rand][2]); // Warp the player
        SetPlayerInterior(playerid, 0);
        GivePlayerWeapon(playerid,24,500);
        GivePlayerWeapon(playerid,27,200);
        GivePlayerWeapon(playerid,31,1000);
        SetPlayerArmour(playerid, 100.0);
        SetPlayerColor(playerid,BLUE);
    }
    if(gTeam[playerid] == TEAM_CIVIS)
    {
        new rand = random(sizeof(gRandomPlayerSpawns));
        SetPlayerPos(playerid, gRandomPlayerSpawns[rand][0], gRandomPlayerSpawns[rand][1], gRandomPlayerSpawns[rand][2]);
        SetPlayerInterior(playerid, 0);
        GivePlayerWeapon(playerid,22,1000);
        GivePlayerWeapon(playerid,26,100);
        GivePlayerWeapon(playerid,41,100);
        SetPlayerArmour(playerid, 50.0);
        SetPlayerColor(playerid,WHITE);
    }
    if(gTeam[playerid] == TEAM_TERRORIST)
    {
        if(GetPlayerScore(playerid) >= 500)
        {
        gTeam[playerid] = TEAM_TERRORIST;
        }
        new rand = random(sizeof(gRandTerrorist));
        SetPlayerPos(playerid, gRandTerrorist[rand][0], gRandTerrorist[rand][1], gRandTerrorist[rand][2]); // Warp the player
        SetPlayerInterior(playerid, 0);
        GivePlayerWeapon(playerid,24,1000);
                GivePlayerWeapon(playerid,26,500);
                GivePlayerWeapon(playerid,4,1);
        SetPlayerArmour(playerid, 100.0);
        SetPlayerColor(playerid, GREEN);
        SetPlayerTeam(playerid, TEAM_TERRORIST);
    }
    return 1;
}

// public OnPlayerRequestClass(playerid, classid)

    SetupPlayerForClassSelection(playerid);
    if(classid >= 0 && classid <= 16)
    {
        GameTextForPlayer(playerid,"~b~COPS!",5000,6);
        gTeam[playerid] = TEAM_COPS;
    }
    else if(classid >= 17 && classid <= 237)
    {
        gTeam[playerid] = TEAM_CIVIS;
        GameTextForPlayer(playerid,"~w~CIVIS!!",5000,6);
    }
    else if(classid >= 238 && classid <= 241)
    {
        gTeam[playerid] = TEAM_TERRORIST;
        GameTextForPlayer(playerid,"~r~TERRORIST",5000,6);
    }
    return 1;
}

public SetupPlayerForClassSelection(playerid)
{
    SetPlayerInterior(playerid,14);
    SetPlayerPos(playerid,258.4893,-41.4008,1002.0234);
    SetPlayerFacingAngle(playerid, 270.0);
    SetPlayerCameraPos(playerid,256.0815,-43.0475,1004.0234);
    SetPlayerCameraLookAt(playerid,258.4893,-41.4008,1002.0234);
}
Estб ai e a parte dos times alguem pode me dizer o que tem ke fazer para bloquea-los?
Perdгo se floodei!
Reply
#6

pawn Код:
public OnPlayerRequestSpawn(playerid)
{
    if(gTeam[playerid] == TEAM_COPS)
    {
    return Scm(playerid, AZUL, "Vocк nгo tem 250 de Score para entrar neste TEAM!");
        ForceClassSelection(playerid);
        TogglePlayerSpectating(playerid, true);
        TogglePlayerSpectating(playerid, false);
    }
/*     if(gTeam[playerid] == TEAM_CHANGME)
        {
    return Scm(playerid, BRANCO, "Vocк nгo tem 300 de Score para entrar neste TEAM!");
        ForceClassSelection(playerid);
        TogglePlayerSpectating(playerid, true);
        TogglePlayerSpectating(playerid, false);
        }*/

//Vocк pode adicionar mais times que necessita score! Sу por aki igual ao exemplo acima! Mudando o nome dos times claro e o score!
        return 1;
}
Se ajudei + Reputation
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)