Advertisement
DanGT

d!CMD

Dec 10th, 2013
357
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.98 KB | None | 0 0
  1. /*
  2.  * --- d!CMD ---
  3.  * Por Danilo Galvão
  4.  * [iPs]TeaM - Equipe GT
  5.  * [url]www.ipsbr.net[/url] - [url]www.equipegt.com[/url]
  6.  *
  7. */
  8.  
  9. stock iscmd(string[])
  10. {
  11.     new id, position = -1;
  12.  
  13.     while(string[++position] ^ 0x0 && string[position])
  14.         id ^= (string[position] - string[1]);
  15.  
  16.     return id;
  17. }
  18.  
  19. public OnPlayerCommandText(playerid, cmdtext[])
  20. {
  21.     new cmdpos = -1, id, params[128];
  22.  
  23.     while(cmdtext[++cmdpos] > ' ')
  24.         id ^= cmdtext[cmdpos] - cmdtext[1];
  25.  
  26.     format(params, sizeof(params), "%s", cmdtext[cmdpos+1]);
  27.  
  28.     #if defined Ips_OnPlayerCommandText
  29.         return Ips_OnPlayerCommandText(playerid, id, params);
  30.     #else
  31.         return 0;
  32.     #endif
  33. }
  34. #if defined _ALS_OnPlayerCommandText
  35.     #undef OnPlayerCommandText
  36. #else
  37.     #define _ALS_OnPlayerCommandText
  38. #endif
  39. #define OnPlayerCommandText Ips_OnPlayerCommandText
  40.  
  41. #if defined Ips_OnPlayerCommandText
  42.     forward Ips_OnPlayerCommandText(playerid, commandid, params[]);
  43. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement