SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 25/07/2017, 04:41 PM   #391
augustogdo
Little Clucker
 
augustogdo's Avatar
 
Join Date: Jan 2017
Posts: 22
Reputation: 0
Default Re: Pawn.CMD - the fastest and most functional command processor

Caught my eye, I'll take a severe test and see if it's good
augustogdo is offline   Reply With Quote
Old 26/07/2017, 05:44 PM   #392
Bussyman
Big Clucker
 
Join Date: Apr 2017
Posts: 163
Reputation: 0
Default Re: Pawn.CMD - the fastest and most functional command processor

In Command: i can use any return?
Bussyman is offline   Reply With Quote
Old 26/07/2017, 10:56 PM   #393
R4nd4ll
Big Clucker
 
R4nd4ll's Avatar
 
Join Date: Jul 2017
Location: Los Santos, The Federal Bureau of Investigation HQ
Posts: 128
Reputation: 56
Default Re: Pawn.CMD - the fastest and most functional command processor

Quote:
Originally Posted by SmileJack View Post
Nice men! Grest Job
Man *, Great *
R4nd4ll is offline   Reply With Quote
Old 27/07/2017, 02:36 AM   #394
Bussyman
Big Clucker
 
Join Date: Apr 2017
Posts: 163
Reputation: 0
Default Re: Pawn.CMD - the fastest and most functional command processor

Code:
public OnPlayerCommandPerformed(playerid, cmd[], params[], result, flags) 
{ 
    if(result == -1) 
    { 
        SendClientMessage(playerid, 0xFFFFFFFF, "SERVER: Unknown command."); 
        return 0; 
    } 

    return 1; 
}
result only returns -1 ?
Bussyman is offline   Reply With Quote
Old 29/07/2017, 07:09 AM   #395
Logic_
High-roller
 
Logic_'s Avatar
 
Join Date: Jun 2015
Location: Hunter's Palace
Posts: 1,173
Reputation: 135
Default Re: Pawn.CMD - the fastest and most functional command processor

Quote:
Originally Posted by Bussyman View Post
Code:
public OnPlayerCommandPerformed(playerid, cmd[], params[], result, flags) 
{ 
    if(result == -1) 
    { 
        SendClientMessage(playerid, 0xFFFFFFFF, "SERVER: Unknown command."); 
        return 0; 
    } 

    return 1; 
}
result only returns -1 ?
No, the result returns whatever the value is returned from the command. For example, if you want to make something like this...

PHP Code:
CMD:ajetpack(playerid)
{
    if(
pInfo[playerid][AdminLvl] < 2) return 0// this will send result value as 0.
    
if(!AdmDuty{playerid}) return SendClientMessage(playeridCOLOR_RED"ERROR: "COL_GREY"You must be on admin duty to use this command."), 0// this will send result value as 0 as well.

    
SetPlayerSpecialAction(playeridSPECIAL_ACTION_USEJETPACK);
    
SendClientMessage(playeridCOLOR_PINK"* Spawned Jetpack.");
    return 
1// this will send result value as 1.
}

