Raised This Month: $ Target: $400
 0% 

[Help] Using concmd


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Shiina.Mashiro
Senior Member
Join Date: Sep 2014
Location: Vietnam
Old 11-11-2014 , 08:59   [Help] Using concmd
Reply With Quote #1

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
__________________
Shiina.Mashiro is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 11-11-2014 , 09:17   Re: [Help] Using concmd
Reply With Quote #2

By using the read_arg* functions
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Shiina.Mashiro
Senior Member
Join Date: Sep 2014
Location: Vietnam
Old 11-11-2014 , 09:54   Re: [Help] Using concmd
Reply With Quote #3

Quote:
Originally Posted by YamiKaitou View Post
By using the read_arg* functions
can you give me an example of using that ? thanks
__________________
Shiina.Mashiro is offline
Aydeev
Junior Member
Join Date: Oct 2014
Old 11-11-2014 , 09:56   Re: [Help] Using concmd
Reply With Quote #4

Quote:
Originally Posted by Shiina.Mashiro View Post
can you give me an example of using that ? 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)


Last edited by Aydeev; 11-11-2014 at 09:58.
Aydeev is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 11-11-2014 , 11:23   Re: [Help] Using concmd
Reply With Quote #5

Quote:
Originally Posted by Aydeev View Post
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.
__________________
HamletEagle is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 11-11-2014 , 22:42   Re: [Help] Using concmd
Reply With Quote #6

Quote:
Originally Posted by HamletEagle View Post
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".
__________________
fysiks is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 11-11-2014 , 10:06   Re: [Help] Using concmd
Reply With Quote #7

Quote:
Originally Posted by Shiina.Mashiro View Post
can you give me an example of using that ? thanks
https://wiki.alliedmods.net/Intro_to...od_X_Scripting
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 11-11-2014 , 09:58   Re: [Help] Using concmd
Reply With Quote #8

Can you search ?
__________________
HamletEagle is offline
Shiina.Mashiro
Senior Member
Join Date: Sep 2014
Location: Vietnam
Old 11-12-2014 , 00:28   Re: [Help] Using concmd
Reply With Quote #9

ok thank to you all, my problem solved thanks
__________________
Shiina.Mashiro 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 17:37.


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