| mugiwara |
10-09-2009 14:11 |
Error with my 2 plugins
Well i just read a tutorial of how to create a plugin
i made the code and that thinks from the tutorial i learned but i thinks there are errors with the codes i made. Can someone see if there any error?
This is the Health Code
Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#define PLUGIN "givehealth"
#define VERSION "1.0"
#define AUTHOR "mugiwara"
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /health", "medic")
set_user_health(id, 150)
client_print(id, print_chat,"You just purchased some medic packs, Dont Get Killd!")
}
new plugin_on
new price
public plugin_init()
{register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /heath", "medic")
plugin_on = register_cvar("amx_givehealth_plugin", "1")
price = register_cvar("amx_givehealth_price", "4000")
}
public medic(id)
{
new money = cs_get_user_money(id)
if (get_pcvar_num(plugin_on) == 1)
}
{
set_user_health(id, 150)
client_print(id, print_chat,"You just purchased some medic packs, Dont Get Killd!"")
}
else
{
client_print(id, print_chat,"Not enough money. Go work out, loser!")
}
{
cs_set_user_money(id, money - get_pcvar_num(price))
}
This is the Armor Code
Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#define PLUGIN "givearmor"
#define VERSION "1.0"
#define AUTHOR "mugiwara"
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /armor", "armor")
set_user_health(id, 150)
client_print(id, print_chat,"You just purchased some armor, AntiShotGuy!!!")
}
new plugin_on
new price
public plugin_init()
{register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /armor", "armor")
plugin_on = register_cvar("amx_givearmor_plugin", "1")
price = register_cvar("amx_givearmor_price", "4000")
}
public armor(id)
{
new money = cs_get_user_money(id)
if (get_pcvar_num(plugin_on) == 1)
}
{
set_user_armor(id, 100)
client_print(id, print_chat,"You just purchased some armor, AntiShotGuy!!!"")
}
else
{
client_print(id, print_chat,"Not enough money. Go work out, loser!")
}
{
cs_set_user_money(id, money - get_pcvar_num(price))
}
if theres any error with it plzz reply
|