Check when one player attacks another

Started by kennedyarz, Mar 07, 2017, 04:24 PM

Previous topic - Next topic

kennedyarz

How to check when a player is attacking another? Is it possible to know this at the moment it attacks? Example.
Message("" + player.Name + "Is Attacking" + plr.Name + "", player)

KAKAN

oh no

kennedyarz


vito

its alomost impossible in typical vc-mp gameplay, PlayerShoot wont work with fpv, shotgus, arms...

kennedyarz

Quote from: vito on Mar 07, 2017, 06:11 PMits alomost impossible in typical vc-mp gameplay, PlayerShoot wont work with fpv, shotgus, arms...
:(

KAKAN

function Player::PlayerShoot(player, weapon, hitEntity, hitPosition){
if( hitEntity == null ) return 1; // Don't use break, it may give weird errors in VCMP :x
if( hitEntity.rawget( "ID" ) == null ) return 1;
//hitEntity is a player :)
local stream = Stream();
stream.WriteInt( hitEntity.ID );
Server side:-
function onClientScriptData(player){
Message( player.Name + " is shooting " + FindPlayer( Stream.ReadInt() ).Name ); // Do some error checking before using theez
}
Theoretically it should work, but if
Quote from: vito on Mar 07, 2017, 06:11 PMPlayerShoot wont work with fpv, shotgus, arms...
its true, then it wont :)
oh no