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

This is pretty damn interesting, dude. Great work. I'm considering using this in my next gamemode especially since sscanf2 is fucking me over. However, does this support optional parameters?
Reply
#42

Good job
Reply
#43

Quote:
Originally Posted by Ainseri
View Post
This is pretty damn interesting, dude. Great work. I'm considering using this in my next gamemode especially since sscanf2 is fucking me over. However, does this support optional parameters?
It most probably will in the new version.
Reply
#44

Quote:
Originally Posted by RyDeR`
View Post
It most probably will in the new version.
Alright, cool. To be honest, though, when I think about it, optional parameters don't seem like that big of a deal.
Reply
#45

Finally, the update!
Quote:
Originally Posted by RyDeR`
View Post
Changelog
  • 21/04/2012 - v0.1.2:
    • Changed the whole syntax so there's not rCmd_Init anymore (thanks Y_Less):
      Code:
      rCmd[specifiers]->commandname(playerid, success, ...)
    • Added some new useful specifiers h, b and u:
      StringCharacterIntegerFloatUser name/idHexBinary
      s
      c
      i or d
      f
      u
      h
      b
    • Fixed a bug where the stack didn't get restored when your command was incomplete.
Unfortunately, I didn't add the optional parameters yet as it needs a few changes in the main code itself, but that's not that important, is it?

EDIT: See first post for examples and stuff.
Reply
#46

Could you give some examples with the new syntax please?
Reply
#47

Quote:
Originally Posted by Ainseri
View Post
Could you give some examples with the new syntax please?
Check first post.
Reply
#48

I'm wondering, what good is the 'success' parameter?
Reply
#49

Quote:
Originally Posted by Hiddos
View Post
I'm wondering, what good is the 'success' parameter?
It lets you know if they put in all the parameters and that they are all the correct type, I believe.
Reply
#50

Quote:
Originally Posted by Hiddos
View Post
I'm wondering, what good is the 'success' parameter?
Tells you if there were no flaws with the parameters. Pretty much what Ainseri said.
Reply
#51

Damn man, i first thought this cmd processor was very difficult to understand, but after reading it 3 times i see,its just the best one ever,man, gonna use this,for sure, GREAT JOB man 20/10 :d
Reply
#52

I love this command structure, more fun, and more clear, thank you for making this include
Reply
#53

This include is fastest?
Reply
#54

Nice work! Can you add "optional parameters" support? like: [iiff(is)]
Reply
#55

Quote:
Originally Posted by Britas
View Post
This include is fastest?
Obviously not.

Quote:
Originally Posted by SeoToX
View Post
Nice work! Can you add "optional parameters" support? like: [iiff(is)]
Sure, but not for now as said before.
Reply
#56

public CallBack() return OnPlayerCommandText(0, "/command");

How to do it with rCmd?
Reply
#57

Well said ******. I agree completely.
Reply
#58

is there a function like in zcmd to use as: return cmd_infernus(playerid, params);

is there a function in rcmd called: return rcmd_infernus(playerid, success);?? to use in a other command like
pawn Код:
rcmd[]->infernus(playerid, succes)
{
//code shitty here
return 1;
}
rcmd[]->inf(playerid, succes)
{
return rcmd_infernus(playerid, success, .......);
}
is there a function like that? cuz i used it alot

greets niels
Reply
#59

Just like this:
pawn Код:
rcmd[]->infernus(playerid) {
    // Code here
    return 1;
}

rcmd[]->inf(playerid) {
    return cmd_infernus(playerid);
}
Make sure you don't use "success" when you have no extra params.

And commands with multi-params just in the same way:
pawn Код:
rcmd[us]->ban(playerid, success, user, reason[]) {
    if(!success) {
        return SendClientMessagee(playerid, 0xFF0000FF, "<!> /ban [player id/name] [reason]");
    }
    if(IsPlayerConnected(user)) {
        BanEx(user, reason);
    } else {
        return SendClientMessage(playerid, 0xFF0000FF, "<!> Player not connected!");
    }
    return 1;
}

rcmd[us]->othername(playerid, success, user, reason[]) {
    return cmd_ban(playerid, success, user, reason);
}
Reply
#60

Nice but Zcmd is still better then your one.
Reply


Forum Jump:


Users browsing this thread: 9 Guest(s)