AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Zombie Plague Mod (https://forums.alliedmods.net/forumdisplay.php?f=126)
-   -   [Help]Class ZM only for Admins (https://forums.alliedmods.net/showthread.php?t=118454)

edduard 02-11-2010 07:17

[Help]Class ZM only for Admins
 
How i put this class only for admins?
Thanks.
Quote:

#include <amxmodx>
#include <fakemeta>
#include <zombieplague>
#define PLUGIN "[ZP] Class : Leap Zombie"
#define VERSION "1.4.2"
#define AUTHOR "Fry!"
new const zclass_name[] = "Leap Zombie"
new const zclass_info[] = "HP+ Speed+ Gravity++ Knockback++"
new const zclass_model[] = "zombie_source"
new const zclass_clawmodel[] = "v_knife_zombie.mdl"
const zclass_health = 2200
const zclass_speed = 230
const Float:zclass_gravity = 0.5
const Float:zclass_knockback = 1.7
new bool:g_hasLeap[33]
new g_zclass_Leap, g_Leap_force, g_Leap_height
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)

register_cvar("zp_zclass_leap_zombie",VERSION ,FCVAR_SERVER|FCVAR_EXTDLL|FCVAR_UNLOGGED|FCV AR_SPONLY)

g_Leap_force = register_cvar("zp_zclass_leap_force", "570")
g_Leap_height = register_cvar("zp_zclass_leap_height", "275")

register_forward(FM_PlayerPreThink, "fw_PlayerPreThink")
}
public plugin_precache()
{
g_zclass_Leap = zp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback)
}
public client_connect(id)
{
g_hasLeap[id] = false
}
public zp_user_infected_post(player, infector)
{
if (zp_get_user_zombie_class(player) == g_zclass_Leap)
g_hasLeap[player] = true

return PLUGIN_CONTINUE
}
public zp_user_humanized_post(player)
{
g_hasLeap[player] = false
}
public fw_PlayerPreThink(id)
{
if (!is_user_alive(id) || !zp_get_user_zombie(id))
return FMRES_IGNORED

if (zp_get_user_zombie_class(id) != g_zclass_Leap)
{
g_hasLeap[id] = false
}

if (allowed_Leap(id))
{
g_hasLeap[id] = true

static Float:velocity[3]
velocity_by_aim(id, get_pcvar_num(g_Leap_force), velocity)

velocity[2] = get_pcvar_float(g_Leap_height)

set_pev(id, pev_velocity, velocity)
}

return FMRES_IGNORED
}
allowed_Leap(id)
{
if (!zp_get_user_zombie(id) || zp_get_user_zombie_class(id) != g_zclass_Leap)
return false

static buttons
buttons = pev(id, pev_button)

if (!(pev(id, pev_flags) & FL_ONGROUND) || fm_get_speed(id) < 20 || !(buttons & IN_JUMP) || !(buttons & IN_DUCK))
return false

return true
}
stock fm_get_speed(entity)
{
static Float:velocity[3]
pev(entity, pev_velocity, velocity)

return floatround(vector_length(velocity))
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1049\\ f0\\ fs16 \n\\ par }
*/


edduard 02-18-2010 07:20

Re: [Help]Class ZM only for Admins
 
Somebody help me?

georgik57 02-18-2010 11:40

Re: [Help]Class ZM only for Admins
 
giving some rights just for admins sucks
i saw this on many romanian servers...that's why they all suck
and also because they're full of retards

meTaLiCroSS 02-18-2010 14:54

Re: [Help]Class ZM only for Admins
 
Quote:

Originally Posted by georgik57 (Post 1092556)
they're full of retards

:crab::crab::crab::crab::crab::crab:

edduard 02-18-2010 17:04

Re: [Help]Class ZM only for Admins
 
If you don't help me...please SHUT UP!

AfteR. 02-18-2010 19:25

Re: [Help]Class ZM only for Admins
 
Go here:

PHP Code:

public zp_user_infected_post(playerinfector)
{
if (
zp_get_user_zombie_class(player) == g_zclass_Leap)
g_hasLeap[player] = true

return PLUGIN_CONTINUE


And change it for this:

PHP Code:

public zp_user_infected_post(playerinfector)
{
if (
zp_get_user_zombie_class(player) == g_zclass_Leap && is_user_admin(player))
g_hasLeap[player] = true

return PLUGIN_CONTINUE


Only admins will have long jump, if not, they will only get speed, gravity, knockback and health.

oponing-force 02-18-2010 19:45

Re: [Help]Class ZM only for Admins
 
Quote:

Originally Posted by meTaLiCroSS (Post 1092728)
:crab::crab::crab::crab::crab::crab:

fuck you :up:

chileno gordo :up:

puto :up:

edduard 02-19-2010 00:28

Re: [Help]Class ZM only for Admins
 
Thanks AfteR.


All times are GMT -4. The time now is 13:19.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.