#include <amxmodx>
#include <fun>
#include <cstrike>
#define TAG "Clan Reklam"
new bool:has_rb[33]
new cost_cvar, lasts_cvar, speed_cvar, speed_cvar2
public plugin_init()
{
register_clcmd("say /redbull","say_cmd_handle")
cost_cvar = register_cvar("RB_Cost","5555") //PARA
lasts_cvar = register_cvar("RB_Lasts","20.0") //SURE
speed_cvar = register_cvar("RB_Speed","600.0") //CT HIZ
speed_cvar2 = register_cvar("RB_Speed2","400.0") //T HIZ
register_event("CurWeapon","curweap","be")
}
public curweap(id)
{
if(is_user_alive(id) && has_rb[id])
{
if(get_user_team(id) == 2 ) {
client_cmd(id,"cl_forwardspeed 400;cl_backspeed 400;cl_sidespeed 400")
set_user_maxspeed(id,get_pcvar_float(speed_cvar))
} else if( get_user_team(id) == 1) {
client_cmd(id,"cl_forwardspeed 400;cl_backspeed 400;cl_sidespeed 400")
set_user_maxspeed(id,get_pcvar_float(speed_cvar2))
}
}
}
public client_connect(id) has_rb[id]=false
public client_disconnect(id) has_rb[id]=false
public say_cmd_handle(id)
{
if(!is_user_alive(id))
{
renkli_yazi(id,"!n[!t%s!n] !gOluyken redbull alamazsin.",TAG)
}
else if(has_rb[id])
{
renkli_yazi(id,"!n[!t%s!n] !gZaten Redbull etkin devam ediyor.",TAG)
}
else if(cs_get_user_money(id)<get_pcvar_num(cost_cvar))
{
renkli_yazi(id,"!n[!t%s!n] !gRedbull icin yeterli paran yok. Gereken para $%d. ",TAG,get_pcvar_num(cost_cvar))
}
else
{
if(get_user_team(id) == 2 ) {
cs_set_user_money(id,cs_get_user_money(id) - get_pcvar_num(cost_cvar),1)
has_rb[id]=true
set_task(get_pcvar_float(lasts_cvar),"redbull_over",id)
set_task(1.0,"plus_hp",id,"",0,"b")
set_user_gravity(id,0.5)
set_user_maxspeed(id,get_pcvar_float(speed_cvar))
renkli_yazi(id,"!n[!t%s!n] !gRedbull satin aldin.",TAG)
renkli_yazi(id,"!n[!t%s!n] !gRedbull etkisinin gecmesine 20 saniye var.",TAG)
} else if( get_user_team(id) == 1 ) {
cs_set_user_money(id,cs_get_user_money(id) - get_pcvar_num(cost_cvar),1)
has_rb[id]=true
set_task(get_pcvar_float(lasts_cvar),"redbull_over",id)
set_task(1.0,"plus_hp",id,"",0,"b")
set_user_gravity(id,0.5)
set_user_maxspeed(id,get_pcvar_float(speed_cvar2))
renkli_yazi(id,"!n[!t%s!n] !gRedbull satin aldin.",TAG)
renkli_yazi(id,"!n[!t%s!n] !gRedbull etkisinin gecmesine 20 saniye var.",TAG)
}
}
}
public plus_hp(id)
{
if(has_rb[id]) set_user_health(id,get_user_health(id)+1)
}
public redbull_over(id)
{
if(is_user_connected(id))
{
has_rb[id]=false
renkli_yazi(id,"!n[!t%s!n] !gRedbull Etkisi gecti.",TAG)
set_user_gravity(id,1.0)
set_user_maxspeed(id,320.0)
set_user_gravity(id,1.0)
remove_task(id)
}
}
stock renkli_yazi(const id, const input[], any:...)
{
new count = 1, players[32];
static msg[191];
vformat(msg, 190, input, 3);
replace_all(msg, 190, "!n", "^x01"); // Default Renk(Sarý)
replace_all(msg, 190, "!g", "^x04"); // Yeþil Renk
replace_all(msg, 190, "!t", "^x03"); // Takým Renk( CT mavi , T kýrmýzý )
if (id) players[0] = id; else get_players(players, count, "ch");
{
for (new i = 0; i < count; i++)
{
if (is_user_connected(players[i]))
{
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]);
write_byte(players[i]);
write_string(msg);
message_end();
}
}
}
}