Raised This Month: $ Target: $400
 0% 

[Solved] [HELP] remove admin acces and add this chiefid


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Old.School
Senior Member
Join Date: Sep 2015
Location: France
Old 10-19-2015 , 09:59   [Solved] [HELP] remove admin acces and add this chiefid
Reply With Quote #1

I wanna remove admin acces from this plugin and add jailbreak chief acces : if( !jbe_is_user_chief( index ) )
Attached Files
File Type: sma Get Plugin or Get Source (magic_marker.sma - 501 views - 3.5 KB)
__________________
You keep bringing B.R down .. He will rise again and kick Enemies asses !

Last edited by Arkshine; 10-19-2015 at 14:40.
Old.School is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 10-19-2015 , 10:08   Re: [HELP] remove admin acces and add this chiefid
Reply With Quote #2

Attach the code in [PHP] tags next time.

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <xs>
#include <cstrike>

#define PLUGIN "Magic Marker"
#define VERSION "3.1"
#define AUTHOR "stupok69"

#define MAX_PLAYERS 32

new Float:origin[MAX_PLAYERS+1][3]
new 
prethink_counter[MAX_PLAYERS+1]
new 
bool:is_drawing[MAX_PLAYERS+1]
new 
bool:is_holding[MAX_PLAYERS+1]

new 
spriteid
native jbe_is_user_chief
(id)

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("+paint""paint_handler"0"Paint on the walls!")
    
register_clcmd("-paint""paint_handler"0"Paint on the walls!")
    
register_forward(FM_PlayerPreThink"forward_FM_PlayerPreThink"0)
}

public 
plugin_precache()
{
    
spriteid precache_model("sprites/lgtning.spr")
}

public 
paint_handler(idlevelcid)
{
    if(!
jbe_is_user_chief(id))
        return 
PLUGIN_HANDLED
    
    
if(!is_user_alive(id))
    {
        
client_print(idprint_chat"* You cannot use the magic marker when you are dead.")
        return 
PLUGIN_HANDLED
    
}
    
    static 
cmd[2]
    
read_argv(0cmd1)
    
    switch(
cmd[0])
    {
        case 
'+'is_drawing[id] = true
        
case '-'is_drawing[id] = false
    
}
    return 
PLUGIN_HANDLED
}

public 
forward_FM_PlayerPreThink(id)
{
    if(
prethink_counter[id]++ > 5)
    {
        if(
is_drawing[id] && !is_aiming_at_sky(id))
        {
            static 
Float:cur_origin[3], Float:distance

            cur_origin 
origin[id]
            
            if(!
is_holding[id])
            {
                
fm_get_aim_origin(idorigin[id])
                
move_toward_client(idorigin[id])
                
is_holding[id] = true
                
return FMRES_IGNORED
            
}
            
            
fm_get_aim_origin(idorigin[id])
            
move_toward_client(idorigin[id])
            
            
distance get_distance_f(origin[id], cur_origin)
            
            if(
distance 2)
            {
                
draw_line(origin[id], cur_origin)
            }
        }
        else
        {
            
is_holding[id] = false
        
}
        
prethink_counter[id] = 0
    
}
    
    return 
FMRES_IGNORED
}

stock draw_line(Float:origin1[3], Float:origin2[3])
{
    
message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
    
write_byte(TE_BEAMPOINTS)
    
engfunc(EngFunc_WriteCoordorigin1[0])
    
engfunc(EngFunc_WriteCoordorigin1[1])
    
engfunc(EngFunc_WriteCoordorigin1[2])
    
engfunc(EngFunc_WriteCoordorigin2[0])
    
engfunc(EngFunc_WriteCoordorigin2[1])
    
engfunc(EngFunc_WriteCoordorigin2[2])
    
write_short(spriteid)
    
write_byte(0)
    
write_byte(10)
    
write_byte(255)
    
write_byte(50)
    
write_byte(0)
    
write_byte(random(255))
    
write_byte(random(255))
    
write_byte(random(255))
    
write_byte(255)
    
write_byte(0)
    
message_end()
}

