Raised This Month: $29 Target: $400
 7% 

[Help]Class ZM only for Admins


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
edduard
Junior Member
Join Date: Sep 2009
Old 02-11-2010 , 07:17   [Help]Class ZM only for Admins
Reply With Quote #1

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 is offline
edduard
Junior Member
Join Date: Sep 2009
Old 02-18-2010 , 07:20   Re: [Help]Class ZM only for Admins
Reply With Quote #2

Somebody help me?
__________________
edduard is offline
georgik57
Veteran Member
Join Date: Oct 2008
Location: 🎧Music World
Old 02-18-2010 , 11:40   Re: [Help]Class ZM only for Admins
Reply With Quote #3

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
__________________
georgik57 is offline
Send a message via MSN to georgik57 Send a message via Yahoo to georgik57 Send a message via Skype™ to georgik57
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 02-18-2010 , 14:54   Re: [Help]Class ZM only for Admins
Reply With Quote #4

Quote:
Originally Posted by georgik57 View Post
they're full of retards
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline
edduard
Junior Member
Join Date: Sep 2009
Old 02-18-2010 , 17:04   Re: [Help]Class ZM only for Admins
Reply With Quote #5

If you don't help me...please SHUT UP!
__________________
edduard is offline
AfteR.
Veteran Member
Join Date: Dec 2008
Location: λ
Old 02-18-2010 , 19:25   Re: [Help]Class ZM only for Admins
Reply With Quote #6

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.
AfteR. is offline
oponing-force
BANNED
Join Date: Dec 2009
Location: Argentina
Old 02-18-2010 , 19:45   Re: [Help]Class ZM only for Admins
Reply With Quote #7

Quote:
Originally Posted by meTaLiCroSS View Post
fuck you

chileno gordo

puto
oponing-force is offline
Send a message via MSN to oponing-force
edduard
Junior Member
Join Date: Sep 2009
Old 02-19-2010 , 00:28   Re: [Help]Class ZM only for Admins
Reply With Quote #8

Thanks AfteR.
__________________
edduard is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:44.


Powered by vBulletin®
Copyright ©2000 - 2021, vBulletin Solutions, Inc.
Theme made by Freecode