Vice Underdogs

Scripting => Script Showroom => Topic started by: MaDKilleR on April 27, 2012, 06:07:44 pm

Title: MaDKiLLeR's Death Match Script v1.0
Post by: MaDKilleR on April 27, 2012, 06:07:44 pm
MaDKiLLeR's DM Script v1.0

As you can see, i'm horrible at naming scripts. Anyways, i bring my little project on which i worked the last week. MDM SQ v1.0 by me. I've written the Script from scratch. The Script uses a SQL Database to store Data. I've tried my best to keep the use of Queries as much low as i can to avoid lag.

Author: [VU_T]MaDKiLLeR
Credits: [VU]Stormeus ( STORM256 encryption ), [Ka]Force.

Commands:

/c register, /c login, /c stats, /c hp, /c armour, /c loc, /c script, /c forum, /c goto, /c heal, /c fix, /c gotoloc, /c saveloc, /c nogoto, /c server, /c admins, /c spree, /c level, /c cash.

Property Commands:

/c buyprop, /c sellprop, /c delshareprop, /c shareprop, /c home, /c myprops, /c myshareprops

Vehicle Commands:

/c mycars, /c mysharecars, /c sharecar, /c delsharecar, /c buycar, /c sellcar, /c getcar

Admin Commands:

/c ann, kick, kill, drown, mute, unmute, get, ip, freeze, unfreeze, getip, ban, addprop

Download:

Download (http://madkiller.comze.com/Files/MDM-SQ.rar)


Note: Please let me know if you found some bugs and, don't forget to suggest me to for improving this  :)

Title: Re: MaDKiLLeR's Death Match Script v1.0
Post by: Charley on April 27, 2012, 06:26:18 pm
Nice one, I'll take a look over it when I get time.
Title: Re: MaDKiLLeR's Death Match Script v1.0
Post by: Midiox on April 27, 2012, 07:26:29 pm
Great script man  :) best of luck  :thumbsup:
Title: Re: MaDKiLLeR's Death Match Script v1.0
Post by: morphine on April 27, 2012, 09:27:47 pm
Is that browser executable the SQLite browser by any chance?
Title: Re: MaDKiLLeR's Death Match Script v1.0
Post by: Eddy on April 27, 2012, 11:13:08 pm
Nice one MaD
Title: Re: MaDKiLLeR's Death Match Script v1.0
Post by: GranDoIz on April 28, 2012, 12:50:43 am
Nice one MaD
Title: Re: MaDKiLLeR's Death Match Script v1.0
Post by: Nadeem on April 28, 2012, 01:57:08 am
Nice one MaD
Title: Re: MaDKiLLeR's Death Match Script v1.0
Post by: Thijn on April 28, 2012, 12:31:27 pm
I though you said you tried to keep queries low. But this is yet another script that uses them too often.
For the cars and props, you can just read them into an class or array and access them from there.

Something far more worse though: Timers. You're using them everywhere....

I've seen worse scripts, but I've also seen better ones.
Title: Re: MaDKiLLeR's Death Match Script v1.0
Post by: Charley on April 28, 2012, 01:01:07 pm
I didn't really see a problem with timers, in fact there are only 7 in the entire script and only 2 of which will be used regularly. The on onPlayerJoin is justifiable, it's a necessary part of most scripts otherwise in a full server people will miss any messages given to them when they join. The one onPlayerEnterVehicle can go.

But yeah, the use of SQLite is way way too high, there are 57 queries in the script, you can probably minimise it to about 10.

As Thijn said, cars and props should be in array entries.

Other than that though, it is a very good effort at making a script. You're really getting better and you're almost there.

One other small thing I noticed, your DecCash and IncCash functions can be simplified by using the -= and += operators. Also, you use player.ID a lot. It's better to assign it into a separate variable like 'id' so that you don't keep calling player.ID. It's just a simple bit of optimisation.

Another thing I've just noticed is saving data. You need to save player data periodically while they're in the server, in case it crashes. If someone's been playing in your server for 2 hours and the server crashes, they lose everything as there won't be an onPlayerPart signal.
Title: Re: MaDKiLLeR's Death Match Script v1.0
Post by: MaDKilleR on April 28, 2012, 01:25:58 pm
I didn't really see a problem with timers, in fact there are only 7 in the entire script and only 2 of which will be used regularly. The on onPlayerJoin is justifiable, it's a necessary part of most scripts otherwise in a full server people will miss any messages given to them when they join. The one onPlayerEnterVehicle can go.

But yeah, the use of SQLite is way way too high, there are 57 queries in the script, you can probably minimise it to about 10.

As Thijn said, cars and props should be in array entries.

Other than that though, it is a very good effort at making a script. You're really getting better and you're almost there.

One other small thing I noticed, your DecCash and IncCash functions can be simplified by using the -= and += operators. Also, you use player.ID a lot. It's better to assign it into a separate variable like 'id' so that you don't keep calling player.ID. It's just a simple bit of optimisation.

Another thing I've just noticed is saving data. You need to save player data periodically while they're in the server, in case it crashes. If someone's been playing in your server for 2 hours and the server crashes, they lose everything as there won't be an onPlayerPart signal.

About the Cars & Props, i'll use arrays for them & will update this as soon as possible.  :)
Title: Re: MaDKiLLeR's Death Match Script v1.0
Post by: Charley on April 28, 2012, 02:14:13 pm
Also, you need to free your queries after you've used them using FreeSQLQuery(query), otherwise you'll get a memory leak.
Title: Re: MaDKiLLeR's Death Match Script v1.0
Post by: VercettiS on April 29, 2012, 07:58:24 am
Nice one MaD
;D
Title: Re: MaDKiLLeR's Death Match Script v1.0
Post by: Rathan on May 27, 2012, 01:00:38 pm
Nice one MaD
;D
Title: Re: MaDKiLLeR's Death Match Script v1.0
Post by: Blurry on June 27, 2012, 05:16:19 pm
Nice one MaD
Title: Re: MaDKiLLeR's Death Match Script v1.0
Post by: [Sb]Hunter on March 24, 2021, 10:48:04 am
Your provided link is not working pls updated this link
Title: Re: MaDKiLLeR's Death Match Script v1.0
Post by: MaDKilleR on September 23, 2022, 03:28:55 am
Your provided link is not working pls updated this link

no