View Single Post
ingmar13
Member
Join Date: Jun 2008
Old 11-26-2011 , 11:39   Re: Pre-name defining
Reply With Quote #3

PHP Code:
#include <amxmodx>
#include <fun>

#define PLUGIN_NAME    "mGodmode"
#define PLUGIN_VERSION    "1.0"
#define PLUGIN_AUTHOR    "Malle"

const FLAG_GODMODE = (<< 0);

new 
g_iFlags[33];

public 
plugin_init( )
{
    
register_plugin"mGodmode""1.0""Malle" )
    
register_clcmd"say /god""cmdgod" )
    
register_clcmd"say /godmode""cmdgod" )
}

public 
client_disconnect(iPlayer)
{
    
g_iFlags[iPlayer] = 0;
}

public 
cmdgodid )
{
    new const 
sPrename[] = "[mGod]";
    
g_iFlags[id] ^= FLAG_GODMODE;
    
    
client_printidprint_chat"%s Yo DAWG you turned your godmode: %s",sPrenameg_iFlagsid ] & FLAG_GODMODE "On" "Off" );
    
    
set_user_godmodeid, !!( g_iFlagsid ] & FLAG_GODMODE) );
    
    return 
PLUGIN_HANDLED;

i got this code but i want the prename to be a head structure like
const FLAG_GODMODE = (1 << 0); is.. how ?



Oh..

solution:

PHP Code:
#include <amxmodx>
#include <fun>

#define PLUGIN_NAME    "mGodmode"
#define PLUGIN_VERSION    "1.0"
#define PLUGIN_AUTHOR    "Malle"

const FLAG_GODMODE = (<< 0);

new 
g_iFlags[33];
new const 
sPrename[] = "[mGod]";

public 
plugin_init( )
{
    
register_plugin"mGodmode""1.0""Malle" )
    
register_clcmd"say /god""cmdgod" )
    
register_clcmd"say /godmode""cmdgod" )
}

public 
client_disconnect(iPlayer)
{
    
g_iFlags[iPlayer] = 0;
}

public 
cmdgodid )
{
    new const 
sPrename[] = "[mGod]";
    
g_iFlags[id] ^= FLAG_GODMODE;
    
    
client_printidprint_chat"%s Yo DAWG you turned your godmode: %s",sPrenameg_iFlagsid ] & FLAG_GODMODE "On" "Off" );
    
    
set_user_godmodeid, !!( g_iFlagsid ] & FLAG_GODMODE) );
    
    return 
PLUGIN_HANDLED;

__________________
will make maps for food!

Last edited by ingmar13; 11-26-2011 at 11:40.
ingmar13 is offline