求OP能在基地回血的插件,如图。非常感谢!
http://img2011.5sing.com/m/2011/11/24/9b5840be-3160-4c2b-b78d-250aaf55fe98.jpg希望能发源码,非常感谢。 去翻一下发布区03年至05年的帖子可找到这东西了..以前发过一次的了 http://forums.alliedmods.net/showthread.php?t=550 呵呵、、有意思、、 编译不了、 本帖最后由 coolhurter 于 2011-11-27 00:20 编辑
/* AMX Mod script.
*
*Health Replinish
*(C)2003 by GeekGod Industries, this script is provided as is (No Warranties)
*Based on Jailbreak by SpaceDude, rewritten to only handle health recharges
*
*/
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <cstrike>
#include <fun>
#define TE_BEAMPOINTS 0
#define TE_SPRITETRAIL 15
#define HEALTHSIZE 40
#define HEALTHLIFE 20 // seconds*10
#define HEALTHBEAMWIDTH 15
#define HEALTHBEAMNOISE 0
#define HEALTHBEAMBRIGHTNESS 64
#define RESCUETIME 30.0
#define MAXESCAPEATTEMPTS 3
#define BURYDEPTH 40
#define RESCUECOUNTDOWN 5
new bool:THealthSet // Terrorist = Team 1
new bool:CTHealthSet // Counter-Terrorist = Team 2
new THealthCoords
new CTHealthCoords
new PlayerCoords
new bool:IsInHealth
new bool:CheckIfStuck
new bool:IsBuried
new EscapeAttempts
new HealthBeam
//new flaresprite
//new gmsgDeathMsg
new gmsgScoreAttrib
public new_round(id)
{
if (get_cvar_num("gg_replinishhealth")==0) return PLUGIN_CONTINUE
new teamnumber=get_user_team(id)
if (teamnumber==1 && !THealthSet)
{
get_user_origin(id, THealthCoords)
THealthSet=true
}
else if (teamnumber==2 && !CTHealthSet)
{
get_user_origin(id, CTHealthCoords)
CTHealthSet=true
}
IsInHealth=false
IsBuried=false
EscapeAttempts=0
CheckIfStuck=false
set_user_godmode(id)
set_user_rendering(id)
return PLUGIN_CONTINUE
}
public create_health_box(){
if (get_cvar_num("gg_replinishhealth")==0) return PLUGIN_CONTINUE
new red, green, blue
new origin
new x1, y1, x2, y2, height
new i, j, k
new shape = {{1,1},{-1,1},{-1,-1},{1,-1}}
for (j=0; j<4; j++){
height=30*j-30
for (i=0; i<4; i++){
x1=shape*HEALTHSIZE
y1=shape*HEALTHSIZE
if (i<3){
x2=shape*HEALTHSIZE
y2=shape*HEALTHSIZE
}
else{
x2=shape*HEALTHSIZE
y2=shape*HEALTHSIZE
}
for (k=1; k<3; k++){
if (k==1){
copy(origin,3,THealthCoords)
red=255
green=0
blue=0
}
else if (k==2){
copy(origin,3,CTHealthCoords)
red=0
green=0
blue=255
}
message_begin( MSG_BROADCAST, SVC_TEMPENTITY )
write_byte( TE_BEAMPOINTS )
write_coord(origin+x1)
write_coord(origin+y1)
write_coord(origin+height)
write_coord(origin+x2)
write_coord(origin+y2)
write_coord(origin+height)
write_short(HealthBeam) // model
write_byte( 0 ) // start frame
write_byte( 0 ) // framerate
write_byte( HEALTHLIFE ) // life
write_byte( HEALTHBEAMWIDTH )// width
write_byte( HEALTHBEAMNOISE ) // noise
write_byte( red ) // r, g, b
write_byte( green ) // r, g, b
write_byte( blue ) // r, g, b
write_byte( HEALTHBEAMBRIGHTNESS ) // brightness
write_byte( 0 ) // speed
message_end()
}
}
}
return PLUGIN_CONTINUE
}
public check_position(){
if (get_cvar_num("gg_replinishhealth")==0) return PLUGIN_CONTINUE
new origin, playerorigin, players
new i, numofplayers, id
new teamnumber
get_players(players, numofplayers)
for (i=0; i<numofplayers; i++){
id=players
if (!is_user_alive(id)) continue
get_user_origin(id, playerorigin)
teamnumber = get_user_team(id)
if (teamnumber==2)
{
copy(origin,3,CTHealthCoords)
}
else if (teamnumber==1)
{
copy(origin,3,THealthCoords)
}
if (CheckIfStuck && PlayerCoords==playerorigin){
origin+=random_num(-HEALTHSIZE+20,HEALTHSIZE-20)
origin+=random_num(-HEALTHSIZE+20,HEALTHSIZE-20)
origin+=1 // Avoid getting teleported all over the place on certain maps
set_user_origin(id, origin)
PlayerCoords=origin
CheckIfStuck=true
}
CheckIfStuck=false
if(!(origin-playerorigin > HEALTHSIZE || origin-playerorigin < -HEALTHSIZE ||
origin-playerorigin > HEALTHSIZE || origin-playerorigin < -HEALTHSIZE ||
origin-playerorigin > HEALTHSIZE || origin-playerorigin < -HEALTHSIZE))
{
// person is in health box, replinish health by 5 or 10
if(get_user_health(id)<100)
{
set_user_health(id,get_user_health(id)+5)
cs_set_user_money(id,cs_get_user_money(id)+1000)
client_print(id,print_chat," Increasing health by 5 points");
if(get_user_health(id)>99)
{
client_print(id,print_chat," Health is now maxed.Go fight!");
client_cmd(id, "spk ^"fvox/administering_medical^"")
}
}
}
}
return PLUGIN_CONTINUE
}
public end_round(){
if (get_cvar_num("gg_replinishhealth")==0) return PLUGIN_CONTINUE
THealthSet=false
CTHealthSet=false
return PLUGIN_CONTINUE
}
public scoreboard(id,state){ // 0 - nothing, 1 - dead, 2 - bomb
message_begin( MSG_ALL, gmsgScoreAttrib,{0,0,0},0)
write_byte(id)
write_byte(state)
message_end()
return PLUGIN_HANDLED
}
public client_connect(id){
if (get_cvar_num("gg_replinishhealth")==0) return PLUGIN_CONTINUE
IsInHealth=false
return PLUGIN_CONTINUE
}
public plugin_precache(){
HealthBeam = precache_model("sprites/zbeam4.spr")
//flaresprite = precache_model( "sprites/blueflare2.spr")
return PLUGIN_CONTINUE
}
public plugin_init()
{
//gmsgDeathMsg = get_user_msgid("DeathMsg")
gmsgScoreAttrib = get_user_msgid("ScoreAttrib")
register_plugin("Health Replinish","0.1.0","GeekGod")
register_cvar("Health_Replinish","1.02",FCVAR_SERVER)
register_event("SendAudio","end_round","a","2=%!MRAD_terwin","2=%!MRAD_ctwin","2=%!MRAD_rounddraw")
register_event("ResetHUD", "new_round", "b")
register_cvar("gg_replinishhealth","1",0)
set_task(2.5,"create_health_box",987,"",0,"b")
set_task(1.0,"check_position",963,"",0,"b")
return PLUGIN_CONTINUE
}
提示两处错误,无法编译。//AMXXPC compile.exe
// by the AMX Mod X Dev Team
//// health_replinish.sma
// D:\Program Files\CS1.6标准版\cstrike\addons\amxmodx\scripting\health_replinis
h.sma(184) : error 010: invalid function or declaration
// D:\Program Files\CS1.6标准版\cstrike\addons\amxmodx\scripting\health_replinis
h.sma(187) : error 029: invalid expression, assumed zero
//
// 2 Errors.
// Could not locate output file D:\Program Files\CS1.6标准版\cstrike\addons\amxm
odx\scripting\compiled\health_replinish.amx (compile failed).
//
// Compilation Time: 0.12 sec
// ----------------------------------------
Press enter to exit ...
希望帮忙解决下。 public scoreboard(id,state){ // 0 - nothing, 1 - dead, 2 - bomb
message_begin( MSG_ALL, gmsgScoreAttrib,{0,0,0},0)
write_byte(id)
write_byte(state)
message_end()
return PLUGIN_HANDLED
}
是这行吧,我注释掉这行。编译有个错误,但是插件能用。 试试瞧行不行
页:
[1]