Raised This Month: $32 Target: $400
 8% 

API Scripting Help [TUT] ZP 5.0 Admin Only class


Post New Thread Reply   
 
Thread Tools Display Modes
H.RED.ZONE
Veteran Member
Join Date: Sep 2011
Location: Serbia, Belgrade
Old 04-07-2012 , 14:32   Re: [TUT] ZP 5.0 Admin Only class
Reply With Quote #21

Quote:
Originally Posted by Tozy View Post
But this don't work for ZPA
[TUT] ZP 5.0 Admin Only class
Dont revive old threads read before you comment.
__________________

Last edited by H.RED.ZONE; 04-07-2012 at 14:32.
H.RED.ZONE is offline
ekselent1
Junior Member
Join Date: Jan 2012
Old 04-16-2012 , 07:47   Re: [TUT] ZP 5.0 Admin Only class
Reply With Quote #22

can someone make an example for ZP 4.3?
ekselent1 is offline
ESPADONGAMING
Senior Member
Join Date: Mar 2011
Location: In the Game [ro]
Old 04-16-2012 , 22:34   Re: [TUT] ZP 5.0 Admin Only class
Reply With Quote #23

good tutorial
__________________
Skype: cristi.c94
SteamID: cristic_1994
ESPADONGAMING is offline
Send a message via MSN to ESPADONGAMING Send a message via Yahoo to ESPADONGAMING Send a message via Skype™ to ESPADONGAMING
cr0w
Senior Member
Join Date: Mar 2014
Location: middle east
Old 09-24-2014 , 06:53   Re: [TUT] ZP 5.0 Admin Only class
Reply With Quote #24

PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <zombieplague>

new g_zclass_bhzombie

new g_hasBhop33 ]
new 
pcvar_enabledpcvar_autojump

new bool:g_restorevel[33]
new 
Float:g_velocity[33][3]

new const 
zclass_name[] = { "BunnyHop Zombie" }
new const 
zclass_info[] = { "BunnyHop, Pain Shock Free" }
new const 
zclass_model[] = { "zombie_source" }
new const 
zclass_clawmodel[] = { "v_knife_zombie.mdl" }
const 
zclass_health 1500
const zclass_speed 250
const Float:zclass_gravity 0.9
const Float:zclass_knockback 0.0

public plugin_init()
{
        
register_plugin("[ZP] Class : BunnyHop Zombie""1.1""ƒa†es™")

    
register_event"DeathMsg""event_player_death""a" )

    
pcvar_enabled register_cvar"zp_bhzombie_bunnyhop_enabled""1" )
    
pcvar_autojump register_cvar"zp_bhzombie_autojump""1" )

    
register_forwardFM_PlayerPreThink"forward_prethink" )
}

public 
plugin_precache()
{
    
g_zclass_bhzombie zp_register_zombie_class(zclass_namezclass_infozclass_modelzclass_clawmodelzclass_healthzclass_speedzclass_gravityzclass_knockback)

    
register_forward(FM_PlayerPreThink"fw_PlayerPreThink")
    
register_forward(FM_PlayerPreThink"fw_PlayerPreThink_Post"1)
}

public 
zp_user_infected_post(idinfector)
{
    if (
zp_get_user_zombie_class(id) == g_zclass_bhzombie)
    {
        
g_hasBhopid ] = true

        pev
(idpev_velocityg_velocity[id])
    }
}

public 
client_connectid )
{
    
g_hasBhopid ] = false
}

public 
event_player_death()
{
    
g_hasBhopread_data) ] = false
}

public 
forward_prethinkid )
{
    if(!
is_user_alive(id) || !zp_get_user_zombie(id))
         return 
PLUGIN_CONTINUE

        
if (zp_get_user_zombie_class(id) != g_zclass_bhzombie)
        return 
PLUGIN_CONTINUE

    
if( get_pcvar_numpcvar_enabled ) )
    {
        
set_pevidpev_fuser20.0 )
        
        if( 
get_pcvar_numpcvar_autojump ) && pevidpev_button ) & IN_JUMP )
        {
            new 
szFlags pevidpev_flags )
            if( !( 
szFlags FL_WATERJUMP ) && pevidpev_waterlevel ) < && szFlags FL_ONGROUND )
            {
                new 
FloatszVelocity]
                
pevidpev_velocityszVelocity)
                
szVelocity] += 250.0
                set_pev
idpev_velocityszVelocity )
                
set_pevidpev_gaitsequence)
            }
        }
    }
        return 
FMRES_IGNORED
}

public 
fw_PlayerPreThink(id)
{    
    if ( !
is_user_alive(id) || !is_user_bot(id) || !zp_get_user_zombie(id) )
        return 
FMRES_IGNORED
    
    
if (zp_get_user_zombie_class(id) != g_zclass_bhzombie)
        return 
FMRES_IGNORED
        
    
if (pev(idpev_flags) & FL_ONGROUND)
    {
        
pev(idpev_velocityg_velocity[id])
        
        
g_restorevel[id] = true
    
}
    return 
FMRES_IGNORED
}

public 
fw_PlayerPreThink_Post(id)
{
    if (
zp_get_user_zombie_class(id) != g_zclass_bhzombie)
        return 
FMRES_IGNORED
        
    
if (g_restorevel[id])
    {
        
g_restorevel[id] = false

        
if (!(pev(idpev_flags) & FL_ONTRAIN))
        {
            new 
groundent pev(idpev_groundentity)
            
            if (
pev_valid(groundent) && (pev(groundentpev_flags) & FL_CONVEYOR))
            {    
                static 
Float:vecTemp[3]
                
                
pev(idpev_basevelocityvecTemp)
                
                
g_velocity[id][0] += vecTemp[0]
                
g_velocity[id][1] += vecTemp[1]
                
g_velocity[id][2] += vecTemp[2]
            }                

            
set_pev(idpev_velocityg_velocity[id])
            
            return 
FMRES_HANDLED
        
}
    }
    return 
FMRES_IGNORED

can some one make it admin only ?
__________________
the city is no fun
there is no sun
and its so dark
cr0w is offline
Send a message via Yahoo to cr0w Send a message via Skype™ to cr0w
SnowFake
Senior Member
Join Date: Oct 2012
Old 09-24-2014 , 07:10   Re: [TUT] ZP 5.0 Admin Only class
Reply With Quote #25

Code:
#include <amxmodx> 
#include <fakemeta> 
#include <zombieplague> 

new g_zclass_bhzombie 

new g_hasBhop[ 33 ] 
new pcvar_enabled, pcvar_autojump 

new bool:g_restorevel[33] 
new Float:g_velocity[33][3] 

new const zclass_name[] = { "BunnyHop Zombie" } 
new const zclass_info[] = { "BunnyHop, Pain Shock Free" } 
new const zclass_model[] = { "zombie_source" } 
new const zclass_clawmodel[] = { "v_knife_zombie.mdl" } 
const zclass_health = 1500 
const zclass_speed = 250 
const Float:zclass_gravity = 0.9 
const Float:zclass_knockback = 0.0 

public plugin_init() 
	{ 
	register_plugin("[ZP] Class : BunnyHop Zombie", "1.1", "ƒa†es™") 
	
	register_event( "DeathMsg", "event_player_death", "a" ) 
	
	pcvar_enabled = register_cvar( "zp_bhzombie_bunnyhop_enabled", "1" ) 
	pcvar_autojump = register_cvar( "zp_bhzombie_autojump", "1" ) 
	
	register_forward( FM_PlayerPreThink, "forward_prethink" ) 
} 

public plugin_precache() 
	{ 
	g_zclass_bhzombie = zp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback) 
	
	register_forward(FM_PlayerPreThink, "fw_PlayerPreThink") 
	register_forward(FM_PlayerPreThink, "fw_PlayerPreThink_Post", 1) 
} 

public zp_user_infected_pre(id) { 
	if(!(get_user_flags(id) & ADMIN_LEVEL_H)) { 
		if (zp_get_user_next_class(id) == g_zclass_bhzombie) { 
			zp_set_user_zombie_class(id, 0) 
			client_print(id, print_center, "Your selected class in only for *VIP* members") 
			client_print(id, print_chat, "Your selected class in only for *VIP* members. Changed to default zombie class.") 
		}     
	} 
}  
public zp_user_infected_post(id, infector) 
	{ 
	if (zp_get_user_zombie_class(id) == g_zclass_bhzombie) 
		{ 
		g_hasBhop[ id ] = true 
		
		pev(id, pev_velocity, g_velocity[id]) 
	} 
} 

public client_connect( id ) 
	{ 
	g_hasBhop[ id ] = false 
} 

public event_player_death() 
	{ 
	g_hasBhop[ read_data( 2 ) ] = false 
} 

public forward_prethink( id ) 
	{ 
	if(!is_user_alive(id) || !zp_get_user_zombie(id)) 
		return PLUGIN_CONTINUE 
	
	if (zp_get_user_zombie_class(id) != g_zclass_bhzombie) 
		return PLUGIN_CONTINUE 
	
	if( get_pcvar_num( pcvar_enabled ) ) 
		{ 
		set_pev( id, pev_fuser2, 0.0 ) 
		
		if( get_pcvar_num( pcvar_autojump ) && pev( id, pev_button ) & IN_JUMP ) 
			{ 
			new szFlags = pev( id, pev_flags ) 
			if( !( szFlags & FL_WATERJUMP ) && pev( id, pev_waterlevel ) < 2 && szFlags & FL_ONGROUND ) 
				{ 
				new Float: szVelocity[ 3 ] 
				pev( id, pev_velocity, szVelocity) 
				szVelocity[ 2 ] += 250.0 
				set_pev( id, pev_velocity, szVelocity ) 
				set_pev( id, pev_gaitsequence, 6 ) 
			} 
		} 
	} 
	return FMRES_IGNORED 
} 

public fw_PlayerPreThink(id) 
	{     
	if ( !is_user_alive(id) || !is_user_bot(id) || !zp_get_user_zombie(id) ) 
		return FMRES_IGNORED 
	
	if (zp_get_user_zombie_class(id) != g_zclass_bhzombie) 
		return FMRES_IGNORED 
	
	if (pev(id, pev_flags) & FL_ONGROUND) 
		{ 
		pev(id, pev_velocity, g_velocity[id]) 
		
		g_restorevel[id] = true 
	} 
	return FMRES_IGNORED 
} 

public fw_PlayerPreThink_Post(id) 
	{ 
	if (zp_get_user_zombie_class(id) != g_zclass_bhzombie) 
		return FMRES_IGNORED 
	
	if (g_restorevel[id]) 
		{ 
		g_restorevel[id] = false 
		
		if (!(pev(id, pev_flags) & FL_ONTRAIN)) 
			{ 
			new groundent = pev(id, pev_groundentity) 
			
			if (pev_valid(groundent) && (pev(groundent, pev_flags) & FL_CONVEYOR)) 
				{     
				static Float:vecTemp[3] 
				
				pev(id, pev_basevelocity, vecTemp) 
				
				g_velocity[id][0] += vecTemp[0] 
				g_velocity[id][1] += vecTemp[1] 
				g_velocity[id][2] += vecTemp[2] 
			}                 
			
			set_pev(id, pev_velocity, g_velocity[id]) 
			
			return FMRES_HANDLED 
		} 
	} 
	return FMRES_IGNORED 
}
Try this. For admins with flag "t"

Last edited by SnowFake; 09-24-2014 at 07:11.
SnowFake is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 09-24-2014 , 10:05   Re: [TUT] ZP 5.0 Admin Only class
Reply With Quote #26

PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <zombieplague>

#define ADMIN_FLAG ADMIN_LEVEL_H

new g_zclass_bhzombie

new g_hasBhop33 ]
new 
pcvar_enabledpcvar_autojump

new bool:g_restorevel[33]
new 
Float:g_velocity[33][3]

