AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Execute a system command -- possible? (https://forums.alliedmods.net/showthread.php?t=11902)

KaOs 03-30-2005 21:43

Execute a system command -- possible?
 
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..

TotalNoobScripter 03-30-2005 21:49

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()

Twilight Suzuka 03-30-2005 22:00

never execute player commands on the server!

TotalNoobScripter 03-30-2005 22:08

i added a admin_execall :wink:

KaOs 03-30-2005 22:35

I'm sorry that I wasn't specific, I mean a SYSTEM, like OPERATING-SYSTEM command.. you know.. 'ls' .. 'chmod'.. etc..

VarmVaffel 03-31-2005 02:55

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 )

Twilight Suzuka 03-31-2005 08:06

is there a command "system" that does that?

If there is, thats pretty fucked up right there.

VarmVaffel 03-31-2005 08:43

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. :P

KaOs 03-31-2005 09:06

There's no AMX command named 'system' .. are you talking about for the module ?

VarmVaffel 03-31-2005 09:16

Yes I'm talking about for the module.


All times are GMT -4. The time now is 09:54.

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