[Include] [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


Messages In This Thread
[INC] One Shot One Kill - Support for multiple players and weapon IDs. - by GTA_Rules - 17.12.2009, 00:05
Re: [INC] Instagib (no timers!) - Support for multiple players and weapon IDs. - by lolumadd - 17.12.2009, 01:20
Re: [INC] Instagib (no timers!) - Support for multiple players and weapon IDs. - by Marshew_DD - 17.12.2009, 01:37
Re: [INC] Instagib (no timers!) - Support for multiple players and weapon IDs. - by GTA_Rules - 17.12.2009, 05:26
Re: [INC] Instagib (no timers!) - Support for multiple players and weapon IDs. - by GTA_Rules - 17.12.2009, 11:27
Re: [INC] Instagib (no timers!) - Support for multiple players and weapon IDs. - by Retardedwolf - 17.12.2009, 11:34
Re: [INC] Instagib (no timers!) - Support for multiple players and weapon IDs. - by woot - 17.12.2009, 11:49
Re: [INC] Instagib (no timers!) - Support for multiple players and weapon IDs. - by GTA_Rules - 17.12.2009, 12:34
Re: [INC] Instagib (no timers!) - Support for multiple players and weapon IDs. - by GTA_Rules - 17.12.2009, 14:31
Re: [INC] Instagib (no timers!) - Support for multiple players and weapon IDs. - by Scream[SM] - 18.12.2009, 16:59
Re: [INC] Instagib (no timers!) - Support for multiple players and weapon IDs. - by GTA_Rules - 18.12.2009, 17:03
Re: [INC] One Shot One Kill - Support for multiple players and weapon IDs. - by Retardedwolf - 18.12.2009, 23:03
Re: [INC] One Shot One Kill - Support for multiple players and weapon IDs. - by Tyain - 19.12.2009, 01:37
Re: [INC] One Shot One Kill - Support for multiple players and weapon IDs. - by Lynn09© - 19.12.2009, 01:44
Re: [INC] One Shot One Kill - Support for multiple players and weapon IDs. - by GTA_Rules - 19.12.2009, 06:01
Re: [INC] One Shot One Kill - Support for multiple players and weapon IDs. - by Kyeno - 19.12.2009, 12:50
Re: [INC] One Shot One Kill - Support for multiple players and weapon IDs. - by SpanishMan - 19.12.2009, 12:53
Re: [INC] One Shot One Kill - Support for multiple players and weapon IDs. - by GTA_Rules - 19.12.2009, 13:04
Re: [INC] One Shot One Kill - Support for multiple players and weapon IDs. - by Tyain - 19.12.2009, 15:11
Re: [INC] One Shot One Kill - Support for multiple players and weapon IDs. - by GTA_Rules - 19.12.2009, 15:17
Re: [INC] One Shot One Kill - Support for multiple players and weapon IDs. - by Tyain - 19.12.2009, 15:47
Re: [INC] One Shot One Kill - Support for multiple players and weapon IDs. - by Marcel - 19.12.2009, 16:03
Re: [INC] One Shot One Kill - Support for multiple players and weapon IDs. - by GTA_Rules - 19.12.2009, 16:35
Re: [INC] One Shot One Kill - Support for multiple players and weapon IDs. - by Retardedwolf - 19.12.2009, 21:39
Re: [INC] One Shot One Kill - Support for multiple players and weapon IDs. - by GTA_Rules - 21.12.2009, 14:55
Re: [INC] One Shot One Kill - Support for multiple players and weapon IDs. - by [TG]Chase - 22.12.2009, 03:04
Re: [INC] One Shot One Kill - Support for multiple players and weapon IDs. - by GTA_Rules - 22.12.2009, 07:02
Re: [INC] One Shot One Kill - Support for multiple players and weapon IDs. - by Marcel - 23.12.2009, 08:12
Re: [INC] One Shot One Kill - Support for multiple players and weapon IDs. - by SlashPT - 23.12.2009, 12:23
Re: [INC] One Shot One Kill - Support for multiple players and weapon IDs. - by pspleo - 23.12.2009, 18:44
Re: [INC] One Shot One Kill - Support for multiple players and weapon IDs. - by .:HustLeR:. - 20.03.2010, 19:35
Re: [INC] One Shot One Kill - Support for multiple players and weapon IDs. - by [MWR]Blood - 20.03.2010, 19:39
Re: [INC] One Shot One Kill - Support for multiple players and weapon IDs. - by .:HustLeR:. - 21.03.2010, 00:49
Re: [INC] One Shot One Kill - Support for multiple players and weapon IDs. - by GTA_Rules - 21.03.2010, 08:43
Re: [INC] One Shot One Kill - Support for multiple players and weapon IDs. - by .:HustLeR:. - 22.03.2010, 00:54
Re: [INC] One Shot One Kill - Support for multiple players and weapon IDs. - by IDownload - 22.03.2010, 04:39
Re: [INC] One Shot One Kill - Support for multiple players and weapon IDs. - by GTA_Rules - 22.03.2010, 06:13
Re: [INC] One Shot One Kill - Support for multiple players and weapon IDs. - by Bleach1 - 25.04.2010, 15:01
Re: [INC] One Shot One Kill - Support for multiple players and weapon IDs. - by GTA_Rules - 25.04.2010, 17:47

Forum Jump:


Users browsing this thread: 8 Guest(s)