Survival - Play Mining Emmiter parameters

marceloSRmarceloSR Posts: 47 Seed
edited November 2015 in Mods
Hi,

In the function Survival:PlayMiningEmitter( voxel, pos, prevMat, newMat, schem, player ) does the variable player reference the actual local player doing the action?
When I do the checks:
if not player then
return
end
local pawn = player:NKGetPawn()
if not pawn then
return
end

None of them return a nil value. However, when I try to get the player name ( pawn:NKGetPlayerName() ) it returns me a nil value. I don`t understand why. Does not every pawn has a name associated with it? Or can a pawn be different than a LocalWorldPlayer ?

Thank you,
Marcelo

Comments

  • johnycilohoklajohnycilohokla Posts: 283 Developer
    The NKGetPlayerName function is exposed on WorldPlayer, in this case it would be the player variable.
    player:NKGetPlayerName()
    You can also get the name of the player from pawn(BasePlayer/LocalPlayer) using pawn.m_playerName
    My Blog
    jc.png
      yt.png  t.png  
  • marceloSRmarceloSR Posts: 47 Seed
    Hmm ok, I managed to get the name from the player itself.
    I always confuse the LocalPlayer with the pawn...

    Thank you Johny!
Sign In or Register to comment.