PHP Code:
for (wep : this.staff_weps) { if (player.clientr.isStaff) player.addweapon(wep); }
|
Don't ever do that. It's -really- important to assign
wep as a temporary variable, right now it's not. It's also very important to name your variables logically instead of taking shortcuts in order to get the names as short as possible. You'll thank me for that last piece of advice in a year or two when you go back and look at your old code.
There's little to no reason to keep the weapon list stored in a permanent array, so I'd change that too to a temporary one.
I also hate that styling, but then again it comes down to personal preference in this case.
Correct way, with my personal touch to it:
PHP Code:
temp.listOfStaffWeapons = {
"Weapon1",
"Weapon2",
"Weapon3"
}
for (temp.weaponName: temp.listOfStaffWeapons) {
if (player.clientr.isStaff)
player.addWeapon(temp.weaponName);
}
I don't like indenting my code. Tried it in PHP, didn't make a difference to me. But I'll try from now on 
|
Good luck getting anywhere on Graal as a programmer without using proper indenting and styling.