idx out of range

Started by Xmair, Oct 15, 2015, 12:24 PM

Previous topic - Next topic

Xmair

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.

Credits to Boystang!

VU Full Member | VCDC 6 Coordinator & Scripter | EG A/D Contributor | Developer of VCCNR | Developer of KTB | Ex-Scripter of EAD

KAKAN

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
oh no

Xmair


Credits to Boystang!

VU Full Member | VCDC 6 Coordinator & Scripter | EG A/D Contributor | Developer of VCCNR | Developer of KTB | Ex-Scripter of EAD