|
以下是点通礼物的插件源码,怎样去掉无敌和变轻模式?
#include <amxmodx>
#include <fun>
#include <cstrike>
#include "dtgifts"
#define TID_GODMODE 40201
#define TID_GRAVITY_UP 40251
#define PLUGIN_NAME "DTGifts-Fun"
#define PLUGIN_VERSION "1.1"
#define PLUGIN_AUTHOR "ahcat"
public plugin_init() {
register_plugin( PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR);
register_dictionary( "dt_gift.txt");
register_gift_l( "life_increase", "GIFT_LIFEUP_NAME", "GIFT_LIFEUP_INFO", 45);
register_gift_l( "money_increase", "GIFT_ADDMONEY_NAME", "GIFT_ADDMONEY_INFO", 45);
register_gift_l( "become_god", "GIFT_STRANGE", "GIFT_GODMODE", 45);
register_gift_l( "strip_weapons", "GIFT_STRANGE", "STRIP_WEAPONS", 15);
register_gift_l( "gravity_up", "GIFT_STRANGE", "GRAVITY_UP", 45);
register_event("DeathMsg", "hook_death", "a");
}
public life_increase( id){
set_user_health( id, get_user_health( id) + 50);
}
public money_increase( id){
cs_set_user_money( id, cs_get_user_money( id) + 4000);
}
public become_god( id){
if( task_exists( id + TID_GODMODE))
remove_task( id + TID_GODMODE);
set_user_godmode( id, 1);
client_print( id, print_chat, "%L", LANG_PLAYER, "YOU_BECOME_GOD");
set_task( 30.0, "remove_godmode", TID_GODMODE + id);
}
public remove_godmode( id){
id -= TID_GODMODE;
if( is_user_alive( id)){
set_user_godmode( id, 0);
client_print( id, print_chat, "%L", LANG_PLAYER, "GODMODE_DISAPPEAR");
}
}
public strip_weapons( id){
strip_user_weapons( id);
}
public gravity_up( id){
if( task_exists( id + TID_GRAVITY_UP))
remove_task( id + TID_GRAVITY_UP);
set_user_gravity( id, 0.5);
client_print( id, print_chat, "%L", LANG_PLAYER, "GRAVITY_UP");
set_task( 30.0, "remove_gravity", TID_GRAVITY_UP + id);
}
public remove_gravity( id){
id -= TID_GRAVITY_UP;
if( is_user_alive( id)){
set_user_gravity( id, 1.0);
client_print( id, print_chat, "%L", LANG_PLAYER, "GRAVITY_UP_DISAPPEAR");
}
}
public hook_death(){
new nVictim = read_data(2);
if( task_exists( nVictim + TID_GODMODE))
remove_task( nVictim + TID_GODMODE);
if( task_exists( nVictim + TID_GRAVITY_UP))
remove_task( nVictim + TID_GRAVITY_UP);
} |
|