Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: Xmair on Oct 15, 2015, 12:24 PM

Title: idx out of range
Post by: Xmair on Oct 15, 2015, 12:24 PM
Hey guys, I'm getting an error since I'm new to the playerson array thing I don't know much about it.
Here's the error "idx out of range" this error comes on line 332 when there is only 1 player and the player leaves.
That's what I use on line 332 : playerson.Remove(player.ID)
Any help will be appreciated.
Title: Re: idx out of range
Post by: KAKAN on Oct 15, 2015, 12:30 PM
You have to see if the playerson is null or not. I use that playerson too.
Use this;-
if(playerson.find(player.ID)!=null ) playerson.remove(player.ID);If you use player.Name, you just need to change the ID to Name
Title: Re: idx out of range
Post by: Xmair on Oct 15, 2015, 02:21 PM
Works, Thanks.