|
楼主 |
发表于 2009-10-2 21:56:16
|
显示全部楼层
来自 日本–东京都
修改之后,编译不通过。
问题:
1。数组的初始化(0)是不是要这样写?p_count[32] = [0, 0, ...]
2。killer = read_data(1)的话,被杀的人target是否为read_data(2) ?
以下为修改之后的代码。- #include <amxmodx>
- #include <unlimited_money>
- new k_count[32] = [0, 0, ...]
- public plugin_init() {
- register_plugin("MultiKill", "1.1", "Marshall")
- register_event("DeathMsg", "hook_death", "a")
- register_logevent("hook_roundstart",2,"0=World triggered","1=Round_Start")
- }
- public hook_death(){
- new msg[128]
- new Killer = read_data(1)
- new headshot = read_data(3)
- new p_weapon[16]
- read_data(4,p_weapon,15)
- new p_name[16]
- get_user_name(Killer,p_name,15)
-
- //爆头奖励
- if(headshot){
- format(msg,127,"^x04爆头奖励:^x03%s^x01 获得$1000!",p_name)
- client_color(Killer, Killer, msg)
- cs_set_user_money2(Killer,cs_get_user_money2(Killer) + 1000)
- }
- //刀杀奖励
- if(strcmp(p_weapon,"knife")==0){
- format(msg,127,"^x04刀杀奖励:^x03%s^x01 获得$5000!",p_name)
- client_color(Killer, Killer, msg)
- cs_set_user_money2(Killer,cs_get_user_money2(Killer) + 5000)
- }
-
- //雷杀奖励
- if(strcmp(p_weapon,"grenade")==0){
- format(msg,127,"^x04雷杀奖励:^x03%s^x01 获得$1500!",p_name)
- client_color(Killer, Killer, msg)
- cs_set_user_money2(Killer,cs_get_user_money2(Killer) + 1500)
- }
-
- //连续杀人奖励
- k_count[Killer]++
- if(k_count[Killer]>=5){
- format(msg,127,"^x04连续杀人奖励:^x03%s^x01 连续杀人5次,获得$3000!",p_name)
- client_color(Killer, Killer, msg)
- cs_set_user_money2(Killer,cs_get_user_money2(Killer) + 3000)
- k_count[Killer] = 0
- }
- }
- public hook_roundstart(){
- k_count[32] = [0, 0, ...]
- }
- public client_color(playerid,colorid,msg[])
- {
- message_begin(playerid?MSG_ONE:MSG_ALL, get_user_msgid("SayText"), {0,0,0}, playerid)
- write_byte(colorid)
- write_string(msg)
- message_end()
- }
- /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
- *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang2052\\ f0\\ fs16 \n\\ par }
- */
复制代码 |
|