roflmuffin / CounterStrikeSharp

CounterStrikeSharp allows you to write server plugins in C# for Counter-Strike 2/Source2/CS2

Home Page:https://docs.cssharp.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

playerPawn vs playerPawn.Value, etc

WeirdPhrog opened this issue · comments

What's the difference between playerPawn and playerPawn.Value? weapon and weapon.Value? etc. What should I work with and when? What should I check for null and IsValid? Where can I read about this?

  1. e.g. playerPawn is the handler of the entity, playerPawn.Value is the actual entity
  2. playerPawn.Value after check valid
  3. whenever you wanna change value or use function on the entity, check with != null && IsValid (not 100% accurate)
  4. docs.cssharp.dev

Should I also check handler of the entity for valid?