Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //==============================================================================
- #define FILTESRCRIPT
- #define NAILEDBAT_SLOT (06)
- #define USE_ZCMD true
- #define ON_MSG "INFO: Your bat will now have nails attached."
- #define OFF_MSG "INFO: You've hidden the nails from your bat."
- #include a_samp
- #if USE_ZCMD == true
- #tryinclude zcmd
- #endif
- #if !defined _zcmd_included && USE_ZCMD == true
- #error zcmd.inc by zeex was not located.
- #endif
- forward GivePlayerWeaponEx(playerid, weaponid, ammo);
- forward SetItem(playerid);
- public GivePlayerWeaponEx(playerid, weaponid, ammo)
- {
- if(weaponid == WEAPON_BAT)
- {
- SetTimerEx("SetItem", 500, false, "i", playerid);
- {
- return GivePlayerWeapon(playerid, weaponid, ammo);
- }
- #define GivePlayerWeapon GivePlayerWeaponEx
- public SetItem(playerid)
- {
- if( !IsPlayerAttachedObjectSlotUsed( playerid, NAILEDBAT_SLOT ) )
- SetPlayerAttachedObject( playerid, NAILEDBAT_SLOT, 2045, 6, 0.051999, 0.012000, 0.229000, 94.099998, -4.900009, -0.900002, 2.211000, 1.263000, 2.211999 );
- return 1;
- }
- #if USE_ZCMD == true
- CMD:nailedbat( playerid, params[] )
- {
- switch( GetPVarInt( playerid, "pUseBat" ) )
- {
- case 0:
- {
- SetPVarInt( playerid, "pUseBat", 1 );
- SendClientMessage( playerid, -1, ON_MSG );
- }
- default:
- {
- SetPVarInt( playerid, "pUseBat", 0 );
- SendClientMessage( playerid, -1, OFF_MSG );
- if( IsPlayerAttachedObjectSlotUsed( playerid, NAILEDBAT_SLOT ) )
- RemovePlayerAttachedObject( playerid, NAILEDBAT_SLOT );
- }
- }
- return 1;
- }
- #endif
- #if USE_ZCMD == false
- public OnPlayerCommandText( playerid, cmdtext[] )
- {
- if( !strcmp( cmdtext, "/nailedbat" ) )
- {
- switch( GetPVarInt( playerid, "pUseBat" ) )
- {
- case 0:
- {
- SetPVarInt( playerid, "pUseBat", 1 );
- SendClientMessage( playerid, -1, ON_MSG );
- }
- default:
- {
- SetPVarInt( playerid, "pUseBat", 0 );
- SendClientMessage( playerid, -1, OFF_MSG );
- if( IsPlayerAttachedObjectSlotUsed( playerid, NAILEDBAT_SLOT ) )
- RemovePlayerAttachedObject( playerid, NAILEDBAT_SLOT );
- }
- }
- }
- }
- #endif
- // <[ End Of File ]> //
- //==============================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement