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

Solved Add only Multijump for CT/Admin pls


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Godofwar
AlliedModders Donor
Join Date: Dec 2015
Location: Germany
Old 05-20-2020 , 13:08   Add only Multijump for CT/Admin pls
Reply With Quote #1

Can anyone add the function that only CT Players can use multijump? Admin Only is avaible like i see but need it for CT only. THX


Code:
#include <amxmodx>
#include <amxmisc>
#include <engine>

#define ADMINACCESS ADMIN_LEVEL_H

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

public plugin_init()
{
	register_plugin("MultiJump","1.1","twistedeuphoria")
	register_cvar("amx_maxjumps","1")
	register_cvar("amx_mjadminonly","1")
}

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

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

public client_PreThink(id)
{
	if(!is_user_alive(id)) return PLUGIN_CONTINUE
	if(get_cvar_num("amx_mjadminonly") && (!access(id,ADMINACCESS))) 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("amx_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("amx_mjadminonly") && (!access(id,ADMINACCESS))) 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
}

Last edited by Godofwar; 05-21-2020 at 07:51.
Godofwar is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 05-20-2020 , 13:44   Re: Add only Multijump for CT/Admin pls
Reply With Quote #2

Quote:
Originally Posted by Godofwar View Post
Can anyone add the function that only CT Players can use multijump? Admin Only is avaible like i see but need it for CT only. THX


Code:
#include <amxmodx>
#include <amxmisc>
#include <engine>

#define ADMINACCESS ADMIN_LEVEL_H

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

public plugin_init()
{
	register_plugin("MultiJump","1.1","twistedeuphoria")
	register_cvar("amx_maxjumps","1")
	register_cvar("amx_mjadminonly","1")
}

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

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

public client_PreThink(id)
{
	if(!is_user_alive(id)) return PLUGIN_CONTINUE
	if(get_cvar_num("amx_mjadminonly") && (!access(id,ADMINACCESS))) 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("amx_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("amx_mjadminonly") && (!access(id,ADMINACCESS))) 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
}
For CT Only:
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <engine>

#define ADMINACCESS ADMIN_LEVEL_H

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

public plugin_init()
{
    
register_plugin("MultiJump","1.1","twistedeuphoria")
    
register_cvar("amx_maxjumps","1")
    
register_cvar("amx_mjadminonly","1")
}

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

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

public 
client_PreThink(id)
{
    if(!
is_user_alive(id) && cs_get_user_team(id) == CS_TEAM_CT) return PLUGIN_CONTINUE
    
if(get_cvar_num("amx_mjadminonly") && (!access(id,ADMINACCESS))) 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("amx_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("amx_mjadminonly") && (!access(id,ADMINACCESS))) 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

Change level access as you like from this code
PHP Code:
#define ADMINACCESS ADMIN_LEVEL_H 
Supremache is offline
Godofwar
AlliedModders Donor
Join Date: Dec 2015
Location: Germany
Old 05-21-2020 , 03:12   Re: Add only Multijump for CT/Admin pls
Reply With Quote #3

Error: Undefined symbol "cs_get_user_team" on line 32
Godofwar is offline
iNdio
Senior Member
Join Date: Apr 2015
Location: Ro
Old 05-21-2020 , 05:24   Re: Add only Multijump for CT/Admin pls
Reply With Quote #4

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <engine> 
--->
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <engine> 
__________________
Where Cs had no value, amxx, sometimes, had its price...
iNdio is offline
Godofwar
AlliedModders Donor
Join Date: Dec 2015
Location: Germany
Old 05-21-2020 , 05:46   Re: Add only Multijump for CT/Admin pls
Reply With Quote #5

The Plugin dont work. I still have Multijump as Terrorist...

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <engine>  

#define ADMINACCESS ADMIN_LEVEL_H

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

public plugin_init()
{
    
register_plugin("MultiJump","1.1","twistedeuphoria")
    
register_cvar("amx_maxjumps","1")
    
register_cvar("amx_mjadminonly","1")
}

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

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

public 
client_PreThink(id)
{
    if(!
is_user_alive(id) && cs_get_user_team(id) == CS_TEAM_CT) return PLUGIN_CONTINUE
    
if(get_cvar_num("amx_mjadminonly") && (!access(id,ADMINACCESS))) 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("amx_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("amx_mjadminonly") && (!access(id,ADMINACCESS))) 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

Godofwar is offline
iNdio
Senior Member
Join Date: Apr 2015
Location: Ro
Old 05-21-2020 , 06:51   Re: Add only Multijump for CT/Admin pls
Reply With Quote #6

Because this:
register_cvar("amx_mjadminonly","1")

Make sure you add the cvar register_cvar("amx_mjadminonly","0") in /configs/amxx.cfg.
Use this one btw.
Attached Files
File Type: sma Get Plugin or Get Source (multijump.sma - 130 views - 1.6 KB)
__________________
Where Cs had no value, amxx, sometimes, had its price...
iNdio is offline
Old 05-21-2020, 07:16
Godofwar
This message has been deleted by Godofwar.
Godofwar
AlliedModders Donor
Join Date: Dec 2015
Location: Germany
Old 05-21-2020 , 07:17   Re: Add only Multijump for CT/Admin pls
Reply With Quote #7

Quote:
Originally Posted by iNdio View Post
Because this:
register_cvar("amx_mjadminonly","1")

Make sure you add the cvar register_cvar("amx_mjadminonly","0") in /configs/amxx.cfg.
Use this one btw.

no no . now i tested as NON VIP - i still have multijump as CT . Terrorists are fixed but why i have multijump as non vip at CT ?
Godofwar is offline
iNdio
Senior Member
Join Date: Apr 2015
Location: Ro
Old 05-21-2020 , 07:39   Re: Add only Multijump for CT/Admin pls
Reply With Quote #8

I thought you want both CT (normal player) + ADMIN CT.
Just use cvar: amx_mjadminonly "1"
__________________
Where Cs had no value, amxx, sometimes, had its price...
iNdio is offline
Godofwar
AlliedModders Donor
Join Date: Dec 2015
Location: Germany
Old 05-21-2020 , 07:51   Re: Add only Multijump for CT/Admin pls
Reply With Quote #9

Quote:
Originally Posted by iNdio View Post
I thought you want both CT (normal player) + ADMIN CT.
Just use cvar: amx_mjadminonly "1"
THX this works now all . ♥
Godofwar 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 04:10.


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