Advertisement
Guest User

Advanced Healing Mode

a guest
Jul 14th, 2012
320
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.86 KB | None | 0 0
  1. #define FILTERSCRIPT
  2.  
  3. #define PRESSED(%0) \
  4.     (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
  5.  
  6. #include <a_samp>
  7. #include playershoot
  8.  
  9. new Text:textheal;
  10.  
  11. #if defined FILTERSCRIPT
  12.  
  13. public OnFilterScriptInit()
  14. {
  15.     print("\n--------------------------------------");
  16.     print("ADVANCED HEALING SYSTEM : OWNER: PREDA");
  17.     print("--------------------------------------\n");
  18.    
  19.     textheal = TextDrawCreate(8.000000, 323.000000, "HEALED");
  20.     TextDrawBackgroundColor(textheal, 16711935);
  21.     TextDrawFont(textheal, 1);
  22.     TextDrawLetterSize(textheal, 0.340000, 1.400000);
  23.     TextDrawColor(textheal, 65535);
  24.     TextDrawSetOutline(textheal, 1);
  25.     TextDrawSetProportional(textheal, 1);
  26.     return 1;
  27. }
  28. #else
  29.  
  30. #endif
  31.  
  32. public OnPlayerConnect(playerid)
  33. {
  34.     return 1;
  35. }
  36.  
  37. public OnPlayerShootPlayer(shootid, playerid, Float:health, wep)
  38. {
  39.     new gun = GetPlayerWeapon(shootid);
  40.     if(gun == 41)
  41.     {
  42.         SetPlayerHealth(playerid, 100);
  43.         TextDrawShowForPlayer(playerid, Text:textheal);
  44.         SetTimer("healthtextdraw", 5000, false);
  45.         GivePlayerMoney(shootid, 100);
  46.         GivePlayerMoney(playerid, -100);
  47.         new
  48.              g_szString [ 256 ],
  49.              pName      [  24 ];
  50.  
  51.         GetPlayerName(playerid, pName, sizeof ( pName ) );
  52.         format( g_szString, sizeof ( g_szString ), "You Healed %s and recivied 100 $ ! ", pName );
  53.         SendClientMessage(shootid, 0x90EE90FF, g_szString );
  54.  
  55.         GetPlayerName(shootid, pName, sizeof ( pName ) );
  56.         format( g_szString, sizeof ( g_szString ), "You got healed by %s for 100 $  ! ", pName );
  57.         SendClientMessage(playerid, 0x90EE90FF, g_szString );
  58.     }
  59.     return true;
  60. }
  61.  
  62. forward healthtextdraw(playerid);
  63. public healthtextdraw(playerid)
  64. {
  65.     TextDrawHideForPlayer(playerid, Text:textheal);
  66.  
  67.     return 1;
  68. }
  69.  
  70. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  71. {
  72.     if(PRESSED(KEY_NO))
  73.     {
  74.         GivePlayerWeapon(playerid, 41, 9999);
  75.  
  76.     }
  77.     return 1;
  78. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement