[Ajuda] Verificar membros online para executar cmd.
#1

como faзo pra verificar se a org X tem X players online pra conseguir executar um comando?
Reply
#2

Mostre o cуdigo para encontrarmos uma soluзгo
Reply
#3

Regras: PESQUISAR antes de perguntar, a maioria das questхes jб foram respondidas!


Ou seja tenha certeza que nгo consigua resolver para criar o topico; e nгo acontecer isso;
Reply
#4

ta mano
mas ja que ja criei me ajuda nisso aqui
como faзo pra verificar se a org X tem X players online pra conseguir executar um comando?
Reply
#5

Use um loop for

Retornando o valor da variavel x da determinada Org
Exemplo bY SchocC:
pawn Код:
enum e_dat
{
    e_orgid
};
new pinfo[ 10 ][ e_dat ];
forward GetTotalOrg(playerid ,orgid );
public GetTotalOrg( playerid, orgid )
{
    for(new i; i != /*MAX_ORG*/40; ++i )
    if( pinfo[ i ][ e_orgid ] == pinfo[ playerid ][ e_orgid ] )
    {
        return orgid ;
    }
    return false;
}


This forum requires that you wait 120 seconds between posts. Please try again in 81 seconds.
Reply
#6

https://sampwiki.blast.hk/wiki/Loops
Reply
#7

Quote:
Originally Posted by ChrisRock
Посмотреть сообщение
ta mano
mas ja que ja criei me ajuda nisso aqui
como faзo pra verificar se a org X tem X players online pra conseguir executar um comando?
A tag correta seria pedido nгo ajuda...

Quote:
Originally Posted by LuxurioN™
• PESQUISAR antes de perguntar, a maioria das questхes jб foram respondidas!
Reply
#8

Quote:
Originally Posted by HumildadeAgain
Посмотреть сообщение
A tag correta seria pedido nгo ajuda...
http://forum.sa-mp.com/search.php?searchid=6010406
Reply
#9

Eu nгo testei nada. Mais usando a funзгo que criei fica dessa forma;


Um exemplo. Lembrando que pode ser feito A mesma tecnica com Defines !

pawn Код:
By: SchocC Scripter
forward GetTotalOrg(playerid ,orgid );

enum e_dat
{
    e_orgid
};

new pinfo[ 10 ][ e_dat ];


public GetTotalOrg( playerid, orgid )
{
    for(new i; i != MAX_PLAYERS; ++i )
    if( pinfo[ i ][ e_orgid ] == pinfo[ playerid ][ e_orgid ] )
    {
        return orgid ;
    }
    return false;
}




//      Usando em OnPlayerCommandText
public OnPlayerCommandText( playerid,  cmdtext[] )
{

    if( GetTotalOrg( playerid, orgid ) >= TANDO_DE_PLAYERS )
    {
        //Cуdigos Se tal org tem tanto X de players
        return true;
    }

    return 0;
}


//      Usando em ZCMD
CMD:mandarorgpratdm( playerid )
{
    if( GetTotalOrg( playerid, orgid ) >= TANDO_DE_PLAYERS )
    {
        //Codigos Se a org X tem tanto X de players
        return true;
    }
    else {
        //Caso nгo tenha X Players
    }
    return true;
}
Reply
#10

Quote:
Originally Posted by HumildadeAgain
Посмотреть сообщение
A tag correta seria pedido nгo ajuda...
nгo estava pedindo o sistema pronto, tava pedindo ajuda..

Quote:
Originally Posted by Schocc
Посмотреть сообщение
Eu nгo testei nada. Mais usando a funзгo que criei fica dessa forma;


Um exemplo. Lembrando que pode ser feito A mesma tecnica com Defines !

pawn Код:
By: SchocC Scripter
forward GetTotalOrg(playerid ,orgid );

enum e_dat
{
    e_orgid
};

new pinfo[ 10 ][ e_dat ];


public GetTotalOrg( playerid, orgid )
{
    for(new i; i != MAX_PLAYERS; ++i )
    if( pinfo[ i ][ e_orgid ] == pinfo[ playerid ][ e_orgid ] )
    {
        return orgid ;
    }
    return false;
}




//      Usando em OnPlayerCommandText
public OnPlayerCommandText( playerid,  cmdtext[] )
{

    if( GetTotalOrg( playerid, orgid ) >= TANDO_DE_PLAYERS )
    {
        //Cуdigos Se tal org tem tanto X de players
        return true;
    }

    return 0;
}


//      Usando em ZCMD
CMD:mandarorgpratdm( playerid )
{
    if( GetTotalOrg( playerid, orgid ) >= TANDO_DE_PLAYERS )
    {
        //Codigos Se a org X tem tanto X de players
        return true;
    }
    else {
        //Caso nгo tenha X Players
    }
    return true;
}
vlw manow, eu jб consegui mas vlw por ter tentado ajudar ao inves de me criticar s2
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)