[Plugin] Pawn.CMD

Worked after converting to easy-mysql
Reply

Quote:
Originally Posted by Meller
Посмотреть сообщение
Worked after converting to easy-mysql
Yeah, but you didn't fix anything. You just went and did something you didn't need to do.

Though, if you were using y_ini for saving profiles and such, it's a great trade. But what will you do if you still want to use other YSI libraries? Do you have a good replacement for ALL of them?
Reply

Guys pls give me an example

for a commands admin and how i check if he is admin

and how to call the Command

and what mean flags
Reply

Quote:
Originally Posted by Crayder
Посмотреть сообщение
Yeah, but you didn't fix anything. You just went and did something you didn't need to do.

Though, if you were using y_ini for saving profiles and such, it's a great trade. But what will you do if you still want to use other YSI libraries? Do you have a good replacement for ALL of them?
Why are u commenting on this so often? No Offence.
Reply

Quote:
Originally Posted by WhiteGhost
Посмотреть сообщение
Why are u commenting on this so often? No Offence.
Why would I be offended? You just asked me a simple question, nothing to be offended by...

Why are YOU commenting here? I have open suggestions on this thread, most of which were already added and made this plugin much cooler than just a speed boost. You only came here to ask me something that you could've PM'ed me about.

Why are you worried about what I do? You just added a completely pointless post to this grand thread while all of mine (except this reply to YOUR useless comment) were either regarding my other posts or helping others.

WHY
Reply

I have a question about the plugin: does the server crash when users enter empty cmds or very long cmds? because this happens with zcmd if you don't put some checks under OnPlayerCommandReceived
Reply

I think I do not understand something from the graph.

a) dc_cmd - created in assembler, it is faster than zcmd and izcmd

b) izcmd - improved zcmd
- specification:
y_commands took 1231ms on average
ZCMD took 1201ms on average
I-ZCMD (non-case-sensitive) took 547ms on average
I-ZCMD (case-sensitive) took 353ms on average

c) zcmd - all known

d) mcmd = strcmp ? WTF

The timing of action should be specified in milliseconds.
Reply

Quote:
Originally Posted by AbyssMorgan
Посмотреть сообщение
I think I do not understand something from the graph.
The graph will be updated soon.

Quote:
Originally Posted by AbyssMorgan
Посмотреть сообщение
d) mcmd = strcmp ? WTF
https://sampforum.blast.hk/showthread.php?tid=522724

Quote:
Originally Posted by AbyssMorgan
Посмотреть сообщение
The timing of action should be specified in milliseconds.
Shouldn't.
Reply

Quote:
Originally Posted by Crayder
Посмотреть сообщение
Yeah, but you didn't fix anything. You just went and did something you didn't need to do.

Though, if you were using y_ini for saving profiles and such, it's a great trade. But what will you do if you still want to use other YSI libraries? Do you have a good replacement for ALL of them?
Well Quoted by Shadow:
Quote:
Originally Posted by YourShadow
Посмотреть сообщение
Pawn.CMD is not compatible with YSI because YSI changes public's ids at runtime.
I do understand your point, but...

Speechless.
Reply

Unfortunately all of my commands return this error:
Код:
[debug] Run time error 20: "Invalid index parameter (bad entry point)"
Reply

