|
Member
Join Date: Jan 2011
Location: Bulgaria
|

01-05-2012
, 16:49
Re: Bomb Countdown HUD Timer
|
#51
|
We are very sorry but how to change the position of the figures to say I have some sight, but as krafta where the money goes where I want to timer and move from left to right (from hp for the money)!
Many thanks!
Quote:
#include <amxmodx>
#include <csx>
#define PLUGIN "Bomb Countdown Timer"
#define VERSION "0.2"
#define AUTHOR "SAMURAI"
#define MAX_PLAYERS 32
new g_position[MAX_PLAYERS+1]
//От тук си променяте позицията на цифрите.
new const Float:g_mernik[][] = {{0.37, 0.58},{0.35, 0.48},{0.51, 0.34},{0.56, 0.40},{0.57, 0.50},{0.57, 0.58},{0.52, 0.65},{0.46, 0.66},{0.39, 0.63}}
new g_c4timer, pointnum;
new bool:b_planted = false;
public plugin_init()
{
register_plugin(PLUGIN,VERSION,AUTHOR);
pointnum = get_cvar_pointer("mp_c4timer");
register_logevent("newRound", 2, "1=Round_Start");
register_logevent("endRound", 2, "1=Round_End");
register_logevent("endRound", 2, "1&Restart_Round_");
}
public newRound()
{
g_c4timer = -1;
remove_task(652450);
b_planted = false;
}
public endRound()
{
g_c4timer = -1;
remove_task(652450);
}
public bomb_planted()
{
b_planted = true;
g_c4timer = get_pcvar_num(pointnum);
dispTime()
set_task(1.0, "dispTime", 652450, "", 0, "b");
}
public bomb_defused()
{
if(b_planted)
{
remove_task(652450);
b_planted = false;
}
}
public bomb_explode()
{
if(b_planted)
{
remove_task(652450);
b_planted = false;
}
}
public dispTime()
{
new Position = ++g_position[ 0 ]
if( Position == sizeof(g_mernik)) Position = g_position[ 0 ] = 0
if(!b_planted)
{
remove_task(652450);
return;
}
if(g_c4timer >= 0)
{
if(g_c4timer > 15) set_hudmessage(0, 150, 0, Float:g_mernik[Position][0], Float:g_mernik[Position][1], 0, 1.0, 1.0, 0.01, 0.01, -1);
else if(g_c4timer > 10) set_hudmessage(150, 150, 0, Float:g_mernik[Position][0], Float:g_mernik[Position][1], 0, 1.0, 1.0, 0.01, 0.01, -1);
else set_hudmessage(150, 0, 0, Float:g_mernik[Position][0], Float:g_mernik[Position][1], 0, 1.0, 1.0, 0.01, 0.01, -1);
show_hudmessage(0, "C4:%d", g_c4timer);
--g_c4timer;
}
}
|
|
|