iPLEOMAX

multicmd.inc

Mar 7th, 2012
321
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.95 KB | None | 0 0
  1.  
  2. /* This Source Code Form is subject to the terms of the Mozilla Public
  3.  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  4.  * You can obtain one at http://mozilla.org/MPL/2.0/. */
  5.  
  6. // Author: iPLEOMAX, 2012
  7.  
  8. #if defined _multicmd_included
  9.     #endinput
  10. #endif
  11.  
  12. #define _multicmd_included
  13.  
  14. #include <a_samp>
  15.  
  16. new
  17.     iStartMCMD = -1,
  18.     iCommandMCMD[128]
  19. ;
  20.  
  21. /*
  22. native MultiCommand(playerid, Commands[]);
  23. */
  24.  
  25. stock MultiCommand( playerid, Commands[] )
  26. {
  27.     iStartMCMD = -1;
  28.     iCommandMCMD[0] = EOS;
  29.    
  30.     for ( new iPos, iLen = strlen(Commands); iPos <= iLen; iPos++ )
  31.     {
  32.         if ( Commands[iPos] == '/' || iPos == iLen )
  33.         {
  34.             switch(iStartMCMD)
  35.             {
  36.                 case -1: iStartMCMD = iPos;
  37.                 default:
  38.                 {
  39.                     strmid(iCommandMCMD, Commands, iStartMCMD, iPos);
  40.                     CallLocalFunction( "OnPlayerCommandText", "is", playerid, iCommandMCMD);
  41.                     iStartMCMD = iPos;
  42.                 }
  43.             }
  44.         }
  45.     }
  46.    
  47.     return true;
  48. }
Advertisement
Add Comment
Please, Sign In to add comment