Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //=================== this is gettok functions
- function GetTok(string, separator, n, ...)
- {
- local m = vargv.len() > 0 ? vargv[0] : n,
- tokenized = split(string, separator),
- text = "";
- if (n > tokenized.len() || n < 1) return null;
- for (; n <= m; n++)
- {
- text += text == "" ? tokenized[n-1] : separator + tokenized[n-1];
- }
- return text;
- }
- //=================this is example: /c kick==============
- else if ( cmd == "kick" )
- {
- if ( IsNoob( player, cmd ) ) return 0;
- else if ( !text ) ao( "[AdminPanel] Syntax - /c " + cmd + " <Nick/ID> <Reason>", player );
- local plr = GetPlayer( GetTok( text, " ", 1 ) );
- if ( !plr ) ao( "[AdminPanel] Error - Invalid player.", player );
- else
- {
- local reason = GetTok( text, " ", 2, NumTok( text, " " ) );
- if ( reason == null ) reason = "None";
- Kick( plr, player, reason );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement