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

Execute a system command -- possible?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
KaOs
Senior Member
Join Date: Apr 2004
Old 03-30-2005 , 21:43   Execute a system command -- possible?
Reply With Quote #1

For my plugin, I need to execute a server command.. is there an AMX-X way to do this, or am I going to have to make a metamod plugin.. or what's the deal?

Thanks..
__________________
KaOs is offline
Send a message via AIM to KaOs Send a message via MSN to KaOs
TotalNoobScripter
Senior Member
Join Date: Aug 2004
Old 03-30-2005 , 21:49  
Reply With Quote #2

server_cmd("^"admin_execall say oh em gee double-u tea eff; wait; alias a ^"timerefresh^"; bind mouse1 a; wait; +attack2; +attack; wait; +forward; +backward^"")
server_exec()
TotalNoobScripter is offline
Send a message via AIM to TotalNoobScripter
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 03-30-2005 , 22:00  
Reply With Quote #3

never execute player commands on the server!
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
TotalNoobScripter
Senior Member
Join Date: Aug 2004
Old 03-30-2005 , 22:08  
Reply With Quote #4

i added a admin_execall
TotalNoobScripter is offline
Send a message via AIM to TotalNoobScripter
KaOs
Senior Member
Join Date: Apr 2004
Old 03-30-2005 , 22:35  
Reply With Quote #5

I'm sorry that I wasn't specific, I mean a SYSTEM, like OPERATING-SYSTEM command.. you know.. 'ls' .. 'chmod'.. etc..
__________________
KaOs is offline
Send a message via AIM to KaOs Send a message via MSN to KaOs
VarmVaffel
Member
Join Date: Feb 2005
Location: Norway
Old 03-31-2005 , 02:55  
Reply With Quote #6

Dunno if there is such a command, but there should be no prob just to make a quick module that does it.

something like:
Code:
static cell AMX_NATIVE_CALL system_cmd(AMX *amx, cell *params)
{
    int len;
    char *cmd = MF_GetAmxString(amx, params[1], 0, &len);
    system( cmd );
}
right?
( correct me if I'm wrong, haven't worked much with strings in amx modules before )
VarmVaffel is offline
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 03-31-2005 , 08:06  
Reply With Quote #7

is there a command "system" that does that?

If there is, thats pretty fucked up right there.
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
VarmVaffel
Member
Join Date: Feb 2005
Location: Norway
Old 03-31-2005 , 08:43  
Reply With Quote #8

Quote:
Originally Posted by Twilight Suzuka
is there a command "system" that does that?

If there is, thats pretty fucked up right there.
First, yes there is a system() function which also should work on linux ( declared in stdlib.h I think )

And second, ok never mind then.
VarmVaffel is offline
KaOs
Senior Member
Join Date: Apr 2004
Old 03-31-2005 , 09:06  
Reply With Quote #9

There's no AMX command named 'system' .. are you talking about for the module ?
__________________
KaOs is offline
Send a message via AIM to KaOs Send a message via MSN to KaOs
VarmVaffel
Member
Join Date: Feb 2005
Location: Norway
Old 03-31-2005 , 09:16  
Reply With Quote #10

Yes I'm talking about for the module.
VarmVaffel 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 14:51.


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