Advertisement
Biesmen

Untitled

May 5th, 2012
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.34 KB | None | 0 0
  1. //==============================================================================
  2. #define FILTESRCRIPT
  3. #define NAILEDBAT_SLOT  (06)
  4. #define USE_ZCMD        true
  5. #define ON_MSG          "INFO: Your bat will now have nails attached."
  6. #define OFF_MSG         "INFO: You've hidden the nails from your bat."
  7.  
  8. #include a_samp
  9. #if USE_ZCMD == true
  10.     #tryinclude zcmd
  11. #endif
  12. #if !defined _zcmd_included && USE_ZCMD == true
  13.     #error zcmd.inc by zeex was not located.
  14. #endif
  15.  
  16. forward GivePlayerWeaponEx(playerid, weaponid, ammo);
  17. forward SetItem(playerid);
  18.  
  19. public GivePlayerWeaponEx(playerid, weaponid, ammo)
  20. {
  21.     if(weaponid == WEAPON_BAT)
  22.     {
  23.         SetTimerEx("SetItem", 500, false, "i", playerid);
  24.     {
  25.     return GivePlayerWeapon(playerid, weaponid, ammo);
  26. }
  27. #define GivePlayerWeapon GivePlayerWeaponEx
  28.  
  29. public SetItem(playerid)
  30. {
  31.     if( !IsPlayerAttachedObjectSlotUsed( playerid, NAILEDBAT_SLOT ) )
  32.                     SetPlayerAttachedObject( playerid, NAILEDBAT_SLOT, 2045, 6, 0.051999, 0.012000, 0.229000, 94.099998, -4.900009, -0.900002, 2.211000, 1.263000, 2.211999 )
  33.     return 1;
  34. }
  35.  
  36. #if USE_ZCMD == true
  37. CMD:nailedbat( playerid, params[] )
  38. {
  39.     switch( GetPVarInt( playerid, "pUseBat" ) )
  40.     {
  41.         case 0:
  42.         {
  43.             SetPVarInt( playerid, "pUseBat", 1 );
  44.             SendClientMessage( playerid, -1, ON_MSG );
  45.         }
  46.         default:
  47.         {
  48.             SetPVarInt( playerid, "pUseBat", 0 );
  49.             SendClientMessage( playerid, -1, OFF_MSG );
  50.             if( IsPlayerAttachedObjectSlotUsed( playerid, NAILEDBAT_SLOT ) )
  51.                 RemovePlayerAttachedObject( playerid, NAILEDBAT_SLOT );
  52.         }
  53.     }
  54.     return 1;
  55. }
  56. #endif
  57. #if USE_ZCMD == false
  58. public OnPlayerCommandText( playerid, cmdtext[] )
  59. {
  60.     if( !strcmp( cmdtext, "/nailedbat" ) )
  61.     {
  62.         switch( GetPVarInt( playerid, "pUseBat" ) )
  63.         {
  64.             case 0:
  65.             {
  66.                 SetPVarInt( playerid, "pUseBat", 1 );
  67.                 SendClientMessage( playerid, -1, ON_MSG );
  68.             }
  69.             default:
  70.             {
  71.                 SetPVarInt( playerid, "pUseBat", 0 );
  72.                 SendClientMessage( playerid, -1, OFF_MSG );
  73.                 if( IsPlayerAttachedObjectSlotUsed( playerid, NAILEDBAT_SLOT ) )
  74.                     RemovePlayerAttachedObject( playerid, NAILEDBAT_SLOT );
  75.             }
  76.         }
  77.     }
  78. }
  79. #endif
  80.  
  81. // <[ End Of File ]> //
  82. //==============================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement