
10-13-2008, 01:07 AM
|
|
Registered User
|
Join Date: Oct 2003
Posts: 2,712
|
|
|
Consecutive if statements without using else if is improper programming. Although it works fine in GScript, if you tried programming like that in other languages, the compiler would report errors.
Also, to help prevent possible glitching, you should take the absolute value of the donated amount and then run your checks from there. I see that you do have a > 0 check, but you don't have any else statements in the code which makes it not-so user friendly when it comes to the script reporting proper syntax for players that use the donate command improperly.
For the withdraw bit, you should create an array where you can simply add accounts to the array granting permission to withdrawing from the safe. For convenience, adding and removing of accounts into the array should be able to be handled from client to prevent the inconvenience of loading the script and editing it each time you wish to give or take the right to withdraw from the safe from someone.
For the actual donating, there should be a verifying option that tells the user how much they are going to donate and asks them if they wish to donate that amount. This is to prevent people from donating an amount that they didn't want to. Perhaps you should also do the same for the withdrawing bit to prevent someone from withdrawing too much or so.
And there should also be a cooldown system for withdrawing to prevent someone from glitching it to where they take money from the chest without the chest actually losing money. The same should be done for donating to prevent adding money to the chest while not removing the money from the player.
Just some things I noticed at a quick glance. |
Last edited by Gambet; 10-13-2008 at 01:44 AM..
|
|
|