Raised This Month: $ Target: $400
 0% 

could u add this to this??


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Sum
Member
Join Date: Oct 2011
Old 05-13-2012 , 16:40   could u add this to this??
Reply With Quote #1

#include < amxmodx >
#include < amxmisc >
#include < hamsandwich >

#define MAX_PLAYERS 32

new Float:g_flTimePlayed[ MAX_PLAYERS + 1 ];
new g_pCvarTimeToPlay, g_pCvarAccesFlag;

public plugin_init( )
{
register_plugin( "Time VIPs", "0.0.1", "Kid" );
RegisterHam( Ham_Spawn, "player", "hamSpawnPost", 1 );
g_pCvarTimeToPlay = register_cvar( "vip_time", "10" ); // In hours
g_pCvarAccesFlag = register_cvar( "vip_flag", "t" ); // ADMIN_LEVEL_H flag.
}

public client_putinserver( id )
{
g_flTimePlayed[ id ] = get_gametime( );
}

public client_disconnect( id )
{
checkTime( id, 0 );
}

public hamSpawnPost( id )
{
checkTime( id, is_user_connected( id ) );
}

public checkTime( id, connected )
{
g_flTimePlayed[ id ] = ( get_gametime( ) - g_flTimePlayed[ id ] );
new time = floatround( g_flTimePlayed[ id ] );
if ( ( time >= ( get_pcvar_num( g_pCvarTimeToPlay ) * 3600 ) ) && !is_user_admin( id ) )
{
new szAuthId[ 35 ], szFlags[ 26 ];
get_user_authid( id, szAuthId, charsmax( szAuthId ) );
get_pcvar_string( g_pCvarAccesFlag, szFlags, charsmax( szFlags ) );
server_cmd( "amx_addadmin ^"%s^" ^"%s^" ^"^" ^"steamid^"", szAuthId, szFlags );
if ( connected )
{
client_print( id, print_chat, "u became vip" );
}
}
g_flTimePlayed[ id ] = get_gametime( );
}


could u add hud message when player reaches 1 hour 2 3 4 5 etc until he gets 20hours then he becomes admin_level_h??

could u add nvault ?? to it? so hours spent on server will be saved?? by steam_id??
Sum is offline
 


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 00:22.


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