爬梯
本帖最后由 hikaru15jp 于 2009-2-8 08:01 编辑程序作者: xPaw
增补作者: chungkiman
插件名称: ladder
插件语言:中文
适用版本: AMXX1.76 or above
版权声明:
说 明:制作梯的插件,放ladder models 上去再实体化,可爬梯及有爬梯声
Admin指令:
say .ladder -建立梯子
say .removeladder -删除梯子
插件由TestingServer提供
本插件是在转贴的,原发贴者没有提供源码
ps.Mdl档放在cstrike\models
要打开 fakemeta_util modules
看影片就知道了
http://www.youtube.com/watch?v=X5CkJerjihI&eurl=http://www.nightly-love.com/viewthread.php?tid=4252 确实很好看 源码.在这里
#include <amxmodx>
#include <fakemeta_util>
#pragma semicolon 1
#define MODEL "models/ladder.mdl"
// ladder dimensions
new Float:gLadderMinY = {-32.0,-4.0,-32.0};
new Float:gLadderMaxY = { 32.0, 4.0, 32.0};
new bool:gOnLadder;
public plugin_init() {
register_plugin("Ladder", "1.0", "xPaw");
register_clcmd("say .ladder", "cmdCreateLadder");
register_clcmd("say .removeladder", "cmdDeleteLadder");
register_forward( FM_PlayerPreThink, "fwdPlayerPreThink", 0 );
register_forward( FM_Touch, "fwdTouch" );
}
public plugin_precache()
precache_model( MODEL );
public fwdPlayerPreThink(id) {
if ( is_user_alive(id)) {
if( gOnLadder ) {
new Float:velocity;
pev(id, pev_velocity, velocity);
if ( (pev(id, pev_button) & IN_FORWARD) && (velocity == 0.0 || velocity == 0.0) ) {
velocity = 250.0;
set_pev(id, pev_velocity, velocity);
}
gOnLadder = false;
}
new ent, body;
get_user_aiming(id, ent, body, 320);
if (isLadder(ent)) {
set_hudmessage(0, 25, 255, -1.0, -0.90, 0, 1.0, 1.0, 0.2, 0.2, 1);
show_hudmessage(id, "First In-Game Ladder.");
}
}
}
public fwdTouch(ent, id) {
if (is_user_alive(id) && isLadder(ent)) {
set_pev(id, pev_movetype, MOVETYPE_FLY);
gOnLadder = true;
// Velocity way
new Float:velocity;
pev(id, pev_velocity, velocity);
if ( (pev(id, pev_button) & IN_FORWARD) && (velocity == 0.0 || velocity == 0.0) ) {
velocity = 250.0;
set_pev(id, pev_velocity, velocity);
}
}
}
public cmdCreateLadder( id ) {
if (get_user_flags(id) & ADMIN_KICK) {
new Float:vOrigin;
new origin;
//get the origin of the player and add Z offset
get_user_origin(id, origin, 3);
IVecFVec(origin, vOrigin);
vOrigin += 4.0;
createLadder( vOrigin );
client_print(id, print_chat, "* You Spawned Ladder, Have Fun! :-)");
}
}
public cmdDeleteLadder(id) {
if (get_user_flags(id) & ADMIN_KICK) {
new ent, body;
get_user_aiming(id, ent, body);
if (isLadder(ent)) {
fm_remove_entity(ent);
client_print(id, print_chat, "* You Removed Ladder.");
}
}
}
createLadder( Float:vOrigin ) {
new ent = fm_create_entity( "info_target" );
if (fm_is_valid_ent(ent)) {
set_pev(ent, pev_classname, "xpaw_ladder");
set_pev(ent, pev_solid, SOLID_BBOX);
set_pev(ent, pev_movetype, MOVETYPE_NONE);
new Float:vSizeMin;
new Float:vSizeMax;
new Float:vAngles;
vSizeMin = gLadderMinY;
vSizeMax = gLadderMaxY;
vAngles = 90.0;
vAngles = 90.0;
//adjust size min/max vectors depending on scale
for (new i = 0; i < 3; ++i) {
if (vSizeMin != 4.0 && vSizeMin != -4.0)
vSizeMin *= 1.0;
if (vSizeMax != 4.0 && vSizeMax != -4.0)
vSizeMax *= 1.0;
}
fm_entity_set_model(ent, MODEL);
set_pev(ent, pev_angles, vAngles);
fm_entity_set_size(ent, vSizeMin, vSizeMax);
fm_entity_set_origin(ent, vOrigin);
return ent;
}
return 0;
}
bool:isLadder(ent) {
if (fm_is_valid_ent(ent)) {
new szClassname;
pev(ent, pev_classname, szClassname, 32);
if (equal(szClassname, "xpaw_ladder"))
return true;
}
return false;
} 无源码..还要回复干什么.........:o 僵尸F用来看看 下载太贵了
DT设置得那么高- -
下一个东西要 -5 还不如直接用爬墙插件,省了打命令!!!
页:
[1]