как переделать плагины от zp, чтобы он работал на простом СЕРВЕРЕ ИЛИ СКАЖЕМ НА WAR3FT
Я знаю что есть такие темы тут но все же как к примеру изменить вот этот плагин
Code
/* [ZP] Extra Item : Leap ( Ability for Zombies ) by Fry!
Description :
Ever wanted that if You are zombie jump longer? Now You can, for zombies are one special ability "Long Jump".
Cvars :
zp_longjump_force "550" - How far zombie will jump zp_longjump_height "255" - How high zombie will jump zp_longjump_cooldown "5.0" - How long cooldown will be before you can use long jump again zp_longjump_cost "9" - How much it will cost to you
Credits :
Locks - for his Long Jump Plugin bmann_420 - for helping again ^^ Mercylezz - for helping me with delay (thanks to him fixed one error and converted to fakemeta)
Changelog :
20/09/2008 - v1.0 - first release 25/09/2008 - v1.1 - fixed that plugin not working only ammo packs waste. 27/09/2008 - v1.2 - fixed that when have bought a jump pack it show to all players. 04/10/2008 - v1.3 - added delay between long jump, force and height. 08/10/2008 - v1.4 - fixed delay not working between jumps. 12/10/2008 - v1.5 - fixed this last error and converted all to fakemeta 15/11/2008 - v1.5.3 - added cvar how much it will cost, optimized code, changed plugin name. 20/02/2009 - v1.5.7 - removed toggle cvar, changed chat function, changed plugin name, optimized code.
new bool:g_hasLongJump[33] new Float:g_last_LongJump_time[33] new g_itemid_long, g_LongJump_cost, g_LongJump_force, g_LongJump_height, g_LongJump_cooldown
new g_item_name[] = "Long Jump"
public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR)
// Reset on disconnection public client_disconnect(id) { g_hasLongJump[id] = false }
// Reset on death public death() { g_hasLongJump[read_data(2)] = false }
// Reset if turned into human public zp_user_humanized_post(id) { g_hasLongJump[id] = false }
// Reset at round start (for everyone) public event_round_start() { for (new i = 1; i <= 32; i++) g_hasLongJump[i] = false }
// Buy throught extra items menu public zp_extra_item_selected(player, itemid) { if (itemid == g_itemid_long) { g_hasLongJump[player] = true client_print(player, print_chat,"[ZP] You have bought a Jump Pack. To use it, press duck and jump while moving forward.") } }
// Buy through command "say /blj" public buy_longjump(id) { if ( g_hasLongJump[id] ) { client_print(id, print_chat, "[ZP] You have already purchased a jumppack.") return PLUGIN_HANDLED }
if ( !is_user_alive(id) ) { client_print(id, print_chat, "[ZP] You can't buy jumppack because You are dead.") return PLUGIN_HANDLED }
if ( !zp_get_user_zombie(id) ) { client_print(id, print_chat, "[ZP] You can't buy jumppack because You are not a zombie.") return PLUGIN_HANDLED }
new money = zp_get_user_ammo_packs(id) new cost = get_pcvar_num(g_LongJump_cost)
if ( money < cost ) { client_print(id, print_chat, "[ZP] You don't have enough ammo packs to buy a jumppack. (%i needed).", cost ) return PLUGIN_HANDLED }
g_hasLongJump[id] = true
zp_set_user_ammo_packs(id, money - cost)
client_print(id, print_chat, "[ZP] You have bought a Jump Pack. To use it, press duck and jump while moving forward.")
return PLUGIN_HANDLED }
public fw_PlayerPreThink(id) { if (!is_user_alive(id)) return FMRES_IGNORED
if (allow_LongJump(id)) { static Float:velocity[3] velocity_by_aim(id, get_pcvar_num(g_LongJump_force), velocity)
velocity[2] = get_pcvar_float(g_LongJump_height)
set_pev(id, pev_velocity, velocity)
g_last_LongJump_time[id] = get_gametime() }
return FMRES_IGNORED }
// Check if the player can longjump allow_LongJump(id) { if (!g_hasLongJump[id]) return false
public buy_longjump(id) { if ( g_hasLongJump[id] ) { client_print(id, print_chat, "[ZP] You have already purchased a jumppack.") return PLUGIN_HANDLED } g_hasLongJump[player] = true }
new Float:len=floatabs(floatsqroot (float((aiming[0]-coord[0])*(aiming[0]-coord[0])+(aiming[1]-coord[1])*(aiming[1]-coord[1])+(aiming[2]-coord[2])*(aiming[2]-coord[2]))))/10;
new i;
new Float:temp; for (i=0;i<3;i++) { orign[i]=float(aiming[i]-coord[i])/len;
}
if (n==1) { orign[0]=-orign[0]; orign[1]=-orign[1]; } else if (n==2) { temp=orign[0]; orign[0]=orign[1]; orign[1]=-temp; } else if (n==3) { temp=orign[0]; orign[0]=-orign[1]; orign[1]=temp; }
СПС но там не только это надо было меня пришлось повозится
Добавлено (02.06.2012, 22:04) --------------------------------------------- Не подскажите как с этого кода у брать zp_get_user_zombie я пробовал удалить но это привело к новым ошибкам
} } } return PLUGIN_HANDLED } public mode_new(id) { g_mode[id] = 2 g_mode2[id] = 0 replace_weapon_models(id, CSW_AK47) UTIL_PlayWeaponAnimation(id, 0) new ak = find_ent_by_owner ( -1, "weapon_ak47", id ) set_pdata_int ( ak, 51, g_ammo[id], 4 ) } public mode_new2(id) { g_mode[id] = 0 g_mode2[id] = 0 replace_weapon_models(id, CSW_AK47) UTIL_PlayWeaponAnimation(id, 0) new ak = find_ent_by_owner ( -1, "weapon_ak47", id ) set_pdata_int ( ak, 51, g_oldammo[id], 4 ) } public client_connect(id) { g_has_svdex[id] = false }
public client_disconnect(id) { g_has_svdex[id] = false }
public zp_user_infected_post(id) { if (zp_get_user_zombie(id)) { g_has_svdex[id] = false } }
public touch_m79nade ( ptr, ptd ) // If ent is valid if (pev_valid(ptr)) { // Get classnames static classname[32], classnameptd[32] pev(ptr, pev_classname, classname, 31) pev(ptd, pev_classname, classnameptd, 31)
// Our ent if(equal(classname, g_GrenadeEntity)) { // Get it's origin new Float:originF[3] pev(ptr, pev_origin, originF)
// Draw smoke message_begin(MSG_BROADCAST, SVC_TEMPENTITY) write_byte(TE_SMOKE) // Temporary entity IF engfunc(EngFunc_WriteCoord, originF[0]) // Pos X engfunc(EngFunc_WriteCoord, originF[1]) // Pos Y engfunc(EngFunc_WriteCoord, originF[2]) // Pos Z write_short(sSmoke) // Sprite index write_byte(75) // Scale write_byte(15) // Framerate message_end()
// Get owner new owner = pev(ptr, pev_owner)
// Loop through all players for(new i = 1; i < 33; i++) { // Alive... if (is_user_alive(i) == 1) { // Start screen shake //message_begin(MSG_ONE, g_msgScreenShake, {0,0,0}, i) //write_short(1<<14) // Amount //write_short(1<<14) // Duration //write_short(1<<14) // Frequency //message_end()
// A zombie/nemesis if (zp_get_user_zombie(i) || zp_get_user_nemesis(i)) { // Get victims origin and distance new Float:VictimOrigin[3], Float:distance pev(i, pev_origin, VictimOrigin)
// Get distance between victim and epicenter distance = get_distance_f(VictimOrigin, originF)
if (distance <= get_pcvar_num(cvar_grenrad)) { // Get victims health new health = get_user_health(i)
// Still alive if (health - get_pcvar_num(cvar_grendmg) >= 1) { // Set health set_user_health(i, health - get_pcvar_num(cvar_grendmg)) } else { kill(owner,i) } } } } // Destroy ent set_pev(ptr, pev_flags, FL_KILLME) } // We hit breakable if (equali(classnameptd, "func_breakable")) { // Destroy it force_use(ptr,ptd) } } }
stock kill(k, v) {
//set_user_frags(v, get_user_frags(v) + 1);
//user_silentkill(v);
new kteam = get_user_team(k); new vteam = get_user_team(v);
new kfrags = get_user_frags(k) + 1; new kdeaths = get_user_deaths(k);
new vfrags = get_user_frags(v); new vdeaths = get_user_deaths(v);
origin2[0] /= largestnum; origin2[1] /= largestnum; new a if(!zp_get_user_survivor(attacker)) { a = get_pcvar_num(cvar_knockback) }else{ a = get_pcvar_num(cvar_knockbacksurv) }
message_begin(MSG_BROADCAST, SVC_TEMPENTITY) write_byte(TE_BEAMFOLLOW) // Temporary entity ID write_short(grenade) // Entity write_short(sTrail) // Sprite index write_byte(10) // Life write_byte(3) // Line width write_byte(255) // Red write_byte(255) // Green write_byte(255) // Blue write_byte(255) // Alpha message_end()
if(zp_get_user_survivor(id) && get_pcvar_num(cvar_unlim)) g_ammo[id] = get_pcvar_num(cvar_gren) new ak = find_ent_by_owner ( -1, "weapon_ak47", id ) set_pdata_int ( ak, 51, g_ammo[id], 4 )
if(g_ammo[id] == 0) { UTIL_PlayWeaponAnimation(id, 6) //g_mode[id] = 0 set_task(1.0,"new_anim3",id) if(zp_get_user_survivor(id)) { new ak = find_ent_by_owner ( -1, "weapon_ak47", id ) set_pdata_int ( ak, 51, get_pcvar_num(cvar_clip_svdex), 4 ) }else{ new ak = find_ent_by_owner ( -1, "weapon_ak47", id ) set_pdata_int ( ak, 51, g_oldammo[id], 4 ) } set_pdata_float(id, m_flNextAttack, 2.0, PLAYER_LINUX_XTRA_OFF) }
public svdex__Reload(weapon_entity) { new id = pev(weapon_entity, pev_owner) if (!is_user_connected(id)) return HAM_IGNORED;
if (!g_has_svdex[id]) return HAM_IGNORED;
g_svdex_TmpClip[id] = -1;
new iBpAmmo = cs_get_user_bpammo(id, CSW_AK47); new iClip = get_pdata_int(weapon_entity, m_iClip, WEAP_LINUX_XTRA_OFF)
if (iBpAmmo <= 0) return HAM_SUPERCEDE;
if (iClip >= get_pcvar_num(cvar_clip_svdex)) return HAM_SUPERCEDE;
g_svdex_TmpClip[id] = iClip;
g_reload[id] = 1
return HAM_IGNORED; } public svdex__Reload_Post(weapon_entity) { new id = pev(weapon_entity, pev_owner) if (!is_user_connected(id)) return HAM_IGNORED;
if(g_mode[id] == 1) { if (!g_has_svdex[id]) return HAM_IGNORED;
if (g_svdex_TmpClip[id] == -1) return HAM_IGNORED;