You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: source/lua.cpp
+17-13Lines changed: 17 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -3,13 +3,19 @@
3
3
#include"lua.h"
4
4
#include<GarrysMod/InterfacePointers.hpp>
5
5
#include"filesystem.h"
6
+
#include"unordered_map"
6
7
7
8
IServer* Server;
8
-
boolLua::Hooks::OnSetSignonState(int userID, int state, int spawncount) // Return true to block it. You would need to block SIGNONSTATE_PRESPAWN to block it from spawning the player.
9
+
int iSlot = 0;
10
+
std::unordered_map<int, IClient*> pClients;
11
+
boolLua::Hooks::OnSetSignonState(IClient* cl, int state, int spawncount) // Return true to block it. You would need to block SIGNONSTATE_PRESPAWN to block it from spawning the player.
9
12
{
10
13
if (Lua::PushHook("PlayerQueue:OnSetSignonState"))
11
14
{
12
-
g_Lua->PushNumber(userID);
15
+
++iSlot;
16
+
pClients[iSlot] = cl;
17
+
18
+
g_Lua->PushNumber(iSlot);
13
19
g_Lua->PushNumber(state);
14
20
g_Lua->PushNumber(spawncount);
15
21
if (g_Lua->CallFunctionProtected(4, 1, true)) // Arg1 = Arguments, Arg2 = Returns, Arg3 = Show Error
@@ -29,20 +35,18 @@ bool Lua::Hooks::OnSetSignonState(int userID, int state, int spawncount) // Retu
0 commit comments