[Plugin] Pawn.CMD

Quote:
Originally Posted by vannesenn
Посмотреть сообщение
I don't understand what I can to do with flags?
You can use them to make helper/admin/rank commands faster and easier see the example in main post
Reply

This is still not working with YSI y_hooks. Please fix.
Reply

Quote:
Originally Posted by Meller
Посмотреть сообщение
This is still not working with YSI y_hooks. Please fix.
I did check, the plugin worked... How do you use y_hooks?
Reply

Quote:
Originally Posted by YourShadow
Посмотреть сообщение
I did check, the plugin worked... How do you use y_hooks?
Well, I managed to get it to work, But there's no error message now if the command don't exist.
Reply

Quote:
Originally Posted by Meller
Посмотреть сообщение
Well, I managed to get it to work, But there's no error message now if the command don't exist.
OnPlayerCommandPerformed?
Reply

can I change my gamemode which using y_commands to this?

EDIT:Is there any function like y_commands like Group_SetCommand or SetGlobalCommand?
Reply

Quote:
Originally Posted by Bradley7
Посмотреть сообщение
can I change my gamemode which using y_commands to this?

EDIT:Is there any function like y_commands like Group_SetCommand or SetGlobalCommand?
What it does?
Reply

Quote:
Originally Posted by YourShadow
Посмотреть сообщение
What it does?
PHP код:
FUNCTION:SetAdminCommand(cmdtext[], level)
{
    new 
cmd Command_GetID(cmdtext);
    if(
level && level 7)
    {
        
level--;
        
Group_SetGlobalCommand(cmdfalse);
        
Group_SetCommand(g_Admin[level], cmdtrue);
        
Group_SetCommand(g_Playercmdfalse);
    }
    else 
        
printf("Error while processed %s on SetAdminCommand function"cmdtext);
    return 
1;

PHP код:
    SetAdminCommand("vc"1);
    
SetAdminCommand("spec"1);
    
SetAdminCommand("specoff"1);
        
//so on 
PHP код:
COMMAND:spec(playeridparams[])
{
    if(
sscanf(params"u"otherID))
    {
        
Usage(playerid"spec(tate) <playerid>");
    }
    else
    {
        if(
isMe(playeridotherID))
        { 
//so on 
zcmd and another command
PHP код:
COMMAND:spec(playeridparams[])
{
    if(
Player[playerid][Level] >= 5)
    {
        if(
sscanf(params"u"otherID))
        {
            
Usage(playerid"spec(tate) <playerid>");
        }        
        else
        {
            if(
isMe(playeridotherID))
            { 
//so on 
Reply

Use flags.
Reply

How about using with sampgdk? It will be possible? (С++ and sampgdk)
Reply

Quote:
Originally Posted by VaReNiX
Посмотреть сообщение
How about using with sampgdk? It will be possible? (С++ and sampgdk)
Do you want to use this plugin in C++?
Reply

Pawn.CMD was updated to version 3.1.1

- Fixed bug in native "PC_RenameCommand".
Reply

Can you do a compararision/Benchmark against iCMD?
Reply

Quote:
Originally Posted by ipsLeon
Посмотреть сообщение
iCMD?
Show me it.
Reply

What exactly is wrong with this? It doesn't seem to detect the flags for my commands, and thus non-admins can use those commands.
Код:
enum(<<=1)
{
    CMD_ADMIN,
};

public OnPlayerCommandReceived(playerid, cmd[], params[], flags)
{
	if((flags & CMD_ADMIN) && !IsPlayerAdmin(playerid))
	{
		SendErrorMessage(playerid, "You do not have permission in order to use this command!");
		return 0;
	}
    return 1;
}

cmd:unstuck(playerid, params[])
{
	new player;
 	if(sscanf(params, "u", player))
		return SendSyntaxMessage(playerid, "/unstuck [playerid]");

	new Float:cX, Float:cY, Float:cZ;
	GetPlayerPos(player, cX, cY, cZ);
	SetPlayerPos(player, cX, cY, cZ+2.0);
    return 1;
}
flags:unstuck(CMD_ADMIN);
Reply

Quote:
Originally Posted by corne
Посмотреть сообщение
What exactly is wrong with this? It doesn't seem to detect the flags for my commands, and thus non-admins can use those commands.
Код:
enum(<<=1)
{
    CMD_ADMIN,
};

public OnPlayerCommandReceived(playerid, cmd[], params[], flags)
{
	if((flags & CMD_ADMIN) && !IsPlayerAdmin(playerid))
	{
		SendErrorMessage(playerid, "You do not have permission in order to use this command!");
		return 0;
	}
    return 1;
}

cmd:unstuck(playerid, params[])
{
	new player;
 	if(sscanf(params, "u", player))
		return SendSyntaxMessage(playerid, "/unstuck [playerid]");

	new Float:cX, Float:cY, Float:cZ;
	GetPlayerPos(player, cX, cY, cZ);
	SetPlayerPos(player, cX, cY, cZ+2.0);
    return 1;
}
flags:unstuck(CMD_ADMIN);
PHP код:
enum(<<=1)
{
    
CMD_ADMIN 1,
}; 
Reply

Quote:
Originally Posted by YourShadow
Посмотреть сообщение
PHP код:
enum(<<=1)
{
    
CMD_ADMIN 1,
}; 
Thanks!
Reply

There is indeed a bug with filterscripts.

When I use loadfs, OnPlayerCommandReceived/Performed callbacks and commands from that filterscript aren't called, only the ones from gamemode, even when I call commands from filterscript.

When I load the filterscript from server.cfg, no gamemode command is working, only commands from that filterscript.

I return 1 in both callbacks in both gamemode and filterscripts.

Also, this is what crashdetect prints when I load again that filterscript, after it was unloaded:
Quote:

[debug] Run time error 19: "File or function is not found"
[debug] PC_Init

. Yes, the plugin was loaded correctly, I use 3.1.

I have
pawn Код:
#define FILTERSCRIPT
on top of the filterscript.

You should test this yourself and solve it.
Reply

Hmm... I will try to solve it.
Reply

Quote:
Originally Posted by IstuntmanI
Посмотреть сообщение
There is indeed a bug with filterscripts.

When I use loadfs, OnPlayerCommandReceived/Performed callbacks and commands from that filterscript aren't called, only the ones from gamemode, even when I call commands from filterscript.

When I load the filterscript from server.cfg, no gamemode command is working, only commands from that filterscript.

I return 1 in both callbacks in both gamemode and filterscripts.

Also, this is what crashdetect prints when I load again that filterscript, after it was unloaded:

. Yes, the plugin was loaded correctly, I use 3.1.

I have
pawn Код:
#define FILTERSCRIPT
on top of the filterscript.

You should test this yourself and solve it.
I'm getting the same error in my logs. I only have a brand new FS, nothing has even been added to it, running Whirlpool, mysql and nativechecker along side it.

Код:
[15:32:25]   Loading filterscript 'Frosty-Admin-System.amx'...
[15:32:25]    Error: Function not registered: 'PC_Init'
[15:32:25]   Loaded 1 filterscripts.
My full filterscript:
Код:
#define FILTERSCRIPT

//Includes
#include <a_samp>
#include <a_mysql>  //Version R39.5 ( https://github.com/pBlueG/SA-MP-MySQL/re.../tag/R39-5 )
#include <Pawn.CMD> //Version 3.1.1 ( https://github.com/urShadow/Pawn.CMD/releases/tag/3.1.1 )

//Colours for chat
#define COLOR_WHITE       (0xFFFFFFFF)
#define COLOR_RED         (0xFF0000FF)
#define COLOR_CYAN        (0x33CCFFFF)
#define COLOR_LIGHTRED    (0xFF6347FF)
#define COLOR_LIGHTGREEN  (0x9ACD32FF)
#define COLOR_YELLOW      (0xFFFF00FF)
#define COLOR_GREY        (0xAFAFAFFF)
#define COLOR_PURPLE      (0xD0AEEBFF)
#define COLOR_LIGHTYELLOW (0xF5DEB3FF)
#define COLOR_DARKBLUE    (0x1394BFFF)
#define COLOR_ORANGE      (0xFFA500FF)
#define COLOR_LIME        (0x00FF00FF)
#define COLOR_GREEN       (0x33CC33FF)
#define COLOR_BLUE        (0x2641FEFF)
#define COLOR_LIGHTBLUE   (0x007FFFFF)

native WP_Hash(buffer[], len, const str[]);

public OnFilterScriptInit()
{
    print("[----------------------------------]");
    print("[--------Frosty Admin System-------]");
    print("[-----Created by: BR3TT-----]");
    print("[----------Version: 1.0.0----------]");
    print("[----------------------------------]");
    return 1;
}

public OnFilterScriptExit()
{
	return 1;
}

main()
{
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)