SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

Reply
 
Thread Tools Display Modes
Old 18/05/2018, 12:39 PM   #91
DeNCHiK01
Little Clucker
 
Join Date: Jun 2013
Posts: 12
Reputation: 0
Default Re: Smart Command Processor (Scripter-friendly, feature rich and fast) (aka iZCMD+)

Quote:
Originally Posted by Verc View Post
It works with y_hooks. I'm currently use them both
But how?
DeNCHiK01 is offline   Reply With Quote
Old 20/05/2018, 11:00 PM   #92
DeNCHiK01
Little Clucker
 
Join Date: Jun 2013
Posts: 12
Reputation: 0
Default Re: Smart Command Processor (Scripter-friendly, feature rich and fast) (aka iZCMD+)

I'm trying to make my gamemode modular, so I want to use y_hooks for this.

With this structure code compiles, but commands don't work
Code:
#include "../vendor/smartcmd.inc"
#include "../source/test/hooks_1.inc"
#include "../source/test/commands_1.inc"
#include "../source/test/hooks_2.inc"
#include "../source/test/commands_2.inc"
#include "../source/commands.inc"
With this compiler crashes
Code:
#include "../source/test/hooks_1.inc"
#include "../source/test/hooks_2.inc"
#include "../vendor/smartcmd.inc"
#include "../source/test/commands_1.inc"
#include "../source/test/commands_2.inc"
#include "../source/commands.inc"
So, how can I use them both? Did someone meet this problem?
DeNCHiK01 is offline   Reply With Quote
Old 21/05/2018, 12:58 AM   #93
Verc
Big Clucker
 
Join Date: Apr 2018
Posts: 66
Reputation: 20
Default Re: Smart Command Processor (Scripter-friendly, feature rich and fast) (aka iZCMD+)

I include y_hooks inside the modular file,not the main file,try it,it might work.
And,show me all your includes.
What compiler do you use?
Verc is online now   Reply With Quote
Old 21/05/2018, 08:27 AM   #94
DeNCHiK01
Little Clucker
 
Join Date: Jun 2013
Posts: 12
Reputation: 0
Default Re: Smart Command Processor (Scripter-friendly, feature rich and fast) (aka iZCMD+)

Quote:
Originally Posted by Verc View Post
I include y_hooks inside the modular file,not the main file,try it,it might work.
And,show me all your includes.
What compiler do you use?
Yep, I use it in modulars too, because it's necessary.
Code:
//hooks1.inc
#include "../vendor/YSI_includes/YSI/y_hooks.inc"

hook OnGameModeInit()
{
	printf("HOOK 1");
	return true;
}
Code:
//commands1.inc
CMD:test1(cmdid, player_ID, params[])
{
	return CMD_SUCCESS;
}
Code:
//hooks2.inc
#include "../vendor/YSI_includes/YSI/y_hooks.inc"

hook OnGameModeInit()
{
	printf("HOOK 2");
	return true;
}
Code:
//commands2.inc
CMD:test2(cmdid, player_ID, params[])
{
	return CMD_SUCCESS;
}
Commands.inc doesn't play a role, so I disabled it for tests now.
So hooks work well, there are messages in the console "HOOK 1", "HOOK 2", but commands are unknown.

I'm using Zeex-modified compiler

Last edited by DeNCHiK01; 21/05/2018 at 09:08 AM.
DeNCHiK01 is offline   Reply With Quote
Old 22/05/2018, 01:00 AM   #95
Verc
Big Clucker
 
Join Date: Apr 2018
Posts: 66
Reputation: 20
Default Re: Smart Command Processor (Scripter-friendly, feature rich and fast) (aka iZCMD+)

Show all your includes..
Verc is online now   Reply With Quote
Old 22/05/2018, 02:30 PM   #96
DeNCHiK01
Little Clucker
 
Join Date: Jun 2013
Posts: 12
Reputation: 0
Default Re: Smart Command Processor (Scripter-friendly, feature rich and fast) (aka iZCMD+)

