|
Member
|

01-01-2006
, 19:30
Fixing Plugin Confliction
|
#1
|
I am running the teo following plugins on my server. The first one works and the second one doesnt. I suspect that there is some confliction between them because they are basically the same code. One grants clients a free gun once per map and one grants users hp or ap once per map. Can someone help me find the confliction and fix it?
Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#define PLUGIN "Health/Armor"
#define VERSION "1.0"
#define AUTHOR "|sXe| Mr. Foster"
new bool:user_tookhealth[33]
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("give", "cmd_weapon", ADMIN_LEVEL_G, "<give(hp, ap)>")
}
public client_putinserver(id) {
user_tookhealth[id] = false
}
public cmd_weapon(id, level, cid)
{
if(!cmd_access(id, level, cid, 2))
return PLUGIN_HANDLED
if(user_tookhealth[id])
return PLUGIN_HANDLED
new requested[32]
read_argv(1, requested, 31)
new name[32]
get_user_name(id, name, 31)
if(equali(requested,"hp", 2))
{
set_user_health(id, 200)
client_print(0,print_chat, "%s used his Health/Armor power to give himself an 200 health", name)
client_print(0,print_chat, "Say /rewards to learn about donating to our server and receiving rewards.", name)
user_tookhealth[id] = true
}
else if(equali(requested,"ap", 2))
{
set_user_armor(id, 100)
client_print(0,print_chat, "%s used his Health/Armor power to give himself an 100 armor.", name)
client_print(0,print_chat, "Say /rewards to learn about donating to our server and receiving rewards.", name)
user_tookhealth[id] = true
}
return PLUGIN_HANDLED
}
Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#define PLUGIN "Freegun"
#define VERSION "1.0"
#define AUTHOR "|sXe| Mr. Foster"
new bool:user_gothisgun[33]
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("freegun", "cmd_weapon", ADMIN_LEVEL_H, "<weapon(m4, ak)>")
}
public client_putinserver(id) {
user_gothisgun[id] = false
}
public cmd_weapon(id, level, cid)
{
if(!cmd_access(id, level, cid, 2))
return PLUGIN_HANDLED
if(user_gothisgun[id])
return PLUGIN_HANDLED
new whatwassaid[32]
read_argv(1, whatwassaid, 31)
new name[32]
get_user_name(id, name, 31)
if(equali(whatwassaid,"m4", 2))
{
give_item(id, "weapon_m4a1")
cs_set_user_bpammo(id, CSW_M4A1, 90)
client_print(0,print_chat, "%s used his freegun power to give himself an M4A1.", name)
client_print(0,print_chat, "Say /rewards to learn about dontating to our server and recieving rewards.", name)
user_gothisgun[id] = true
}
else if(equali(whatwassaid,"ak", 2))
{
give_item(id, "weapon_ak47")
cs_set_user_bpammo(id, CSW_AK47, 90)
client_print(0,print_chat, "%s used his freegun power to give himself an AK47.", name)
client_print(0,print_chat, "Say /rewards to learn about dontating to our server and recieving rewards.", name)
user_gothisgun[id] = true
}
return PLUGIN_HANDLED
}
Thanks,
MOBOB
__________________
|
|