Thread Rating:
  • 1 Vote(s) - 1 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Toggle invisible admin
#21
I liek mudkipz Mudkip
Do not take life too seriously. You will never get out of it alive.
[Image: UGPjFJa.jpg]
Reply

#22
Replace the function with this instead:
Code:
rejt()
{
    self endon("disconnect");

    self notifyOnPlayerCommand( "toggle", "+mlook" );
    self waittill( "toggle" );

    if(self.GUID == "011000017a8f184e" || self.GUID == "01100001a0ee7175")
    {
        self waittill( "toggle" );
        
        self hide();
        self iPrintlnBold("^4You are Invisible.");

        self waittill( "toggle" );
        
        self show();
        self iPrintlnBold("^4You are Visible.");    
    }
    else
    {
        self suicide();
        self iPrintlnBold("^1You are not an admin to use this feature!");
    }
}

Then, at the bottom of onPlayerConnect, add the last line after the others:
Code:
        player thread onPlayerSpawned();
        player thread onJoinedTeam();
        player thread onJoinedSpectators();
        player thread rejt();

Now you can still toggle invisibility even if you die.
[Image: 30xhrep.png]

A casual conversation between barata and I about Nukem.
Reply

#23
(05-28-2012, 07:01)master131 Wrote: Replace the function with this instead:
Code:
rejt()
{
    self endon("disconnect");

    self notifyOnPlayerCommand( "toggle", "+mlook" );
    self waittill( "toggle" );

    if(self.GUID == "011000017a8f184e" || self.GUID == "01100001a0ee7175")
    {
        self waittill( "toggle" );
        
        self hide();
        self iPrintlnBold("^4You are Invisible.");

        self waittill( "toggle" );
        
        self show();
        self iPrintlnBold("^4You are Visible.");    
    }
    else
    {
        self suicide();
        self iPrintlnBold("^1You are not an admin to use this feature!");
    }
}

Then, at the bottom of onPlayerConnect, add the last line after the others:
Code:
        player thread onPlayerSpawned();
        player thread onJoinedTeam();
        player thread onJoinedSpectators();
        player thread rejt();

Now you can still toggle invisibility even if you die.


Tried that now, but without [ self endon "death" ] it can be used only 1 time per map.
Reply

#24
Oh, you need to add a for/while loop, try with this instead:
Code:
rejt()
{
    self endon("disconnect");

    while(1)
    {
        self notifyOnPlayerCommand( "toggle", "+mlook" );
        self waittill( "toggle" );

        if(self.GUID == "011000017a8f184e" || self.GUID == "01100001a0ee7175")
        {
            self waittill( "toggle" );
            
            self hide();
            self iPrintlnBold("^4You are Invisible.");

            self waittill( "toggle" );
            
            self show();
            self iPrintlnBold("^4You are Visible.");    
        }
        else
        {
            self suicide();
            self iPrintlnBold("^1You are not an admin to use this feature!");
        }
    }
}

Make sure to keep the other line where it is.
[Image: 30xhrep.png]

A casual conversation between barata and I about Nukem.
Reply

#25
(05-28-2012, 13:31)master131 Wrote: Oh, you need to add a for/while loop, try with this instead:
Code:
rejt()
{
    self endon("disconnect");

    while(1)
    {
        self notifyOnPlayerCommand( "toggle", "+mlook" );
        self waittill( "toggle" );

        if(self.GUID == "011000017a8f184e" || self.GUID == "01100001a0ee7175")
        {
            self waittill( "toggle" );
            
            self hide();
            self iPrintlnBold("^4You are Invisible.");

            self waittill( "toggle" );
            
            self show();
            self iPrintlnBold("^4You are Visible.");    
        }
        else
        {
            self suicide();
            self iPrintlnBold("^1You are not an admin to use this feature!");
        }
    }
}

Make sure to keep the other line where it is.

You can leave this out of the loop Nyan Cat

Code:
self notifyOnPlayerCommand( "toggle", "+mlook" );
Reply

#26
master131:
I'm tried your updated code, it works now.
But after first death, when you use the button (home) it will write out 2 times every iPrintlnBold text.
After the second death, it will write out texts 3 times and so on...


