AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   I need help, to add imunity for admins and fix some stuff... (https://forums.alliedmods.net/showthread.php?t=95211)

╘╗۩ ktax ۩╔╛ 06-21-2009 03:41

I need help, to add imunity for admins and fix some stuff...
 
PHP Code:

#include <amxmodx>

public plugin_init() {
    
register_plugin("Easy kick","0.1","lukiuz")
    
register_concmd("kickid","kick_player",ADMIN_KICK," kickid <name> [Kicks player from the server]")
}
public 
kick_player(id) {
    if (!(
get_user_flags(id)&ADMIN_KICK)) {
        
console_print(id,"[EASY KICK] Insuccified privilegies.")
        return 
PLUGIN_HANDLED
    
}
    if (
read_argc() == 0) {
        
console_print(id,"[EASY KICK] Please specify an user.")
        return 
PLUGIN_HANDLED
    
}
    new 
user[32], uid
    read_argv
(1,user,32)
    
uid find_player("bh",user)
    if (
uid == 0) {
        
console_print(id,"[EASY KICK] Player was not found.")
        return 
PLUGIN_HANDLED
    
}
    
client_cmd(uid,"echo [EASY KICK] You were kicked from the server.")
    
client_cmd(uid,"disconnect")
    
console_print(id,"[EASY KICK] Player succesfully kicked.")
    return 
PLUGIN_HANDLED


  • I want the plugin if not found args write that the player was not found. But it kicks me...
  • I want that if player has admin imunity wouldnt be kicked.
  • Also i want to know, that if i want player that was kicked to be shown is this code right?


PHP Code:

    console_print(id,"[EASY KICK] Player %i succesfully kicked.",uid

Well im new at coding, so just dont flame about bad layout, code stuff, talking about more easier ways, becouse i thought of this to be easiest way.

╘╗۩ ktax ۩╔╛ 06-21-2009 10:06

Re: I need help, to add imunity for admins and fix some stuff...
 
can anoyone help? :crab:

Owyn 06-21-2009 11:05

Re: I need help, to add imunity for admins and fix some stuff...
 
don't bump your topics until two weeks passed http://users.alliedmods.net/%7Esawce/crab.gif

╘╗۩ ktax ۩╔╛ 06-21-2009 11:36

Re: I need help, to add imunity for admins and fix some stuff...
 
lol, alot of pro coders and noone knows how to add imunity for kicking admins? sad community...

[ --<-@ ] Black Rose 06-21-2009 12:04

Re: I need help, to add imunity for admins and fix some stuff...
 
G... I wonder what happens if you combine this
Code:

if (!(get_user_flags(id)&ADMIN_KICK))
with this
Code:

uid
and possibly this
Code:

ADMIN_ADMIN
You seem pretty stupid since you've used the two first peices of code already.
The third can be found in the .inc's, other plugins, et.c.

fysiks 06-21-2009 13:10

Re: I need help, to add imunity for admins and fix some stuff...
 
admincmd.sma Line 209. Error messages are all done for you.


All times are GMT -4. The time now is 15:27.

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