[FilterScript] Execute PAWN Functions In-Game
#41

This is a very good idea !!!

I tryed it, but it don't work for me ...

How must I use it ? Can anybody explain me step by step please ? Because my server returns unknow command ...

Thanks =)
Reply
#42

Use

Код:
/exec Ban(playerid);
Reply
#43

I don't want to ban, I want to know how to use this filterscript ^^
Reply
#44

It works perfectly for me now. But I had a problem : everyone could use /exec command ! So I little changed the filterscript and it is now :

pawn Код:
#include <a_samp>

#define ERROR_OUT_OF_MEMORY_SOURCES 0
#define ERROR_BAD_FORMAT 11
#define ERROR_FILE_NOT_FOUND 2
#define ERROR_PATH_NOT_FOUND 3

native WinExec(execPath[]);

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/exec", true, 5))
    {
        if (!IsPlayerAdmin(playerid))
        return SendClientMessage(playerid, 0xFF0000AA, "You are not an admin ! !");
        else if(cmdtext[5] != ' ' || cmdtext[6] == EOS)
        return SendClientMessage(playerid, 0xFF0000FF, "/exec [command]");
        else
        {
       
        new
            File: execFile,
            pawnScript[256]
        ;
        execFile = fopen("ExecFS.pwn", io_write);
       
        if(execFile)
        {
            strcat(pawnScript, "#include <a_samp>\r\n\r\n");
            strcat(pawnScript, "public OnFilterScriptInit()\r\n");
            strcat(pawnScript, "{\r\n\t");
            strcat(pawnScript, cmdtext[6]);
            strcat(pawnScript, "\r\n}");
           
            fwrite(execFile, pawnScript);
            fclose(execFile);
           
            if(WinExec("pawno\\pawncc.exe ./scriptfiles/ExecFS.pwn"))
            {
                SetTimer("ReloadFS", 50, 0);
                return 1;
            }
            else return SendClientMessage(playerid, -1, "WinExec is unable to execute pawncc.exe!");
        }
        return 0;
       
        }
    }
    return 0;
}

forward ReloadFS();
public ReloadFS()
{
    if(fexist("ExecFS.amx"))
        SendRconCommand("reloadfs ../scriptfiles/ExecFS");
}
Now, you must be admin to use the command.
Reply
#45

----------
Loaded log file: "server_log.txt".
----------

SA-MP Dedicated Server
----------------------
v0.3c, ©2005-2010 SA-MP Team

[23:43:12] filterscripts = "" (string)
[23:43:12]
[23:43:12] Server Plugins
[23:43:12] --------------
[23:43:12] Loading plugin: WinExec
[23:43:12] Failed.
[23:43:12] Loaded 0 plugins.

[23:43:12]
[23:43:12] Ban list
[23:43:12] --------
[23:43:12] Loaded: samp.ban
[23:43:12]
[23:43:12]
[23:43:12] Filter Scripts
[23:43:12] ---------------
[23:43:12] Loaded 0 filter scripts.

[23:43:12] Minimode loaded
[23:43:12] Number of vehicle models: 0
Reply
#46

looks a bit hard to use ,but thanks bro
Reply
#47

Quote:
Originally Posted by Rapgangsta
Посмотреть сообщение
----------
Loaded log file: "server_log.txt".
----------

SA-MP Dedicated Server
----------------------
v0.3c, ©2005-2010 SA-MP Team

[23:43:12] filterscripts = "" (string)
[23:43:12]
[23:43:12] Server Plugins
[23:43:12] --------------
[23:43:12] Loading plugin: WinExec
[23:43:12] Failed.
[23:43:12] Loaded 0 plugins.

[23:43:12]
[23:43:12] Ban list
[23:43:12] --------
[23:43:12] Loaded: samp.ban
[23:43:12]
[23:43:12]
[23:43:12] Filter Scripts
[23:43:12] ---------------
[23:43:12] Loaded 0 filter scripts.

[23:43:12] Minimode loaded
[23:43:12] Number of vehicle models: 0
Just install .net Framework 4 and it should be fine.
Reply
#48

That's an amazing filterscript.
Reply
#49

Quote:
Originally Posted by Pooh7
View Post
Nice.

Can you make it for Linux?
I want it too xD
Reply
#50

Wow from the video it looks great, downloading now .
Reply
#51

Pretty amazing.

I've remembered I coded something a like once back in 2010 for a small community and it was useless because you still need to restart the server so just hit compile on pawno then GMX.
Reply
#52

Nice
Reply
#53

Thanks dude, love you for4ver for this cool script !
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)