Hello There, Guest! Login or Register


[INC] One Shot One Kill - Support for multiple players and weapon IDs.
#1
Hello there!

Well, this is my first include, there's not too much I can say. It's a (small) include enabling/disabling Instagib on any weaponid for anyone at any time. I made this because the SA-MP RCON function didn't satisfy me (enabling Instagib on all weapons for everyone) and because I didn't see any good scripts yet.

Important note: This script doesn't use any timers at all, so don't worry about lag.

1. What is Instagib?

It's a modus where your weapon can kill somebody with one shot, instant kill.

2. Features

Functions:
  • Inst::OnPlayerConnect(playerid) - This function has to be used in OnPlayerConnect for the script to function correctly.
  • Inst::OnPlayerKeyStateChange(playerid, newkeys, oldkeys) - This function has to be used in OnPlayerKeyStateChange for the script to function correctly.
  • Inst::OnPlayerSpawn(playerid) - This function has to be used in OnPlayerSpawn for the script to function correctly.
  • SetInstagibForPlayer(playerid, weaponid, bool:Enabled) - This function sets instagib for one player, on one weaponid, use true if you want it enabled, false if you want it disabled.
  • SetInstagibForAll(weaponid, bool:Enabled) - This function sets instagib every connected player, on one weaponid, use true if you want it enabled, false if you want it disabled.
  • GetWeaponInstagib(weaponid) - You can use this function to know wheter a weapon has Instagib or not. returns true if it does. False if it doesn't.
  • GetPlayerInstagib(playerid, weaponid) - You can use this function to know wheter a player has Instagib enabled for a specific weapon or not. returns true if it does. False if it doesn't.

Other functions:
  • IsValidWeapon(weaponid) - Returns true if it's a valid weapon, false if it isn't.
  • IsPlayerAiming(playerid, aimid) - Not my function. Returns true it he's aiming, false if he's not.

Callback:
  • OnPlayerInstagibKill(playerid, killerid, weaponid) - This callback is called when somebody kills another player using a weapon with Instagib enabled.

Video:

Testing my SA-MP Include for Instagib

3. Downloads

v 1.0:

Instagib.inc (Sendspace)
Instagib.inc (Pastebin)
Example Filterscript (.pwn) (Sendspace)
Example Filterscript (.amx) (Sendspace)
Example Filterscript (.pwn) (Pastebin)

v 1.1:

Instagib.inc (Megaupload)
Instagib.inc (Pastebin)
ExampleFS.pwn (Megaupload)
ExampleFS.amx (Megaupload)

v 1.2 Recommended!

Instagib.inc (Megaupload)
Instagib.inc (Pastebin)
ExampleFS.pwn (Megaupload)
ExampleFS.amx (Megaupload)
ExampleFS (Pastebin)


4. How to install?

1. Download Instagib.inc and the Example filterscript (both .pwn and .amx) from one of the links provided above.
2. Place Instagic.inc into Pawno/Include
3. Place ExampleFS.pwn and ExampleFS.amx in the filterscripts folder.
4. Add 'ExampleFS' to your server.cfg.
5. Run the server!

5. Credits

- woot (aka wootcake) - He has helped me A LOT with testing and helped fixing some bugs.
- Lithirm - He has helped me testing everything.
- [TW]deather - He helped me testing as well.
- hittt - Helped me making the video.

6. I try to compile the FS but it says can't read from file Instagib.inc???

There are 2 possible causes.

1. You didn't download the include or didn't put it in the correct folder (Pawno/Include)
2. Close Pawno.exe and try opening the filterscript with the one in the server folder you've put the FS and the include in.

7. Changelog

v 1.0
* Initial release.
v 1.1
* Fixed a small bug with the state of the player.
v 1.2
* Fixed some minor bugs.
* Fixed OnPlayerInstagibKill sometimes being called twice.

8. Last word

Well, I  really hope you enjoy this, and there might be room for improvement, since this is my first include I've ever made. If you find any bugs, please reply here. I'll do my best fixing them.

Have fun with it.

~Matthias
Reply
#2
Updated the first post with the video.
Reply
#3
Good job. :D I'm sure it'll be useful for some people out there. :+
Reply
#4
Thank you! :P

Small update.
Reply
#5
Couldn't you make this when I was making my server?
Reply
#6
(12-19-2009, 08:07 PM)Exquiza link Wrote: Couldn't you make this when I was making my server?
Newp ;p.
Reply
#7
nice idea and good work !
Reply
#8
Thank you!
Reply
#9
Nice work, Matthias!
Reply
#10
Ty :+
Reply