[Include] MultiCommands (Use different commands at the same time!)
#1

MultiCommands
An enhancement for all command systems
A very short but useful include.

Video:
[ame]http://www.youtube.com/watch?v=HfKQ3WfLmug[/ame]

A single function:
pawn Код:
native MultiCommand(playerid, commands[]);
Usage:
pawn Код:
//ZCMD
CMD:multi(playerid, params[])
{
    if(isnull(params)) return SendClientMessage(playerid, -1, "Usage: /multi [Desired /Commands, ...]");
    MultiCommand(playerid, params);
    return true;
}

//rCmd:
rCmd:multi(playerid, success, commands[]) {
    if(!success) return SendClientMessage(playerid, -1, "Usage: /multi [Desired /Commands, ...]");
    MultiCommand(playerid, commands);
    return 1;
}

//YCMD:
YCMD:multi(playerid, params[], help)
{
    if(help) return SendClientMessage(playerid, -1, "Help: Enables you to use different commands at the same time.");
    if(isnull(params)) return SendClientMessage(playerid, -1, "Usage: /multi [Desired /Commands, ...]");
    MultiCommand(playerid, params);
    return true;
}

//Default:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/multi", true, 6)) return MultiCommand(playerid, cmdtext[7]);
   
    //Other...
   
    return false;
}
* Note that you can attach it to the main command processing code to convert ALL commands into multi-commands.
Would slow down performance by few milliseconds though.

Download:

Newbie? You better download this:
Mediafire

or else, you know how to paste it as an include:
Pastebin

Legal:
Mozilla Public License 2.0

Changelog:
Код:
7/Mar/2012- Initial Release
Tell me if you have any suggestions or reported bugs.
Thank you.
Reply
#2

8/10, good
Reply
#3

7/10,
Really cool and usable.
Reply
#4

Amazing :]
Reply
#5

:O Very epic ! Didn't know it was possible. Great work ! And lol @ sig ;p
Reply
#6

amazing 10/10
Reply
#7

Good, 7/10
Reply
#8

nice 8/10

lol @ signature
Reply
#9

LOL
Amazing. 5/5
Reply
#10

Although I like this idea since now you can use multiple commands at once.
Anyways this version might been made in stock and there are server which uses commands like
Код:
//command
So I just remade your script and uploaded this one:

mcmds.inc Pastebin


Usage:

Код:
M_CMDs(playerid, params[], somevariable);
or
Код:
MultiCommands(playerid, params[], somevariable);
or if you get any warnings that a variable shadows at a proceeding level
Код:
M_CMDsEx(playerid, params[], somevariable1, somevariable2, somevariable3);
Код:
M_CMDs
Function name

Код:
playerid
Player ID to perform the multiple commands

Код:
params[]
Parameters

Код:
somevariable, somevariable1, somevariable2, somevariable3
Just put here undeclared/undefined variables (It's important for the loop inside this macro)


Example:
pawn Код:
M_CMDs(playerid, params, i);
or
pawn Код:
M_CMDs(playerid, params, ehlol);
or
pawn Код:
M_CMDs(playerid, params, randomstuff);
etc..
Reply
#11

Haha! When i saw that thread of a guy with 46 Posts and he was making a multicmd include. That was pretty fucked up for me :S

Cross checked the code and found it was you :P

Anyways good work with this. I already had your include before it was released Gonna use it for sure.
Reply
#12

Freaky awesome
Reply
#13

10/10 Rep+
Reply
#14

omg epic
Reply
#15

I actually find this really useful!
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)