//from fakemeta_util.inc
stock fm_get_aim_origin(indexFloat:origin[3])
{
    static 
Float:start[3], Float:view_ofs[3]
    
pev(indexpev_originstart)
    
pev(indexpev_view_ofsview_ofs)
    
xs_vec_add(startview_ofsstart)
    
    static 
Float:dest[3]
    
pev(indexpev_v_angledest)
    
engfunc(EngFunc_MakeVectorsdest)
    
global_get(glb_v_forwarddest)
    
xs_vec_mul_scalar(dest9999.0dest)
    
xs_vec_add(startdestdest)
    
    
engfunc(EngFunc_TraceLinestartdest0index0)
    
get_tr2(0TR_vecEndPosorigin)
    
    return 
1
}

stock move_toward_client(idFloat:origin[3])
{        
    static 
Float:player_origin[3]
    
    
pev(idpev_originplayer_origin)
    
    
origin[0] += (player_origin[0] > origin[0]) ? 1.0 : -1.0
    origin
[1] += (player_origin[1] > origin[1]) ? 1.0 : -1.0
    origin
[2] += (player_origin[2] > origin[2]) ? 1.0 : -1.0
}
//Thanks AdaskoMX!
bool:is_aiming_at_sky(index)
{
    new 
Float:origin[3];
    
fm_get_aim_origin(indexorigin);

    return 
engfunc(EngFunc_PointContentsorigin) == CONTENTS_SKY;


Last edited by OciXCrom; 10-19-2015 at 10:11.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Hartmann
Senior Member
Join Date: Nov 2014
Old 10-19-2015 , 18:06   Re: [HELP] remove admin acces and add this chiefid
Reply With Quote #3

Quote:
Originally Posted by OciXCrom View Post
Attach the code in [PHP] tags next time.
Why? What problem with Attached Files?
__________________

RETAKES v1.0
github.com/alghtryer/retakes

Contact : [email protected]

BTC Donate: 1QAh1NLmeHy81LF9r8PaeGjYqHL2BBcJTx

Hartmann is offline
Old.School
Senior Member
Join Date: Sep 2015
Location: France
Old 10-19-2015 , 11:11   Re: [HELP] remove admin acces and add this chiefid
Reply With Quote #4

ok and thnx
__________________
You keep bringing B.R down .. He will rise again and kick Enemies asses !
Old.School is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 10-19-2015 , 13:57   Re: [Solved]
Reply With Quote #5

Stop deleting the content of your threads. Do you see anyone else doing it?!
OciXCrom is offline
Send a message via Skype™ to OciXCrom
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 10-19-2015 , 19:09   Re: [Solved]
Reply With Quote #6

Because it's easier to see and work with + I personally visit the forum on my phone sometimes, so I'm unable to view the code if it's attached. I'm probably not the only one as well.

Last edited by OciXCrom; 10-19-2015 at 19:10.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 10-19-2015 , 19:41   Re: [Solved]
Reply With Quote #7

Please leave your subject as it was when you first posted.

If you want to add "[Solved]" that is fine, but leave your original text so others will know what your thread is about.

ie.
"How do I get nothing but headshots?"
to
"[Solved] How do I get nothing but headshots?"
__________________
Bugsy is offline
Old.School
Senior Member
Join Date: Sep 2015
Location: France
Old 10-19-2015 , 20:18   Re: [Solved] [HELP] remove admin acces and add this chiefid
Reply With Quote #8

Ok And Sorry i was doing this just to stop bumping the post for another posts of other pupils bump
__________________
You keep bringing B.R down .. He will rise again and kick Enemies asses !
Old.School is offline
Hartmann
Senior Member
Join Date: Nov 2014
Old 10-19-2015 , 20:19   Re: [Solved] [HELP] remove admin acces and add this chiefid
Reply With Quote #9

Download on mobile.
__________________

RETAKES v1.0
github.com/alghtryer/retakes

Contact : [email protected]

BTC Donate: 1QAh1NLmeHy81LF9r8PaeGjYqHL2BBcJTx

Hartmann is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 10-20-2015 , 07:23   Re: [Solved] [HELP] remove admin acces and add this chiefid
Reply With Quote #10

I doubt that .sma is supported on mobile.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
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 22:12.


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