ZM VIP plugin

Vaata eelmist teemat Vaata järgmist teemat Go down

Sixthen
Sixthen
Juunior
Liitus : 06/06/2016
Postitusi : 63

PostitamineSixthen 24.10.17 13:11

Tervist,

Oleks vaja töötavat ZM MODile VIP pluginat mis peaks sisaldama VIPidel siis järgnevat

- Multijump (2x)
- Extra ammo packs (Kill = 2 AP, Infection = 3 AP )
- VIPide kuvamine
- VIPi tellimise info "/vip"
- Automaatselt 100 armor

Töötava plugina korral võib maksta ka € vaevatasu.
avatar
Külaline
Külaline

PostitamineKülaline 24.10.17 17:43

Selline plugin ilmselgelt internetis olemas, selleeest maksta pole mõtet. Kui hiljem aega leian viskan koodi siia.
Sixthen
Sixthen
Juunior
Liitus : 06/06/2016
Postitusi : 63

PostitamineSixthen 24.10.17 17:43

Selline plugin on tõepoolest netis saadaval, kuid üsna vigane.
avatar
Külaline
Külaline

PostitamineKülaline 24.10.17 21:04

Kood:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <zombieplague>
#include <hamsandwich>
#include <cstrike>
#include <engine>

#define VIPFLAG ADMIN_LEVEL_H

new g_iExtraArmor, g_iStartHealth, g_iStartArmor

// CS Offsets
#if cellbits == 32
const OFFSET_CLIPAMMO = 51
#else
const OFFSET_CLIPAMMO = 65
#endif
const OFFSET_LINUX_WEAPONS = 4

new Float:g_damage[33]

// Max Clip for weapons
new const MAXCLIP[] = { -1, 13, -1, 10, 1, 7, -1, 30, 30, 1, 30, 20, 25, 30, 35, 25, 12, 20,
10, 30, 100, 8, 30, 30, 20, 2, 7, 30, 30, -1, 50 }

new g_has_unlimited_clip[33], g_damage_reward

enum
{
SCOREATTRIB_ARG_PLAYERID = 1,
SCOREATTRIB_ARG_FLAGS
};

enum ( <<= 1 )
{
SCOREATTRIB_FLAG_NONE = 0,
SCOREATTRIB_FLAG_DEAD = 1,
SCOREATTRIB_FLAG_BOMB,
SCOREATTRIB_FLAG_VIP
};

new jumpnum[33] = 0
new bool:dojump[33] = false

public plugin_init()
{
register_plugin("Lel", "0.1", "cchq")

RegisterHam(Ham_Spawn, "player", "OnPlayerSpawnPost", 1)
RegisterHam(Ham_Killed, "player", "OnPlayerKilled")

RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage")

g_iExtraArmor = register_cvar("vip_extra_armor", "15")
g_iStartHealth = register_cvar("vip_start_HP", "150")
g_iStartArmor = register_cvar("vip_start_armor", "100")
g_damage_reward = register_cvar("vip_damage_reward", "100")
register_cvar("vip_enable_jumps","0")
register_cvar("vip_maxjumps","0")

register_message( get_user_msgid( "ScoreAttrib" ), "MessageScoreAttrib" );
}
/*
=====================================
============MAIN CODE================
=====================================
*/
public OnPlayerSpawnPost(id)
{
if(is_user_alive(id) && !zp_get_user_zombie(id) && get_user_flags(id) & VIPFLAG)
{
set_pev(id, pev_health, get_pcvar_float(g_iStartHealth))
set_pev(id, pev_armorvalue, get_pcvar_float(g_iStartArmor))
}
}
public fw_TakeDamage(victim, inflictor, attacker, Float:damage, damage_type)
{
if(get_user_flags(attacker) & VIPFLAG)
{
damage *= 2
SetHamParamFloat(4, damage)
}

if(get_user_flags(attacker) & VIPFLAG) {
if(get_pcvar_num(g_damage_reward) > 0) {
g_damage[attacker]+=damage
if(g_damage[attacker] > get_pcvar_float(g_damage_reward)) {
zp_set_user_ammo_packs(attacker, zp_get_user_ammo_packs(attacker)+1)
g_damage[attacker] -= get_pcvar_float(g_damage_reward)
}
}
}

}
public OnPlayerKilled(victim, attacker)
{
if(!is_user_alive(attacker) || victim == attacker)
return

if(!zp_get_user_zombie(attacker) && get_user_flags(attacker) & VIPFLAG)
{
set_pev(attacker, pev_armorvalue, pev(attacker, pev_armorvalue) + get_pcvar_float(g_iExtraArmor))
for (new id; id <= 32; id++) g_has_unlimited_clip[id] = true;
}
}
// Reset flags for all players on newround
public event_round_start()
{
for (new id; id <= 32; id++) g_has_unlimited_clip[id] = false;
}

