Message For World

Started by Street Killer, May 16, 2015, 11:04 AM

Previous topic - Next topic

Street Killer

Hello!!

I Make A Msg System For World 2 And It's Working Fine But It's Give Me A Error... :(
He Say --> The Index 'World' Does Not Exist ??

Here Is The System....
function eMessage(text)
{
for( local plr, i = 0; i <= g__WorldLimits[2]; i++ )
{
plr = FindPlayer(i);
if(plr.World==2) //<-- This Line Give Error... :(
{
MessagePlayer(""+text+"",plr);
}
}
}

DizzasTeR

Always check if the 'plr' instance is valid or not, try this:

function eMessage( text )
{
for( local plr, i = 0; i <= g__WorldLimits[2]; i++ )
{
plr = FindPlayer( i );
if( plr && plr.World == 2 ) MessagePlayer("" + text + "", plr );
}
}

Street Killer

@Doom_Killer Thnks Now It's Working Fine... :)