Raised This Month: $ Target: $400
 0% 

HELP with some codes.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
lolzin123
Member
Join Date: Apr 2009
Old 05-28-2009 , 15:11   HELP with some codes.
Reply With Quote #1

GodMode:

PHP Code:
case 6// GodMode
        
if( get_user_flags(plr0)&ADMIN_KICK )
        {
            if (!
get_user_godmode(plr))     
            {
                
set_user_godmode(plr,1);
                
                new 
szName[32];
                
get_user_name(plrszName32);
    
                
fnGreenChat(0"[BCM] %s ligou o GodMode."szName);
            }
        }
        else 
        {
            
set_user_godmode(plr,0);
            
            new 
szName[32];
            
get_user_name(plrszName32);
    
            
fnGreenChat(0"[BCM] %s desligou o GodMode."szName);
        }
    } 
I want every time you press the button, turn on or off.

AND SAVE/LOAD:
PHP Code:
case 5// Save/Load
        
{
            new 
szTitle[49];
            
format(szTitle48"Load Menu - Current: %s"gCurConfig);
            
            new 
menu menu_create(szTitle"mnuLoad"0);
            
            new 
szAccessFlag[2];
            
get_pcvar_string(gCvarAccessLoadszAccessFlag1);
            new 
accessLoad read_flags(szAccessFlag);
            
            new 
dir open_dir(gDir""0);
            
            new 
szFileName[65];
            while( 
next_file(dirszFileName64) )
            {
                if( 
szFileName[0] == '.' )
                {
                    continue;
                }
                
                
replace(szFileName64".txt""");
                
menu_additem(menuszFileName""accessLoad, -1);
            }
            
close_dir(dir);
            
            
menu_additem(menu"New Config""1"0, -1);
            
            
menu_additem(menu"Save""2"0, -1);
            {
            new 
szName[32];
            
get_user_name(plrszName31);
            
            
fnGreenChat(0"[BCM] %s saved config ^"%s^", %i objects."szName,
                
gCurConfigfnSave());
            }
            
            
menu_setprop(menuMPROP_EXITNAME"Main Menu");
            
            
menu_display(plrmenu0);
            
            return 
PLUGIN_CONTINUE;
            
            
/*new ent = fnGetAimEnt(plr);
            
            new type = fnGetObjectType(ent);
            if( type && type != 99 )
            {
                new szName[32];
                pev(ent, pev_targetname, szName, 31);
                
                if( szName[0] == '^0' )
                {
                    copy(szName, 31, "Unknown");
                }
                
                fnGreenChat(plr, "[KzM] Creator: %s", szName);
            }
            else
            {
                fnGreenChat(plr, "[KzM] Aim at an object first.");
            }*/
        

I want to save, create cfg's, and load.Because saving has a bug.

Any help will be very grateful.
lolzin123 is offline
zacky
Senior Member
Join Date: Mar 2008
Location: Sweden
Old 05-28-2009 , 15:26   Re: HELP with some codes.
Reply With Quote #2

PHP Code:
case 6// GodMode 
        
if( get_user_flags(plr0)& ADMIN_KICK 
        { 
            if (!
get_user_godmode(plr))      
            { 
                
set_user_godmode(plr,1); 
                 
                new 
szName[32]; 
                
get_user_name(plrszName32); 
     
                
fnGreenChat(0"[BCM] %s ligou o GodMode."szName); 
            }
            else  
            { 
                
set_user_godmode(plr,0); 
             
                new 
szName[32]; 
                
get_user_name(plrszName32); 
     
                
fnGreenChat(0"[BCM] %s desligou o GodMode."szName); 
            } 
        } 
    } 
This is only godmode
zacky is offline
Send a message via Skype™ to zacky
lolzin123
Member
Join Date: Apr 2009
Old 05-29-2009 , 16:39   Re: HELP with some codes.
Reply With Quote #3

But I want to add it to a menu, which can connect and disconnect the godmode.Any idea?
lolzin123 is offline
zacky
Senior Member
Join Date: Mar 2008
Location: Sweden
Old 05-29-2009 , 17:23   Re: HELP with some codes.
Reply With Quote #4

Show me hold code then
zacky is offline
Send a message via Skype™ to zacky
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 13:47.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode