Quote:
Originally Posted by freddddd
Would it be possible to allow players to personally toggle this on or off via a command?
|
Quote:
Originally Posted by Chrahb
Would be cool with an option like !radar, to toggle it on, and off as a player.
Also maybe fix so it uses latest syntax
|
I coded something time ago. csgo only
PHP Code:
#define HIDEHUD_RADAR 1 << 12
#define SHOWHUD_RADAR 1 >> 12
bool radar[MAXPLAYERS + 1] = true;
public void OnPluginStart()
{
RegConsoleCmd("sm_radar", Command_radar, "Allows player to toggle the radar.");
}
public Action Command_radar(int client, int args)
{
if(radar[client])
{
SetEntProp(client, Prop_Send, "m_iHideHUD", HIDEHUD_RADAR);
radar[client] = false;
}
else
{
SetEntProp(client, Prop_Send, "m_iHideHUD", SHOWHUD_RADAR);
radar[client] = true;
}
}