Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- else if ( cmd == "ipalias" )
- {
- if ( status[ player.ID ].Registered == false ) ErrorMessage( "[#FFFFFF]You need to be a part of our community to use this command.", player );
- else if ( status[ player.ID ].Logged == false ) ErrorMessage( "[#FFFFFF]You need to be identified to use this command.", player );
- else if ( GetLevel( player ) < 5 ) MessagePlayer("[Error] You don't have access to use this Command.", player );
- else if ( !text ) ErrorMessage( "Syntax: /" + cmd + " <Nick/ID>", player );
- else
- {
- local plr = GetPlayer( text );
- if ( !plr ) ErrorMessage( "Unknown Player.", player );
- else ShowAlias( player, plr, "ip" );
- }
- }
- else if ( cmd == "subnetalias" )
- {
- if ( !text ) ErrorMessage( "Syntax: /" + cmd + " <Nick/ID>", player );
- else
- {
- local plr = GetPlayer( text );
- if ( !plr ) ErrorMessage( "Unknown Player.", player );
- else ShowAlias( player, plr, "subnet" );
- }
- }
- else if ( cmd == "uidalias" )
- {
- if ( !text ) ErrorMessage( "Syntax: /"+ cmd + " <Nick/ID>", player );
- else
- {
- local plr = GetPlayer( text );
- if ( !plr ) ErrorMessage( "Unknown Player.", player );
- else ShowAlias( player, plr, "uid" );
- }
- }
- function ShowAlias( player, plr, option )
- {
- if ( option == "ip" )
- {
- local i = 0, a = Alias.len(), b;
- while( i < a )
- {
- if ( plr.IP == Alias[i].IP && plr.Name != Alias[i].Nick )
- {
- if ( b ) b = b + ", " + Alias[i].Nick;
- else b = Alias[i].Nick;
- }
- i ++;
- }
- if ( !b ) SendMessage( plr.Name + " has no IP alias.", player );
- else SendMessage( plr.Name + "'s IP alias: " + b + ".", player );
- }
- else if ( option == "subnet" )
- {
- local i = 0, a = Alias.len(), b;
- local getsub_1 = split( player.IP, "." ),
- sub_1 = getsub_1[0] + getsub_1[1];
- while( i < a )
- {
- local getsub_2 = split( Alias[i].IP, "." ),
- sub_2 = getsub_2[0] + getsub_2[1];
- if ( sub_1 == sub_2 && plr.Name != Alias[i].Nick )
- {
- if ( b ) b = b + ", " + Alias[i].Nick;
- else b = Alias[i].Nick;
- }
- i ++;
- }
- if ( !b ) SendMessage( plr.Name + " has no Subnet alias.", player );
- else SendMessage( plr.Name + "'s Subnet alias: " + b + ".", player );
- }
- else if ( option == "uid" )
- {
- local i = 0, a = Alias.len(), b;
- while( i < a )
- {
- if ( plr.UniqueID == Alias[i].UID && plr.Name != Alias[i].Nick )
- {
- if ( b ) b = b + ", " + Alias[i].Nick;
- else b = Alias[i].Nick;
- }
- i ++;
- }
- if ( !b ) SendMessager( plr.Name + " has no UID alias.", player );
- else SendMessage( plr.Name + "'s UID alias: " + b + ".", player );
- }
- }
Add Comment
Please, Sign In to add comment