Advertisement
ipsBruno

(Pawn) Include [iPs]Comandos V5 - Desenvolvimento

Jul 18th, 2012
321
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.15 KB | None | 0 0
  1. //
  2. //
  3. //  icmd v5 -> development
  4. //
  5. //
  6.  
  7. #define cmd(%0,%1,%2) \
  8.             g_Cmd@%0(%1,%2); public g_Cmd@%0(%1,%2)
  9.  
  10.  
  11.        
  12. static
  13.         cmdname[32],
  14.         cmdindex;
  15.        
  16. public OnPlayerCommandText(playerid,cmdtext[]) {
  17.  
  18.     cmdname[0] = EOS;
  19.  
  20.     if((cmdindex = strfind(cmdtext, " ")) != -1) {
  21.  
  22.         if(strlen(cmdtext) - cmdindex > 1) {
  23.  
  24.             format(cmdname, 32, cmdtext[cmdindex +1]);
  25.             cmdtext[cmdindex] = EOS, cmdtext[0] = '@';
  26.             format(cmdtext, 32, "g_Cmd%s", cmdtext);
  27.  
  28.             if((funcidx(cmdtext) != -1)) {
  29.                 return CallLocalFunction(cmdtext, "is", playerid, cmdname), true;
  30.             }
  31.             return true;
  32.         }
  33.  
  34.         cmdtext[cmdindex] = EOS;
  35.  
  36.         if((funcidx(cmdtext) != -1)) {
  37.             return CallLocalFunction(cmdtext, "is", playerid, "\1"), true;
  38.         }
  39.     }
  40.  
  41.  
  42.     if((funcidx(cmdtext) != -1)) {
  43.  
  44.         cmdtext[0] = '@';
  45.         format(cmdtext, 32, "g_Cmd%s", cmdtext);
  46.  
  47.         return CallLocalFunction(cmdtext, "is", playerid, "\1"), true;
  48.     }
  49.     return true;
  50. }
  51. ///////////////////////////////////////////////////////////////////////////////////////////
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement