Your code styling is inconsistent and looks terrible. Please do the following:
Quote:
Originally Posted by fowlplay4
How to style your script properly with jsbeautifer.org
Copy-paste your code into the code text area.
Settings:
- Indent with 2 spaces
- Braces with control statement
- Un-check all Checkboxes
Click 'Beautify'
|
Things that caught my eye:
setTimer(.005, 1); - setTimer(float): The minimum value is 0.05, and it's only one parameter. Use this.scheduleevent() if you need to pass parameters to the looping event.
PHP Code:
function getItems()
{
for (clientr.weps : temp.weps)
{
return temp.weps; // only returns the first weapon.
}
}
I would guess you were aiming to do the following:
PHP Code:
function getItems() {
return clientr.weps; // returns an array of weapons.
}
You also have numerous amounts of active debugging code, and other logic errors. Like the fact you're sending multiple triggers in one block of code for next to no reason, and calling useItem where it doesn't exist and attempting to access the DB on the client-side.
Quote:
Originally Posted by xAndrewx
I'll make it bold for the people that replied above
|
That doesn't make it okay.
The code gallery shouldn't become a repository of poorly written broken scripts. Code reviews can take place outside the forums without issue but to me this sub-forum should be for proper working scripts which developers can take, use, and learn from without issue.