Raised This Month: $ Target: $400
 0% 

[ Request ] nvault & add / remove a plr


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Aooka
Veteran Member
Join Date: Aug 2011
Location: Villeurbanne
Old 06-25-2012 , 04:27   [ Request ] nvault & add / remove a plr
Reply With Quote #1

Hello ,
My code :
Code:
#include < amxmodx > #include < amxmisc > #include < nvault > #define CMDTARGET_NO_BOTS  (1<<3) new g_iSaving; new bool: g_bIsVip[ 33 ]; public plugin_init( ) {     register_plugin( "Vip test" , "1.0" , "Aooka" );     register_concmd( "amx_addvip" , "CmdAddVip" , ADMIN_IMMUNITY , "<#userid>" );     register_concmd( "amx_removevip" , "CmdRemoveVip" , ADMIN_IMMUNITY , "<#userid>" );     register_clcmd( "say /vip" , "VipMenu" );     g_iSaving = nvault_open( "vip_file" );     new iMenu = menu_create( "Awesome Vip Menu" , "Handler_Menu" );     menu_additem( iMenu , "Test 1" , "1" , 0 );     menu_additem( iMenu , "Test 2" , "2" , 0 );     menu_setprop( iMenu , MPROP_EXITNAME , "Sortir" ); } public client_putinserver( id ) {     g_bIsVip[ id ] = false; } public plugin_end( ) {     nvault_close( g_iSaving ); } public VipMenu( id , iMenu ) {     if( is_user_alive( id ) && g_bIsVip[ id ] == true )     {         menu_display( id , iMenu , 0 );     }     else     {         client_print( id , print_center , "If you whant to go to the VipMenu you msut be a Vip" );     } } public Handler_Menu( id , iMenu , item ) {     if( item != MENU_EXIT )     {         switch( item )         {             case 1:                 client_print( id , print_center , "Test 1 :: OK" );             case 2:                 client_print( id , print_center , "Test 2 :: OK" );         }     }     else     {         client_print( id , print_center , "Menu is closed" );         menu_destroy( iMenu );     } } public CmdAddVip( id , level , cid ) {     if( !cmd_access( id , level , cid , 2 ) )     {         return 1;     }     else     {         new szArg[ 36 ];         read_argv( 1 , szArg , charsmax( szArg ) );         new target = cmd_target( id , szArg , CMDTARGET_NO_BOTS );         if( !target )         {             console_print( id , "Player not found" );             return 1;         }                 else if( g_bIsVip[ target ] == true )         {             console_print( id , "Player is alrady a Vip" );             return 1;         }                 static szName[ 2 ][ 36 ];         get_user_name( id , szName[ 0 ] , charsmax( szName[ ] ) );         get_user_name( target , szName[ 1 ] , charsmax( szName[ ] ) );         static szAuthID[ 2 ][ 35 ];         get_user_authid( id , szAuthID[ 0 ] , charsmax( szAuthID[ ] ) );         get_user_authid( target , szAuthID[ 1 ] , charsmax( szAuthID[ ] ) );             client_print( 0 , print_chat , "%s (%s) gave a Vip place for the player %s (%s)" , szName[ 0 ] , szAuthID[ 0 ] , szName[ 1 ] , szAuthID[ 1 ] );             log_amx( "%s (%s) gave a place of Vip to %s (%s)" , szName[ 0 ] , szAuthID[ 0 ] , szName[ 1 ] , szAuthID[ 1 ] ); } public CmdRemoveVip( id , level , cid ) {     if( !cmd_access( id , level , cid , 2 ) )     {         return 1;     }         new szArg[ 36 ];     read_argv( 1 , szArg , charsmax( szArg ) );         new target = cmd_target( id , szArg , CMDTARGET_NO_BOTS );         if( !target )     {         console_print( id , "Player not found" );         return 1;     }         else if( g_bIsVip[ target ] == false )     {         g_bIsVip[ target ] = true;     }         static szName[ 2 ][ 36 ];     get_user_name( id , szName[ 0 ] , charsmax( szName[ ] ) );     get_user_name( target , szName[ 1 ] , charsmax( szName[ ] ) );     static szAuthID[ 2 ][ 35 ];     get_user_authid( id , szAuthID[ 0 ] , charsmax( szAuthID[ ] ) );     get_user_authid( target , szAuthID[ 1 ] , charsmax( szAuthID[ ] ) );         client_print( 0 , print_chat , "%s (%s) remove a Vip place for the player %s (%s)" , szName[ 0 ] , szAuthID[ 0 ] , szName[ 1 ] , szAuthID[ 1 ] );         log_amx( "%s (%s) remove a place of Vip to %s (%s)" , szName[ 0 ] , szAuthID[ 0 ] , szName[ 1 ] , szAuthID[ 1 ] ); }

It do not work and i test a lots of things this last weeks but ...

So thank you in advance all
__________________
Pawn ? Useless
Aooka is offline
 



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 06:15.


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