yxcs123456
|
分享:
▲
▼
o(︶︿︶)o 唉不会传 把原放到这里了 期待大侠解决 小弟万分感谢!!
#include <amxmodx> #include <fun> #include <cstrike> #include <zombieplague> /*===========自定权限分类========*/ //生命 #define hp1 350 #define hp2 100 #define hp3 150 #define hp4 150 #define hp5 500 /*==========*/ //子弹包 #define ap1 40 #define ap2 15 #define ap3 25 #define ap4 50 #define ap5 100 /*=========*/ //护甲 #define am1 350 #define am2 100 #define am3 150 #define am4 150 #define am5 500 public eNewRound(id){ { if(get_user_flags(id) & ADMIN_LEVEL_H){ set_user_health(id, get_user_health(id) + hp1) } if(get_user_flags(id) & ADMIN_LEVEL_B){ set_user_health(id, get_user_health(id) + hp2) } if(get_user_flags(id) & ADMIN_LEVEL_A){ set_user_health(id, get_user_health(id) + hp3) } if(get_user_flags(id) & ADMIN_LEVEL_G){ set_user_health(id, get_user_health(id) + hp4) } if(get_user_flags(id) & ADMIN_LEVEL_C){ set_user_health(id, get_user_health(id) + hp5) } if(get_user_flags(id) & ADMIN_USER){ set_user_health(id, get_user_health(id) + 0) }}} public eResetHUD(id){ set_hudmessage(255,0,0,0.7, 0.5, 0, 10.0, 10.0, 0.5, 0.15, 3) { if(get_user_flags(id) & ADMIN_LEVEL_H){ show_hudmessage(id,"等级权限:<OP>^n^n额外增值生命%d护甲%d子弹包",am1, ap1 ) zp_set_user_ammo_packs(id, zp_get_user_ammo_packs(id) + ap1) cs_set_user_armor(id ,am1 ,CS_ARMOR_KEVLAR) } if(get_user_flags(id) & ADMIN_LEVEL_B){ show_hudmessage(id,"等级权限:<高级VIP>额外增值生命%d护甲%d子弹包",am2, ap2) zp_set_user_ammo_packs(id, zp_get_user_ammo_packs(id) + ap2) cs_set_user_armor(id ,am2 ,CS_ARMOR_KEVLAR) } if(get_user_flags(id) & ADMIN_LEVEL_A){ show_hudmessage(id,"等级权限:<OP巡查>额外增值生命%d护甲%d子弹包",am3, ap3) zp_set_user_ammo_packs(id, zp_get_user_ammo_packs(id) + ap3) cs_set_user_armor(id ,am3 ,CS_ARMOR_KEVLAR) } if(get_user_flags(id) & ADMIN_LEVEL_G){ show_hudmessage(id,"等级权限:<服务器OP>额外增值生命%d护甲%d子弹包",am4, ap4) zp_set_user_ammo_packs(id, zp_get_user_ammo_packs(id) + ap4) cs_set_user_armor(id ,am4 ,CS_ARMOR_KEVLAR) } if(get_user_flags(id) & ADMIN_LEVEL_C){ show_hudmessage(id,"等级权限:<高级OP>额外增值生命%d护甲%d子弹包",am5, ap5) zp_set_user_ammo_packs(id, zp_get_user_ammo_packs(id) + ap5) cs_set_user_armor(id ,am5 ,CS_ARMOR_KEVLAR) } if(get_user_flags(id) & ADMIN_USER){ show_hudmessage(id,"等级权限:<普通玩家>无任何增值生命和护甲^n^n需要弹药请购买VIP") zp_set_user_ammo_packs(id, zp_get_user_ammo_packs(id) + 0) } } }
public plugin_init(){ register_plugin("admin分级系统","1.0","飞的更高") register_event("RoundTime", "eNewRound", "be") register_event("ResetHUD","eResetHUD","be") } public client_putinserver(id){ client_print(0, print_chat, "丧尸之无耻之徒精神摧残服拥有等级分级系统,VIP拥有不同的级别") }
|
|
x0
[1 樓]
From:未知地址 | Posted:2011-01-14 16:09 |
|
|
i-c0112
|
分享:
▲
▼
編排 有點亂呢@@ 內容除了if條件比較有問題外 其他都ok... 有問題的可能是cs_set_user_ammo 或 zp_ser_user_ammo_packs吧 這兩個條件不設好常會造成 run-time erro 複製程式
#include <amxmodx>
#include <fun>
#include <zombieplague>
#include <cstrike>
/*===========自定权限分类========*/
//生命
#define hp1 350
#define hp2 100
#define hp3 150
#define hp4 150
#define hp5 500
/*==========*/
//子弹包
#define ap1 40
#define ap2 15
#define ap3 25
#define ap4 50
#define ap5 100
/*=========*/
//护甲
#define am1 350
#define am2 100
#define am3 150
#define am4 150
#define am5 500
public eNewRound(){
for(new id=1; id <= get_maxplayers(); id++) {
if (!is_user_connected(id) || !is_user_alive(id) || is_user_bot(id))
return;
if(get_user_flags(id) & ADMIN_LEVEL_H)
set_user_health(id, get_user_health(id) + hp1)
else if(get_user_flags(id) & ADMIN_LEVEL_B)
set_user_health(id, get_user_health(id) + hp2)
else if(get_user_flags(id) & ADMIN_LEVEL_A)
set_user_health(id, get_user_health(id) + hp3)
else if(get_user_flags(id) & ADMIN_LEVEL_G)
set_user_health(id, get_user_health(id) + hp4)
else if(get_user_flags(id) & ADMIN_LEVEL_C)
set_user_health(id, get_user_health(id) + hp5)
else if(get_user_flags(id) & ADMIN_USER)
set_user_health(id, get_user_health(id) + 0)
}
}
public eResetHUD(id){
if (!is_user_connected(id) || !is_user_alive(id) || is_user_bot(id))
return;
set_hudmessage(255,0,0,0.7, 0.5, 0, 10.0, 10.0, 0.5, 0.15, 3)
if(get_user_flags(id) & ADMIN_LEVEL_H){
show_hudmessage(id,"等级权限:<OP>^n^n额外增值生命%d护甲%d子弹包",am1, ap1 )
zp_set_user_ammo_packs(id, zp_get_user_ammo_packs(id) + ap1)
cs_set_user_armor(id ,am1 ,CS_ARMOR_KEVLAR)
}
else if(get_user_flags(id) & ADMIN_LEVEL_B){
show_hudmessage(id,"等级权限:<高级VIP>额外增值生命%d护甲%d子弹包",am2, ap2)
zp_set_user_ammo_packs(id, zp_get_user_ammo_packs(id) + ap2)
cs_set_user_armor(id ,am2 ,CS_ARMOR_KEVLAR)
}
else if(get_user_flags(id) & ADMIN_LEVEL_A){
show_hudmessage(id,"等级权限:<OP巡查>额外增值生命%d护甲%d子弹包",am3, ap3)
zp_set_user_ammo_packs(id, zp_get_user_ammo_packs(id) + ap3)
cs_set_user_armor(id ,am3 ,CS_ARMOR_KEVLAR)
}
else if(get_user_flags(id) & ADMIN_LEVEL_G){
show_hudmessage(id,"等级权限:<服务器OP>额外增值生命%d护甲%d子弹包",am4, ap4)
zp_set_user_ammo_packs(id, zp_get_user_ammo_packs(id) + ap4)
cs_set_user_armor(id ,am4 ,CS_ARMOR_KEVLAR)
}
else if(get_user_flags(id) & ADMIN_LEVEL_C){
show_hudmessage(id,"等级权限:<高级OP>额外增值生命%d护甲%d子弹包",am5, ap5)
zp_set_user_ammo_packs(id, zp_get_user_ammo_packs(id) + ap5)
cs_set_user_armor(id ,am5 ,CS_ARMOR_KEVLAR)
}
else if(get_user_flags(id) & ADMIN_USER){
show_hudmessage(id,"等级权限:<普通玩家>无任何增值生命和护甲^n^n需要弹药请购买VIP")
//zp_set_user_ammo_packs(id, zp_get_user_ammo_packs(id) + 0)
}
}
public plugin_init(){
register_plugin("admin分级系统","1.0","飞的更高")
register_event("HLTV", "eNewRound", "a", "1=0", "2=0")
register_event("ResetHUD","eResetHUD","be")
}
public client_putinserver()
client_print(0, print_chat, "丧尸之无耻之徒精神摧残服拥有等级分级系统,VIP拥有不同的级别")
|
|
x0
[2 樓]
From:台灣中華電信 | Posted:2011-01-14 22:03 |
|
|
|