[Include] rCmd.inc - Easiest way to create commands!
#81

As I see this command system is getting more and more attention, I've planned to re-write this with many bug fixes (if there are), performance tweaks and new features and maybe integrate the DynamicParams.inc to the include itself so you just have to download one thing.

Beside this, I'm not sure what makes this incompatible for some people, but I will try figure out soon.
Reply
#82

Thank you very much , Ryder it's a really nice Command processor , i tried it it not works with all commands but with them it works its very fast 0003-0006 mili seconds!
Reply
#83

But do I need to declare the commands in OnPlayerCommandText like with dcmd, or should it be enough with writing the functions?
Reply
#84

Nope, just the functions like in the examples.
Reply
#85

Quote:
Originally Posted by RyDeR`
View Post
You will also need my DynamicParams.inc include. (Will create a seperate topic for this include soon).
Not sure if this ever made it to its own topic,
if so could someone point me to it.

and is it okay to use this in other projects?

thx
Reply
#86

Quote:
Originally Posted by Jonny5
View Post
Not sure if this ever made it to its own topic,
if so could someone point me to it.

and is it okay to use this in other projects?

thx
Ah, forgot about that! But yes, you're free to use it in other projects.
Reply
#87

Quote:
Originally Posted by RyDeR`
View Post
As I see this command system is getting more and more attention, I've planned to re-write this with many bug fixes (if there are), performance tweaks and new features and maybe integrate the DynamicParams.inc to the include itself so you just have to download one thing.

Beside this, I'm not sure what makes this incompatible for some people, but I will try figure out soon.
Thanks you. This command processor so very nice. I will wait for fix.
Reply
#88

@Ryder`
Oh i would love to see another release of it
Reply
#89

Important fix!

Guess I just found why some commands would work and some would not. For some reason I used break to stop the loop when the index wasn't found, while there are commands in the remaining indexes. Here's a simple fix, open the include and replace this:
pawn Code:
if(!GetPublicNameByIndex(i, s_szFunc, sizeof(s_szFunc))) {
    break;
}
with this:
pawn Code:
if(!GetPublicNameByIndex(i, s_szFunc, sizeof(s_szFunc))) {
    continue;
}
and it should work just fine! I changed it in the download link too.
Reply
#90

Quote:
Originally Posted by RyDeR`
View Post
Important fix!

Guess I just found why some commands would work and some would not. For some reason I used break to stop the loop when the index wasn't found, while there are commands in the remaining indexes. Here's a simple fix, open the include and replace this:
pawn Code:
if(!GetPublicNameByIndex(i, s_szFunc, sizeof(s_szFunc))) {
    break;
}
with this:
pawn Code:
if(!GetPublicNameByIndex(i, s_szFunc, sizeof(s_szFunc))) {
    continue;
}
and it should work just fine! I changed it in the download link too.
Very nice. Thanks you. Now everything works fine.

Sorry my bad English.
Reply
#91

Is optional parameters a feature which is going to be implemented soon?
Reply
#92

Is there any way to put a "z" for optional string?
Reply
#93

Can i use this with OnPlayerCommandText callback(strcmp)?
Reply
#94

Hello,
i have a very big Problem.
some of my commands work and some doesn't work and the server returns "SERVER: Unknown Command."
For example /supcar works but /ban not.
I have removed OnPlayeCommandText, dont have any other CMD System.
Here the Code of a CMD, who doesnt work e.g. and returns SERVER: Unknown Command:
Code:
rCmd[iii]->veh(playerid,success,vid,c1,c2)
{
	new Float:Pos[4],vehid;
	if(!success)return SendClientMessage(playerid,ROT,"Benutze: /veh [Modelid des Fahrzeugs] [Farbe 1] [Farbe 2]");
	if(!IsAdmin(playerid,6))return ZugriffVerweigert(playerid,0,0,6);
	GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
	GetPlayerFacingAngle(playerid,Pos[3]);
	vehid = CreateVehicle(vid,Pos[0],Pos[1],Pos[2],Pos[3],c1,c2,_NEVER);
	SetVehicleNumberPlate(vehid,"~> Admin <~");
	PutPlayerInVehicle(playerid,vehid,0);
	SetPVarInt(playerid,"vehicleid",vehid);
	SendClientMessage(playerid,GRЬN,"Du hast ein Admincar gespawnt. Dies wird nach dem Verlassen wieder automatisch gelцscht!");
	return 1;
}
Reply
#95

To all people experiencing problems with this include, I'm about to rewrite it with more features and make it more stable, the current one has some problems with the memory I guess, it gets all messed up after some time.
Reply
#96

I managed to integrate sscanf2 plugin with this include, it's working great and I'm pretty sure you'll like it too! Once I'm %100 sure it's stable enough, I will release it. Stay tuned.
Reply
#97

I'm sorry for a third post in row, but it's to announce that I finally released the awesome version of rCmd! sscanf plugin is fully integrated now (which means you can now use optional parameters, and all other features of sscanf). Please make sure you read the Syntax part again, it's very important!
Quote:
Originally Posted by RyDeR`
View Post
Changelog
  • 06/01/2013 - v0.2.0:
    • Rewrote the whole include, as well as DynamicParams.inc. I found some critical bugs that made this include completely worthless, but I'm sure it's completely fixed now and is %100 to use.
    • sscanf plugin is fully integrated now and automatically makes use of all features of the sscanf plugin.
    • Just make sure you read "Syntax" part of the topic again as there are some important things to note:
      Quote:
      Syntax

      Code:
      rCmd["specifiers"]->commandname(playerid, success, ...)
      NEW (IMPORTANT NOTES):
      • You can use all sscanf specifiers in the specifiers input, yes, literally whole sscanf.
      • Note the quotes around specifiers in this new version. It's not necessary, but when you use brackets for optional parameters, it will give you errors without the quotes.
      • You have to use & in front of all non-array variables (floats, integers, ..., NOT playerid and success) because DynamicParams.inc is passes the address of the value. If you skip this, the value of the integer/float will be wrong. Example:
        Code:
        rCmd["us[24]"]->setname(playerid, success, &targetid, name[]) {
        	// ...
        	return 1;
        }
Reply
#98

Wow, never saw a scripted literally combined with sscanf, so i don't need sscanf.inc?
Reply
#99

No, you NEED sscanf.
Reply

Hi Ryder,
I thank you for your update.
Now all Commands are working
Reply


Forum Jump:


Users browsing this thread: 10 Guest(s)