SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Plugin Development

Reply
 
Thread Tools Display Modes
Old 02/06/2016, 02:37 AM   #21
Stanford
High-roller
 
Stanford's Avatar
 
Join Date: Feb 2012
Posts: 1,037
Reputation: 84
Default Re: Pawn.CMD - the fastest and most functional command processor

Great job! I hope that you will keep updating it - and it would be cool if someone posts a benchmark with ZCMD, YCMD and iZCMD and maybe other command processors.
__________________
Y_Less: "That code compiles perfectly, but I can tell you now it won't make me a cup of tea."

Y_Less: "I've said this before. People think that MySQL is some simple plug-and-play magic bullet that you can use to just make your mode instantly better. They don't realise that the "L" in "SQL" means "language". So instead of programming PAWN, and using a bit of this mystery thing, you are now programming in two languages at once. If you spend months learning PAWN, you should spend the same time learning SQL, if not more - it is probably the more complex of the two languages, and not something that just gets bolted on to the side."
Stanford is offline   Reply With Quote
Old 02/06/2016, 02:44 AM   #22
Crayder
High-roller
 
Crayder's Avatar
 
Join Date: Sep 2013
Location: Flames of Hell
Posts: 3,856
Reputation: 569
Default Re: Pawn.CMD - the fastest and most functional command processor

Quote:
Originally Posted by Stanford View Post
Great job! I hope that you will keep updating it - and it would be cool if someone posts a benchmark with ZCMD, YCMD and iZCMD and maybe other command processors.
There is no need for any of those benchmarks, any plugin processor like this and MCMD knock out any PAWN processor without doubt by miles.
__________________
Those who deserve reputation, do not need to beg for it.
Also, don't expect the help you need when offering reputation, you'll just be attracting Rep Hunters.
Join SA-MP Discord!
Crayder is offline   Reply With Quote
Old 02/06/2016, 07:06 AM   #23
YourShadow
Big Clucker
 
YourShadow's Avatar
 
Join Date: Apr 2016
Posts: 111
Reputation: 174
Default Re: Pawn.CMD - the fastest and most functional command processor

