- 听众
- 收听
- 积分
- 21
- 主题
- 回帖
- 0
- 精华
注册时间2008-3-16
最后登录1970-1-1
该用户从未签到
|
发表于 2008-3-24 10:02:54
|
显示全部楼层
/* Plugin generated by AMXX-Studio */
#include
#include
#include
#include
#include
#include
#define PLUGIN "Same IP Same Team"
#define VERSION "1.5"
#define AUTHOR "martins"
new g_msgid
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_cvar("amx_sameipsameteam","1")
register_cvar("knifekillaward","1")
register_cvar("knifekillmoney","500")
register_event("DeathMsg", "Death_insameip", "a")
g_msgid = get_user_msgid("SayText")
return PLUGIN_CONTINUE
}
public client_death(killer,victim,wpnindex,hitplace,TK) {
if(get_cvar_num("amx_sameipsameteam") != 1) return PLUGIN_CONTINUE
new id = victim
new pnum,target,sameipid,sameipcnt=0,team
new usrip[32],ips[32][32]
new players[32],name[32],target_name[32]
get_user_ip(id,usrip,31,1)
//console_print(0,"usrip is %s",usrip)
if(is_user_connected(id)){
get_players(players,pnum)
for( new i = 0 ; i <PNUM
target = players
if (id != target){
get_user_ip(target,ips,31,1)
if(equali(usrip,ips)){
sameipid = target
sameipcnt = 1
break
}
}
}
if (sameipcnt){
new target_team = get_user_team(sameipid)
get_name(id,name,31)
get_name(sameipid,target_name,31)
team = get_user_team(id)
if ((team != target_team) && (!(get_user_flags(id)&ADMIN_IMMUNITY)) && (!(get_user_flags(id)&ADMIN_RESERVATION))){
switch(target_team){
case 2: {
cs_set_user_team(id,CS_TEAM_CT,CS_CT_GIGN)
new sjMsg[192]
format(sjMsg,191,"^x04*玩家: ^x03%s^x04 因为和 ^x03%s^x04 相同IP: ^x03%s^x04 加入队伍 CT",name,target_name,usrip)
display_chat( sjMsg)
/*
new oldmoney = cs_get_user_money(killer)
new newmoney
newmoney = oldmoney + 3000
set_user_money(killer,newmoney)
new killer_frags = get_user_frags(killer)
set_user_frags(killer,killer_frags+1)
*/
}
case 1:
{
cs_set_user_team(id,CS_TEAM_T,CS_T_TERROR)
new sjMsg[192]
format(sjMsg,191,"^x04*玩家: ^x03%s^x04 因为和 ^x03%s^x04 相同IP: ^x03%s^x04 加入队伍 T",name,target_name,usrip)
display_chat( sjMsg)
/*
new oldmoney = cs_get_user_money(killer)
new newmoney
newmoney = oldmoney + 3000
set_user_money(killer,newmoney)
new killer_frags = get_user_frags(killer)
set_user_frags(killer,killer_frags+1)
*/
}
}
}
}
}
return PLUGIN_CONTINUE
}
public Death_insameip(){
new id = read_data(2)
new killer = read_data(1)
new wpn[32]
read_data(4,wpn,31)
if ( !killer || killer==id || get_user_team(killer)==get_user_team(id)){
return PLUGIN_CONTINUE
}else{
if (killer){
if (equal(wpn,"knife")){
if (get_cvar_num("knifekillaward") == 1){
new sjMsg[192]
new killer_name[32],id_name[32]
new award = get_cvar_num("knifekillmoney")
new oldmoney = cs_get_user_money(killer)
get_name(killer,killer_name,31)
get_name(id,id_name,31)
new newmoney
newmoney = oldmoney + award
set_user_money(killer, newmoney)
format(sjMsg,191,"^x03%s^x04 用小刀杀死 ^x03%s^x04 得到奖励 ^x01%d",killer_name,id_name,award)
display_chat( sjMsg)
}
}
}
}
return PLUGIN_CONTINUE
}
display_chat( sjMsg[]){
message_begin( MSG_ALL, g_msgid);
write_byte(1);
write_string( sjMsg);
message_end();
}
stock get_name(id, name[32])
{
new buffer = engfunc(EngFunc_GetInfoKeyBuffer, id)
new strtmp1[256]
copy_infokey_buffer(buffer, strtmp1, 255)
new offset = contain(strtmp1, "\name\") + 6
new thischr
new i
for (;;i++)
{
thischr = memhack_get_char(buffer + offset + i, MEM_NULLBASE, MEMTYPE_DATA, MEM_SIGNED)
if (thischr == '\' || thischr == 0)
{
name = 0
break
}
else
{
name = thischr
}
}
} //// sameIPsameTeam.sma
// C:\addons\amxmodx\scripting\sameIPsameTeam.sma(45) : 错误 088: 参数不匹配
// C:\addons\amxmodx\scripting\sameIPsameTeam.sma(46) : 错误 088: 参数不匹配
// C:\addons\amxmodx\scripting\sameIPsameTeam.sma(100) : 错误 088: 参数不匹配
// C:\addons\amxmodx\scripting\sameIPsameTeam.sma(101) : 错误 088: 参数不匹配
//
// 4 个错误 .
// Could not locate output file C:\addons\amxmodx\scripting\compiled\sameIPsameT
eam.amx (compile failed).
//
// Compilation Time: 0.23 sec
// ----------------------------------------
请问这是什么原因?谢谢。 |
|