-
Notifications
You must be signed in to change notification settings - Fork 3
/
test.sp
83 lines (64 loc) · 2.35 KB
/
test.sp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/* Plugin Template generated by Pawn Studio */
#include <sourcemod>
#include <tf2>
#include <tf2_stocks>
public Plugin:myinfo =
{
name = "New Plugin",
author = "Unknown",
description = "<- Description ->",
version = "1.0",
url = "<- URL ->"
}
const STEAMID_MAX = 30;
new String:captions_steamid[2][STEAMID_MAX];
public OnPluginStart()
{
//HookEvent("player_activate", Event_PlayerActivate, EventHookMode_Post);
//HookEvent("player_disconnect", Event_PlayerDisconnect, EventHookMode_Pre);
RegConsoleCmd("test_do", Command_mcp_menu);
}
public Action:Command_mcp_menu(client, args)
{
PrintToChatAll("IsClientInGame(%i) = %f", client, IsClientInGame(client));
return Plugin_Handled;
}
/*--------------------------------------------------------------------------------
/ Hooks
/-------------------------------------------------------------------------------*/
/*
public Action:Event_PlayerActivate(Handle:event, const String:name[], bool:dontBroadcast)
{
new id = GetEventInt(event, "userid");
new client = GetClientOfUserId(id);
new String:client_name[100];
new String:steamid[100] = "NOPE";
new bool:isAuth = IsClientAuthorized(client);
GetClientName(client, client_name, 100);
if(isAuth){
GetClientAuthString(client, steamid, 100);
if(strcmp(captions_steamid[0], steamid) == 0)
PrintToChat(client, "Welcome Back");
}
PrintToChatAll("Connect..Auth: %i, AuthID: %s, Name: %s, Client: %i, UserID: %i", isAuth, steamid, client_name, client, id);
return Plugin_Continue;
}
public Action:Event_PlayerDisconnect(Handle:event, const String:name[], bool:dontBroadcast)
{
new id = GetEventInt(event, "userid");
new client = GetClientOfUserId(id);
new String:client_name[100];
new String:steamid[100] = "NOPE";
new bool:isAuth = IsClientAuthorized(client);
GetClientName(client, client_name, 100);
if(isAuth){
GetClientAuthString(client, steamid, 100);
strcopy(captions_steamid[0], STEAMID_MAX, steamid);
}
PrintToChatAll("Disconnect..Auth: %i, AuthID: %s, Name: %s, Client: %i, UserID: %i", isAuth, steamid, client_name, client, id);
return Plugin_Continue;
}
*/
//On dissconnect, add auth string to array of 10 strings or size 2(Caption and player)
//On Active, check against both arrays for match
//Name size is max 32 chars - > Make 33 max char size strings for names