SA-MP Forums Archive
[Ajuda] Verificar membros online para executar cmd. - 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] Verificar membros online para executar cmd. (/showthread.php?tid=419139)



Verificar membros online para executar cmd. - ChrisRock - 27.02.2013

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


Re: SendClientMessageToAll Mandando x Players. - Dwayne-Pheonix - 27.02.2013

Mostre o cуdigo para encontrarmos uma soluзгo


Re: SendClientMessageToAll Mandando x Players. - Schocc - 27.02.2013

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;


Re: SendClientMessageToAll Mandando x Players. - ChrisRock - 27.02.2013

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?


Re: Verificar membros online para executar cmd. - Schocc - 27.02.2013

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.


Re: Verificar membros online para executar cmd. - Blix - 27.02.2013

https://sampwiki.blast.hk/wiki/Loops


Re: SendClientMessageToAll Mandando x Players. - HumildadeAgain - 27.02.2013

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!



Re: SendClientMessageToAll Mandando x Players. - Blix - 27.02.2013

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


Re: Verificar membros online para executar cmd. - Schocc - 27.02.2013

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;
}



Re: SendClientMessageToAll Mandando x Players. - ChrisRock - 03.03.2013

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