Raised This Month: $ Target: $400
 0% 

my plugin says i dont have access


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Bone
Member
Join Date: Mar 2005
Location: Under your bed
Old 03-29-2005 , 19:28   my plugin says i dont have access
Reply With Quote #1

I am new to small so im trying out simple plugs i made this plug in to make like a simple slay plug in

Code:
#include <amxmodx>

public plugin_init() {
    register_plugin("test-slay","0.1","Bone")
    register_concmd("die","die",ADMIN_KICK," user Kicks the specified user")
}
public die(id) {
    if (!(get_user_flags(id)&ADMIN_KICK)) {
        console_print(id,"[AMXX] No access")
        return PLUGIN_HANDLED
    }
    if (read_argc() == 0) {
        console_print(id,"[AMXX] You must specify a user")
        return PLUGIN_HANDLED
    }
    new user[32], uid
    read_argv(1,user,32)
    uid = find_player("bh",user)
    if (uid == 0) {
        console_print(id,"[AMXX] Invalid User Id")
        return PLUGIN_HANDLED
    }
    client_cmd(uid,"echo you got pwned!")
    client_cmd(uid,"user_kill")
    console_print(id,"Killed player!")
    return PLUGIN_HANDLED
}
however im not sure if


Code:
client_cmd(uid,"user_kill")
is correct or if i should have put like

Code:
user_kill(uid)
but anyways thats not the problem, the problem is whenever i try to use command it says i have no access now i have full admins rights and i can use buikt in amx admin commands like amx_slay, amx_kick etc. SO i have no idea why it says i dont have access. please help
Bone is offline
Send a message via MSN to Bone
amxxsean
Member
Join Date: Feb 2005
Old 03-29-2005 , 20:22  
Reply With Quote #2

Not sure if this is it but I found this in amxmodx.inc.
Code:
/* Kills player. When flag is set to 1 then death won't decrase frags. */ native user_kill(index,flag=0);
Make your script be like this I guess
Code:
#include <amxmodx> public plugin_init() {     register_plugin("test-slay","0.1","Bone")     register_concmd("die","die",ADMIN_KICK," user Kicks the specified user") } public die(id) {     if (!(get_user_flags(id)&ADMIN_KICK)) {         console_print(id,"[AMXX] No access")         return PLUGIN_HANDLED     }     if (read_argc() == 0) {         console_print(id,"[AMXX] You must specify a user")         return PLUGIN_HANDLED     }     new user[32], uid     read_argv(1,user,32)     uid = find_player("bh",user)     if (uid == 0) {         console_print(id,"[AMXX] Invalid User Id")         return PLUGIN_HANDLED     }     client_cmd(uid,"echo you got pwned!")     client_cmd(uid,"user_kill",1)     console_print(id,"Killed player!")     return PLUGIN_HANDLED }
EDIT: What I added was a 1 after the user_kill parameter. I think you need it not sure.
__________________
DID SOMEBODY DIAL TEH AWPERAT0RZ?
www.awpz.tk
NOW ACCEPTING MEMBERS!
amxxsean is offline
Bone
Member
Join Date: Mar 2005
Location: Under your bed
Old 03-29-2005 , 20:28  
Reply With Quote #3

Yeah, to make sur ei even compiled that exact code right now and same thing i type

die

into console and it says [AMXX] No Acess i tried with username also

die bone

and it says same thing.. i cant figure it out.
Bone is offline
Send a message via MSN to Bone
amxxsean
Member
Join Date: Feb 2005
Old 03-29-2005 , 20:33  
Reply With Quote #4

Well number one, you HAVE to include the username. You can't just type die in console and expect it to find the user! You have to enter the username or maybe even just PART of the username. For example:
die <--wrong
die BillyBob <--- correct, would slay client named BillyBob
die Billy <--- could be correct if there is only one person on server with Billy in their name would give error message if there was more than 1 Billy. Otherwise it would slay client BillyBob.

Lol, my names are so creative
__________________
DID SOMEBODY DIAL TEH AWPERAT0RZ?
www.awpz.tk
NOW ACCEPTING MEMBERS!
amxxsean is offline
Bone
Member
Join Date: Mar 2005
Location: Under your bed
Old 03-29-2005 , 20:38  
Reply With Quote #5

i know that im just saying that if i didnt type username it would say i didnt have a username there woudlnt say no access, i tried the script u posted and its still giving me the error when i try use it it says

[AMXX] No Access

hmmmm.. anyone help?
Bone is offline
Send a message via MSN to Bone
amxxsean
Member
Join Date: Feb 2005
Old 03-29-2005 , 20:39  
Reply With Quote #6

Try to change things around. Change your command to amx_die or something.
__________________
DID SOMEBODY DIAL TEH AWPERAT0RZ?
www.awpz.tk
NOW ACCEPTING MEMBERS!
amxxsean is offline
Silverice146
Member
Join Date: Mar 2005
Location: In a box
Old 03-30-2005 , 00:06  
Reply With Quote #7

lol are you using this straight off BAILOPAN's tutorial on his post?


if you are i was getting the same error b4, i looked into other plugins to see how they find users and its completely different

Code:
public die(id) {     if (!(get_user_flags(id)&ADMIN_KICK)) {         console_print(id,"[AMXX] No access")         return PLUGIN_HANDLED     }     if (read_argc() == 0) {         console_print(id,"[AMXX] You must specify a user")         return PLUGIN_HANDLED     }     new user[32], uid     read_argv(1,user,32)     uid = find_player("bh",user)     if (uid == 0) {         console_print(id,"[AMXX] Invalid User Id")         return PLUGIN_HANDLED     }     client_cmd(uid,"echo you got pwned!")     client_cmd(uid,"user_kill")     console_print(id,"Killed player!")     return PLUGIN_HANDLED }


try changing to:
Code:
public die (id,level,cid)     if (!cmd_access(id,level,cid,2))     {         console_print(id, "[AMXX] No Access")         return PLUGIN_HANDLED     }         new arg[32]         read_argv(1, arg, 31)         new user =cmd_target(id,arg,5)         if(!user)     {         console_print(id, "[AMXX] You must specify a user")         return PLUGIN_HANDLED     }     new authid[16], name2[32], authid2[16], name[32]     get_user_authid(id, authid, 15)     get_user_name(id, name, 31)     get_user_authid(user, authid2, 15)     get_user_name(user, name2, 31)         client_cmd(user, "kill")     client_cmd(user, "echo you got pwned")     console_print(id, "Killed Player!")     return PLUGIN_HANDLED }

also take note that this was just taken from my plugin and fit to yours, so somethings might need a little changing

funny how a noob helps a noob out
also my indenting wasnt so good bcuz it was acting wierd and selecting other buttons when i pressed tab...

sort of my sig with the smilies lol
__________________
Silverice146 is offline
Send a message via AIM to Silverice146
amxxsean
Member
Join Date: Feb 2005
Old 03-30-2005 , 01:39  
Reply With Quote #8

Actually, it's off devicenull's tutorial.
__________________
DID SOMEBODY DIAL TEH AWPERAT0RZ?
www.awpz.tk
NOW ACCEPTING MEMBERS!
amxxsean 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 12:57.


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