Post Reply 
 
Thread Rating:
  • 1 Votes - 1 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Toggle invisible admin
05-27-2012, 15:19
Post: #1
Toggle invisible admin
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!");
        }
    }


Related links
Find all posts by this user
Add Thank You Quote this message in a reply
05-27-2012, 15:42
Post: #2
RE: Toggle invisible admin
'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]
Find all posts by this user
Add Thank You Quote this message in a reply
05-27-2012, 15:43 (This post was last modified: 05-27-2012 15:44 by barata.)
Post: #3
RE: Toggle invisible admin
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="images/smilies/wink.gif" style="vertical-align: middle;" border="0" alt="Wink" title="Wink" />
  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...

I'm brazilian, we have some problems in our country but we carry on because we believe that one day everything will be different!
Find all posts by this user
Add Thank You Quote this message in a reply
05-27-2012, 15:50 (This post was last modified: 05-27-2012 15:51 by TheRaZ.)
Post: #4
RE: Toggle invisible admin
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.
Related links
Find all posts by this user
Add Thank You Quote this message in a reply
05-27-2012, 15:56
Post: #5
RE: Toggle invisible admin
You can't "create" new action keys.
Find all posts by this user
Add Thank You Quote this message in a reply
05-27-2012, 16:06
Post: #6
RE: Toggle invisible admin
(05-27-2012 15:56)Rendflex Wrote:  You can't "create" new action keys.

+mlook is already in the game :fp:

[Image: MaEIQ.png]
Find all posts by this user
Add Thank You Quote this message in a reply
[-] The following 1 user says Thank You to Pozzuh for this post:
Yamato (05-27-2012)
05-27-2012, 16:07 (This post was last modified: 05-27-2012 16:09 by TheRaZ.)
Post: #7
RE: Toggle invisible admin
(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.
Find all posts by this user
Add Thank You Quote this message in a reply
05-27-2012, 16:13
Post: #8
RE: Toggle invisible admin
Do the iprintlnbolds show up?
Related links

[Image: MaEIQ.png]
Find all posts by this user
Add Thank You Quote this message in a reply
05-27-2012, 16:15
Post: #9
RE: Toggle invisible admin
(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?
Find all posts by this user
Add Thank You Quote this message in a reply
05-27-2012, 16:20
Post: #10
RE: Toggle invisible admin
(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)
Find all posts by this user
Add Thank You Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Admin menu don't work michiix 5 556 07-16-2011 04:26
Last Post: Cgallagher
  Admin Menu Question GeKKoFL0X 6 573 01-26-2011 16:40
Last Post: GeKKoFL0X

Forum Jump:


User(s) browsing this thread: 1 Guest(s)
Media Embeding by Simple Audio Video Embeder