SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 09/05/2017, 07:16 AM   #371
Dayrion
High-roller
 
Dayrion's Avatar
 
Join Date: Jan 2016
Location: France
Posts: 1,349
Reputation: 115
Default Re: Pawn.CMD - the fastest and most functional command processor

Can we deactivate commands per player?
Dayrion is offline   Reply With Quote
Old 09/05/2017, 11:16 AM   #372
RakeDW
Little Clucker
 
Join Date: Jul 2014
Posts: 31
Reputation: 0
Default Re: Pawn.CMD - the fastest and most functional command processor

Quote:
Originally Posted by Dayrion View Post
Can we deactivate commands per player?
Code:
new bool: actived[MAX_PLAYERS] = true;

CMD:example(id, params[]) {
if (!actived[id]) return 1;
//.......
return 1;
}
This?
RakeDW is offline   Reply With Quote
Old 13/05/2017, 05:22 PM   #373
vannesenn
Gangsta
 
vannesenn's Avatar
 
Join Date: Feb 2011
Posts: 663
Reputation: 15
Default Re: Pawn.CMD - the fastest and most functional command processor

Quote:
Originally Posted by RakeDW View Post
Code:
new bool: actived[MAX_PLAYERS] = true;

CMD:example(id, params[]) {
if (!actived[id]) return 1;
//.......
return 1;
}
This?
Nop... It's better via callback OnPlayerCommandReceived

Code:
new bool:active[MAX_PLAYERS];

public OnPlayerCommandReceived(...)
{
     if(!active[playerid]) return (false);
    // REST OF THE CODE
}
vannesenn is offline   Reply With Quote
Old 14/05/2017, 01:29 AM   #374
GSFBart
Big Clucker
 
Join Date: Apr 2017
Location: Brazil
Posts: 69
Reputation: 1
Default Re: Pawn.CMD - the fastest and most functional command processor

[13/05/2017 20:55:57] Error: Function not registered: 'PC_EmulateCommand'

Code:
CMD:fakecmd(playerid, params[])
{
    //[...]
    new sCMD[30];

    if(sscanf(params, "ds[30]", id, sCMD)) return SendClientMessage(playerid, COLOR_ERRO, "[ x ] Uso correto: /FakeCMD [ ID ] [ Comando ]");
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_ERRO, "[ x ] Ninguém online com esse ID!");  

    PC_EmulateCommand(id, sCMD); 
    return 1;
}
GSFBart is offline   Reply With Quote
Old 14/05/2017, 02:27 AM   #375
amirm3hdi
Banned
 
Join Date: Apr 2015
Location: Brain
Posts: 265
Reputation: 14
Default Re: Pawn.CMD - the fastest and most functional command processor

Server doesn't need fast command processing...
Developer needs a command processor that is simple and fast to develop not fast to process.
amirm3hdi is offline   Reply With Quote
Old 14/05/2017, 02:11 PM   #376
Chris53340
High-roller
 
Chris53340's Avatar
 
Join Date: Jul 2011
Posts: 1,766
Reputation: 54
Default Re: Pawn.CMD - the fastest and most functional command processor

Thank you.

I would like to know how PAWN.CMD used for irregular use.

Here is my code with strcmp

Resume

PHP Code:
public OnPlayerCommandText(playeridcmdtext[])
{
    new 
HelpCMD[20];
    
format(HelpCMDsizeof(HelpCMD), "/aide");
    if(
strcmp(HelpCMDcmdtexttrue10) == 0
    {
        
// My Code
        
return 1;
    }
    return 
1;

With PWN.CMD

PHP Code:
cmd:HelpCMD(playeridparam[]) return 1
No put my irregular variable.

Thanks.. (Bad English)
__________________
Ma présentation / Mon Showroom

[11 FilterScripts]
[4 Maps]
[6 Includes]
[9 Tutoriels]
[1 Tool/Web/Other]
Chris53340 is offline   Reply With Quote
Old 18/05/2017, 08:36 AM   #377
Chris53340
High-roller
 
Chris53340's Avatar
 
Join Date: Jul 2011
Posts: 1,766
Reputation: 54
Default Re: Pawn.CMD - the fastest and most functional command processor

Bump pls
__________________
Ma présentation / Mon Showroom

[11 FilterScripts]
[4 Maps]
[6 Includes]
[9 Tutoriels]
[1 Tool/Web/Other]
Chris53340 is offline   Reply With Quote
Old 18/05/2017, 11:27 AM   #378
Dice_
Huge Clucker
 
Dice_'s Avatar
 
Join Date: Sep 2015
Location: Indonesia
Posts: 400
Reputation: 45
Default Re: Pawn.CMD - the fastest and most functional command processor

Quote:
Originally Posted by Chris53340 View Post
Thank you.

I would like to know how PAWN.CMD used for irregular use.

Here is my code with strcmp

Resume

PHP Code:
public OnPlayerCommandText(playeridcmdtext[])
{
    new 
HelpCMD[20];
    
format(HelpCMDsizeof(HelpCMD), "/aide");
    if(
strcmp(HelpCMDcmdtexttrue10) == 0
    {
        
// My Code
        
return 1;
    }
    return 
1;

With PWN.CMD

PHP Code:
cmd:HelpCMD(playeridparam[]) return 1
No put my irregular variable.

Thanks.. (Bad English)
What are you trying to do?please explain it again..
__________________
quit
Dice_ is offline   Reply With Quote
Old 18/05/2017, 11:34 AM   #379
Yuri8
Big Clucker
 
Join Date: Nov 2016
Posts: 60
Reputation: 0
Default Re: Pawn.CMD - the fastest and most functional command processor

How can I create a command? I know only ZCMD style.
Yuri8 is offline   Reply With Quote
Old 18/05/2017, 11:47 AM   #380
Dayrion
High-roller
 
Dayrion's Avatar
 
Join Date: Jan 2016
Location: France
Posts: 1,349
Reputation: 115
Default Re: Pawn.CMD - the fastest and most functional command processor

Quote:
Originally Posted by Chris53340 View Post
Bump pls
PHP Code:
CMD:aide(playeridparams[])
{
    
// ton code... / your code ...
    
return 1;

Also, "params[]" can be removed since you don't need any parameters. I mean, if you have only "/aide" and nothing more, remove "params[]".
Tu peux retirer "params[]" si tu n'as pas besoin de mettre de paramètre. Si ta commande est juste "/aide" sans paramètre (ex: "/aide 1" où 1 est un paramètre de la commande), tu peux retirer "params[]".
Dayrion 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 04:23 PM
[Tutorial] PAWN Pre-Processor (Updated 22/04/13) Misiur Tutorials 6 10/07/2016 02:33 PM
[Include] y_commands - Most flexible and fastest command processor, now on the YSI wiki corne Includes 19 03/12/2015 01:41 AM
[Tutorial] PAWN Pre-Processor - Pre-processor alternatives - Part 5/7 Misiur Tutorials 0 14/04/2015 09:13 PM


All times are GMT. The time now is 04:04 AM.


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