求一个杀人奖励金钱的插件
金钱奖励插件 刀杀加钱 第一个杀人加钱 连杀加钱 还有 暴头,雷杀加钱, 与C4埋加钱与拆c4加钱要原码谢谢了
回复: 求一个杀人奖励金钱的插件
#include <amxmodx>
#include <fakemeta>
#define PLUGIN "Test"
#define AUTHOR "Jim"
#define VERSION "1.0"
#define MONEY_FUNCTION 3
#define get_player_team(%1) get_pdata_int(%1, 114)
#if MONEY_FUNCTION == 1
#include <cstrike>
#define add_player_money(%1,%2) cs_set_user_money(%1, cs_get_user_money(%1) + %2)
#else
#if MONEY_FUNCTION == 2
#include <unlimited_money>
#define add_player_money(%1,%2) cs_set_user_money2(%1, cs_get_user_money2(%1) + %2)
#else
#define add_player_money(%1,%2) set_pdata_int(%1, 115, get_pdata_int(%1, 115) + %2)
#endif
#endif
#define MONEY_KNIFE 1000
#define MONEY_GRENADE 300
#define MONEY_HEADSHOT 500
#define MONEY_FIRSTKILLER 1000
#define MONEY_KILLSTREAK 1000
#define MONEY_BOMBPLANTER 2000
#define MONEY_BOMBDEFUSER 2000
new bool:firstkiller
new lastkiller
stock get_loguser_index()
{
new loguser, name
read_logargv(0, loguser, 79)
parse_loguser(loguser, name, 31)
return get_user_index(name)
}
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("DeathMsg", "event_death", "a")
register_logevent("round_start", 2, "1=Round_Start")
register_logevent("bomb_planted", 3, "2=Planted_The_Bomb")
register_logevent("bomb_defused", 3, "2=Defused_The_Bomb")
}
public round_start()
{
firstkiller = false
lastkiller = 0
}
public bomb_planted()
{
new id = get_loguser_index()
if(is_user_connected(id))
add_player_money(id, MONEY_BOMBPLANTER)
}
public bomb_defused()
{
new id = get_loguser_index()
if(is_user_connected(id))
add_player_money(id, MONEY_BOMBDEFUSER)
}
public event_death()
{
new k = read_data(1)
new v = read_data(2)
if(!k || k == v || get_player_team(k) == get_player_team(v))
return
if(k != lastkiller)
{
lastkiller = k
}
else
{
add_player_money(k, MONEY_KILLSTREAK)
}
if(!firstkiller)
{
add_player_money(k, MONEY_FIRSTKILLER)
firstkiller = true
}
new w
read_data(3, w, 2)
if(w == 'k')
{
add_player_money(k, MONEY_KNIFE)
}
if(w == 'r')
{
add_player_money(k, MONEY_GRENADE)
}
if(read_data(4))
{
add_player_money(k, MONEY_HEADSHOT)
}
}
回复: 求一个杀人奖励金钱的插件
说明一下MONEY_FUNCTION是设置你要使用哪个函数给玩家加钱1是cstrike模块里的cs_g/set_user_money
2是金钱无限的native函数cs_g/set_user_money2
3是fakemeta的方法
编译时候自行选择,推荐3
那些MONEY_XXXX是加钱的项目,钱数你自己设置
另外连杀是什么我不是很清楚,这里定义连杀就是一个人接连杀人,中间不间隔其它人。
页:
[1]