Raised This Month: $51 Target: $400
 12% 

Can some1 plz help?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
rikards1
Member
Join Date: Aug 2009
Old 10-29-2009 , 04:43   Can some1 plz help?
Reply With Quote #1

How do I make a plugin so when u type like /real this cofig exec?
Attached Files
File Type: cfg config.cfg (284 Bytes, 65 views)
rikards1 is offline
Xellath
Veteran Member
Join Date: Dec 2007
Location: Sweden
Old 10-29-2009 , 05:06   Re: Can some1 plz help?
Reply With Quote #2

Just lol.

Register a client command(using register_clcmd), then in the function execute a server command (using server_cmd).

Something like:

Code:
server_cmd( "exec config.cfg" );

Also, the client_prints in your config.. a config file is just an ordinary text file, it wont work typing client_print in the text file. Use echo.

Code:
echo "/////Config has been loaded/////"
echo "/////Real gaming....... On!/////"
echo "/////Get of Spec NOW!/////"
__________________
Achievements API - a simple way for you to create your OWN custom achievements!
Xellath is offline
rikards1
Member
Join Date: Aug 2009
Old 10-29-2009 , 05:23   Re: Can some1 plz help?
Reply With Quote #3

can u make the .sma plz so I understand what you mean and so I can make more plugins ^^
rikards1 is offline
Xellath
Veteran Member
Join Date: Dec 2007
Location: Sweden
Old 10-29-2009 , 06:02   Re: Can some1 plz help?
Reply With Quote #4

Code:
#include < amxmodx > #include < amxmisc > public plugin_init( ) {     register_plugin( "Exec Config", "0.1.0", "Xellath" );         register_concmd( "amx_execfile", "ConsoleCommand_ExecFile", ADMIN_KICK ); } public ConsoleCommand_ExecFile( iClient, iLevel, iCid ) {     if ( !cmd_access( iClient, iLevel, iCid, 2 ) )         return PLUGIN_HANDLED;         new szArg[ 20 ];     read_argv( iClient, szArg, charsmax( szArg ) );         new szDir[ 64 ];     get_configsdir( szDir, charsmax( szDir ) );         server_cmd( "exec %s/%s.cfg", szDir, szArg );         return PLUGIN_HANDLED; }

Use this syntax to execute the config: amx_execfile "config" - it'll execute a file called config.cfg.
Your config file must be put in the config folder in your amxmodx directory.
ie. moddir/addons/amxmodx/configs
__________________
Achievements API - a simple way for you to create your OWN custom achievements!
Xellath is offline
rikards1
Member
Join Date: Aug 2009
Old 10-29-2009 , 06:16   Re: Can some1 plz help?
Reply With Quote #5

Okey, thns alot man! ^^
rikards1 is offline
rikards1
Member
Join Date: Aug 2009
Old 10-29-2009 , 06:28   Re: Can some1 plz help?
Reply With Quote #6

... in the config file should I type echo thing or client print? couse now I have echo and when i type amx_execfile in console it stands "Usage:"
rikards1 is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 10-29-2009 , 06:58   Re: Can some1 plz help?
Reply With Quote #7

if ( !cmd_access( iClient, iLevel, iCid, 1 ) )
__________________
xPaw is offline
Trafalete
Senior Member
Join Date: Sep 2008
Location: Bucuresti ( Printre nori
Old 10-29-2009 , 07:27   Re: Can some1 plz help?
Reply With Quote #8

yeap...it's 1 because you have only one argument, that beeing the command
__________________


Trafalete is offline
rikards1
Member
Join Date: Aug 2009
Old 10-29-2009 , 08:37   Re: Can some1 plz help?
Reply With Quote #9

Itīs not working.... I type amx_execfile config, and nothing happens....
rikards1 is offline
izzle
Senior Member
Join Date: Aug 2009
Old 10-29-2009 , 08:43   Re: Can some1 plz help?
Reply With Quote #10

are you typing it in console?
izzle 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 02:35.


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