| ingmar13 |
11-26-2011 11:39 |
Re: Pre-name defining
PHP Code:
#include <amxmodx> #include <fun>
#define PLUGIN_NAME "mGodmode" #define PLUGIN_VERSION "1.0" #define PLUGIN_AUTHOR "Malle"
const FLAG_GODMODE = (1 << 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 cmdgod( id ) { new const sPrename[] = "[mGod]"; g_iFlags[id] ^= FLAG_GODMODE; client_print( id, print_chat, "%s Yo DAWG you turned your godmode: %s",sPrename, g_iFlags[ id ] & FLAG_GODMODE ? "On" : "Off" ); set_user_godmode( id, !!( g_iFlags[ id ] & 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 = (1 << 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 cmdgod( id ) { new const sPrename[] = "[mGod]"; g_iFlags[id] ^= FLAG_GODMODE; client_print( id, print_chat, "%s Yo DAWG you turned your godmode: %s",sPrename, g_iFlags[ id ] & FLAG_GODMODE ? "On" : "Off" ); set_user_godmode( id, !!( g_iFlags[ id ] & FLAG_GODMODE) ); return PLUGIN_HANDLED; }
|