There is an issue: when I include OnPlayerCommandPerformed callback in the gamemode for a custom unknown command message, any command from filterscripts (they're with Pawn.CMD too) gives the message that the commands don't exist even though they do and work.

I also had a filterscript for testing purposes that used ZCMD and its commands don't perform. I had to change them to Pawn.CMD as well.
Reply

Ok, so I know I said before that I would transit to this plugin if you added the features I mentioned before... And you DID add them all... But now I have one more request...

A 'help' parameter on the commands, like in y_commands. You could simply add the help parameter to the command syntax or make it optional if possible. You would then need to add a help parameter to PC_EmulateCommand.

Though, I don't like the idea of it being called 'help'. You could call it 'extra'. That way it would make more sense as an integer and we could call the command with extra details.

For example:
pawn Код:
native PC_EmulateCommand(playerid, const cmdtext[], extra);

// Example Defines
#define CMD_EX_HELP     1
#define CMD_EX_INFO     2

CMD:something(playerid, params[], extra) {
    if(extra == CMD_EX_HELP)
        return SendClientMessage(playerid, -1, "Command Syntax: /something <param 1> <param 2>");
    if(extra == CMD_EX_INFO)
        return SendClientMessage(playerid, -1, "This is a randomly named command.");
   
    // Else, run command normally.
    return 1;
}

CMD:cmdhelp(playerid, params[], extra) {
    if(extra == CMD_EX_HELP)
        return SendClientMessage(playerid, -1, "Command Syntax: /cmdhelp <command name>");
    if(extra == CMD_EX_INFO)
        return SendClientMessage(playerid, -1, "This command returns help for a specified command.");
   
    if(!PC_CommandExists(params))
        return SendClientMessage(playerid, -1, "That command doesn't exist.");
   
    PC_EmulateCommand(playerid, params, CMD_EX_HELP);
}

CMD:cmdinfo(playerid, params[], extra) {
    if(extra == CMD_EX_HELP)
        return SendClientMessage(playerid, -1, "Command Syntax: /cmdinfo <command name>");
    if(extra == CMD_EX_INFO)
        return SendClientMessage(playerid, -1, "This command returns information on a specified command.");
   
    if(!PC_CommandExists(params))
        return SendClientMessage(playerid, -1, "That command doesn't exist.");
   
    PC_EmulateCommand(playerid, params, CMD_EX_INFO);
}
Now again, I think this would be best as an optional thing.
Reply

Quote:
Originally Posted by Crayder
Посмотреть сообщение
Ok, so I know I said before that I would transit to this plugin if you added the features I mentioned before... And you DID add them all... But now I have one more request...

A 'help' parameter on the commands, like in y_commands. You could simply add the help parameter to the command syntax or make it optional if possible. You would then need to add a help parameter to PC_EmulateCommand.

Though, I don't like the idea of it being called 'help'. You could call it 'extra'. That way it would make more sense as an integer and we could call the command with extra details.

For example:
pawn Код:
native PC_EmulateCommand(playerid, const cmdtext[], extra);

// Example Defines
#define CMD_EX_HELP     1
#define CMD_EX_INFO     2

CMD:something(playerid, params[], extra) {
    if(extra == CMD_EX_HELP)
        return SendClientMessage(playerid, -1, "Command Syntax: /something <param 1> <param 2>");
    if(extra == CMD_EX_INFO)
        return SendClientMessage(playerid, -1, "This is a randomly named command.");
   
    // Else, run command normally.
    return 1;
}

CMD:cmdhelp(playerid, params[], extra) {
    if(extra == CMD_EX_HELP)
        return SendClientMessage(playerid, -1, "Command Syntax: /cmdhelp <command name>");
    if(extra == CMD_EX_INFO)
        return SendClientMessage(playerid, -1, "This command returns help for a specified command.");
   
    if(!PC_CommandExists(params))
        return SendClientMessage(playerid, -1, "That command doesn't exist.");
   
    PC_EmulateCommand(playerid, params, CMD_EX_HELP);
}

CMD:cmdinfo(playerid, params[], extra) {
    if(extra == CMD_EX_HELP)
        return SendClientMessage(playerid, -1, "Command Syntax: /cmdinfo <command name>");
    if(extra == CMD_EX_INFO)
        return SendClientMessage(playerid, -1, "This command returns information on a specified command.");
   
    if(!PC_CommandExists(params))
        return SendClientMessage(playerid, -1, "That command doesn't exist.");
   
    PC_EmulateCommand(playerid, params, CMD_EX_INFO);
}
Now again, I think this would be best as an optional thing.
But, you can do this without 'extra' parameter.
Reply

I guess it was about
PHP код:
#define CMD_DEFAULT     (0b10000000000)
#define CMD_TEAM_1      (0b01000000000)
#define CMD_TEAM_2      (0b00100000000)
#define CMD_ADMIN_1     (0b00010000000)
#define CMD_ADMIN_2     (0b00011000000)
#define CMD_ADMIN_3     (0b00011100000)
#define CMD_ADMIN_4     (0b00011110000)
#define CMD_ADMIN_5     (0b00011111000)
#define CMD_VIP_1       (0b00000000100)
#define CMD_VIP_2       (0b00000000110)
#define CMD_VIP_3       (0b00000000111) 
Reply

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
Why that insistence of a benchmark? We all know that command processor written in PAWN cannot beat the plugin.
What about Life CMD? MCMD and other processors made as plugin?
Reply

Quote:
Originally Posted by vannesenn
Посмотреть сообщение
What about Life CMD? MCMD and other processors made as plugin?
These plugins do not hash commands.
Reply

Quote:
Originally Posted by Spmn
Посмотреть сообщение
That's not how bitflags work. Some of those numbers aren't even valid 32-bit integers. I guess you wanted to write them in binary form instead of hexadecimal.
Yes obviously... xD

I actually noticed my mistake right after I posted the reply. I just figured you guys weren't dumb enough to think I thought the prefix for a binary integer constant was 'x', so I didn't changed it. Instead I started working on a larger list, that I forgot to post.

pawn Код:
// Everybody
#define CMD_DEFAULT     (0b10000000000000000000000000000000)

// Teams
#define CMD_TEAM_1      (0b01000000000000000000000000000000)
#define CMD_TEAM_2      (0b00100000000000000000000000000000)

// Admins
#define CMD_ADMIN_1     (0b00010000000000000000000000000000)
#define CMD_ADMIN_2     (0b00011000000000000000000000000000)
#define CMD_ADMIN_3     (0b00011100000000000000000000000000)
#define CMD_ADMIN_4     (0b00011110000000000000000000000000)
#define CMD_ADMIN_5     (0b00011111000000000000000000000000)

// VIP
#define CMD_VIP_1       (0b00000000100000000000000000000000)
#define CMD_VIP_2       (0b00000000110000000000000000000000)
#define CMD_VIP_3       (0b00000000111000000000000000000000)

// Jobs
#define CMD_MINERS      (0b00000000000100000000000000000000)
#define CMD_CASHIER     (0b00000000000010000000000000000000)
#define CMD_FISHER      (0b00000000000001000000000000000000)
#define CMD_COP_1       (0b00000000000000100000000000000000)
#define CMD_COP_2       (0b00000000000000110000000000000000)
#define CMD_COP_3       (0b00000000000000111000000000000000)

// Classes
#define CMD_ARMY         (0b0000000000000000110000000000000000)
#define CMD_MARINE       (0b0000000000000000100000000000000000)
#define CMD_NAVY         (0b0000000000000000010000000000000000)
#define CMD_GENERAL      (0b0000000000000000111000000000000000)

// Almighty
#define CMD_OWNER        (0b1111111111111111111111111111111111)
Better?
Reply

I will update the graph tomorrow.
Reply

The graph was updated.
Reply

I don't understand what I can to do with flags?
Reply


Forum Jump:


Users browsing this thread: 11 Guest(s)