PHP Code:
/* Plugin generated by Emilioneri */
#include <amxmodx>
#include <amxmisc>
#include <biohazard>
#include <cstrike>
#define PLUGIN "T-Virus Antidote"
#define VERSION "1.0"
#define AUTHOR "Emilioneri"
new g_Cost
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
// Add your code here...
g_Cost = register_cvar("amx_antidotecost", "5000")
register_clcmd("say /antidote", "cmd_antidote")
register_logevent("Event_Round_Start", 2, "1=Round_Start")
}
public Event_Round_Start()
{
client_print(0, print_chat, "To buy an Antidote type in chat: /antidote")
}
public cmd_antidote(id)
{
if(!is_user_alive(id))
{
client_print(id, print_chat, "You can't buy an antidote while you are dead!")
}
if(!is_user_zombie(id))
{
client_print(id, print_chat, "You can't buy an antidote, because you are a human")
}
new iMoney = cs_get_user_money(id)
new iCost = get_pcvar_num(g_Cost)
if(iMoney >= iCost)
{
cs_set_user_money(id, iMoney - iCost)
cure_user(id)
client_print(id, print_chat, "You have used an antidote")
}
else
{
client_print(id, print_chat, "You don't have enaugh moeny! $%i needed!", iCost)
}
}
I've got 2 questions:
1. Why this code doesn't work

2. Why is "cs_get_user_money" useless

And what way Biohazard uses to set money
3. +k who will help me!
__________________