AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [Help] Using concmd (https://forums.alliedmods.net/showthread.php?t=251339)

Shiina.Mashiro 11-11-2014 08:59

[Help] Using concmd
 
Hi! I'm new to Pawn and I have some trouble with concmd
Example:
PHP Code:

register_concmd("amx_example""example"ADMIN_KICK

In this section
PHP Code:

public example(idlevelcid

How could I get the value of the argument?

Sorry for my bad English :D

YamiKaitou 11-11-2014 09:17

Re: [Help] Using concmd
 
By using the read_arg* functions

Shiina.Mashiro 11-11-2014 09:54

Re: [Help] Using concmd
 
Quote:

Originally Posted by YamiKaitou (Post 2222789)
By using the read_arg* functions

can you give me an example of using that ? :D thanks

Aydeev 11-11-2014 09:56

Re: [Help] Using concmd
 
Quote:

Originally Posted by Shiina.Mashiro (Post 2222807)
can you give me an example of using that ? :D thanks

PHP Code:

public example()
{
new 
Arg1[3]
read_argv(1Arg12// read argument 1 and strore it in Arg1

//if you need to convert the string to an integer (for example: a player id)
new playerid str_to_num(Arg1)



HamletEagle 11-11-2014 09:58

Re: [Help] Using concmd
 
Can you search ?

YamiKaitou 11-11-2014 10:06

Re: [Help] Using concmd
 
Quote:

Originally Posted by Shiina.Mashiro (Post 2222807)
can you give me an example of using that ? :D thanks

https://wiki.alliedmods.net/Intro_to...od_X_Scripting

HamletEagle 11-11-2014 11:23

Re: [Help] Using concmd
 
Quote:

Originally Posted by Aydeev (Post 2222808)
PHP Code:

public example()
{
new 
Arg1[3]
read_argv(1Arg12// read argument 1 and strore it in Arg1

//if you need to convert the string to an integer (for example: a player id)
new playerid str_to_num(Arg1)



Don't harcode the size of the arrays, use charsmax to get it.

fysiks 11-11-2014 22:42

Re: [Help] Using concmd
 
Quote:

Originally Posted by HamletEagle (Post 2222829)
Don't harcode the size of the arrays, use charsmax to get it.

Strings, not arrays. The size for arrays is "sizeof" and the size for strings is "charsmax".

Shiina.Mashiro 11-12-2014 00:28

Re: [Help] Using concmd
 
ok thank to you all, my problem solved :D thanks


All times are GMT -4. The time now is 17:37.

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