Advertisement
DanGT

dCMD

Mar 15th, 2015
459
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. static
  4. command[34],
  5. commandid,
  6. params[128],
  7. params_start;
  8.  
  9.  
  10. public OnPlayerCommandText(playerid, cmdtext[])
  11. {
  12. for(params_start = 1; !((cmdtext[params_start]-47) & 0x80000000); ++params_start)
  13. cmdtext[params_start] |= 32;
  14.  
  15. strcat((command[0] = '\0', command), cmdtext[1], params_start);
  16.  
  17. strcat((params[0] = '\0', params), cmdtext[++params_start]);
  18.  
  19. if(!getproperty(.name = command))
  20. setproperty(.name = command, .value = ++commandid);
  21.  
  22. CallLocalFunction("OnPlayerExecuteCommand", "iis", playerid, getproperty(.name = command), params);
  23. return true;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement