Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- //
- // icmd v5 -> development
- //
- //
- #define cmd(%0,%1,%2) \
- g_Cmd@%0(%1,%2); public g_Cmd@%0(%1,%2)
- static
- cmdname[32],
- cmdindex;
- public OnPlayerCommandText(playerid,cmdtext[]) {
- cmdname[0] = EOS;
- if((cmdindex = strfind(cmdtext, " ")) != -1) {
- if(strlen(cmdtext) - cmdindex > 1) {
- format(cmdname, 32, cmdtext[cmdindex +1]);
- cmdtext[cmdindex] = EOS, cmdtext[0] = '@';
- format(cmdtext, 32, "g_Cmd%s", cmdtext);
- if((funcidx(cmdtext) != -1)) {
- return CallLocalFunction(cmdtext, "is", playerid, cmdname), true;
- }
- return true;
- }
- cmdtext[cmdindex] = EOS;
- if((funcidx(cmdtext) != -1)) {
- return CallLocalFunction(cmdtext, "is", playerid, "\1"), true;
- }
- }
- if((funcidx(cmdtext) != -1)) {
- cmdtext[0] = '@';
- format(cmdtext, 32, "g_Cmd%s", cmdtext);
- return CallLocalFunction(cmdtext, "is", playerid, "\1"), true;
- }
- return true;
- }
- ///////////////////////////////////////////////////////////////////////////////////////////
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement