Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: Street Killer on May 16, 2015, 11:04 AM

Title: Message For World
Post by: Street Killer on May 16, 2015, 11:04 AM
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);
}
}
}
Title: Re: Message For World
Post by: DizzasTeR on May 16, 2015, 11:57 AM
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 );
}
}
Title: Re: Message For World
Post by: Street Killer on May 16, 2015, 12:10 PM
@Doom_Killer Thnks Now It's Working Fine... :)