MuhammadZeeshan

clan errors

Dec 2nd, 2016
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. //========== onplayerjoin =============
  2. Clan <- GetTag( player.Name );
  3. if ( Clan && !IsClanRegister( Clan.tolower() ) ) MessagePlayer( "Use /cmds to see the list of available commands", player );
  4. else if ( Clan && IsClanRegister( Clan.tolower() ) ) MessagePlayer( "", player );
  5.  
  6.  
  7. function GetTag( strPlayer )
  8. {
  9. local
  10. D_DELIM = regexp(@"([\[(=^<]+\w+[\])=^>]+)"),
  11. S_DELIM = regexp(@"(\w.+[.*=]+)"),
  12.  
  13. D_DELIM_res = D_DELIM.capture(strPlayer),
  14. S_DELIM_res = S_DELIM.capture(strPlayer);
  15.  
  16. if ( D_DELIM_res != null )
  17. {
  18. return strPlayer.slice( D_DELIM_res[ 0 ].begin + 1, D_DELIM_res[ 0 ].end - 1 );
  19. }
  20. else if ( S_DELIM_res != null )
  21. {
  22. return strPlayer.slice( S_DELIM_res[ 0 ].begin, S_DELIM_res[ 0 ].end - 1 );
  23. }
  24. else return null;
  25. }
Add Comment
Please, Sign In to add comment