Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PLUGIN = nil
- function Initialize(Plugin)
- Plugin:SetName("Sniper")
- Plugin:SetVersion(2)
- --Hooks
- cPluginManager:AddHook(cPluginManager.HOOK_PLAYER_USING_ITEM, RightClicking)
- PLUGIN = Plugin
- --Command Bindings
- cPluginManager.BindCommand("/sniper", "sniper.get", getsniper, " - /sniper - to get sniper")
- LOG("Initialised " .. Plugin:GetName() .. " v." .. Plugin:GetVersion())
- return true -- the trueth is out there
- end
- function OnDisable()
- LOG("Sniper shots itself...")
- end
- function getsniper(Split, Player)
- local sniper = cItem(E_ITEM_BLAZE_ROD, 1, 0, "")
- --local sniper = cItem(ItemType, Count, Damage, EnchantmentString, CustomName, Lore)
- local sniper = cItem(E_ITEM_BLAZE_ROD, 1, 0, "", "§aSNIPER", "")
- Player:GetInventory():AddItem( sniper )
- return true
- end
- function RightClicking(Shooter, BlockX, BlockY, BlockZ, BlockFace, CursorX, CursorY, CursorZ, BlockType, BlockMeta)
- local sniper = cItem(E_ITEM_BLAZE_ROD, 1, 0, "", "§aSNIPER", "")
- local inhand = Shooter:GetEquippedItem()
- if ( sniper:IsEqual( inhand ) == true ) then
- Shooter:SendMessageFatal("Focus!")
- --Shooter:AddEntityEffect( 16, 1, 1 ) -- night vision
- --Shooter:AddEntityEffect( 2 ) -- slowness
- -- -> doesnt work at moment
- return true
- else
- return false
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement