sm-plugins/RadarSpotAll/scripting/RadarSpotAll.sp

40 lines
914 B
SourcePawn

#include <sourcemod>
#include <sdkhooks>
#include <sdktools>
#pragma semicolon 1
#pragma newdecls required
public Plugin myinfo =
{
name = "RadarSpotAll",
author = "BotoX",
description = "Always spot every player on the radar.",
version = "1.0",
url = ""
};
int g_hPlayerSpotted;
int g_aSpottedPlayers[MAXPLAYERS+1] = {1, ...};
public void OnPluginStart()
{
g_hPlayerSpotted = FindSendPropInfo("CCSPlayerResource", "m_bPlayerSpotted");
if(g_hPlayerSpotted == -1)
SetFailState("Couldn't find CCSPlayerResource::m_bPlayerSpotted");
}
public void OnMapStart()
{
int entity = FindEntityByClassname(MaxClients+1, "cs_player_manager");
if(entity == -1)
SetFailState("Unable to find cs_player_manager entity");
SDKHook(entity, SDKHook_ThinkPost, OnThinkPost);
}
public void OnThinkPost(int entity)
{
SetEntDataArray(entity, g_hPlayerSpotted, g_aSpottedPlayers, MAXPLAYERS+1, 1, true);
}