Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update health invalid #5

Open
yangjie-code opened this issue May 15, 2024 · 0 comments
Open

update health invalid #5

yangjie-code opened this issue May 15, 2024 · 0 comments

Comments

@yangjie-code
Copy link

yangjie-code commented May 15, 2024

I have each player's blood level set to 500 at EventPlayerSpawn, but it doesn't work!

public HookResult OnEventPlayerSpawnd(EventPlayerSpawned @event, GameEventInfo info)
{

 @event.Userid.PlayerPawn.Value.Health = 500;
 @event.Userid.PlayerPawn.Value.MaxHealth = 500;
 @event.Userid.Pawn.Value.Health = 500;
 @event.Userid.Pawn.Value.MaxHealth = 500;
 @event.Userid.PawnHealth = 500;
 @event.Userid.Health = 500;
 @event.Userid.MaxHealth = 500;
 Logger.LogInformation($"-----------------------------------------------EventPlayerSpawned22222 -----------player health{@event.Userid.Health}-------------------------------------------------------");
 return HookResult.Continue;

}

[GameEventHandler]
public HookResult OnEventPlayerSpawn(EventPlayerSpawn @event, GameEventInfo info)
{

 @event.Userid.PlayerPawn.Value.Health = 500;
 @event.Userid.PlayerPawn.Value.MaxHealth = 500;
 @event.Userid.Pawn.Value.Health = 500;
 @event.Userid.Pawn.Value.MaxHealth = 500;
 @event.Userid.PawnHealth = 500;
 @event.Userid.Health = 500;
 @event.Userid.MaxHealth = 500;
 Logger.LogInformation($"-----------------------------------------------EventPlayerSpawned1111 -----------player health{@event.Userid.Health}-------------------------------------------------------");
 return HookResult.Continue;

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant