Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*******************************************************************************
- * *
- * LifeCMD Powered by © Fusion Technology *
- * © All rights reserved *
- * Copyrights © Kazon 2012 *
- * LifeCMD Created: 1/01/13. *
- * *
- *******************************************************************************/
- /*==================================[Defines]==================================*/
- #define CMD:%1(%2) LCMD:%1(%2)
- #define COMMAND:%1(%2) LCMD:%1(%2)
- #define LCMD:%1(%2) \
- forward lcmd_%1(%2); \
- public lcmd_%1(%2)
- static bool:Call = false, bool:Finish = false;
- /*==================================[Public's]==================================*/
- public OnGameModeInit()
- {
- Call = funcidx("OnPlayerCommandCall") != -1;
- Finish = funcidx("OnPlayerCommandFinish") != -1;
- return CallLocalFunction("LifeCMD_OnGameModeInit", "");
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- new cout, func[32];
- if(Call) CallRemoteFunction("OnPlayerCommandCall", "is", playerid, cmdtext);
- while(cmdtext[++cout] > ' ') func[cout-1] = tolower(cmdtext[cout]);
- while(cmdtext[cout] == ' ') cout++;
- format(func, 32, "lcmd_%s", func);
- if(!cmdtext[cout])
- {
- if(Finish) return CallRemoteFunction("OnPlayerCommandFinish", "isi", playerid, cmdtext, CallLocalFunction(func, "is", playerid, "\1"));
- return CallLocalFunction(func, "is", playerid, "\1");
- }
- if(Finish) return CallRemoteFunction("OnPlayerCommandFinish", "isi", playerid, cmdtext, CallLocalFunction(func, "is", playerid, cmdtext[cout]));
- return CallLocalFunction(func, "is", playerid, cmdtext[cout]);
- }
- /*==================================[Forward's]==================================*/
- forward OnPlayerCommandCall(playerid, cmdtext[]);
- forward OnPlayerCommandFinish(playerid, cmdtext[], success);
- forward LifeCMD_OnGameModeInit();
- forward LifeCMD_OnPlayerCommandText(playerid, cmdtext[]);
- /*==================================[Define's]==================================*/
- #if defined _ALS_OnPlayerCommandText
- #undef OnPlayerCommandText
- #else
- #define _ALS_OnPlayerCommandText
- #endif
- #define OnPlayerCommandText LifeCMD_OnPlayerCommandText
- #if defined _ALS_OnGameModeInit
- #undef OnGameModeInit
- #else
- #define _ALS_OnGameModeInit
- #endif
- #define OnGameModeInit LifeCMD_OnGameModeInit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement