Raised This Month: $ Target: $400
 0% 

Just a small problem!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
K.K.Lv
Veteran Member
Join Date: Aug 2008
Location: GameFolder
Old 08-31-2009 , 12:40   Just a small problem!
Reply With Quote #1

hi guys !
I saw many people use this func"cmd_access ( id, level, cid, num)"
But I don't know how to use it !
can some one make a explanation about it ?
thx !
__________________
QQ:116268742
K.K.Lv is offline
Send a message via MSN to K.K.Lv
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-31-2009 , 12:51   Re: Just a small problem!
Reply With Quote #2

http://www.amxmodx.org/funcwiki.php?...acce&go=search
__________________
Arkshine is offline
K.K.Lv
Veteran Member
Join Date: Aug 2008
Location: GameFolder
Old 08-31-2009 , 13:05   Re: Just a small problem!
Reply With Quote #3

But I don't know how to set the last parameter
__________________
QQ:116268742
K.K.Lv is offline
Send a message via MSN to K.K.Lv
BOYSplayCS
BANNED
Join Date: Apr 2008
Location: Gainesville, FL
Old 08-31-2009 , 13:19   Re: Just a small problem!
Reply With Quote #4

Show us your code, since I now know about the cmd_access() function, I'll help you out.
BOYSplayCS is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-31-2009 , 13:20   Re: Just a small problem!
Reply With Quote #5

It's written. It's the number of arguments passed ( command itself included ).
__________________
Arkshine is offline
K.K.Lv
Veteran Member
Join Date: Aug 2008
Location: GameFolder
Old 09-01-2009 , 01:13   Re: Just a small problem!
Reply With Quote #6

OK, I just make a simple example !
PHP Code:
#include <amxmodx>
public plugin_int()
{
 
//my code
 
register_clcmd("command""myFunction"ADMIN_LEVEL"Show something")
}
public 
myFunction(idlevelcid)
{
 if (!
cmd_access(idlevelcid"I don't know how to set this parameter"))
 {
  return 
PLUGIN_HANDLED
 
}
 
//my code

__________________
QQ:116268742

Last edited by K.K.Lv; 09-01-2009 at 01:25.
K.K.Lv is offline
Send a message via MSN to K.K.Lv
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 09-01-2009 , 01:33   Re: Just a small problem!
Reply With Quote #7

if( !cmd_access(id, level, cid, ParamsNum ) {

If you have like, amx_cmd nick, it will be 2 param, cmd + nick ;)
__________________
xPaw is offline
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 09-01-2009 , 02:21   Re: Just a small problem!
Reply With Quote #8

Yes, like xPaw said.

So if you want to use only the command without an additional parameter just use number 1... and if you want a command with additional 2 parameters like for example:

amx_kick <player1> <player2>

Just use number 3.

P.S: In short, the command is a parameter too.
__________________
Approved Plugins - Steam Profile

Public non-terminated projects:
All Admins Menu, HLTV parameters, Subnick,
Second Password (cool style), InfoZone,
Binary C4 plant/defuse, and more...

Private projects:
NoSpec (+menu), NV Surf Management,
PM Adanved System, KZ longjump2, and more...
Alucard^ is offline
Send a message via Skype™ to Alucard^
K.K.Lv
Veteran Member
Join Date: Aug 2008
Location: GameFolder
Old 09-01-2009 , 04:56   Re: Just a small problem!
Reply With Quote #9

I think i may know a little, anyway , thx !!
__________________
QQ:116268742
K.K.Lv is offline
Send a message via MSN to K.K.Lv
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 09-01-2009 , 17:13   Re: Just a small problem!
Reply With Quote #10

When you said last parameter I was thinking of the current version of the cmd_access() function .

PHP Code:
stock cmd_access(idlevelcidnumbool:accesssilent false
__________________
fysiks 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 15:09.


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