07.03.2012, 10:03
(
Последний раз редактировалось iPLEOMAX; 07.03.2012 в 16:42.
)
MultiCommands
An enhancement for all command systems
A very short but useful include. An enhancement for all command systems
Video:
[ame]http://www.youtube.com/watch?v=HfKQ3WfLmug[/ame]
A single function:
pawn Код:
native MultiCommand(playerid, commands[]);
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;
}
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
Thank you.