SA-MP Forums Archive
[Plugin] [REL] Execute - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Plugin Development (https://sampforum.blast.hk/forumdisplay.php?fid=18)
+--- Thread: [Plugin] [REL] Execute (/showthread.php?tid=100177)

Pages: 1 2 3


Re: [REL] Execute - Ironboy500[TW] - 25.07.2011

Quote:
Originally Posted by [MrS]Lake
Посмотреть сообщение
Does someone know how to open and close a file using linux cmds?

Like windows cmds, for example:

open
pawn Код:
exec("START samp-server.exe");
close
pawn Код:
exec("TASKKILL /F /IM \"samp-server.exe\"");
But i want for linux
Start: shell_exec("cd /path/to/server; nohup ./samp03svr &");
Stop: shell_exec("pkill -9 samp03svr");

I suggest you use ssh2 module, it will work much better.


AW: [REL] Execute - Pablo Borsellino - 26.07.2011

Works greakt - have anyone usefull Functions like:
Quote:

exec("COLOR 1F");

or:
Quote:

exec("TASKKILL /F /IM \"RocketDock.exe\"");

?



Re: [REL] Execute - Stylock - 03.08.2011

This plugin seems to crash my friend's PC. Is it compatible with Windows 7


Re: [REL] Execute - JaTochNietDan - 13.08.2011

Quote:
Originally Posted by YJIET
Посмотреть сообщение
This plugin seems to crash my friend's PC. Is it compatible with Windows 7
Should be compatible with all versions of Windows that can run the C++ libraries really.

Although I cannot see at all how this plugin could make an entire Operating System "crash"


Re: [REL] Execute - Stylock - 13.08.2011

Well I'm not sure what exactly caused his OS to freeze, but it has something to do with this code:
pawn Код:
exec("cd npcmodes & if not exist dir_npc md dir_npc & cd recordings & if not exist dir_rec md dir_rec");
Once that code was removed, the crash disappeared.


Re: [REL] Execute - JaTochNietDan - 13.08.2011

Quote:
Originally Posted by YJIET
Посмотреть сообщение
Well I'm not sure what exactly caused his OS to freeze, but it has something to do with this code:
pawn Код:
exec("cd npcmodes & if not exist dir_npc md dir_npc & cd recordings & if not exist dir_rec md dir_rec");
Once that code was removed, the crash disappeared.
I just tested that on Windows 7 Professional x64 and it worked fine, so I don't know what could be causing that, has he tried running the samp-server.exe as an Administrator (Right-click and run as administrator)? You could also try disabling UAC. Either way both of those options may help, the executable might not have access to write directories. I just know it worked fine for me and I have UAC disabled.


Re: [REL] Execute - Stylock - 13.08.2011

The directories were actually created normally. Everything froze a few seconds after command execution (tested 2 times) and then he had to shut down his PC manually... but oh well, the main thing that the crash is gone now.


Re: [REL] Execute - Pridit - 29.08.2011

Thank you so much for this. I've been rattling my brain over how to automatically chmod something my script creates and this just solved my problem. Without this I don't know what I would have done.


Re: [REL] Execute - KoczkaHUN - 16.11.2011

Please implement a native to check if the target is a Windows or a Linux host:
Код:
#ifdef _WIN32
    int OS = 0;
#else
    int OS = 1;
#endif
...
AMX_NATIVE_CALL GetOS(AMX *amx, cell *params)
{
    return OS;
}
Thanks in advance.


Re: [REL] Execute - Partner - 07.03.2012

OMG, nvm i wronged


Re: [REL] Execute - DeathTone - 28.08.2012

Is it possible to make a "dummy" windows plugin for this? Just so we won't get any errors while trying to run it on our PC, and not having to go back to your script and comment #include <exec> and the function.


Re: [REL] Execute - JaTochNietDan - 28.08.2012

Quote:
Originally Posted by DeathTone
Посмотреть сообщение
Is it possible to make a "dummy" windows plugin for this? Just so we won't get any errors while trying to run it on our PC, and not having to go back to your script and comment #include <exec> and the function.
I don't really know what you're asking, or what you are talking about.


Re: [REL] Execute - DeathTone - 29.08.2012

Quote:
Originally Posted by JaTochNietDan
Посмотреть сообщение
I don't really know what you're asking, or what you are talking about.
When trying to run the server on windows, and we have #include <exec>

It will give us a runtime error, so is there any way to make it easier so we don't have to comment "#include <exec>" every time we are going to test the server on our windows PC?


Respuesta: [REL] Execute - Siralos - 29.08.2012

Is there any way to thread this plugin?
I'm trying to do a big operation with exec and the whole server is frozen until it finishes...

Thanks!


Re: [REL] Execute - Edvin - 29.08.2012

This is like a command processor or what?


Respuesta: [REL] Execute - Siralos - 07.08.2014

Works like a charm with Python scripts


Re: [REL] Execute - Suxi - 08.08.2014

How to do this on linux?
pawn Код:
new file2[256];
format(file2, 256, "pawno/pawncc.exe scriptfiles/%s.pwn",rec_name[p_rec_id[playerid]]), exec(file2);



Respuesta: Re: [REL] Execute - Siralos - 08.08.2014

Quote:
Originally Posted by Suxi
Посмотреть сообщение
How to do this on linux?
pawn Код:
new file2[256];
format(file2, 256, "pawno/pawncc.exe scriptfiles/%s.pwn",rec_name[p_rec_id[playerid]]), exec(file2);
You have to use WINE.
http://dracoblue.net/dev/compile-sam...-exe-on-linux/


Re: [REL] Execute - Suxi - 08.08.2014

and is there another way? D=


Re: [REL] Execute - iZN - 08.08.2014

Why don't you just use edited pawn compiler by Zeex/xeeZ? He fixed several issues related to compiler bugs plus there's a Linux version aswell https://github.com/Zeex/pawn/releases