March 28, 2024, 09:19:11 pm

Author Topic: MaDKiLLeR's Death Match Script v1.0  (Read 5949 times)

0 Members and 1 Guest are viewing this topic.

MaDKilleR

  • Vice Underdog
  • Crazy Man
  • *
  • Posts: 1517
  • Country: ca
  • Hi.
    • View Profile
    • MaDKiLLeR's Site
MaDKiLLeR's Death Match Script v1.0
« 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


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

« Last Edit: April 28, 2012, 10:49:20 am by MaDKilleR »
Agree Disagree Funny Winner Pwnt Informative Friendly Useful Optimistic Artistic Late Brain Donor

- [VU]MaDKiLLeR

Charley

  • Vice Underdog
  • Crazy Man
  • *
  • *
  • Posts: 4749
  • Country: 00
    • View Profile
Re: MaDKiLLeR's Death Match Script v1.0
« Reply #1 on: April 27, 2012, 06:26:18 pm »
Nice one, I'll take a look over it when I get time.
Agree Disagree Funny Winner Pwnt Informative Friendly Useful Optimistic Artistic Late Brain Donor

Writer of excessively long posts


Midiox

  • Crazy Man
  • *****
  • Posts: 459
    • View Profile
Re: MaDKiLLeR's Death Match Script v1.0
« Reply #2 on: April 27, 2012, 07:26:29 pm »
Great script man  :) best of luck  :thumbsup:
« Last Edit: April 29, 2012, 11:04:36 am by mehdi »
Agree Disagree Funny Winner Pwnt Informative Friendly Useful Optimistic Artistic Late Brain Donor


morphine

  • Crazy Man
  • *****
  • Posts: 1908
  • Country: lt
    • View Profile
Re: MaDKiLLeR's Death Match Script v1.0
« Reply #3 on: April 27, 2012, 09:27:47 pm »
Is that browser executable the SQLite browser by any chance?
Agree Disagree Funny Winner Pwnt Informative Friendly Useful Optimistic Artistic Late Brain Donor


Eddy

  • Crazy Man
  • *****
  • Posts: 947
  • Country: do
  • CTF Manager
    • View Profile
Re: MaDKiLLeR's Death Match Script v1.0
« Reply #4 on: April 27, 2012, 11:13:08 pm »
Nice one MaD
Agree Disagree Funny Winner Pwnt Informative Friendly Useful Optimistic Artistic Late Brain Donor


GranDoIz

  • Crazy Man
  • *****
  • Posts: 690
  • Country: mz
  • Palestine Will Be Free (°_°) Freedom
    • View Profile
Re: MaDKiLLeR's Death Match Script v1.0
« Reply #5 on: April 28, 2012, 12:50:43 am »
Agree Disagree Funny Winner Pwnt Informative Friendly Useful Optimistic Artistic Late Brain Donor



Thijn

  • Forum Administrator
  • Crazy Man
  • *
  • *
  • *
  • Posts: 2946
  • Country: nl
    • View Profile
Re: MaDKiLLeR's Death Match Script v1.0
« Reply #7 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.
Agree Disagree Funny Winner Pwnt Informative Friendly Useful Optimistic Artistic Late Brain Donor

I'm not totally useless,
I can be used as an bad example ;)

"Never do Today, What you can do Tomorrow"


Charley

  • Vice Underdog
  • Crazy Man
  • *
  • *
  • Posts: 4749
  • Country: 00
    • View Profile
Re: MaDKiLLeR's Death Match Script v1.0
« Reply #8 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.
Agree Disagree Funny Winner Pwnt Informative Friendly Useful Optimistic Artistic Late Brain Donor

Writer of excessively long posts


MaDKilleR

  • Vice Underdog
  • Crazy Man
  • *
  • Posts: 1517
  • Country: ca
  • Hi.
    • View Profile
    • MaDKiLLeR's Site
Re: MaDKiLLeR's Death Match Script v1.0
« Reply #9 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.  :)
Agree Disagree Funny Winner Pwnt Informative Friendly Useful Optimistic Artistic Late Brain Donor

- [VU]MaDKiLLeR

Charley

  • Vice Underdog
  • Crazy Man
  • *
  • *
  • Posts: 4749
  • Country: 00
    • View Profile
Re: MaDKiLLeR's Death Match Script v1.0
« Reply #10 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.
Agree Disagree Funny Winner Pwnt Informative Friendly Useful Optimistic Artistic Late Brain Donor

Writer of excessively long posts


VercettiS

  • Regular
  • ***
  • Posts: 64
    • View Profile
Agree Disagree Funny Winner Pwnt Informative Friendly Useful Optimistic Artistic Late Brain Donor

Quote
<xCow>: ** [3]  [MKt]DeViL_JiN: i Dont care if 10 players aim on me there m60
<xCow>: ** [3]  [MKt]DeViL_JiN: i only care ABout Nilz
<xCow>: ** [MK]Nilz killed [MKt]DeViL_JiN (Stubby) (Torso) (8.4m)
<xCow>: ** [3]  [MKt]DeViL_JiN: shit


Blurry

  • Fanatic
  • ****
  • Posts: 126
  • Country: in
    • View Profile
Re: MaDKiLLeR's Death Match Script v1.0
« Reply #13 on: June 27, 2012, 05:16:19 pm »
Agree Disagree Funny Winner Pwnt Informative Friendly Useful Optimistic Artistic Late Brain Donor




[Sb]Hunter

  • Newbie
  • *
  • Posts: 8
  • Country: pk
    • View Profile
Re: MaDKiLLeR's Death Match Script v1.0
« Reply #14 on: March 24, 2021, 10:48:04 am »
Your provided link is not working pls updated this link
Funny Funny x 5 (list)
Agree Disagree Funny Winner Pwnt Informative Friendly Useful Optimistic Artistic Late Brain Donor