public 
OnPlayerCommandPerformed(playeridcmd[], params[], resultflags)
{
    if(!
result// if result is zero
        
return SendClientMessage(playeridCOLOR_RED"ERROR: You're not permitted to use this command.");
    return 
1;

Result value can be important, and if you use flags along with it, it might make your code better (This is just an example.) Result only comes up as -1 when the command doesn't exist, otherwise as said it'll return the result passed in the command.

--------

Is PC_EmulateCommand supposed not to call "OnPlayerCommandPerformed"? Because it doesn't calls for me.
__________________
SA-MP, G-MOD and Web hosting @ https://www.prestigesteve.com.
Logic_ is offline   Reply With Quote
Old 29/07/2017, 06:52 PM   #396
YourShadow
Big Clucker
 
YourShadow's Avatar
 
Join Date: Apr 2016
Posts: 106
Reputation: 151
Default Re: Pawn.CMD - the fastest and most functional command processor

Quote:
Originally Posted by Logic_ View Post
Is PC_EmulateCommand supposed not to call "OnPlayerCommandPerformed"? Because it doesn't calls for me.
"OnPlayerCommandPerformed" is called if the public exists.

Last edited by YourShadow; 30/07/2017 at 01:38 PM.
YourShadow is offline   Reply With Quote
Old 01/08/2017, 05:49 PM   #397
Bussyman
Big Clucker
 
Join Date: Apr 2017
Posts: 163
Reputation: 0
Default Re: Pawn.CMD - the fastest and most functional command processor

What if in command return -1;? so in callback if(result == -1) will do check? and why

public OnPlayerCommandPerformed(playerid, cmd[], params[], result, flags)
{
if(result == -1)
{

return 0;
}
return 1;
}

Why need return 0;? is there effect anything?
Bussyman is offline   Reply With Quote
Old 02/08/2017, 05:01 PM   #398
YourShadow
Big Clucker
 
YourShadow's Avatar
 
Join Date: Apr 2016
Posts: 106
Reputation: 151
Default Re: Pawn.CMD - the fastest and most functional command processor

Quote:
Originally Posted by Bussyman View Post
What if in command return -1;? so in callback if(result == -1) will do check?
Yes.
Quote:
Originally Posted by Bussyman View Post
Why need return 0;? is there effect anything?
return 1 => stop iterating over scripts queue.
YourShadow is offline   Reply With Quote
Old 18/08/2017, 10:38 PM   #399
Humza
Gangsta
 
Humza's Avatar
 
Join Date: Oct 2014
Posts: 608
Reputation: 106
Default Re: Pawn.CMD - the fastest and most functional command processor

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

SA-MP Dedicated Server
----------------------
v0.3.7-R2, (C)2005-2015 SA-MP Team

[22:17:36] filterscripts = ""  (string)
[22:17:36] 
[22:17:36] Server Plugins
[22:17:36] --------------
[22:17:36]  Loading plugin: crashdetect.so
[22:17:36]   CrashDetect v4.18.1 is OK.
[22:17:36]   Loaded.
[22:17:36]  Loading plugin: streamer.so
[22:17:36] 

*** Streamer Plugin v2.9.1 by Incognito loaded ***

[22:17:36]   Loaded.
[22:17:36]  Loading plugin: sscanf.so
[22:17:36] 

[22:17:36]  ===============================

[22:17:36]       sscanf plugin loaded.     

[22:17:36]          Version:  2.8.2        

[22:17:36]    (c) 2012 Alex "Y_Less" Cole  

[22:17:36]  ===============================

[22:17:36]   Loaded.
[22:17:36]  Loading plugin: mysql.so
[22:17:36]  >> plugin.mysql: R41-3 successfully loaded.
[22:17:36]   Loaded.
[22:17:36]  Loading plugin: MapAndreas.so
[22:17:36]   Loaded.
[22:17:36]  Loading plugin: SKY.so
[22:17:36]   Loaded.
[22:17:36]  Loading plugin: pawncmd.so
[22:17:36] Pawn.CMD plugin v3.1.3 by urShadow loaded
[22:17:36]   Loaded.
[22:17:36]  Loaded 7 plugins.

[22:17:36] 
[22:17:36] Filterscripts
[22:17:36] ---------------
[22:17:36]   Loaded 0 filterscripts.

[22:17:36]  
[22:17:36]  
[22:17:36]  
[22:17:36]  ======================================= 
[22:17:36]  |                                     | 
[22:17:36]  |        YSI version 4.00.0001        | 
[22:17:36]  |        By Alex "Y_Less" Cole        | 
[22:17:36]  |                                     | 
[22:17:36]  ======================================= 
[22:17:36]  
[22:17:37] Succesfully connected.
[22:17:37] Number of vehicle models: 12
[22:18:03] [join] Hydra has joined the server
[22:23:47] [chat] [Hydra]:  /base
[22:23:49] [debug] Server crashed while executing Test.amx
[22:23:49] [debug] AMX backtrace:
[22:23:49] [debug] #0 00000074 in ?? (... <28 arguments>) at <unknown file>:0
[22:23:49] [debug] #1 00000074 in public pc_cmd_base () at <unknown file>:0
Any idea?
__________________
Humza is offline   Reply With Quote
Old 18/08/2017, 10:42 PM   #400
HoussemGaming
Banned
 
Join Date: Jun 2017
Location: France
Posts: 206
Reputation: 10
Default Re: Pawn.CMD - the fastest and most functional command processor

Show the base CMD
HoussemGaming 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 11:49 PM.


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