public client_putinserver(id)
{
jumpnum[id] = 0
dojump[id] = false
}

public client_disconnect(id)
{
jumpnum[id] = 0
dojump[id] = false
}

// Unlimited clip code
public message_cur_weapon(msg_id, msg_dest, msg_entity)
{
// Player doesn't have the unlimited clip upgrade
if (!g_has_unlimited_clip[msg_entity])
return;

// Player not alive or not an active weapon
if (!is_user_alive(msg_entity) || get_msg_arg_int(1) != 1)
return;

static weapon, clip
weapon = get_msg_arg_int(2) // get weapon ID
clip = get_msg_arg_int(3) // get weapon clip

// Unlimited Clip Ammo
if (MAXCLIP[weapon] > 2) // skip grenades
{
set_msg_arg_int(3, get_msg_argtype(3), MAXCLIP[weapon]) // HUD should show full clip all the time

if (clip < 2) // refill when clip is nearly empty
{
// Get the weapon entity
static wname[32], weapon_ent
get_weaponname(weapon, wname, sizeof wname - 1)
weapon_ent = fm_find_ent_by_owner(-1, wname, msg_entity)

// Set max clip on weapon
fm_set_weapon_ammo(weapon_ent, MAXCLIP[weapon])
}
}
}
public MessageScoreAttrib( iMsgId, iDest, iReceiver )
{
new iPlayer = get_msg_arg_int( SCOREATTRIB_ARG_PLAYERID );

if( access( iPlayer, VIPFLAG ) )
{
set_msg_arg_int( SCOREATTRIB_ARG_FLAGS, ARG_BYTE, SCOREATTRIB_FLAG_VIP );
}
}
public client_PreThink(id)
{
if(!is_user_alive(id)) return PLUGIN_CONTINUE
if(get_cvar_num("vip_enable_jumps") && (!access(id,VIPFLAG))) return PLUGIN_CONTINUE
new nbut = get_user_button(id)
new obut = get_user_oldbutton(id)
if((nbut & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(obut & IN_JUMP))
{
if(jumpnum[id] < get_cvar_num("vip_maxjumps"))
{
dojump[id] = true
jumpnum[id]++
return PLUGIN_CONTINUE
}
}
if((nbut & IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))
{
jumpnum[id] = 0
return PLUGIN_CONTINUE
}
return PLUGIN_CONTINUE
}

public client_PostThink(id)
{
if(!is_user_alive(id)) return PLUGIN_CONTINUE
if(get_cvar_num("vip_enable_jumps") && (!access(id,VIPFLAG))) return PLUGIN_CONTINUE
if(dojump[id] == true)
{
new Float:velocity[3]
entity_get_vector(id,EV_VEC_velocity,velocity)
velocity[2] = random_float(265.0,285.0)
entity_set_vector(id,EV_VEC_velocity,velocity)
dojump[id] = false
return PLUGIN_CONTINUE
}
return PLUGIN_CONTINUE
}
/*
=====================================
============STOCKS===================
=====================================
*/
// Find entity by its owner (from fakemeta_util)
stock fm_find_ent_by_owner(entity, const classname[], owner)
{
while ((entity = engfunc(EngFunc_FindEntityByString, entity, "classname", classname)) && pev(entity, pev_owner) != owner) {}

return entity;
}

// Set Weapon Clip Ammo
stock fm_set_weapon_ammo(entity, amount)
{
set_pdata_int(entity, OFFSET_CLIPAMMO, amount, OFFSET_LINUX_WEAPONS);
}

See töötab, aga iseenesest siia neid client_printe lihtne lisada /vip jms. Prolly sellega saaksid ise hakkama. See mu vanast ZM'ist alles, ei mäleta kes reaalse koodi tegi, ise vast midagi timminud, aga AP süsteem on damage peal nagu Sa näed.

Kui ei sobi siis äkki leian mõne parema.

Vaata eelmist teemat Vaata järgmist teemat Tagasi üles

Soovid vestluses osaleda?

Selleks logi sisse või tee endale kasutaja.

Liitu foorumiga

Tee endale kasutaja ning osale aruteludes.


Tee uus kasutaja

Logi sisse

Omad foorumis juba kasutajat? Logi sisse.


Logi sisse

 
Permissions in this forum:
Sa ei saa vastata siinsetele teemadele