Jump to content

About this event.


Recommended Posts

From wiki:

--First, we create a function for the event handler to use. 
function onClientPlayerWeaponFireFunc(weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement ) 
    if weapon == 38 then -- If the player shoots with a minigun, and hits another player... 
         outputChatBox ( "Don't kill people with minigun, it's lame!", 255, 0, 0 ) -- We output a warning to him. 
    end 
end 
-- Add this as a handler so that the function will be triggered every time the local player fires. 
addEventHandler ( "onClientPlayerWeaponFire", getLocalPlayer(), onClientPlayerWeaponFireFunc ) 

Just modyfy the weapon id

Link to comment

No, like this:

addEventHandler( "onClientPlayerWeaponFire", localPlayer, 
function ( ) 
local weapon = getPedWeapon(localPlayer) 
    if weapon == 38 then 
    cancelEvent() 
    outputChatBox("* No't allowed to kill people by minigun", localPlayer, 255, 0, 0) 
    end 
end 
) 

Edited by Guest
Link to comment
  • Moderators

This event is called when player shoots a weapon. This does not trigger for projectiles based, or melee weapons. Also note that this event is only triggered for players nearby the local player's camera. This is due to elements far away being streamed out.

People can't read?

The only event that supports Molotov thingy is:

https://wiki.multitheftauto.com/wiki/On ... leCreation

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...