-=貌似惩罚插件=-
本帖最后由 Hebe 于 2009-7-15 18:24 编辑#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <fakemeta_stocks>
#pragma semicolon 1
#define PLUGIN "Punisher"
#define VERSION "1.4.1"
#define AUTHOR "R3X"
#define Keyspunisher (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<7)|(1<<8)|(1<<9)
#define TASK_BLUR 1
#define TASK_FALL 33
#define TASK_HOST 65
#define TASK_DETONATE 97
#define TASK_EXEC 129
//#define TASK_BALL 161
#define set_blur(%1) fm_set_rendering(id, kRenderFxNone, _,_,_, kRenderTransTexture, %1)
#define FALL_DOWN "models/apache.mdl"
#define HOST_MODEL "models/hostage.mdl"
#define C4_MODEL "models/w_c4.mdl"
#define EXEC_MODEL "models/v_deagle.mdl"
#define BALL_MODEL "models/football.mdl"
new gHeliSound[]="ambience/heli-pass.wav";
new gSound[]="ambience/lightningbolt.wav";
new gC4[]="weapons/c4_beep5.wav";
new gC4exp[]="weapons/c4_explode1.wav";
new gWeaponSnd[]="weapons/deagle-1.wav";
#define SIZEOFMETHODS 8
new gszMethods[]={
"random",
"explode",
"blur",
"light",
"falldown",
"hostage",
"execution",
"football"
};
new MenuPospunisher;
new MenuPlayerspunisher;
new g_punish;
new MethodOffset;
new g_Amount;
new gmsgScreenFade;
new iLightning, iExplosion;
new bool:g_freeze;
public plugin_init(){
register_plugin(PLUGIN, VERSION, AUTHOR);
register_dictionary("punisher.txt");
register_menucmd(register_menuid("punishment"), Keyspunisher, "Pressedpunishment");
register_menucmd(register_menuid("punisher"), Keyspunisher, "Pressedpunisher");
register_clcmd("punisher", "cmd_punishser",ADMIN_SLAY, "<Punisher>");
new szCmd;
for(new i=0;i<SIZEOFMETHODS;i++){
formatex(szCmd, 29, "amx_punisher_%s", gszMethods);
register_concmd(szCmd,"cmd_amx_punisher_", ADMIN_SLAY, "<#userid, Nick, SteamId>");
}
register_event("DeathMsg", "eventDeathMsg", "a");
gmsgScreenFade=get_user_msgid("ScreenFade");
register_forward(FM_PlayerPreThink, "eventPreThink");
register_forward( FM_CmdStart, "fwCmdStart");
register_forward(FM_Think, "eventThink");
server_cmd("amx_addmenuitem ^"Punisher ;D^" ^"punisher^" ^"hu^" ^"punisher.amxx^"");
}
public eventThink(ent){
new class;
pev(ent, pev_classname, class, 9);
if(equal(class,"myhost")){
set_pev(ent, pev_nextthink, get_gametime()+0.1);
}
else if(equal(class,"football")){
set_pev(ent, pev_nextthink, get_gametime()+0.05);
new Float:Origin;
pev(ent, pev_origin, Origin);
Origin-=5.0;
set_pev(ent, pev_origin, Origin);
new id=pev(ent, pev_owner);
Origin=fm_entity_range(ent, id);
if(Origin < 40.0){
slay(pev(ent, pev_euser1), id);
}
if(Origin > 250.0){
new param;
param=ent;
EntRemove(param);
}
}
}
public plugin_precache(){
iLightning=precache_model("sprites/lgtning.spr");
iExplosion=precache_model("sprites/bexplo.spr");
precache_model(FALL_DOWN);
precache_model(HOST_MODEL);
precache_model(C4_MODEL);
precache_model(EXEC_MODEL);
precache_model(BALL_MODEL);
precache_sound(gSound);
precache_sound(gHeliSound);
precache_sound(gC4);
precache_sound(gC4exp);
precache_sound(gWeaponSnd);
}
/*
Commands
*/
public cmd_punishser(id, level, cid) {
if(!cmd_access(id, level, cid, 1)) return PLUGIN_HANDLED;
ShowMenupunisher(id, MenuPospunisher=0);
return PLUGIN_HANDLED;
}
public cmd_amx_punisher_(id, level, cid){
if(!cmd_access(id, level, cid, 2)) return PLUGIN_HANDLED;
new szTarget, iTarget;
read_argv(1, szTarget, 33);
iTarget=cmd_target(id, szTarget,0);
if(is_user_alive(iTarget)){
new szCmd;
read_argv(0, szCmd, 32);
if(containi(szCmd,"random")>=0)
formatex(szCmd, 32, "amx_punisher_%s", gszMethods);
if(containi(szCmd,"explode")>=0)
ExplodePlayer(id, iTarget);
else if(containi(szCmd,"blur") >=0)
BlurPlayer(id, iTarget);
else if(containi(szCmd,"light") >=0)
LightPlayer(id, iTarget);
else if(containi(szCmd,"falldown") >=0)
FallDownPlayer(id, iTarget);
else if(containi(szCmd,"hostage")>=0)
HostagePlayer(id, iTarget);
else if(containi(szCmd, "execution")>=0)
ExecutionPlayer(id, iTarget);
else if(containi(szCmd, "football")>=0)
FootballPlayer(id, iTarget);
}
return PLUGIN_HANDLED;
}
/*
Menus
*/
public ShowMenupunisher(id, position) {
// Menu stuff //
if (position < 0) { return 0; }
new i, k;
new MenuBody;
new CurrentKey = 0;
new Start = position * 7;
new Num;
new UserName;
get_players(MenuPlayerspunisher, Num);
if (Start >= Num) { Start = position = MenuPospunisher = 0; }
new Len = format(MenuBody, 255, "\yPunisher player\R%d/%d^n\w^n", position+1, (Num / 7 + ((Num % 7) ? 1 : 0 )) );
new End = Start + 7;
new Keys = (1<<9);
if (End > Num) { End = Num; }
for(i=Start;i<End;i++) {
k = MenuPlayerspunisher;
get_user_name(k, UserName, 31);
if(is_user_alive(k)){
Keys |= (1<<CurrentKey++);
Len += format(MenuBody, (255-Len), "\w%i. %s^n", CurrentKey, UserName);
}else
Len += format(MenuBody, (255-Len), "\d%i. %s^n", ++CurrentKey, UserName);
}
if (End != Num) {
format(MenuBody, (255-Len), "^n\w9. Next^n%s", position ? "\w0. Back" : "\w0. Exit");
Keys |= (1<<8);
}
else {
format(MenuBody, (255-Len), "^n%s", position ? "\w0. Back" : "\w0. Exit");
}
show_menu(id, Keys, MenuBody, -1, "punisher");
return 0;
}
public Pressedpunisher(id, key) {
switch (key) {
case 8: ShowMenupunisher(id, ++MenuPospunisher); // More Option
case 9: ShowMenupunisher(id, --MenuPospunisher); // Back Option
default: {
// Get User ID
new PlayerID = MenuPlayerspunisher;
if(!is_user_alive(PlayerID)) return PLUGIN_HANDLED;
Showpunishment(id, PlayerID);
}
}
return PLUGIN_HANDLED;
}
public Showpunishment(id, who) {
if(!is_user_alive(who)) return;
g_punish=who;
new UserName;
get_user_name(who, UserName, 31);
new szMenu, iLen=0;
new Keys=(1<<8)|(1<<9);
iLen+=formatex(szMenu, 263, "\yPunish %s^n^n\w", UserName);
if(MethodOffset<0) MethodOffset=0;
new start=MethodOffset, stop=min(5+MethodOffset, SIZEOFMETHODS-1);
new buff;
for(new j=0, i=start;i<=stop;j++,i++){
Keys|=(1<<j);
formatex(buff, 15, "%s",gszMethods);
strtoupper(buff);
iLen+=formatex(szMenu, 263-iLen, "\w%d. %L^n", j+1, id, buff);
}
iLen+=formatex(szMenu, 263-iLen, "^n");
if(start>0){
Keys|=(1<<6);
iLen+=formatex(szMenu, 263-iLen, "7. Previous^n");
}
if(5+MethodOffset < SIZEOFMETHODS){
Keys|=(1<<7);
iLen+=formatex(szMenu, 263-iLen, "8. Next^n");
}
iLen+=formatex(szMenu, 263-iLen, "^n9. Back^n 0. Exit");
show_menu(id, Keys, szMenu, -1, "punishment"); // Display menu
}
public Pressedpunishment(id, key) {
if(key<0 || !is_user_alive(g_punish)) return;
switch (key) {
case 6:{
MethodOffset-=6;
Showpunishment(id, g_punish);
}
case 7:{
MethodOffset+=6;
Showpunishment(id, g_punish);
}
case 8:{
ShowMenupunisher(id, MenuPospunisher);
MethodOffset=0;
}
case 9:{
MethodOffset=0;
}
default:{
client_cmd(id, "amx_punisher_%s #%d", gszMethods], get_user_userid(g_punish));
MethodOffset=0;
}
}
}
/*
Events
*/
public eventDeathMsg(){
//new iKiller=read_data(1);
new iVictim=read_data(2);
if(task_exists(TASK_BLUR+iVictim))
remove_task(TASK_BLUR+iVictim);
}
public eventPreThink(id){
if(g_freeze){
new button=pev(id,pev_button);
set_pev(id,pev_velocity,Float:{0.0,0.0,0.0}); // stop motion
set_pev(id, pev_oldbuttons, pev(id,pev_oldbuttons)&(~IN_DUCK));
engfunc(EngFunc_SetClientMaxspeed,id,0.00001); // keep immobile
if(( button & IN_JUMP) && !(pev(id,pev_oldbuttons) & IN_JUMP) && (pev(id,pev_flags) & FL_ONGROUND))
【帖子长度限制源码无法全发】
劳烦哪位汉化一下!
你用AMXX_Studio看,一个个汉化不就可以了嘛。。。- - 什么惩罚的?里面还要加载武器的模型文件还要加载声音文件,没看过哪个惩罚还要加载model的 那是你没看过!amx_super.amxx里都有过!
玩家被大石头砸死.....被N个火箭弹炸死.....效果多着呢```` 那你错了,super里没有大石头砸人。。。 那插件我忘记名字了!反正和SUPER差不多
好像SUPER-||之类的有超多惩罚效果命令 怎么个惩罚发? 来看看学习下 太深了看不明白 惩罚什么?
页:
[1]
2