Quote:
Originally Posted by Verc View Post
Show all your includes..
That's all I have in my test gamemode.
Here it is:
Code:
#include "../vendor/samp_basic/a_samp.inc"
#include "../vendor/smartcmd.inc"
#include "../source/test/hooks_1.inc"
#include "../source/test/commands_1.inc"
#include "../source/test/hooks_2.inc"
#include "../source/test/commands_2.inc"

main()
{

}
public OnGameModeInit()
{
	return true;
}
1st and 2nd is known for you, the others were shown in previous message

Last edited by DeNCHiK01; 22/05/2018 at 04:57 PM.
DeNCHiK01 is offline   Reply With Quote
Old 22/05/2018, 07:37 PM   #97
DeNCHiK01
Little Clucker
 
Join Date: Jun 2013
Posts: 12
Reputation: 0
Default Re: Smart Command Processor (Scripter-friendly, feature rich and fast) (aka iZCMD+)

Quote:
Originally Posted by Verc View Post
Show all your includes..
It seems that problem has been solved.
Thank you!

I placed includes this way:
Code:
#include "../source/test/hooks_1.inc"
#include "../source/test/hooks_2.inc"
#include "../vendor/smartcmd.inc"
#include "../source/test/commands_1.inc"
#include "../source/test/commands_2.inc"
But as I said, compiler had been crashing while compiling earlier. The reason was this:
Code:
f_public Float:GetVehicleSpeed(veh_ID)
Using macro to not to write forward for every public every time
and following warning, that I have for some days, but didn't think that it may be important: warning 208: function with tag result used before definition, forcing reparse

While I hadn't been using hooks and commands, this warning didn't make a problem, but all together they made a collapse for compiler with this reparse and so on.
DeNCHiK01 is offline   Reply With Quote
Old 27/05/2018, 01:36 PM   #98
Yashas
Gangsta
 
Join Date: Jun 2012
Location: India
Posts: 866
Reputation: 295
Default Re: Smart Command Processor (Scripter-friendly, feature rich and fast) (aka iZCMD+)

GitHub Issue #10: new defines for return values of the callbacks (Click Me)

Please use GitHub to voice your opinions.


There is CMD_SUCCESS and CMD_FAILURE which are expected to be used as return values in the command functions.

These definitions don't quite make sense for use in the OnPlayerCommandReceived callback. I was considering adding new defines specifically to serve the purpose of the return values in those callbacks because the existing defines are confusing (and returning numbers are bad as always).

My Proposal:
OnPlayerCommandReceived
CMD_IGNORE - tells the command processor to ignore the command, i.e: command won't be executed and won't be forwarded to other scripts as well

CMD_PROCESS - tells the command processor to go ahead and execute the command if it is in the current script or otherwise forward it to other scripts

OnPlayerCommandPerformed
CMD_SUCCESS and CMD_FAILURE make sort of sense for this callback. Hence, I believe dedicated new defines aren't needed for the return values of this callback.
Yashas is offline   Reply With Quote
Old 19/06/2018, 12:01 PM   #99
kovac
Big Clucker
 
Join Date: Mar 2018
Posts: 158
Reputation: 13
Default Re: Smart Command Processor (Scripter-friendly, feature rich and fast) (aka iZCMD+)

Commands appear to doesn't exist now. command /slap became /pm..
what am I doing wrong?
__________________
AN EXPERIENCED SCRIPTER, WORKING FOR CASH.
I CAN DO ANYTHING: - FROM BUG FIXES TO ADMIN, VIP, HOUSE OR ANY SYSTEM THAT YOU NEED. EVEN A GAMEMODE FROM SCRATCH!
DISCORD: AlexCNR#9200
kovac is offline   Reply With Quote
Old 19/06/2018, 02:21 PM   #100
Verc
Big Clucker
 
Join Date: Apr 2018
Posts: 66
Reputation: 20
Default Re: Smart Command Processor (Scripter-friendly, feature rich and fast) (aka iZCMD+)

Check previous page
Verc is online now   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] eXtended INI Processor - Fast & Feature Rich INI Processor Yashas Includes 28 01/09/2015 07:45 PM
[Include] r_commands - Clear and fast command processor! Swimor Includes 33 04/01/2013 03:30 PM
fast command processor [mad]MLK Help Archive 1 22/08/2009 01:32 AM


All times are GMT. The time now is 08:20 AM.


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