• 1 Vote(s) - 1 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Toggle invisible admin
#1
I try to make a code for using a key to enable/disable the invisibility for a player with admin GUID check.
But it is not working and I can't make it work, tried it, but alltime failed.

Can somebody check my code?

(Used the PHP Code function to paste it there, because it is colorful.)

PHP Code:
// Invisibility

rejt()
{
    
self endon("disconnect");
    
self endon("death");
    
    
self notifyOnPlayerCommand"toggle""+mlook" );
    for(;;)
    {
        
self waittill"toggle" );
        
        if(
self.GUID == "0000000000000000" || self.GUID == "0000000000000000")
        {
            
            
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 and admin to use this feature!");
        }
    }

  Reply
#2
'It doesn't work' is not enough. Does anything happen? Are you calling the function? Have you tried with another trigger like +melee.
[Image: azuw.jpg]
  Reply
#3
Maybe do something like this:

C Code
  1. rejt()
  2. {
  3. self endon("disconnect");
  4. self endon("death");
  5. self.invi = 0;
  6.  
  7. self notifyOnPlayerCommand( "toggle", "+mlook" );
  8. for(;<img src="https://www.itsmods.com/forum/images/smilies/wink.gif" alt="Wink" title="Wink" class="smilie smilie_2" />
  9. {
  10. self waittill( "toggle" );
  11.  
  12. if(self.GUID == "0000000000000000" || self.GUID == "0000000000000000")
  13. {
  14. if(self.invi == 0)
  15. {
  16. self hide();
  17. self iPrintlnBold("^4You are Invisible.");
  18. }
  19. else if(self.invi == 1)
  20. {
  21. self show();
  22. self iPrintlnBold("^4You are Visible.");
  23. }
  24. }
  25. else
  26. {
  27. self suicide();
  28. self iPrintlnBold("^1You are not and admin to use this feature!");
  29. }
  30. }
  31. }


PS: correct the GUID numbers and forget the for(;Wink.

Thanks Barata...
Don't worry if things aren't the way you planned, in the end everything will solve itself...
  Reply
#4
I have binded "+mlook" to Home key, and game is starting, it isn't write any eror, just when I press the Home key, nothing happens.

I want to use the "+mlook", because it isn't used as default.

Thanks Barata, I will try the code, wait a bit.
  Reply
#5
You can't "create" new action keys.
  Reply
#6
(05-27-2012, 15:56)Rendflex Wrote: You can't "create" new action keys.

+mlook is already in the game :fp:
[Image: MaEIQ.png]
  Reply
#7
(05-27-2012, 15:56)Rendflex Wrote: You can't "create" new action keys.

I don't want to "create" new action key, just wanted to assign to a function.

I'm tried Barata's updated code without this as he wrote:
Code:
for(;<img src="images/smilies/wink.gif" style="vertical-align: middle;" border="0" alt="Wink" title="Wink" />
But it isn't working.

And I'm know "+mlook" is the mouse look command.
  Reply
#8
Do the iprintlnbolds show up?
[Image: MaEIQ.png]
  Reply
#9
(05-27-2012, 16:06)Pozzuh Wrote:
(05-27-2012, 15:56)Rendflex Wrote: You can't "create" new action keys.

+mlook is already in the game :fp:

Oh really?
  Reply
#10
(05-27-2012, 16:13)Pozzuh Wrote: Do the iprintlnbolds show up?

No they are not show up.

(05-27-2012, 16:15)Rendflex Wrote:
(05-27-2012, 16:06)Pozzuh Wrote:
(05-27-2012, 15:56)Rendflex Wrote: You can't "create" new action keys.

+mlook is already in the game :fp:

Oh really?

It is the Mouse look option (Options/Look/Toggle Mouse look)
  Reply


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

Forum Jump:


Users browsing this thread: 1 Guest(s)