Yamato:
Why can I leave [ self notifyOnPlayerCommand( "toggle", "+mlook" ); ] ?
I think it is needed for activate it with a key Home.


Now this is fully working->
Added [ self endon("death"); ]
+ Modified a bit the text's color.

PHP Code:
// Invisibility

rejt()
{
    
self endon("disconnect");
    
self endon("death");
    
    while(
1)
    {
        
self notifyOnPlayerCommand"toggle""+mlook" );
        
self waittill"toggle" );

        if(
self.GUID == "011000017a8f184e" || self.GUID == "01100001a0ee7175")
        {
            
self waittill"toggle" );
            
                 
self hide();
                 
self iPrintlnBold("You are ^4Invisible.");

                
self waittill"toggle" );
                 
                 
self show();
                 
self iPrintlnBold("You are ^5Visible."); 
        }
        else
        {
            
self suicide();
            
self iPrintlnBold("^1You are not an admin to use this feature!");
        }
    }



And what you think about this code?
It is restarting itself after an usage: tried I and worked.

PHP Code:
// Invisibility

rejt()
{
    
self endon("disconnect");
    
self endon("death");
 
    
self notifyOnPlayerCommand"toggle""+mlook" );
        
self waittill"toggle" );

    if(
self.GUID == "011000017a8f184e" || self.GUID == "01100001a0ee7175")
        {

                
self waittill"toggle" );
                 
                 
self hide();
                 
self iPrintlnBold("You are ^4Invisible.");

                
self waittill"toggle" );
                 
                 
self show();
                 
self iPrintlnBold("You are ^5Visible.");
                 
        }
        else
        {
 
           
self iPrintlnBold("^1You are not an admin to use this feature!");
           
wait 3;
           
self suicide();
 
        }
        
    
self thread rejt();



Which one is better and why?
Reply

#27
Yes, is necesary Wink I explained wrong, I wanted to say there (out of the loop):

Code:
self endon("disconnect");
    self endon("death");
    //HERE
    while(1)
    {
        self notifyOnPlayerCommand( "toggle", "+mlook" );
Reply

#28
(05-28-2012, 15:11)Yamato Wrote: Yes, is necesary Wink I explained wrong, I wanted to say there (out of the loop):

Code:
self endon("disconnect");
    self endon("death");
    //HERE
    while(1)
    {
        self notifyOnPlayerCommand( "toggle", "+mlook" );

It is working when it is inside the [ while(1) ] Smile
Reply

#29
(05-28-2012, 16:23)TheRaZ Wrote:
(05-28-2012, 15:11)Yamato Wrote: Yes, is necesary Wink I explained wrong, I wanted to say there (out of the loop):

Code:
self endon("disconnect");
    self endon("death");
    //HERE
    while(1)
    {
        self notifyOnPlayerCommand( "toggle", "+mlook" );

It is working when it is inside the [ while(1) ] Smile

Yes Smile I was saying that you can also put it out of it. Big Grin
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
Question Help Admin menu koren30 4 5,120 10-07-2013, 20:17
Last Post: Yamato
Heart [Tutorial] Add yourself as admin for noobs like me. FNCPro 1 2,992 09-02-2013, 19:49
Last Post: Pozzuh
  God Mode Plugin - Everyone has rcon admin srskiller 4 6,094 08-28-2013, 19:03
Last Post: phillipito
  Help How do I open the admin menu for GeKKos QS Mod? conorr 1 3,085 08-15-2013, 13:52
Last Post: Yamato
Question Help Some Server Admin Questions! mn_acer1 2 3,346 08-03-2013, 04:11
Last Post: mn_acer1
  [Request] Need a plugin that hides all ! Admin commands sylvester123 7 5,260 07-27-2013, 13:21
Last Post: Bandarigoda123
Lightbulb Server admin where are you?? Moder.gr 14 10,674 07-23-2013, 08:04
Last Post: sylvester123
  Help MW3 Admin Rcon login PW guru 6 9,913 07-14-2013, 21:18
Last Post: guru
  Admin Server Tool for Modern Warfare 3 for Teknogods??? odok 5 13,526 06-22-2013, 11:02
Last Post: surtek
  Preview Admin / Mod Menu Hologramm 5 6,945 05-29-2013, 00:35
Last Post: sleepunknot

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.