![]() |
Nested for() functions duplicating output
Alright, the problem I am having is with a GUI control, I want to add a filtered list of the player's weapons.
The below code doesnt filter the desired content (and yes, there is an array defined already called this.bannedNPCs) flip the for() loops around, and it filters nothing, but duplicates the output a couple times for example: -wep, -wep, -wep, -wep, -anotherwep, and so on PHP Code:
Thanks! |
Hmm, I don't like the loop your doing.. hmm
PHP Code:
|
aha, a great alternative, thanks Chompy :D
Now how would I alter that code to accomodate prefixes? Instead of having to go through and type in every weapon that isnt allowed (and there are a lot of them), just typing in a prefix, say *, or -, and filtering out all weapons who's names begin with that prefix I've tried: a loop through the array, and then doing temp.wep.name.starts(temp.ban), no avail using a substring(0, #).trim(), no avail |
PHP Code:
|
Quote:
|
PHP Code:
|
Great! works perfectly. Thanks!
|
| All times are GMT +2. The time now is 06:59 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.