mottzi
06-22-2010, 13:43
Hello.
When the player sais "pack" then a BarTime shows. After it loads the player get 50 HP...
But all this just then the bool:limited is true.
Thats not the problem; it works very fine but the bool ist just for 1 player...
When another player is there just 1 can use the BarTime. You udnerstand.
So i need 32 bools, 1 for every id.
my code:
#include <amxmodx>
#include <amxmisc>
#include <fun>
new bartime1;
new bool:limited = true; // <--- HERE <---------------------------------------------------------
public plugin_init()
{
bartime1 = get_user_msgid("BarTime");
register_event( "HLTV", "roundstart1", "a", "1=0", "2=0" )
register_clcmd("say pack","show_bar1")
}
public show_bar1(id)
{
if(limited == true)
{
set_user_rendering(id,kRenderFxGlowShell,255, 0,0,kRenderNormal,25)
message_begin(MSG_ONE,bartime1, {0,0,0} ,id);
write_short(10);
message_end();
set_task(9.5, "after_bar1", id)
}
else
{
client_print(id, print_chat, "[HP] You already used ur healthpack! Nextround, you can use a new one.")
}
}
public roundstart1(id)
{
limited = true;
}
public after_bar1(id)
{
set_user_rendering(id,kRenderFxGlowShell,0,0, 0,kRenderNormal,25)
set_user_health(id, get_user_health(id) + 40)
limited = false;
}
When the player sais "pack" then a BarTime shows. After it loads the player get 50 HP...
But all this just then the bool:limited is true.
Thats not the problem; it works very fine but the bool ist just for 1 player...
When another player is there just 1 can use the BarTime. You udnerstand.
So i need 32 bools, 1 for every id.
my code:
#include <amxmodx>
#include <amxmisc>
#include <fun>
new bartime1;
new bool:limited = true; // <--- HERE <---------------------------------------------------------
public plugin_init()
{
bartime1 = get_user_msgid("BarTime");
register_event( "HLTV", "roundstart1", "a", "1=0", "2=0" )
register_clcmd("say pack","show_bar1")
}
public show_bar1(id)
{
if(limited == true)
{
set_user_rendering(id,kRenderFxGlowShell,255, 0,0,kRenderNormal,25)
message_begin(MSG_ONE,bartime1, {0,0,0} ,id);
write_short(10);
message_end();
set_task(9.5, "after_bar1", id)
}
else
{
client_print(id, print_chat, "[HP] You already used ur healthpack! Nextround, you can use a new one.")
}
}
public roundstart1(id)
{
limited = true;
}
public after_bar1(id)
{
set_user_rendering(id,kRenderFxGlowShell,0,0, 0,kRenderNormal,25)
set_user_health(id, get_user_health(id) + 40)
limited = false;
}