new const 
zclass_name[] = { "BunnyHop Zombie" }
new const 
zclass_info[] = { "BunnyHop, Pain Shock Free" }
new const 
zclass_model[] = { "zombie_source" }
new const 
zclass_clawmodel[] = { "v_knife_zombie.mdl" }
const 
zclass_health 1500
const zclass_speed 250
const Float:zclass_gravity 0.9
const Float:zclass_knockback 0.0

public plugin_init()
{
        
register_plugin("[ZP] Class : BunnyHop Zombie""1.1""ƒa†es™")

    
register_event"DeathMsg""event_player_death""a" )

    
pcvar_enabled register_cvar"zp_bhzombie_bunnyhop_enabled""1" )
    
pcvar_autojump register_cvar"zp_bhzombie_autojump""1" )

    
register_forwardFM_PlayerPreThink"forward_prethink" )
}

public 
plugin_precache()
{
    
g_zclass_bhzombie zp_register_zombie_class(zclass_namezclass_infozclass_modelzclass_clawmodelzclass_healthzclass_speedzclass_gravityzclass_knockback)

    
register_forward(FM_PlayerPreThink"fw_PlayerPreThink")
    
register_forward(FM_PlayerPreThink"fw_PlayerPreThink_Post"1)
}

public 
zp_user_infected_post(idinfector)
{
    if (
get_user_flags(id) & ADMIN_FLAG)
    {
        if (
zp_get_user_zombie_class(id) == g_zclass_bhzombie)
        {
            
g_hasBhopid ] = true

            pev
(idpev_velocityg_velocity[id])
        }
    }
    else
        
client_print(idprint_center"Your selected class in only for *VIP* members"
        
client_print(idprint_chat"Your selected class in only for *VIP* members. Changed to default zombie class."
}

public 
client_connectid )
{
    
g_hasBhopid ] = false
}

public 
event_player_death()
{
    
g_hasBhopread_data) ] = false
}

public 
forward_prethinkid )
{
    if(!
is_user_alive(id) || !zp_get_user_zombie(id))
         return 
PLUGIN_CONTINUE

        
if (zp_get_user_zombie_class(id) != g_zclass_bhzombie)
        return 
PLUGIN_CONTINUE

    
if( get_pcvar_numpcvar_enabled ) )
    {
        
set_pevidpev_fuser20.0 )
        
        if( 
get_pcvar_numpcvar_autojump ) && pevidpev_button ) & IN_JUMP )
        {
            new 
szFlags pevidpev_flags )
            if( !( 
szFlags FL_WATERJUMP ) && pevidpev_waterlevel ) < && szFlags FL_ONGROUND )
            {
                new 
FloatszVelocity]
                
pevidpev_velocityszVelocity)
                
szVelocity] += 250.0
                set_pev
idpev_velocityszVelocity )
                
set_pevidpev_gaitsequence)
            }
        }
    }
        return 
FMRES_IGNORED
}

public 
fw_PlayerPreThink(id)
{    
    if ( !
is_user_alive(id) || !is_user_bot(id) || !zp_get_user_zombie(id) )
        return 
FMRES_IGNORED
    
    
if (zp_get_user_zombie_class(id) != g_zclass_bhzombie)
        return 
FMRES_IGNORED
        
    
if (pev(idpev_flags) & FL_ONGROUND)
    {
        
pev(idpev_velocityg_velocity[id])
        
        
g_restorevel[id] = true
    
}
    return 
FMRES_IGNORED
}

