Advertisement
suchty112

OCMD Include Copyright kleiner Opa

Jan 15th, 2012
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.97 KB | None | 0 0
  1. /*--    ---  .   .   --
  2. |   |  |     |\ /|  |  \
  3. |   |  |     | V |  |   |
  4. |   |  |     |   |  |  /
  5.  ---    ---  |   |   --
  6.   I.O.O  by kleinerOpa*/
  7. #include <a_samp>
  8. forward ocmdOnPlayerCommandText(playerid,cmdtext[]);
  9. #define ocmd:%1(%2) forward ocmd_%1(%2);\
  10. public ocmd_%1(%2)
  11. public OnPlayerCommandText(playerid,cmdtext[])
  12. {
  13.     cmdtext[0]='_';
  14.     new ocmdStr[128],ocmdParams[128],bool:ocmdAffe,ocmdFu;
  15.     for(new i;i<128;i++)
  16.     {
  17.         if(cmdtext[i]=='\0')break;
  18.         if((cmdtext[i]==' ')&&(!ocmdAffe))
  19.         {
  20.             ocmdAffe=true;
  21.             continue;
  22.         }
  23.         if(!ocmdAffe)ocmdStr[i]=cmdtext[i];
  24.         else
  25.         {
  26.             ocmdParams[ocmdFu]=cmdtext[i];
  27.             ocmdFu++;
  28.         }
  29.     }
  30.     format(ocmdStr,128,"ocmd%s",ocmdStr);
  31.     if(!strlen(ocmdParams))format(ocmdParams,128," ");
  32.     if(CallLocalFunction(ocmdStr,"ds",playerid,ocmdParams))return 1;
  33.     cmdtext[0]='/';
  34.     return CallLocalFunction("ocmdOnPlayerCommandText","ds",playerid,cmdtext);
  35. }
  36. #define OnPlayerCommandText ocmdOnPlayerCommandText
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement