改少少
加番個過版人名清零先
#pragma semicolon 1
#include <sourcemod>
#include <sdktools>
#include <sdktools_functions>
#include <adminmenu>
#define PLUGIN_VERSION "0.0.1"
new bool:IsClientEnterCheckPoint[MAXPLAYERS+1];
public Plugin:myinfo =
{
name = "Check Saferoom Player",
author = "LazyCat",
description = "",
version = PLUGIN_VERSION,
url = ""
};
public OnPluginStart()
{
HookEvent("player_entered_checkpoint",Event_PlayerEnteredCheckpoint);
HookEvent("player_left_checkpoint",Event_PlayerLeftCheckpoint);
HookEvent("map_transition", Event_Maptransition, EventHookMode_PostNoCopy);
new maxClients = GetMaxClients();
for (new i = 1; i <= maxClients; i++)
{
IsClientEnterCheckPoint = false;
}
RegConsoleCmd("sm_checkpt", CheckPointState);
}
public Action:Event_PlayerEnteredCheckpoint(Handle:event, const String:name[], bool:dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event, "userid"));
if(client!=0 && IsClientInGame(client) && IsPlayerAlive(client) && GetClientTeam(client) == 2)
{
IsClientEnterCheckPoint[client] = true;
}
}
public Action:Event_PlayerLeftCheckpoint(Handle:event, const String:name[], bool:dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event, "userid"));
if(client!=0 && IsClientInGame(client) && IsPlayerAlive(client) && GetClientTeam(client) == 2)
{
IsClientEnterCheckPoint[client] = false;
}
}
public Action:Event_Maptransition(Handle:event, const String:name[], bool:dontBroadcast)
{
new maxClients = GetMaxClients();
for (new i = 1; i <= maxClients; i++)
{
IsClientEnterCheckPoint = false;
}
}
public Action:CheckPointState(client,args)
{
CheckPointPanel(client);
}
public Action:CheckPointPanel(client)
{
new Handle:panel = CreatePanel();
SetPanelTitle(panel, "CheckPoint名單:");
DrawPanelText(panel, "================");
new maxClients = GetMaxClients();
for (new i = 1; i <= maxClients; i++)
{
if(IsClientEnterCheckPoint)
{
decl String: name[128];
Format(name,sizeof(name),"%N", i);
DrawPanelText(panel, name);
}
}
DrawPanelText(panel, "================");
DrawPanelItem(panel, "取消");
SendPanelToClient(panel, client, PanelContent, 30);
CloseHandle(panel);
}
public PanelContent(Handle:menu, MenuAction:action, param1, param2)
{
if (action == MenuAction_Select) { switch (param2) { case 1:{} } }
}