Raised This Month: $ Target: $400
 0% 

How to overrule immunitycheck?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
plastGNU
Junior Member
Join Date: Jul 2004
Location: Sweden
Old 06-20-2005 , 01:25   How to overrule immunitycheck?
Reply With Quote #1

AS topic says, im wondering how to overrule a flagcheck in my code.

I've been created a command and registered it as concmd, using flag ADMIN_LEVEL_A bound to it as accessflag needed.

However, what ive been trying with bad results is to be able to perform this command on admins as much as on normal users without any accesses. Like if I do this command on an admin, it will be performed and CONTINUED instead of saying "Client has Immunity"

Code:
 if(!cmd_access(id,level,cid,2))
   return PLUGIN_HANDELD
perhaps I would use this instead:

Code:
 if(get_user_flags(id)&ADMIN_LEVEL_A)
   return PLUGIN_CONTINUE
Am I totaly out-of-bounds here, or am I close to the solutionen?
Need a bit help.
plastGNU is offline
Silverice146
Member
Join Date: Mar 2005
Location: In a box
Old 06-20-2005 , 01:37  
Reply With Quote #2

please show all of the small... its kind of hard to determine why, as far as anyone who just looks at this knows, you should be able to do it, and its just and ID10T error (sorry for the computer terms but i believe it was neccessary)
__________________
Silverice146 is offline
Send a message via AIM to Silverice146
Geesu
Veteran Member
Join Date: Mar 2004
Location: Cincinnati, OH
Old 06-20-2005 , 01:40  
Reply With Quote #3

in war3ft I use:

Code:
    if (!(get_user_flags(id)&ADMIN_LEVEL_A)) {         if(id != 0){             client_print(id,print_console,"You have no access to this command")             return PLUGIN_HANDLED         }     }

it looks right
__________________
Need war3ft help? DO NOT PM ME... Check the forums
Geesu is offline
Send a message via AIM to Geesu Send a message via MSN to Geesu
jtp10181
Veteran Member
Join Date: May 2004
Location: Madison, WI
Old 06-20-2005 , 06:52  
Reply With Quote #4

You need to look at the cmd_target section of your code. Look at the includes for info about the functions.

cmd_access just checks the access of the client sending the command. The second method you suggested it a poor way to do it since cmd_access is already there for you to use.

To not have cmd_targtet check for immunity you just need to edit the flag.

Code:
/* Flags:
*  1 - obey immunity
*  2 - allow yourself
*  4 - must be alive
*  8 - can't be bot */
stock cmd_target(id,const arg[],flags = 1)
so.... if you make "flags" "2" then you can run the command on anyone including yourself. The default is for it to be "1" which checks immunity.
__________________
jtp10181 is offline
Send a message via ICQ to jtp10181 Send a message via AIM to jtp10181 Send a message via MSN to jtp10181 Send a message via Yahoo to jtp10181
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 23:05.


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