AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   cut arg1 from read_args(allargs,64) (https://forums.alliedmods.net/showthread.php?t=3563)

splaTTer 07-09-2004 22:07

cut arg1 from read_args(allargs,64)
 
hi,
i have a command:
amx_dgc <nick> <reason>

and i want to store the reason in a mysql database. at the moment i store <nick> and <reason> cause i don't know how to cut the <nick> from read_args. is there any way to do so?
by the way - <reason> is not only one word and i do not want to use "

thx splaTTer

Ryan 07-09-2004 23:47

yep, the parse() function allows you to do so..

Code:
new szArgs[288]; read_args( szArgs, 287 ); new szName[32], szReason[256]; parse( szArgs, szName, 31, szReason, 255 );

be sure to encapsulate each arg in quotes "", or else it may break them up.

Code:

amx_dgc "Ryan" "For being a super 1337 amxx h4x0r!"
Hope this helps :)


All times are GMT -4. The time now is 14:48.

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