Hi im new to the AMXX Forums and a little new to coding plugins. i can code very simple things like hud msg's and some complex stuff like scrim starters. but i wanted to try something different. I wanted to make cs more real where if a player has 20 or less health u bleed to death unless u buy a bandage.
heres the coding i code so far:
Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>
#include <fakemeta>
#include <engine>
#define PLUGIN "CSRealism"
#define VERSION "1.0"
#define AUTHOR "Desert"
new cost
new money
new newmoney
new bandages
new playerHealth
new newPlayerHealth
new speed
new checkHealth
new gainPlayerHealth
new fasterspeed
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_dictionary("fun.inc")
register_dictionary("cstrike.inc")
register_dictionary("amxmodx.inc")
register_dictionary("fakemeta.inc")
register_dictionary("amxmisc.inc")
register_dictionary("engine.inc")
register_cvar("bandage_cost","300")
register_concmd("amx_buybandage", "buybandage", ADMIN_KICK, "sets up buy bandage settings")
}
public buybandage (id)
{
money = cs_get_user_money
cost = get_cvar_num("bandage_cost")
if (money <= cost)
{
bandages = 1
client_print(0, print_chat, "[CSRealism] You have bought a bandage")
newmoney = money - cost
cs_set_user_money(id,newmoney)
}
if (money > cost)
{
client_print(0, print_chat, "[CSRealism] You don't have enough for a bandage.")
client_print(0, print_chat, "[CSRealism] bandage's cost $300.")
}
set_task(2.0,"bleed")
}
public bleed (id)
{
playerHealth = cs_get_user_health
if (playerHealth > 20)
{
Float:speed = - 1.5
newPlayerHealth = playerHealth - 1
set_user_health(id, newPlayerHealth)
set_user_maxspeed (id, speed)
client_print(0, print_chat, "[CSRealism] you don't have any bandages, please buy one to prevent any further loss of health.")
}
if (bandages = 1)
{
Float:fasterspeed = - 1.3
checkHealth = cs_get_user_health
gainPlayerHealth = checkHealth + 20
set_user_health(id,gainPlayerHealth)
set_user_maxspeed ( id, fasterspeed )
bandages--
client_print(0, print_chat, "[CSRealism] you have used to bandage and won't bleed to death.")
}
}
can anyone help me?