Dude: foreach YSI.
#1

Hello,
I wonder if the execution is good to know if this is what is causing me crash:


pawn Код:
foreach (new i : Player)
{
foreach(new j : Bot)
{
/* code */...
}
}
If the case were that this gives crash, how iteration "Character" would be used in this case ?, because I want to acknowledge on one side the players and on the other NPCs.

Код:
Iterators:

Player - List of all players connected.
Bot - List of all bots (npcs) connected.
NPC - Alias of Bot.
Character - All players and bots.
****** translator.., thanks for viewing.
Reply
#2

Do just this:

PHP код:
foreach (new Character)
{
    if(
IsPlayerNPC(i))
    {
        
//Here it is a NPC
        
continue;
    }
    
//Here it is a Player

Reply
#3

pawn Код:
foreach(Bot,i)
{

}

foreach(Character,i)
{

}

foreach(Player,i)
{

}
Reply
#4

Quote:
Originally Posted by liquor
Посмотреть сообщение
pawn Код:
foreach(Bot,i)
{

}

foreach(Character,i)
{

}

foreach(Player,i)
{

}
New foreach versions now use stuff like new i : Player, i : Player ^that is the old syntax.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)