Advertisement
KingOfVC

xDD

Aug 30th, 2014
389
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. //=================== this is gettok functions
  2. function GetTok(string, separator, n, ...)
  3. {
  4. local m = vargv.len() > 0 ? vargv[0] : n,
  5. tokenized = split(string, separator),
  6. text = "";
  7.  
  8. if (n > tokenized.len() || n < 1) return null;
  9. for (; n <= m; n++)
  10. {
  11. text += text == "" ? tokenized[n-1] : separator + tokenized[n-1];
  12. }
  13. return text;
  14. }
  15. //=================this is example: /c kick==============
  16. else if ( cmd == "kick" )
  17. {
  18. if ( IsNoob( player, cmd ) ) return 0;
  19. else if ( !text ) ao( "[AdminPanel] Syntax - /c " + cmd + " <Nick/ID> <Reason>", player );
  20. local plr = GetPlayer( GetTok( text, " ", 1 ) );
  21. if ( !plr ) ao( "[AdminPanel] Error - Invalid player.", player );
  22. else
  23. {
  24. local reason = GetTok( text, " ", 2, NumTok( text, " " ) );
  25. if ( reason == null ) reason = "None";
  26. Kick( plr, player, reason );
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement