AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Just a small problem! (https://forums.alliedmods.net/showthread.php?t=102278)

K.K.Lv 08-31-2009 12:40

Just a small problem!
 
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 !:mrgreen:

Arkshine 08-31-2009 12:51

Re: Just a small problem!
 
http://www.amxmodx.org/funcwiki.php?...acce&go=search

K.K.Lv 08-31-2009 13:05

Re: Just a small problem!
 
But I don't know how to set the last parameter

BOYSplayCS 08-31-2009 13:19

Re: Just a small problem!
 
Show us your code, since I now know about the cmd_access() function, I'll help you out.

Arkshine 08-31-2009 13:20

Re: Just a small problem!
 
It's written. It's the number of arguments passed ( command itself included ).

K.K.Lv 09-01-2009 01:13

Re: Just a small problem!
 
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



xPaw 09-01-2009 01:33

Re: Just a small problem!
 
if( !cmd_access(id, level, cid, ParamsNum ) {

If you have like, amx_cmd nick, it will be 2 param, cmd + nick ;)

Alucard^ 09-01-2009 02:21

Re: Just a small problem!
 
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.

K.K.Lv 09-01-2009 04:56

Re: Just a small problem!
 
I think i may know a little, anyway , thx !!

fysiks 09-01-2009 17:13

Re: Just a small problem!
 
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



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

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