Guest User

Matthias

a guest
Feb 17th, 2010
789
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.92 KB | None | 0 0
  1. /*******************************************************************************
  2. *                   [INC] Instagib include by Matthias                         *
  3. ********************************************************************************
  4. *                                                                              *
  5. *   This is an example filterscript of my include, you can edit it all you     *
  6. *   want, I wrote it in 5 minutes so I don't really care. I hope you enjoy     *
  7. *   the include and the filterscript!                                          *
  8. *                                                                              *
  9. *   Author: Matthias                                                           *
  10. *   Email: [email protected]                                       *
  11. *                                                                              *
  12. *******************************************************************************/
  13. #include <a_samp>
  14. #include <Instagib>
  15.  
  16. #define COLOR_YELLOW 0xFFFF00AA
  17. #define COLOR_GREEN 0x33AA33AA
  18.  
  19. public OnFilterScriptInit()
  20. {
  21.     SetInstagibForAll(31, true); // This will make sure everyone can kill anyone with one shot of an M4.
  22.  
  23.     print("\n=============================================================");
  24.     print(" Example filterscript of Matthias` Instagib include loaded.");
  25.     print("==============================================================\n");
  26.     return 1;
  27. }
  28.  
  29. public OnFilterScriptExit()
  30. {
  31.     print("\n===============================================================");
  32.     print(" Example filterscript of Matthias` Instagib include unloaded.");
  33.     print("================================================================\n");
  34.     return 1;
  35. }
  36.  
  37. public OnPlayerConnect(playerid)
  38. {
  39.     Inst::OnPlayerConnect(playerid); // This is needed in OnPlayerConnect for the script to function correctly.
  40.     return 1;
  41. }
  42.  
  43. public OnPlayerSpawn(playerid)
  44. {
  45.     Inst::OnPlayerSpawn(playerid); // This function is needed in OnPlayerSpawn for the script to function correctly.
  46.     SetInstagibForPlayer(playerid, 34, true); // This player will be able to kill anyone with one shot of a sniper.
  47.    
  48.     // Give him the weapons.. otherwise he won't be able to kill.
  49.     GivePlayerWeapon(playerid, 31, 999);
  50.     GivePlayerWeapon(playerid, 34, 999);
  51.     return 1;
  52. }
  53.  
  54. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  55. {
  56.     // This function is needed in the OnPlayerKeyStateChange callback for the script to function correctly.
  57.     Inst::OnPlayerKeyStateChange(playerid, newkeys, oldkeys);
  58.     return 1;
  59. }
  60.  
  61. public OnPlayerInstagibKill(playerid, killerid, weaponid)
  62. {
  63.     // If somebody kills somebody else with an Instagib kill, we reward him and send everyone a message!
  64.     new szString[128], pName[24], kName[24];
  65.     GetPlayerName(playerid, pName, sizeof(pName));
  66.     GetPlayerName(killerid, kName, sizeof(kName));
  67.     format(szString, sizeof(szString), "* %s has managed to kill %s with one shot of a gun with the weapon ID: %d.", kName, pName, weaponid);
  68.     SendClientMessageToAll(COLOR_YELLOW, szString);
  69.     GivePlayerMoney(killerid, 1337);
  70.     return 1;
  71. }
  72.  
Advertisement
Add Comment
Please, Sign In to add comment