(13-02-2026, 13:48)VOLLAK155 Adlı Kullanıcıdan Alıntı:(12-02-2026, 20:33)VOLLAK Adlı Kullanıcıdan Alıntı: Teşekkürler oldu bu yan hesabımçözdüm çözdüm rbi_cost 0 yaptım ama tek mahkuum kalınca açılıyor onu nasıl düzeltiriz?
bu seferde redbull için 2500 dolar lazım diyor ücretsiz parasız yok mu
PHP Kod:
#define VERSION "2.1"
#define TAG "^4[Red Bull]"
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>
new bool:has_rb[33]
new g_cost
new Float:g_duration
new Float:g_speed
new g_max_hp
new g_hp_regen
new Float:g_gravity
new pcvar_cost
new pcvar_duration
new pcvar_speed
new pcvar_max_hp
new pcvar_hp_regen
new pcvar_gravity
new g_maxplayers
enum _:TASK_IDS
{
TASK_DURATION = 100,
TASK_HP_REGEN = 200
}
public plugin_init()
{
register_plugin("Red Bull", VERSION, "GHW_Chronic")
register_clcmd("say /redbull", "say_cmd_handle")
register_clcmd("say /rb", "say_cmd_handle")
pcvar_cost = register_cvar("rbi_cost", "0")
pcvar_duration = register_cvar("rbi_duration", "20.0")
pcvar_speed = register_cvar("rbi_speed", "400.0")
pcvar_max_hp = register_cvar("rbi_max_hp", "150")
pcvar_hp_regen = register_cvar("rbi_hp_regen", "1")
pcvar_gravity = register_cvar("rbi_gravity", "0.5")
register_clcmd("rbi_reload", "cmd_reload_cvars", ADMIN_RCON, "Reload RB cvars")
register_event("CurWeapon", "curweap", "be")
register_event("DeathMsg", "event_death", "a")
register_dictionary("GHW_Red_Bull.txt")
g_maxplayers = get_maxplayers()
}
public plugin_cfg()
{
cache_cvars()
}
public cmd_reload_cvars(id, level, cid)
{
if(!cmd_access(id, level, cid, 1))
return PLUGIN_HANDLED
cache_cvars()
colored_print(id, "%s ^1CVAR degerleri yenilendi!", TAG)
return PLUGIN_HANDLED
}
cache_cvars()
{
g_cost = get_pcvar_num(pcvar_cost)
g_duration = get_pcvar_float(pcvar_duration)
g_speed = get_pcvar_float(pcvar_speed)
g_max_hp = get_pcvar_num(pcvar_max_hp)
g_hp_regen = get_pcvar_num(pcvar_hp_regen)
g_gravity = get_pcvar_float(pcvar_gravity)
}
public curweap(id)
{
if(is_user_alive(id) && has_rb[id])
{
set_user_maxspeed(id, g_speed)
}
}
public event_death()
{
new victim = read_data(2)
if(victim < 1 || victim > g_maxplayers)
return
if(has_rb[victim])
reset_redbull(victim)
}
public client_connect(id)
has_rb[id] = false
public client_disconnect(id)
reset_redbull(id)
get_alive_team_count(CsTeams:team)
{
new count = 0
for(new i = 1; i <= g_maxplayers; i++)
{
if(is_user_alive(i) && cs_get_user_team(i) == team)
count++
}
return count
}
public say_cmd_handle(id)
{
if(!is_user_alive(id))
{
colored_print(id, "%s ^1%L", TAG, id, "MSG_NOBUY_DEAD")
return PLUGIN_HANDLED
}
// Son mahkum kontrolu - T takiminda tek kisi kaldiysa engelle
if(cs_get_user_team(id) == CS_TEAM_T && get_alive_team_count(CS_TEAM_T) <= 1)
{
colored_print(id, "%s ^1Son mahkum oldugun icin Red Bull alamazsin!", TAG)
return PLUGIN_HANDLED
}
if(has_rb[id])
{
colored_print(id, "%s ^1%L", TAG, id, "MSG_NOBUY_HAVE")
return PLUGIN_HANDLED
}
if(cs_get_user_money(id) < g_cost)
{
colored_print(id, "%s ^1%L", TAG, id, "MSG_NOBUY_POOR", g_cost)
return PLUGIN_HANDLED
}
cs_set_user_money(id, cs_get_user_money(id) - g_cost, 1)
has_rb[id] = true
set_task(g_duration, "redbull_over", id + TASK_DURATION)
set_task(1.0, "plus_hp", id + TASK_HP_REGEN, "", 0, "b")
set_user_gravity(id, g_gravity)
set_user_maxspeed(id, g_speed)
colored_print(id, "%s ^3%L", TAG, id, "MSG_REDBULL1")
colored_print(id, "%s ^3%L", TAG, id, "MSG_REDBULL2")
return PLUGIN_HANDLED
}
public plus_hp(taskid)
{
new id = taskid - TASK_HP_REGEN
if(id < 1 || id > g_maxplayers)
{
remove_task(taskid)
return
}
if(!is_user_alive(id) || !has_rb[id])
{
reset_redbull(id)
return
}
new current_hp = get_user_health(id)
if(current_hp < g_max_hp)
set_user_health(id, min(current_hp + g_hp_regen, g_max_hp))
}
public redbull_over(taskid)
{
new id = taskid - TASK_DURATION
if(id < 1 || id > g_maxplayers)
return
if(!is_user_connected(id))
return
reset_redbull(id)
colored_print(id, "%s ^1%L", TAG, id, "MSG_REDBULL_OFF")
}
reset_redbull(id)
{
if(!has_rb[id])
return
has_rb[id] = false
remove_task(id + TASK_DURATION)
remove_task(id + TASK_HP_REGEN)
if(is_user_alive(id))
set_user_gravity(id, 1.0)
}
stock colored_print(id, const msg[], any:...)
{
new buffer[192]
vformat(buffer, charsmax(buffer), msg, 3)
message_begin(MSG_ONE, get_user_msgid("SayText"), _, id)
write_byte(id)
write_string(buffer)
message_end()
}
)

