20.04.2009, 18:22
Well 2 players from diferent virtual world can talk , how i can turn this off so only if they are in the same virtual world they can talk.
for(new i =0; i<MAX_PLAYERS; i++)
{
if(GetPlayerVirtualWorld(i) == GetPlayerVirtualWorld[playerid])
{
SendClientMessage(i,COLOR,text);
}
}
Originally Posted by Rk_
pawn Код:
|
public OnPlayerText( playerid, text[] )
{
new
i,
world = GetPlayerVirtualWorld( playerid );
for ( i = 0; i < MAX_PLAYERS; i ++ )
{
if ( i != playerid && GetPlayerVirtualWorld( i ) == world )
{
SendPlayerMessageToPlayer( i, playerid, text );
}
}
return false;
}
Originally Posted by Donny
pawn Код:
|
Originally Posted by Daren_Jacobson
Quote:
|
Originally Posted by Daren_Jacobson
since you only use i inside the loop it would be best to create it at the beggining of the for. 'for(new i...'
|