diff options
Diffstat (limited to 'NorthstarDLL')
-rw-r--r-- | NorthstarDLL/scripts/scriptutility.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/NorthstarDLL/scripts/scriptutility.cpp b/NorthstarDLL/scripts/scriptutility.cpp index 8dae49cf..fa35df7b 100644 --- a/NorthstarDLL/scripts/scriptutility.cpp +++ b/NorthstarDLL/scripts/scriptutility.cpp @@ -1,5 +1,7 @@ #include "pch.h" #include "squirrel/squirrel.h" +#include "client/r2client.h" +#include "engine/r2engine.h" // asset function StringToAsset( string assetName ) ADD_SQFUNC( @@ -12,3 +14,16 @@ ADD_SQFUNC( g_pSquirrel<context>->pushasset(sqvm, g_pSquirrel<context>->getstring(sqvm, 1), -1); return SQRESULT_NOTNULL; } + +// string function NSGetLocalPlayerUID() +ADD_SQFUNC( + "string", NSGetLocalPlayerUID, "", "Returns the local player's uid.", ScriptContext::UI | ScriptContext::CLIENT | ScriptContext::SERVER) +{ + if (R2::g_pLocalPlayerUserID) + { + g_pSquirrel<context>->pushstring(sqvm, R2::g_pLocalPlayerUserID); + return SQRESULT_NOTNULL; + } + + return SQRESULT_NULL; +} |