public 
fw_PlayerPreThink_Post(id)
{
    if (
zp_get_user_zombie_class(id) != g_zclass_bhzombie)
        return 
FMRES_IGNORED
        
    
if (g_restorevel[id])
    {
        
g_restorevel[id] = false

        
if (!(pev(idpev_flags) & FL_ONTRAIN))
        {
            new 
groundent pev(idpev_groundentity)
            
            if (
pev_valid(groundent) && (pev(groundentpev_flags) & FL_CONVEYOR))
            {    
                static 
Float:vecTemp[3]
                
                
pev(idpev_basevelocityvecTemp)
                
                
g_velocity[id][0] += vecTemp[0]
                
g_velocity[id][1] += vecTemp[1]
                
g_velocity[id][2] += vecTemp[2]
            }                

            
set_pev(idpev_velocityg_velocity[id])
            
            return 
FMRES_HANDLED
        
}
    }
    return 
FMRES_IGNORED

zmd94 is offline
MrJohnnie
Junior Member
Join Date: Jan 2016
Old 01-13-2016 , 10:12   Re: [TUT] ZP 5.0 Admin Only class
Reply With Quote #27

Can somebody do me a favour and make this so that only Admin (all admins, that have acess to amxmodmenu) be able to use? I'm so noob I couldn't do it. Please?!
Attached Files
File Type: sma Get Plugin or Get Source (zp_class_paokai.sma - 504 views - 15.6 KB)
MrJohnnie is offline
byshorty
New Member
Join Date: Feb 2016
Old 11-28-2016 , 06:55   Re: [TUT] ZP 5.0 Admin Only class
Reply With Quote #28

can some one make it admin only ? flag "b" or admin kick accses?

Code:
/*
Multijump addon by twistedeuphoria
Plagued by Dabbi
Classed by B!gBud

CVARS:
	zp_tight_jump 2 (Default)

*/

#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fakemeta>
#include <zombieplague>

new jumpznum[33] = 0
new bool:dozjump[33] = false
new cvar_jumps
new g_zclass_tight

// Tight Zombie Atributes
new const zclass_name[] = { "Double Jump Zombie" } // name
new const zclass_info[] = { "HP:3500" } // description
new const zclass_model[] = { "zombie_leech" } // model
new const zclass_clawmodel[] = { "v_knive_zombie_leech.mdl" } // claw model
const zclass_health = 3600 // health
const zclass_speed = 250 // speed
const Float:zclass_gravity = 0.5 // gravity
const Float:zclass_knockback = 1.5 // knockback

public plugin_init()
{
	register_plugin("[ZP] Class Tight", "1.0c", "MultiJump by twistedeuphoria, Plagued by Dabbi, Classed by B!gBud")
	cvar_jumps = register_cvar("zp_tight_jump","1")	
}

public plugin_precache()
{
	g_zclass_tight = zp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback)
}

public client_putinserver(id)
{
	jumpznum[id] = 0
	dozjump[id] = false
}

public client_disconnect(id)
{
	jumpznum[id] = 0
	dozjump[id] = false
}

public client_PreThink(id)
{
	if(!is_user_alive(id) || !zp_get_user_zombie(id)) return PLUGIN_CONTINUE
	if(zp_get_user_zombie_class(id) != g_zclass_tight) return PLUGIN_CONTINUE
	
	new nzbut = get_user_button(id)
	new ozbut = get_user_oldbutton(id)
	if((nzbut & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(ozbut & IN_JUMP))
	{
		if (jumpznum[id] < get_pcvar_num(cvar_jumps))
		{
			dozjump[id] = true
			jumpznum[id]++
			return PLUGIN_CONTINUE
		}
	}
	if((nzbut & IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))
	{
		jumpznum[id] = 0
		return PLUGIN_CONTINUE
	}	
	return PLUGIN_CONTINUE
}

public client_PostThink(id)
{
	if(!is_user_alive(id) || !zp_get_user_zombie(id)) return PLUGIN_CONTINUE
	if(zp_get_user_zombie_class(id) != g_zclass_tight) return PLUGIN_CONTINUE
	
	if(dozjump[id] == true)
	{
		new Float:vezlocityz[3]	
		entity_get_vector(id,EV_VEC_velocity,vezlocityz)
		vezlocityz[2] = random_float(265.0,285.0)
		entity_set_vector(id,EV_VEC_velocity,vezlocityz)
		dozjump[id] = false
		return PLUGIN_CONTINUE
	}	
	return PLUGIN_CONTINUE
}
byshorty is offline
RainePlayz1
Junior Member
Join Date: Mar 2022
Old 09-23-2022 , 03:47   Re: [TUT] ZP 5.0 Admin Only class
Reply With Quote #29

How to make like this in human classes?
RainePlayz1 is offline
Reply



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 17:48.


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