SA-MP Forums

Go Back   SA-MP Forums > Non-English > Languages > Portugus/Portuguese

Reply
 
Thread Tools Display Modes
Old 27/03/2014, 06:08 PM   #1
minimessi10
Huge Clucker
 
Join Date: Feb 2013
Posts: 356
Reputation: -5
Default include foreach

Alguem poderia me ajudar como fasso para fazer um Loop com a include foreach para contar o total de player conectados.
minimessi10 is online now   Reply With Quote
Old 27/03/2014, 06:14 PM   #2
Schocc
High-roller
 
Join Date: Mar 2012
Location: /home
Posts: 3,240
Reputation: 378
Default Re: include foreach

pawn Code:
foreach (new i : Player)
{
    printf("%d", i);
}

Tpico do autor.

@off:
No tpico oficial voc encontra toda informao, se estiver usando Mozilla firefox use uma a extenso '****** translate' para selecionar o texto que voc pretende traduzir clicar com o boto direito do mouse, e por fim clicar em traduzir, assim no vai abrir novas abas, a traduo feita na prpria pagina. Sendo assim, quando se trata de cdigos/programao melhor, pois no vai traduzir palavras chaves das linguagens de programao e.g switch/if/else/new etc.
Schocc is offline   Reply With Quote
Old 27/03/2014, 06:17 PM   #3
minimessi10
Huge Clucker
 
Join Date: Feb 2013
Posts: 356
Reputation: -5
Default Re: include foreach

thank's
minimessi10 is online now   Reply With Quote
Old 27/03/2014, 06:17 PM   #4
VeNuZ_
Gangsta
 
VeNuZ_'s Avatar
 
Join Date: Mar 2012
Location: Lisboa, (Portugal)
Posts: 733
Reputation: 40
Default Re: include foreach

Ate te ajudo a nao usar a include foreach kkk' ( nunca a usei )

pawn Code:
new PlayersOnline;
for(new i = 0; i < MAX_PLAYERS; i++)
{
IsPlayerConnected(i)
{
PlayersOnline++;
}
return 1;
}

SendClientMessageToAll(-1, PlayersOnline);
De nada :*
__________________
___
[Include] Rui Almeida Tradutor
(Criado: 08/12/2014)
([Plugin] Rui Almeida Tradutor realizado pelo Willian_Luigi)
___
[FilterScript] Sistema de Nivel
(Criado: 21/03/2014)
___
[FilterScript] Sistema de AFK
(Criado: 23/03/2014)
VeNuZ_ is offline   Reply With Quote
Old 27/03/2014, 06:19 PM   #5
Schocc
High-roller
 
Join Date: Mar 2012
Location: /home
Posts: 3,240
Reputation: 378
Default Re: include foreach

Quote:
Originally Posted by VeNuZ_ View Post
Ate te ajudo a nao usar a include foreach kkk' ( nunca a usei )

pawn Code:
new PlayersOnline;
for(new i = 0; i < MAX_PLAYERS; i++)
{
IsPlayerConnected(i)
{
PlayersOnline++;
}
return 1;
}

SendClientMessageToAll(-1, PlayersOnline);
De nada :*
Precisa formatar isso para usar em uma sada/output.
Schocc is offline   Reply With Quote
Old 27/03/2014, 06:47 PM   #6
VeNuZ_
Gangsta
 
VeNuZ_'s Avatar
 
Join Date: Mar 2012
Location: Lisboa, (Portugal)
Posts: 733
Reputation: 40
Default Re: include foreach

Como assim?
__________________
___
[Include] Rui Almeida Tradutor
(Criado: 08/12/2014)
([Plugin] Rui Almeida Tradutor realizado pelo Willian_Luigi)
___
[FilterScript] Sistema de Nivel
(Criado: 21/03/2014)
___
[FilterScript] Sistema de AFK
(Criado: 23/03/2014)
VeNuZ_ is offline   Reply With Quote
Old 27/03/2014, 07:11 PM   #7
zPain
Gangsta
 
zPain's Avatar
 
Join Date: Sep 2013
Location: Brazil
Posts: 666
Reputation: 183
Default Re: include foreach

Quote:
Originally Posted by VeNuZ_ View Post
Como assim?
Voc est passando uma integer onde deveria estar passando uma string.

pawn Code:
new playersOnline;

for(new i; i < GetMaxPlayers(); ++i)
    if(IsPlayerConnected(i))
        ++playersOnline;

new string[64];
format(string, 32, "Total: %d jogadores conectados.", playersOnline);
SendClientMessageToAll(-1, string);
zPain is offline   Reply With Quote
Old 27/03/2014, 07:22 PM   #8
VeNuZ_
Gangsta
 
VeNuZ_'s Avatar
 
Join Date: Mar 2012
Location: Lisboa, (Portugal)
Posts: 733
Reputation: 40
Default Re: include foreach

Sim mas foi um exemplo eu pessoalmente nao usaria assim, foi para fazer isso rpido, pois estou pelo tlm..
__________________
___
[Include] Rui Almeida Tradutor
(Criado: 08/12/2014)
([Plugin] Rui Almeida Tradutor realizado pelo Willian_Luigi)
___
[FilterScript] Sistema de Nivel
(Criado: 21/03/2014)
___
[FilterScript] Sistema de AFK
(Criado: 23/03/2014)
VeNuZ_ is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Ajuda] Erros Com Include Foreach 4G4M3N0M Portugus/Portuguese 10 11/03/2013 04:05 PM
Erro #include Foreach GustavoPontes Portugus/Portuguese 2 04/02/2013 03:03 AM
[Pedido] Include SII foreach fackbook Portugus/Portuguese 5 16/01/2013 04:25 PM
[AJUDA]Include foreach marcoslucasj Portugus/Portuguese 2 08/05/2012 12:17 AM
[Include] foreach ****** DANGER1979 Русский/Russian 17 24/05/2011 06:04 AM


All times are GMT. The time now is 10:28 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.