Vice City: Multiplayer

VC:MP Discussion => Support => Topic started by: D4rkR420R on Dec 27, 2018, 07:14 PM

Title: The hitEntity's health not updating.
Post by: D4rkR420R on Dec 27, 2018, 07:14 PM
function Player::PlayerShoot( shooter, weapon, hitEntity, hitPosition )
{
if( hitEntity && hitEntity.Type == OBJ_PLAYER && shooter == ::pInfo.Instance )
{
local damaged_player = hitEntity;
Console.Print(  "Target's health: "+ damaged_player.Health +"" );

Why is it that the player's, getting damaged, health is not updating while I'm shooting at him? Bear in mind that ::pInfo.Instance is basically the instance of the user.
Title: Re: The hitEntity's health not updating.
Post by: D4rkR420R on Dec 28, 2018, 02:55 AM
Quote from: KuRuMi^ on Dec 27, 2018, 07:14 PMfunction Player::PlayerShoot( shooter, weapon, hitEntity, hitPosition )
{
if( hitEntity && hitEntity.Type == OBJ_PLAYER && shooter == ::pInfo.Instance )
{
local damaged_player = hitEntity;
Console.Print(  "Target's health: "+ damaged_player.Health +"" );

Why is it that the player's, getting damaged, health is not updating while I'm shooting at him? Bear in mind that ::pInfo.Instance is basically the instance of the user.

Okay, for some reason, it's giving the right information to the player getting shot instead of the shooter. Strange. 0.o
Title: Re: The hitEntity's health not updating.
Post by: D4rkR420R on Dec 28, 2018, 05:50 PM
In conclusion, PlayerShoot seems like a global callback, yet stating the if statements whether the shooter or hitEntity is the user's instance, the code based from its statement will run to that player's game.