Quote:
Originally Posted by Crayder View Post
@YourShadow Can you let us have some more features like:
- Not ignoring the return value, so we can hide commands
- Disabling commands for certain players, which would return 0 for them
PHP Code:
public OnPlayerReceivedCommand(playeridcmd[], params[], bool:exists

    if (
playerid ...) // condition
    

        
SendClientMessage(playerid0xFFFFFFFF"This command not available for you"); 

        return 
0// will not call "cmd: ..."
    


    return 
1

YourShadow is offline   Reply With Quote
Old 02/06/2016, 07:45 AM   #24
Crayder
High-roller
 
Crayder's Avatar
 
Join Date: Sep 2013
Location: Flames of Hell
Posts: 3,856
Reputation: 569
Default Re: Pawn.CMD - the fastest and most functional command processor

Quote:
Originally Posted by YourShadow View Post
PHP Code:
public OnPlayerReceivedCommand(playeridcmd[], params[], bool:exists

    if (
playerid ...) // condition
    

        
SendClientMessage(playerid0xFFFFFFFF"This command not available for you"); 

        return 
0// will not call "cmd: ..."
    


    return 
1

That would require very slow code, like strcmp. Using many strcmp cases could make Pawn.CMD slower than any other processor.
__________________
Those who deserve reputation, do not need to beg for it.
Also, don't expect the help you need when offering reputation, you'll just be attracting Rep Hunters.
Join SA-MP Discord!
Crayder is offline   Reply With Quote
Old 02/06/2016, 08:04 AM   #25
YourShadow
Big Clucker
 
YourShadow's Avatar
 
Join Date: Apr 2016
Posts: 111
Reputation: 174
Default Re: Pawn.CMD - the fastest and most functional command processor

PHP Code:
cmd:ban(playeridparams[])
{
    if (
pAdmin[playerid] == 0// condition
    
{
        
SendClientMessage(playerid0xFFFFFFFF"This command not available for you");

        return; 
// exit from function
    
}
    
    
// code here

YourShadow is offline   Reply With Quote
Old 02/06/2016, 08:28 AM   #26
Crayder
High-roller
 
Crayder's Avatar
 
Join Date: Sep 2013
Location: Flames of Hell
Posts: 3,856
Reputation: 569
Default Re: Pawn.CMD - the fastest and most functional command processor

That would have to be placed in every command I want blocked.

Also, do you realize how slow if statements are? Another thing to slow us down.
__________________
Those who deserve reputation, do not need to beg for it.
Also, don't expect the help you need when offering reputation, you'll just be attracting Rep Hunters.
Join SA-MP Discord!
Crayder is offline   Reply With Quote
Old 02/06/2016, 08:40 AM   #27
YourShadow
Big Clucker
 
YourShadow's Avatar
 
Join Date: Apr 2016
Posts: 111
Reputation: 174
Default Re: Pawn.CMD - the fastest and most functional command processor

Quote:
Originally Posted by Crayder View Post
@YourShadow Can you let us have some more features like:
- Not ignoring the return value, so we can hide commands
- Disabling commands for certain players, which would return 0 for them
Show me an example of how you would like it to see.
YourShadow is offline   Reply With Quote
Old 02/06/2016, 09:31 AM   #28
Yashas
Gangsta
 
Join Date: Jun 2012
Location: India
Posts: 874
Reputation: 266
Default Re: Pawn.CMD - the fastest and most functional command processor

Quote:
Originally Posted by YourShadow View Post
Show me an example of how you would like it to see.
Its here,
http://forum.sa-mp.com/showthread.ph...95#post3475795

Try to keep the syntax same so that people can easily switch. You are beating other plugin based command processors because you have lesser features.

Other processors have two callbacks. You should have one callback before executing the command and one callback after executing the command.
Yashas is offline   Reply With Quote
Old 02/06/2016, 09:54 AM   #29
vannesenn
Gangsta
 
vannesenn's Avatar
 
Join Date: Feb 2011
Posts: 669
Reputation: 15
Default Re: Pawn.CMD - the fastest and most functional command processor

Maybe something like this

Code:
CMD:command(playerid, params[], cmd_id)
. cmd_id is unique command ID(like dialogid for dialogs). And then

Code:
public OnPlayerReceivedCommand(playerid, cmd_id, params[], bool:exists)
{
    switch(cmd_id)
    {
         // CODE GOES HERE
    }

}
vannesenn is offline   Reply With Quote
Old 02/06/2016, 10:08 AM   #30
Crayder
High-roller
 
Crayder's Avatar
 
Join Date: Sep 2013
Location: Flames of Hell
Posts: 3,856
Reputation: 569
Default Re: Pawn.CMD - the fastest and most functional command processor

Quote:
Originally Posted by vannesenn View Post
Maybe something like this

Code:
CMD:command(playerid, params[], cmd_id)
. cmd_id is unique command ID(like dialogid for dialogs). And then

Code:
public OnPlayerReceivedCommand(playerid, cmd_id, params[], bool:exists)
{
    switch(cmd_id)
    {
         // CODE GOES HERE
    }

}
Not a bad idea, but not what I was picturing... But still not a bad idea.

Here's what I had in mind.

- Not ignoring the return value of commands:
Allow commands to return whatever integer the scripter wants. Returning '0' would result in the default actions, the unknown command stuff.
You could also add a new parameter to the callback, a 'result'. The 'result' parameter would hold the value returned by the command.

- Add a function for disabling/enabling specific commands for specific players.
SetPlayerCommandAllowed or something similiar, parameters: (playerid, cmdname[], bool:allow)
Setting 'allow' to false would return '0' if the player used this command, otherwise the command would execute.
Or, you could add yet another parameter to the callback, 'bool:allowed'. You would set this to the value set by the scripter. Then we could easily handle what happens when a player used a command they aren't allowed to use.

Code:
native SetPlayerCommandAllowed(playerid, cmdname[], bool:allow);
forward OnPlayerReceivedCommand(playerid, cmd[], params[], bool:exists, result, bool:allowed);

Doing it this way would keep the speed minimal still, and make the scripters' lives easier.
__________________
Those who deserve reputation, do not need to beg for it.
Also, don't expect the help you need when offering reputation, you'll just be attracting Rep Hunters.
Join SA-MP Discord!
Crayder is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Include] [I-ZCMD]Improved ZCMD - Fastest Command Processor Yashas Includes 99 23/07/2017 05:23 PM
[Tutorial] PAWN Pre-Processor (Updated 22/04/13) Misiur Tutorials 6 10/07/2016 03:33 PM
[Include] y_commands - Most flexible and fastest command processor, now on the YSI wiki corne Includes 19 03/12/2015 02:41 AM
[Tutorial] PAWN Pre-Processor - Pre-processor alternatives - Part 5/7 Misiur Tutorials 0 14/04/2015 10:13 PM


All times are GMT. The time now is 10:52 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.