qStrike
Doriți să reacționați la acest mesaj? Creați un cont în câteva clickuri sau conectați-vă pentru a continua.


qStrike Comunity
 
AcasaAcasa  Ultimele imaginiUltimele imagini  CăutareCăutare  ÎnregistrareÎnregistrare  ConectareConectare  

 

 VIP System( SQL Version ) [Support for Nobs] [16.02.2014]

In jos 
AutorMesaj
bRayn
Premiu I CONCURS
Premiu I CONCURS



Mesaje : 251
Credit : 8219
Data de inscriere : 22/04/2014

VIP System( SQL Version ) [Support for Nobs] [16.02.2014] Empty
MesajSubiect: VIP System( SQL Version ) [Support for Nobs] [16.02.2014]   VIP System( SQL Version ) [Support for Nobs] [16.02.2014] I_icon_minitimeMier Apr 23, 2014 2:48 pm

Descriere: Cred ca toata lumea stie ce face acest plugin! Jucatorul care are flagurile "bit" in special "t" va avea parte de anumite beneficii. Toti cauta un astfel de pluginuri si eu zic, dupa parerea mea ca este unul dintre cele mai complexe sisteme. IN Urmatoarea versiune voi adauga si un meniu pentru. vip-i, itemele vor fi adaugate ca si extra itemele( extras din ZP 5.0.5 surse externe ).
Descarcare v1.0.0: GirlShare! | ZippyShare!
Descarcare v1.0.1: GirlShare! | ZippyShare!
New: Descarcare v1.0.2: GirlShare! | ZippyShare!
[sursa=Avantajele Membrului VIP:]VIP System( SQL Version ) [Support for Nobs] [16.02.2014] 10-1391767213
- VIP Event( intre anumite ore toti jucatorii beneficiaza de VIP Free )
- Alt model pentru VIP
- Este imun la flashbang-uri
- Celelalte avantaje le vedeti in poza de mai sus[/sursa]

[sursa=SMA v1.0.0]/*


Credits: Exolent - VIP in Scoreboard
pharse - x2 Jump for VIP( for ZP 5.0.5 )
Sn!ff3r - Show bullet dmg in HUD only VIP
Askhanar - Change Model to VIP
cheap.suit - No VIP Flash( extracted on Biohazard v2.00 beta )
AMXX Dev Team - Add VIP's
cyby - VIP Event


*/
#include < amxmodx >
#include < amxmisc >
#include < hamsandwich >
#include < cstrike >
#include < fakemeta >
#include < CC_ColorChat >
#include < message_const >

//#define USING_SQL

#if defined USING_SQL
#include < sqlx >
#endif

#pragma semicolon 1

#define VIP_FLAGS "bit" // Flagurile VIP-ului( Nu schimba )
#define VIP_FLAGS_TYPE "a" // a - deconecteaza VIP-ii cu parola invalida( Alte flaguri gasiti in "users.ini" )
#define VIP_PASSWORD "parola" // Aici setati parola oricarui VIP

#define is_user_player(%1) ( 1 <= %1 <= g_iMaxPlayers )

#define TASK_SECRET_MSG 2139

new const PLUGIN_VERSION[ ] = "1.0.0",
PLUGIN_AUTHOR[ ] = "YONTU";

#if defined USING_SQL
new const PLUGIN_NAME_SQL[ ] = "VIP System( SQL )";
#else
new const PLUGIN_NAME[ ] = "VIP System";
#endif

new const g_szTag[ ] = "[Classic VIP]"; // TAG
new const g_szVipFlags[ ] = "bit"; // flagurile vip-ului: b - slot | i - acces la comenzile de chat | t - flagul defalt al oricarui vip

new const YourNick[ ] = "YONTU",
YourMessenger[ ] = "sef_yontu@yahoo.com";

static const COLORG[ ] = "^x04", COLORD[ ] = "^x01", COLORT[ ] = "^x03";

enum {

SCOREATTRIB_ARG_PLAYERID = 1,
SCOREATTRIB_ARG_FLAGS
};

enum ( <<= 1 ) {

SCOREATTRIB_FLAG_NONE = 0,
SCOREATTRIB_FLAG_DEAD = 1,
SCOREATTRIB_FLAG_BOMB,
SCOREATTRIB_FLAG_VIP
};

enum _:WhatUserHas {

Speed,
Jump,
}
new bool:g_bUserHas[ 33 ][ WhatUserHas ];

new g_cvar_speed_spawn,
g_cvar_health_spawn,
g_cvar_armor_spawn,
g_cvar_gravity_spawn,
g_cvar_multidmg,
g_cvar_enable_glow,
g_cvar_health_kill_reward,
g_cvar_health_hs_reward,
g_cvar_maxhealth,
g_cvar_kill_money_reward,
g_cvar_show_msgs,
g_cvar_enable_show_dmg,
g_cvar_ebable_vip_scoreboard,
g_cvar_enable_vip_noflash,
g_cvar_enable_vip_multijump,
g_cvar_enable_vip_event,
g_cvar_enable_vip_model;

new Ham:Ham_Player_ResetMaxSpeed = Ham_Item_PreFrame;

new bool:VipEvent;

new iJumpNum[ 33 ] = 0;
new g_iMultiJumps[ 33 ] = 0;
new g_iMaxJumps = 0;

new g_iMaxPlayers;
new SyncHudMessage;

public plugin_init( ) {





}
}

return 0;
}

public event_Damage( id ) {

if( get_pcvar_num( g_cvar_enable_show_dmg ) > 0 ) {

static iAttacker;
static fDamage;

iAttacker = get_user_attacker( id );
fDamage = read_data( 2 );

if( is_user_alive( id ) && is_user_vip( id ) ) {

set_hudmessage( 255, 0, 0, 0.45, 0.50, 2, 0.1, 1.0, 0.1, 0.1, -1 );
ShowSyncHudMsg( id, SyncHudMessage, "%i^n", fDamage );
}

if( is_user_alive( iAttacker ) && is_user_vip( iAttacker ) ) {

set_hudmessage( 0, 255, 15, -1.0, 0.55, 2, 0.1, 1.0, 0.02, 0.02, -1 );
ShowSyncHudMsg( iAttacker, SyncHudMessage, "%i^n^n", fDamage );
}
}
}

public logevent_RoundStart( ) {

new szPlayers[ 32 ], iNum;
get_players( szPlayers, iNum, "ch" );

for( new i = 0; i < iNum; i++) {

g_bUserHas[ szPlayers[ i ] ][ Speed ] = false;
g_bUserHas[ szPlayers[ i ] ][ Jump ] = false;
g_iMultiJumps[ szPlayers[ i ] ] = 0;
iJumpNum[ szPlayers[ i ] ] = 0;

if( task_exists( szPlayers[ i ] + TASK_SECRET_MSG ) )
remove_task( szPlayers[ i ] + TASK_SECRET_MSG );

set_task( get_pcvar_float( g_cvar_show_msgs ), "task_ShowMessage", szPlayers[ i ] + TASK_SECRET_MSG );
}
}

public logevent_RoundEnd( ) {

new szPlayers[ 32 ], iNum;
get_players( szPlayers, iNum, "ch" );

for( new i = 0; i < iNum; i++ )
remove_task( szPlayers[ i ] );
}

public forward_PlayerPreThink( id ) {

if( !is_user_alive( id ) || !g_iMultiJumps[ id ] )
return 0;

if( ( pev( id, pev_button ) & IN_JUMP ) && !( pev( id, pev_flags ) & FL_ONGROUND ) && !( pev( id, pev_oldbuttons ) & IN_JUMP ) ) {

if( iJumpNum[ id ] < g_iMultiJumps[ id ] ) {

g_bUserHas[ id ][ Jump ] = true;
iJumpNum[ id ]++;

return 0;
}
}

if( ( pev( id, pev_button ) & IN_JUMP ) && ( pev( id, pev_flags ) & FL_ONGROUND ) ) {

iJumpNum[ id ] = 0;
return 0;
}

return 0;
}

public forward_PlayerPostThink( id ) {

if( !is_user_alive( id ) || !g_iMultiJumps[ id ] )
return 0;

if( g_bUserHas[ id ][ Jump ]/* = true*/ ) {

new Float:fVelocity[ 3 ];

pev( id, pev_velocity, fVelocity );

fVelocity[ 2 ] = random_float( 265.0, 285.0 );

set_pev( id, pev_velocity, fVelocity );

g_bUserHas[ id ][ Jump ] = false;
return 0;
}

return 0;
}

public Ham_PlayerSpawnPost( id ) {

if( !is_user_alive( id ) && !is_user_vip( id ) )
return HAM_IGNORED;

if( is_user_vip( id ) && !is_user_bot( id ) )
set_task( 1.0, "task_GiveSkillsAllVips", id );

return HAM_IGNORED;
}

public task_GiveSkillsAllVips( id ) {

//drop_prim( id );

g_bUserHas[ id ][ Speed ] = true;
fm_set_user_maxspeed( id, get_pcvar_float( g_cvar_speed_spawn ) );

new szCommand[ 128 ];
formatex( szCommand, sizeof( szCommand ) - 1, "cl_forwardspeed %.1f;cl_sidespeed %.1f;cl_backspeed %.1f", get_pcvar_float( g_cvar_speed_spawn ), get_pcvar_float( g_cvar_speed_spawn ), get_pcvar_float( g_cvar_speed_spawn ) );
client_cmd( id, szCommand );

if( get_pcvar_num( g_cvar_enable_vip_multijump ) > 0 )
if( g_iMultiJumps[ id ] < g_iMaxJumps || !g_iMaxJumps )
g_iMultiJumps[ id ]++;

set_user_health( id, get_pcvar_num( g_cvar_health_spawn ) );
set_user_armor( id, get_pcvar_num( g_cvar_armor_spawn ) );
set_user_gravity( id, get_pcvar_float( g_cvar_gravity_spawn ) );

fm_give_item( id, "weapon_hegrenade" );
fm_give_item( id, "weapon_flashbang" );
fm_give_item( id, "weapon_flashbang" );
fm_give_item( id, "weapon_smokegrenade" );

//GiveRifle( id );

if( get_pcvar_num( g_cvar_enable_glow ) > 0 ) {

switch( get_user_team( id ) ) {

case 1: fm_set_rendering( id, kRenderFxGlowShell, 200, 10, 20, kRenderNormal, 0 );
case 2: fm_set_rendering( id, kRenderFxGlowShell, 10, 240, 200, kRenderNormal, 0 );
}
}
}

public GiveRifle( id ) {

fm_give_item( id, "weapon_m4a1" );
cs_set_user_bpammo( id, CSW_M4A1, 300 );

fm_give_item( id, "weapon_ak47" );
cs_set_user_bpammo( id, CSW_AK47, 300 );

fm_give_item( id, "weapon_awp" );
cs_set_user_bpammo( id, CSW_AWP, 100 );

fm_give_item( id, "weapon_deagle" );
cs_set_user_bpammo( id, CSW_DEAGLE, 70 );
}

public task_ShowMessage( taskid ) {

new id = taskid - TASK_SECRET_MSG;

ColorChat( id, GREEN, "%s^x01 Vrei sa cumperi si tu^x03 Membru V.I.P^x01? Contacteaza-l pe^x03 %s^x01 la^x03 %s^x01 !!!", g_szTag, YourNick, YourMessenger );

set_task( get_pcvar_float( g_cvar_show_msgs ) * 0.5, "task_ShowMessage2", id );

if( task_exists( taskid ) )
remove_task( taskid );
}

public task_ShowMessage2( id ) {

ColorChat( id, GREEN, "%s^x01 Vrei sa faci rost de^x03 Membru VIP^x01 si nu stii cum? Tasteaza^x03 /wantvip^x01 !!!", g_szTag );

set_task( get_pcvar_float( g_cvar_show_msgs ) * 1.2, "task_PrintVipList", id );
}

public task_PrintVipList( user ) {

new szAdminNames[ 33 ][ 32 ];
new szMessage[ 256 ];
new iCount, iLen;

for( new id = 1 ; id <= g_iMaxPlayers ; id++ )
if( is_user_connected( id ) )
if( is_user_vip( id ) )
get_user_name( id, szAdminNames[ iCount++ ], 31 );

iLen = format( szMessage, 255, "%sVIP's Online: ", COLORG );

if( iCount > 0 ) {

for( new i = 0 ; i < iCount ; i++ ) {

iLen += format( szMessage[ iLen ], 255 - iLen, "^x03%s^x01 | ", szAdminNames[ i ], COLORT, COLORD );

if( iLen > 96 ) {

print_message( user, szMessage );
iLen = format( szMessage, 255, "%s", COLORG );
}
}

print_message( user, szMessage );
}

else {

iLen += format( szMessage[ iLen ], 255 - iLen, "^x01Nu sunt VIP-i online.", COLORD );
print_message( user, szMessage );
}
}

public Ham_ResetMaxSpeedPost( id ) {

if( is_user_alive( id ) && is_user_vip( id ) && get_user_maxspeed( id ) != 1.0 ) {

new Float:flMaxSpeed;

if( g_bUserHas[ id ][ Speed ] )
flMaxSpeed = float( get_pcvar_num( g_cvar_speed_spawn ) );

if( flMaxSpeed > 0.0 )
set_pev( id, pev_maxspeed, flMaxSpeed );
}
}

public Ham_TakeDamagePre( iVictim, iInflictor, iAttacker, Float:fDamage ) {

if( iVictim == iAttacker || !is_user_player( iAttacker ) || !is_user_alive( iAttacker ) || is_user_bot( iAttacker ) )
return HAM_HANDLED;

if( is_user_vip( iAttacker ) && is_user_player( iAttacker ) )
SetHamParamFloat( 4, fDamage * get_pcvar_float( g_cvar_multidmg ) );

return HAM_IGNORED;
}

public MessageScoreAttrib( iMsgId, iMsgDest, id ) {

if( get_pcvar_num( g_cvar_ebable_vip_scoreboard ) > 0 ) {

new iPlayer = get_msg_arg_int( SCOREATTRIB_ARG_PLAYERID );

if( access( iPlayer, read_flags( g_szVipFlags ) ) )
set_msg_arg_int( SCOREATTRIB_ARG_FLAGS, ARG_BYTE, SCOREATTRIB_FLAG_VIP );
}
}

public MessageScreenFade( iMsgId, iMsgDest, id ) {

if( is_user_vip( id ) && is_user_alive( id ) && get_pcvar_num( g_cvar_enable_vip_noflash ) ) {

static szData[ 4 ];

szData[ 0 ] = get_msg_arg_int( 4 );
szData[ 1 ] = get_msg_arg_int( 5 );
szData[ 2 ] = get_msg_arg_int( 6 );
szData[ 3 ] = get_msg_arg_int( 7 );

if( szData[ 0 ] == 255 && szData[ 1 ] == 255 && szData[ 2 ] == 255 && szData[ 3] > 199 )
return 1;
}

return 0;
}

public check_time( ) {

static preluare_ora[ 3 ], ora;
get_time( "%H", preluare_ora, 2 );

ora = str_to_num( preluare_ora );

if( 10 >= ora || ora < 12 ) {

if( !VipEvent )
ColorChat( 0, GREEN, "^x04%s^x01 Eventul^x03 Free VIP^x01 a fost activat!", g_szTag );

VipEvent = true;
server_cmd( "amx_default_access ^"t^"" );
}

else {

if( VipEvent )
ColorChat( 0, GREEN, "^x04%s^x01 Eventul^x03 Free VIP^x01 a fost activat!", g_szTag );

VipEvent = false;
server_cmd( "amx_default_access ^"z^"" );
}

server_cmd( "amx_reloadadmins" );
}

public hud_mess( ) {

if( VipEvent ) {

set_hudmessage( 200, 200, 10, -1.0, 0.0, 1, 1.0, 1.0, 0.1, 0.1 );
show_hudmessage( 0, "Toti jucatorii beneficiaza de VIP free aceasta ora!" );
}
}

public ShowAbilityForVip( id ) {

new iCfgDir[ 32 ], iFile[ 192 ];

get_configsdir( iCfgDir, charsmax( iCfgDir ) );
formatex( iFile, charsmax( iFile ), "%s/vip.html", iCfgDir );

show_motd( id, iFile );
}

public ClCmdSayResetDeath( id ) {

if( !is_user_vip( id ) ) {

ColorChat( id, GREEN, "%s^x01 Nu esti^x03 Membru VIP^x01 !!!", g_szTag );
return 1;
}

else if( cs_get_user_deaths( id ) == 0 ) {

ColorChat( id, GREEN, "%s^x01 Ai deja^x03 0^x01 decese !!!", g_szTag );
return 1;
}

else {

cs_set_user_deaths( id, 0 );
ColorChat( id, GREEN, "%s^x01 Tocmai ti-ai resetat decesele! Acum ai^x03 0^x01 decese^x01 si^x03 %i^x01 fraguri !!!", g_szTag, get_user_frags( id ) );
}

return 0;
}

public ClCmdAddVips( id, level, cid ) {

if( !cmd_access( id, level, cid, 2 ) )
return 1;

new szTarget[ 32 ];
read_argv( 1, szTarget, 31 );

new iPlayer = cmd_target( id, szTarget, 8 );

if( !iPlayer )
return 1;

new szPlayerName[ 32 ], szAdminName[ 32 ];
get_user_name( iPlayer, szPlayerName, charsmax( szPlayerName ) );
get_user_name( id, szAdminName, charsmax( szAdminName ) );

AddVIP( id, szPlayerName, VIP_FLAGS, VIP_PASSWORD, VIP_FLAGS_TYPE, szAdminName );
server_cmd( "amx_reloadadmins" );

console_print( id, "%s Vip-ul a fost adaugat in lista!", g_szTag );
ColorChat( 0, GREEN, "^x04%s^x01 Adminul^x03 %s^x01 l-a adaugat ca VIP pe^x03 %s^x01 !", g_szTag, szAdminName, iPlayer );
ColorChat( iPlayer, GREEN, "^x04%s^x01 Felicitari! Ai fost adaugat ca membru^x03 VIP^x01! VIP-ul se va activa harta viitoare!", g_szTag );

return 1;
}

stock bool:is_user_vip( id ) {

if( get_user_flags( id ) & read_flags( g_szVipFlags ) )
return true;

return false;
}

stock drop_prim( id ) {

new szWeapons[ 32 ], iNum;
get_user_weapons( id, szWeapons, iNum );

for( new i = 0; i < iNum; i++ ) {

if( WeaponAK47 & ( 1<<szWeapons[ i ] ) || WeaponM4a1 & ( 1<<szWeapons[ i ] ) || WeaponDeagle & ( 1<<szWeapons[ i ] ) || WeaponAWP & ( 1<<szWeapons[ i ] ) ) {

static szWeaponName[ 32 ];

get_weaponname( szWeapons[ i ], szWeaponName, sizeof szWeaponName - 1 );
engclient_cmd( id, "drop", szWeaponName );
}
}
}

stock print_message( id, msg[ ] ) {

message_begin( MSG_ONE, get_user_msgid( "SayText" ), { 0, 0, 0 }, id );
write_byte( id );
write_string( msg );
message_end( );
}

// stock by Askhanar
stock bool:bUserHasAnyNade( id ) {

if( user_has_weapon( id, CSW_HEGRENADE ) || user_has_weapon( id, CSW_FLASHBANG ) || user_has_weapon( id, CSW_SMOKEGRENADE ) )
return true;

return false;
}

// stocks from "fakemeta_util"
stock fm_give_item( index, const item[ ] ) {

if( !equal( item, "weapon_", 7 ) && !equal( item, "ammo_", 5 ) && !equal( item, "item_", 5 ) && !equal( item, "tf_weapon_", 10 ) )
return 0;

new ent = fm_create_entity( item );

if( !pev_valid( ent ) )
return 0;

new Float:fOrigin[ 3 ];
pev( index, pev_origin, fOrigin );

set_pev( ent, pev_origin, fOrigin );
set_pev( ent, pev_spawnflags, pev( ent, pev_spawnflags ) | SF_NORESPAWN );

dllfunc( DLLFunc_Spawn, ent );

new save = pev( ent, pev_solid );

dllfunc( DLLFunc_Touch, ent, index );

if( pev( ent, pev_solid ) != save )
return ent;

engfunc( EngFunc_RemoveEntity, ent );

return -1;
}

stock fm_set_user_maxspeed( index, Float:speed = -1.0 ) {

engfunc( EngFunc_SetClientMaxspeed, index, speed );

set_pev( index, pev_maxspeed, speed );

return 1;
}

stock Float:fm_get_user_maxspeed( index ) {

new Float:speed;
pev( index, pev_maxspeed, speed );

return speed;
}

stock fm_set_rendering( entity, fx = kRenderFxNone, r = 255, g = 255, b = 255, render = kRenderNormal, amount = 16 ) {

new Float:RenderColor[ 3 ];
RenderColor[ 0 ] = float( r );
RenderColor[ 1 ] = float( g );
RenderColor[ 2 ] = float( b );

set_pev( entity, pev_renderfx, fx );
set_pev( entity, pev_rendercolor, RenderColor );
set_pev( entity, pev_rendermode, render );
set_pev( entity, pev_renderamt, float( amount ) );

return 1;
}

stock fm_create_entity( const classname[ ] )
return engfunc( EngFunc_CreateNamedEntity, engfunc( EngFunc_AllocString, classname ) );


AddVIP( id, name[ ], accessflags[ ], password[ ], flags[ ], comment[ ]="" ) {

#if defined USING_SQL
new error[ 128 ], errno;

new Handle:info = SQL_MakeStdTuple( );
new Handle:sql = SQL_Connect( info, errno, error, 127 );

if( sql == Empty_Handle ) {

server_print( "[AMXX] %L", LANG_SERVER, "SQL_CANT_CON", error );
#endif
// Make sure that the users.ini file exists.
new configsDir[ 64 ];
get_configsdir( configsDir, 63 );
format( configsDir, 63, "%s/users.ini", configsDir );

if( !file_exists( configsDir ) ) {

console_print( id, "%s File ^"%s^" doesn't exist.", g_szTag, configsDir );
return;
}

// Make sure steamid isn't already in file.
new line = 0, textline[ 256 ], len;
const SIZE = 63;
new line_steamid[ SIZE + 1 ], line_password[ SIZE + 1 ], line_accessflags[ SIZE + 1 ], line_flags[ SIZE + 1 ], parsedParams;

// <name|ip|steamid> <password> <access flags> <account flags>
while( ( line = read_file( configsDir, line, textline, 255, len ) ) ) {

if ( len == 0 || equal( textline, ";", 1 ) )
continue; // comment line

parsedParams = parse( textline, line_steamid, SIZE, line_password, SIZE, line_accessflags, SIZE, line_flags, SIZE );

if( parsedParams != 4 )
continue; // Send warning/error?

if( containi( line_flags, flags ) != -1 && equal( line_steamid, name ) ) {

console_print( id, "%s %s already exists!", g_szTag, name );
return;
}
}

// If we came here, steamid doesn't exist in users.ini. Add it.
new linetoadd[ 512 ];

if( comment[ 0 ]==0 )
formatex( linetoadd, 511, "^r^n^"%s^" ^"%s^" ^"%s^" ^"%s^"", name, password, accessflags, flags );

else
formatex( linetoadd, 511, "^r^n^"%s^" ^"%s^" ^"%s^" ^"%s^" ; %s", name, password, accessflags, flags, comment );

console_print( id, "Adding:^n%s", linetoadd );

if( !write_file( configsDir, linetoadd ) )
console_print( id, "%s Failed writing to %s!", g_szTag, configsDir );
#if defined USING_SQL
}

new table[ 32 ];

get_cvar_string( "amx_sql_table", table, 31 );

new Handle:query = SQL_PrepareQuery( sql, "SELECT * FROM `%s` WHERE (`auth` = '%s')", table, name );

if( !SQL_Execute( query ) ) {

SQL_QueryError( query, error, 127 );
server_print( "[AMXX] %L", LANG_SERVER, "SQL_CANT_LOAD_ADMINS", error );
console_print( id, "[AMXX] %L", LANG_SERVER, "SQL_CANT_LOAD_ADMINS", error );
}

else if( SQL_NumResults( query ) )
console_print( id, "%s %s already exists!", g_szTag, name );

else {

console_print( id, "Adding to database:^n^"%s^" ^"%s^" ^"%s^" ^"%s^"", name, password, accessflags, flags );

SQL_QueryAndIgnore( sql, "REPLACE INTO `%s` (`name`, `password`, `access`, `flags`) VALUES ('%s', '%s', '%s', '%s')", table, name, password, accessflags, flags );
}

SQL_FreeHandle( query );
SQL_FreeHandle( sql);
SQL_FreeHandle( info );
#endif
}

/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/[/sursa]
[sursa=SMA v1.0.2]/*


Credits: Exolent - VIP in Scoreboard
pharse - x2 Jump for VIP( for ZP 5.0.5 )
Sn!ff3r - Show bullet dmg in HUD only VIP
Askhanar - Change Model to VIP
cheap.suit - No VIP Flash( extracted on Biohazard v2.00 beta )
AMXX Dev Team - Add VIP's
cyby - VIP Event


*/
#include < amxmodx >
#include < amxmisc >
#include < hamsandwich >
#include < cstrike >
#include < fakemeta >
#include < engine >
#include < fun >
#include < CC_ColorChat >
#include < message_const >

//#define USING_SQL

#if defined USING_SQL
#include < sqlx >
#endif

// Toate aceste date vor fi trecute in fisierul "users.ini" !
#define VIP_FLAGS "bit" // Flagurile VIP-ului( Nu schimba )
#define VIP_FLAGS_TYPE "a" // a - deconecteaza VIP-ii cu parola invalida( Alte flaguri gasiti in "users.ini" )
#define VIP_PASSWORD "parola" // Aici setati parola oricarui VIP

#define is_user_player(%1) ( 1 <= %1 <= g_iMaxPlayers )

#define TASK_SECRET_MSG 216439

// Aici schimbati orele cand jucatorii pot avea VIP free( pentru a dezactiva setati caloarea 0 cvar-ului "vip_enable_vip_event" )
#define FIRST_HOUR 12
#define LAST_HOUR 13

new const PLUGIN_VERSION[ ] = "1.0.2",
PLUGIN_AUTHOR[ ] = "YONTU";

#if defined USING_SQL
new const PLUGIN_NAME_SQL[ ] = "VIP System( SQL )";
#else
new const PLUGIN_NAME[ ] = "VIP System";
#endif

new const g_szTag[ ] = "[VIP System]"; // TAG
new const g_szVipFlags[ ] = "t"; // flagul vip-ului( ADMIN_LEVEL_H )

// Aici iti pui numele cu care joci pe server si adresa ta( pluginul va afisa un mesaj la inceput de runda cu datele tale daca jucatorii sunt interesati sa cumpere vip );
new const YourNick[ ] = "YONTU",
YourMessenger[ ] = "sef_yontu@yahoo.com";

static const COLORG[ ] = "^x04", COLORD[ ] = "^x01", COLORT[ ] = "^x03";

// Refil Ammo on headshot
new const g_Weapons[ ] = {

CSW_M4A1,
CSW_AK47,
CSW_DEAGLE,
CSW_USP
};

new const g_szWeapons[ ][ ] = {

"weapon_m4a1",
"weapon_ak47",
"weapon_deagle",
"weapon_usp"
};

new const g_iWeaponsAmmo[ ] = {

30,
30,
7,
12
};

enum {

SCOREATTRIB_ARG_PLAYERID = 1,
SCOREATTRIB_ARG_FLAGS
};

enum ( <<= 1 ) {

SCOREATTRIB_FLAG_NONE = 0,
SCOREATTRIB_FLAG_DEAD = 1,
SCOREATTRIB_FLAG_BOMB,
SCOREATTRIB_FLAG_VIP
};

enum _:WhatUserHas {

Speed,
Jump,
}
new bool:g_bUserHas[ 33 ][ WhatUserHas ];

new g_cvar_speed_spawn,
g_cvar_health_spawn,
g_cvar_armor_spawn,
g_cvar_gravity_spawn,
g_cvar_multidmg,
g_cvar_health_kill_reward,
g_cvar_health_hs_reward,
g_cvar_maxhealth,
g_cvar_kill_money_reward,
g_cvar_show_msgs,
g_cvar_enable_show_dmg,
g_cvar_ebable_vip_scoreboard,
g_cvar_enable_vip_noflash,
g_cvar_enable_vip_multijump,
g_cvar_enable_vip_event,
g_cvar_enable_vip_model;

new Ham:Ham_Player_ResetMaxSpeed = Ham_Item_PreFrame;

new bool:VipEvent;

new iJumpNum[ 33 ] = 0;
new g_iMultiJumps[ 33 ] = 0;
new g_iMaxJumps = 0;

new g_iMaxPlayers;
new SyncHudMessage;

public plugin_init( ) {

#if defined USING_SQL
register_plugin( PLUGIN_NAME_SQL,
PLUGIN_VERSION,
PLUGIN_AUTHOR );
#else
register_plugin( PLUGIN_NAME,
PLUGIN_VERSION,
PLUGIN_AUTHOR );
#endif

register_clcmd( "say /wantvip", "ShowAbilityForVip" );
register_clcmd( "say_team /wantvip", "ShowAbilityForVip" );

register_concmd( "amx_addvips", "ClCmdAddVips", ADMIN_RCON, "< nume >" );

register_event( "ResetHUD", "event_ResetModel", "b" );
register_event( "DeathMsg", "event_DeathMsg", "a" );
register_event( "DeathMsg", "event_DeathMsg2", "ae" );
register_event( "Damage", "event_Damage", "b", "2!0", "3=0", "4!0" );

register_logevent( "logevent_RoundStart", 2 , "1=Round_Start" );
register_logevent( "logevent_RoundEnd", 2, "1=Round_End" );

register_forward( FM_PlayerPreThink, "forward_PlayerPreThink" );
register_forward( FM_PlayerPostThink, "forward_PlayerPostThink" );

RegisterHam( Ham_Spawn, "player", "Ham_PlayerSpawnPost", 1 );
RegisterHam( Ham_TakeDamage, "player", "Ham_TakeDamagePre" );
RegisterHam( Ham_Player_ResetMaxSpeed, "player", "Ham_ResetMaxSpeedPost", 1 );

register_message( get_user_msgid( "ScoreAttrib" ), "MessageScoreAttrib" );
register_message( get_user_msgid( "ScreenFade" ), "MessageScreenFade" );

g_cvar_speed_spawn = register_cvar( "vip_speed_spawn", "400.0" ); // viteza pe care o primeste vip-ul la spawn( sa fie cu zecimala.0 )
g_cvar_health_spawn = register_cvar( "vip_health_spawn", "200" ); // viata pe care o primeste vip-ul la spawn
g_cvar_armor_spawn = register_cvar( "vip_armor_spawn", "150" ); // armura pe care o primeste vip-ul la spawn
g_cvar_gravity_spawn = register_cvar( "vip_gravity_spawn", "0.85" ); // gravitatea pe care o primeste vip-ul la spawn
g_cvar_multidmg = register_cvar( "vip_multi_dmg", "2.0" ); // vip-ul are dmg mai mare la toate armele
g_cvar_health_kill_reward = register_cvar( "vip_hp_kill_reward", "15" ); // cata viata sa primeasca vip-ul cand face un kill
g_cvar_health_hs_reward = register_cvar( "vip_hp_hs_reward", "25" ); // cata viata sa primeasca vip-ul cand face un headshot
g_cvar_maxhealth = register_cvar( "vip_maxhealth", "300" ); // viata maxima a vip-ului
g_cvar_kill_money_reward = register_cvar( "vip_kill_money", "1000" ); // Cati bani sa primeasca Vip-ul pe un frag
g_cvar_show_msgs = register_cvar( "vip_show_messages", "30.0" ); // la ce interval de timp.0 sa apara mesajele in chat despre VIP
g_cvar_enable_show_dmg = register_cvar( "vip_show_dmg", "1" ); // afiseaza vip-ului dmg-ul facut de victima si dmg-ul pe care i la facut victimei
g_cvar_ebable_vip_scoreboard = register_cvar( "vip_on_scoreboard", "1" ); // 1 - vip-ii apar in scoreboard ca "VIP" | 0 - dezactivat
g_cvar_enable_vip_noflash = register_cvar( "vip_imune_flashbang", "1" ); // 1 - Vip-ul este imun la flash-uri | 0 - Nu este
g_cvar_enable_vip_multijump = register_cvar( "vip_enable_multijump", "1" ); // 1 - Vip-ul beneficiaza de multi jump | 0 - Nu beneficiaza
g_cvar_enable_vip_event = register_cvar( "vip_enable_vip_event", "1" ); // 1 - Intre anumite ore toti jucatorii au VIP | 0 dezactivat
g_cvar_enable_vip_model = register_cvar( "vip_enable_model", "1" ); // 1 - VIP-ul are alt model pe server | 0 - Nu are

if( get_pcvar_num( g_cvar_enable_vip_event ) > 0 ) {

check_time( );
set_task( 60.0, "check_time", _, _, _, "b" );
set_task( 1.0, "hud_mess", _, _, _, "b" );
}

new szFile[ 64 ]
get_configsdir( szFile, 63 );
format( szFile, 63, "%s/vip_system.cfg", szFile );

if( file_exists( szFile ) )
server_cmd( "exec %s", szFile );

g_iMaxPlayers = get_maxplayers( );
SyncHudMessage = CreateHudSyncObj( );
}

public plugin_cfg( )
set_cvar_float( "sv_maxspeed", 1000.0 );

public plugin_precache( ) {

precache_model( "models/player/vip_ct/vip_ct.mdl" );
precache_model( "models/player/vip_t/vip_t.mdl" );
}

public client_putinserver( id ) {

g_iMultiJumps[ id ] = 0;
iJumpNum[ id ] = 0;
g_bUserHas[ id ][ Jump ] = false;
g_bUserHas[ id ][ Speed ] = false;
}

public client_disconnect( id ) {

g_iMultiJumps[ id ] = 0;
iJumpNum[ id ] = 0;
g_bUserHas[ id ][ Jump ] = false;
g_bUserHas[ id ][ Speed ] = false;
}

public event_ResetModel( id ) {

if( get_pcvar_num( g_cvar_enable_vip_model ) ) {

if( is_user_vip( id ) ) {

new CsTeams:userTeam = cs_get_user_team( id );

if( userTeam == CS_TEAM_T ) {

cs_set_user_model( id, "vip_t" );

return 1;
}

else if( userTeam == CS_TEAM_CT ) {

cs_set_user_model( id, "vip_ct" );

return 1;
}
} else
cs_reset_user_model( id );
} else
return 0;

return 0;
}

public event_DeathMsg( ) {

new iAttacker = read_data( 1 );
new iVictim = read_data( 2 );
new iHeadshot = read_data( 3 );

new HealthOnHeadShot = get_pcvar_num( g_cvar_health_hs_reward );
new MaxHealth = get_pcvar_num( g_cvar_maxhealth );
new HealthOnKill = get_pcvar_num( g_cvar_health_kill_reward );

if( iAttacker == iVictim )
return 0;

if( is_user_vip( iAttacker ) && iAttacker != iVictim ) {

if( get_user_health( iAttacker ) <= MaxHealth ) {

if( iHeadshot ) {

set_user_health( iAttacker, get_user_health( iAttacker ) + HealthOnHeadShot );

set_hudmessage( 0, 250, 0, 0.85, 0.7, 0, 6.0, 5.0 );
ShowSyncHudMsg( iAttacker, SyncHudMessage, "+ %i HP", HealthOnHeadShot );
} else {

set_user_health( iAttacker, get_user_health( iAttacker ) + HealthOnKill );

set_hudmessage( 200, 200, 0, 0.85, 0.7, 0, 6.0, 5.0 );
ShowSyncHudMsg( iAttacker, SyncHudMessage, "+ %i HP", HealthOnKill );
}
}

if( is_user_alive( iAttacker ) && !is_user_bot( iAttacker ) )
if( read_data( 3 ) )
for( new w = 0; w < sizeof( g_Weapons ); w++ )
if( get_user_weapon( iAttacker ) == g_Weapons[ w ] )
if( find_ent_by_owner( -1, g_szWeapons[ w ], iAttacker ) )
cs_set_weapon_ammo( find_ent_by_owner( -1, g_szWeapons[ w ], iAttacker ), g_iWeaponsAmmo[ w ] );
}

return 0;
}

public event_DeathMsg2( ) {

new iAttacker = read_data( 1 );
new iVictim = read_data( 2 );

new BonusMoney = get_pcvar_num( g_cvar_kill_money_reward );

if( iAttacker == iVictim )
return 0;

if( is_user_vip( iAttacker ) )
if( iAttacker && is_user_alive( iAttacker ) )
if( cs_get_user_team( iVictim ) == CS_TEAM_T || cs_get_user_team( iVictim ) == CS_TEAM_CT )
if( cs_get_user_money( iAttacker ) < 16000 - BonusMoney - 300 )
cs_set_user_money( iAttacker, cs_get_user_money( iAttacker ) + BonusMoney - 300 );

return 0;
}

public event_Damage( id ) {

if( get_pcvar_num( g_cvar_enable_show_dmg ) > 0 ) {

static iAttacker;
static fDamage;

iAttacker = get_user_attacker( id );
fDamage = read_data( 2 );

if( is_user_alive( id ) && is_user_vip( id ) ) {

set_hudmessage( 255, 0, 0, 0.45, 0.50, 2, 0.1, 1.0, 0.1, 0.1, -1 );
ShowSyncHudMsg( id, SyncHudMessage, "%i^n", fDamage );
}

if( is_user_alive( iAttacker ) && is_user_vip( iAttacker ) ) {

set_hudmessage( 0, 255, 15, -1.0, 0.55, 2, 0.1, 1.0, 0.02, 0.02, -1 );
ShowSyncHudMsg( iAttacker, SyncHudMessage, "%i^n^n", fDamage );
}
}
}

public logevent_RoundStart( ) {

new szPlayers[ 32 ], iNum;
get_players( szPlayers, iNum, "ch" );

for( new i = 0; i < iNum; i++) {

g_bUserHas[ szPlayers[ i ] ][ Speed ] = false;
g_bUserHas[ szPlayers[ i ] ][ Jump ] = false;
g_iMultiJumps[ szPlayers[ i ] ] = 0;
iJumpNum[ szPlayers[ i ] ] = 0;

if( task_exists( szPlayers[ i ] + TASK_SECRET_MSG ) )
remove_task( szPlayers[ i ] + TASK_SECRET_MSG );

set_task( get_pcvar_float( g_cvar_show_msgs ), "task_ShowMessage", szPlayers[ i ] + TASK_SECRET_MSG );
}
}

public logevent_RoundEnd( ) {

new szPlayers[ 32 ], iNum;
get_players( szPlayers, iNum, "ch" );

for( new i = 0; i < iNum; i++ )
remove_task( szPlayers[ i ] );
}

public forward_PlayerPreThink( id ) {

if( !is_user_alive( id ) || !g_iMultiJumps[ id ] )
return 0;

if( ( pev( id, pev_button ) & IN_JUMP ) && !( pev( id, pev_flags ) & FL_ONGROUND ) && !( pev( id, pev_oldbuttons ) & IN_JUMP ) ) {

if( iJumpNum[ id ] < g_iMultiJumps[ id ] ) {

g_bUserHas[ id ][ Jump ] = true;
iJumpNum[ id ]++;

return 0;
}
}

if( ( pev( id, pev_button ) & IN_JUMP ) && ( pev( id, pev_flags ) & FL_ONGROUND ) ) {

iJumpNum[ id ] = 0;
return 0;
}

return 0;
}

public forward_PlayerPostThink( id ) {

if( !is_user_alive( id ) || !g_iMultiJumps[ id ] )
return 0;

if( g_bUserHas[ id ][ Jump ] ) {

new Float:fVelocity[ 3 ];

pev( id, pev_velocity, fVelocity );

fVelocity[ 2 ] = random_float( 265.0, 285.0 );

set_pev( id, pev_velocity, fVelocity );

g_bUserHas[ id ][ Jump ] = false;
return 0;
}

return 0;
}

public Ham_PlayerSpawnPost( id ) {

if( !is_user_alive( id ) && !is_user_vip( id ) )
return HAM_IGNORED;

if( is_user_vip( id ) && !is_user_bot( id ) )
set_task( 1.0, "task_GiveSkillsAllVips", id );

return HAM_IGNORED;
}

public task_GiveSkillsAllVips( id ) {

//drop_prim( id );

g_bUserHas[ id ][ Speed ] = true;
fm_set_user_maxspeed( id, get_pcvar_float( g_cvar_speed_spawn ) );

new szCommand[ 128 ];
formatex( szCommand, sizeof( szCommand ) - 1, "cl_forwardspeed %.1f;cl_sidespeed %.1f;cl_backspeed %.1f", get_pcvar_float( g_cvar_speed_spawn ), get_pcvar_float( g_cvar_speed_spawn ), get_pcvar_float( g_cvar_speed_spawn ) );
client_cmd( id, szCommand );

if( get_pcvar_num( g_cvar_enable_vip_multijump ) > 0 )
if( g_iMultiJumps[ id ] < g_iMaxJumps || !g_iMaxJumps )
g_iMultiJumps[ id ]++;

set_user_health( id, get_pcvar_num( g_cvar_health_spawn ) );
set_user_armor( id, get_pcvar_num( g_cvar_armor_spawn ) );
set_user_gravity( id, get_pcvar_float( g_cvar_gravity_spawn ) );

fm_give_item( id, "weapon_hegrenade" );
fm_give_item( id, "weapon_flashbang" );
fm_give_item( id, "weapon_flashbang" );
fm_give_item( id, "weapon_smokegrenade" );

//GiveRifle( id );
}

public GiveRifle( id ) {

fm_give_item( id, "weapon_m4a1" );
cs_set_user_bpammo( id, CSW_M4A1, 300 );

fm_give_item( id, "weapon_ak47" );
cs_set_user_bpammo( id, CSW_AK47, 300 );

fm_give_item( id, "weapon_awp" );
cs_set_user_bpammo( id, CSW_AWP, 100 );

fm_give_item( id, "weapon_deagle" );
cs_set_user_bpammo( id, CSW_DEAGLE, 70 );
}

public task_ShowMessage( taskid ) {

new id = taskid - TASK_SECRET_MSG;

ColorChat( id, GREEN, "%s^x01 Vrei sa cumperi si tu^x03 Membru V.I.P^x01? Contacteaza-l pe^x03 %s^x01 la^x03 %s^x01 !!!", g_szTag, YourNick, YourMessenger );

set_task( get_pcvar_float( g_cvar_show_msgs ) * 0.5, "task_ShowMessage2", id );

if( task_exists( taskid ) )
remove_task( taskid );
}

public task_ShowMessage2( id ) {

ColorChat( id, GREEN, "%s^x01 Vrei sa faci rost de^x03 Membru VIP^x01 si nu stii cum? Tasteaza^x03 /wantvip^x01 !!!", g_szTag );

set_task( get_pcvar_float( g_cvar_show_msgs ) * 1.2, "task_PrintVipList", id );
}

public task_PrintVipList( user ) {

new szAdminNames[ 33 ][ 32 ];
new szMessage[ 256 ];
new iCount, iLen;

for( new id = 1 ; id <= g_iMaxPlayers ; id++ )
if( is_user_connected( id ) )
if( is_user_vip( id ) )
get_user_name( id, szAdminNames[ iCount++ ], 31 );

iLen = format( szMessage, 255, "%sVIP's Online: ", COLORG );

if( iCount > 0 ) {

for( new i = 0 ; i < iCount ; i++ ) {

iLen += format( szMessage[ iLen ], 255 - iLen, "^x03%s^x01 | ", szAdminNames[ i ], COLORT, COLORD );

if( iLen > 96 ) {

print_message( user, szMessage );
iLen = format( szMessage, 255, "%s", COLORG );
}
}

print_message( user, szMessage );
} else {

iLen += format( szMessage[ iLen ], 255 - iLen, "^x01Nu sunt VIP-i online.", COLORD );
print_message( user, szMessage );
}
}

public Ham_ResetMaxSpeedPost( id ) {

if( is_user_alive( id ) && is_user_vip( id ) && get_user_maxspeed( id ) != 1.0 ) {

new Float:flMaxSpeed;

if( g_bUserHas[ id ][ Speed ] )
flMaxSpeed = float( get_pcvar_num( g_cvar_speed_spawn ) );

if( flMaxSpeed > 0.0 )
set_pev( id, pev_maxspeed, flMaxSpeed );
}
}

public Ham_TakeDamagePre( iVictim, iInflictor, iAttacker, Float:fDamage ) {

if( iVictim == iAttacker || !is_user_player( iAttacker ) || !is_user_alive( iAttacker ) || is_user_bot( iAttacker ) )
return HAM_HANDLED;

if( is_user_vip( iAttacker ) && is_user_player( iAttacker ) )
SetHamParamFloat( 4, fDamage * get_pcvar_float( g_cvar_multidmg ) );

return HAM_IGNORED;
}

public MessageScoreAttrib( iMsgId, iMsgDest, id ) {

if( get_pcvar_num( g_cvar_ebable_vip_scoreboard ) > 0 ) {

new iPlayer = get_msg_arg_int( SCOREATTRIB_ARG_PLAYERID );

if( access( iPlayer, read_flags( g_szVipFlags ) ) )
set_msg_arg_int( SCOREATTRIB_ARG_FLAGS, ARG_BYTE, SCOREATTRIB_FLAG_VIP );
}
}

public MessageScreenFade( iMsgId, iMsgDest, id ) {

if( is_user_vip( id ) && is_user_alive( id ) && get_pcvar_num( g_cvar_enable_vip_noflash ) ) {

static szData[ 4 ];

szData[ 0 ] = get_msg_arg_int( 4 );
szData[ 1 ] = get_msg_arg_int( 5 );
szData[ 2 ] = get_msg_arg_int( 6 );
szData[ 3 ] = get_msg_arg_int( 7 );

if( szData[ 0 ] == 255 && szData[ 1 ] == 255 && szData[ 2 ] == 255 && szData[ 3] > 199 )
return 1;
}

return 0;
}

public check_time( ) {

static preluare_ora[ 3 ], ora;
get_time( "%H", preluare_ora, 2 );

ora = str_to_num( preluare_ora );

if( FIRST_HOUR >= ora || ora < LAST_HOUR ) {

if( !VipEvent )
ColorChat( 0, GREEN, "^x04%s^x01 Eventul^x03 Free VIP^x01 a fost activat!", g_szTag );

VipEvent = true;
server_cmd( "amx_default_access ^"t^"" );
} else {

if( VipEvent )
ColorChat( 0, GREEN, "^x04%s^x01 Eventul^x03 Free VIP^x01 a fost activat!", g_szTag );

VipEvent = false;
server_cmd( "amx_default_access ^"z^"" );
}

server_cmd( "amx_reloadadmins" );
}

public hud_mess( ) {

if( VipEvent ) {

set_hudmessage( 200, 200, 10, -1.0, 0.0, 1, 1.0, 1.0, 0.1, 0.1 );
show_hudmessage( 0, "Toti jucatorii beneficiaza de VIP free aceasta ora!" );
}
}

public ShowAbilityForVip( id ) {

new iCfgDir[ 32 ], iFile[ 192 ];

get_configsdir( iCfgDir, charsmax( iCfgDir ) );
formatex( iFile, charsmax( iFile ), "%s/vip.html", iCfgDir );

show_motd( id, iFile );
}

public ClCmdAddVips( id, level, cid ) {

if( !cmd_access( id, level, cid, 2 ) )
return 1;

new szTarget[ 32 ];
read_argv( 1, szTarget, 31 );

new iPlayer = cmd_target( id, szTarget, 8 );

if( !iPlayer )
return 1;

new szPlayerName[ 32 ], szAdminName[ 32 ];
get_user_name( iPlayer, szPlayerName, charsmax( szPlayerName ) );
get_user_name( id, szAdminName, charsmax( szAdminName ) );

AddVIP( id, szPlayerName, VIP_FLAGS, VIP_PASSWORD, VIP_FLAGS_TYPE, szAdminName );
server_cmd( "amx_reloadadmins" );

console_print( id, "%s Vip-ul a fost adaugat in lista!", g_szTag );
ColorChat( 0, GREEN, "^x04%s^x01 Adminul^x03 %s^x01 l-a adaugat ca VIP pe^x03 %s^x01 !", g_szTag, szAdminName, iPlayer );
ColorChat( iPlayer, GREEN, "^x04%s^x01 Felicitari! Ai fost adaugat ca membru^x03 VIP^x01! VIP-ul se va activa harta viitoare!", g_szTag );

return 1;
}

stock bool:is_user_vip( id ) {

if( get_user_flags( id ) & read_flags( g_szVipFlags ) )
return true;

return false;
}

stock print_message( id, Msg[ ] ) {

message_begin( MSG_ONE, get_user_msgid( "SayText" ), { 0, 0, 0 }, id );
write_byte( id );
write_string( Msg );
message_end( );
}

// stocks from "fakemeta_util"
stock fm_give_item( index, const item[ ] ) {

if( !equal( item, "weapon_", 7 ) && !equal( item, "ammo_", 5 ) && !equal( item, "item_", 5 ) && !equal( item, "tf_weapon_", 10 ) )
return 0;

new ent = fm_create_entity( item );

if( !pev_valid( ent ) )
return 0;

new Float:fOrigin[ 3 ];
pev( index, pev_origin, fOrigin );

set_pev( ent, pev_origin, fOrigin );
set_pev( ent, pev_spawnflags, pev( ent, pev_spawnflags ) | SF_NORESPAWN );

dllfunc( DLLFunc_Spawn, ent );

new save = pev( ent, pev_solid );

dllfunc( DLLFunc_Touch, ent, index );

if( pev( ent, pev_solid ) != save )
return ent;

engfunc( EngFunc_RemoveEntity, ent );

return -1;
}

stock fm_set_user_maxspeed( index, Float:speed = -1.0 ) {

engfunc( EngFunc_SetClientMaxspeed, index, speed );

set_pev( index, pev_maxspeed, speed );

return 1;
}

stock Float:fm_get_user_maxspeed( index ) {

new Float:speed;
pev( index, pev_maxspeed, speed );

return speed;
}

stock fm_set_rendering( entity, fx = kRenderFxNone, r = 255, g = 255, b = 255, render = kRenderNormal, amount = 16 ) {

new Float:RenderColor[ 3 ];
RenderColor[ 0 ] = float( r );
RenderColor[ 1 ] = float( g );
RenderColor[ 2 ] = float( b );

set_pev( entity, pev_renderfx, fx );
set_pev( entity, pev_rendercolor, RenderColor );
set_pev( entity, pev_rendermode, render );
set_pev( entity, pev_renderamt, float( amount ) );

return 1;
}

stock fm_create_entity( const classname[ ] )
return engfunc( EngFunc_CreateNamedEntity, engfunc( EngFunc_AllocString, classname ) );

AddVIP( id, name[ ], accessflags[ ], password[ ], flags[ ], comment[ ]="" ) {

#if defined USING_SQL
new error[ 128 ], errno;

new Handle:info = SQL_MakeStdTuple( );
new Handle:sql = SQL_Connect( info, errno, error, 127 );

if( sql == Empty_Handle ) {

server_print( "[AMXX] %L", LANG_SERVER, "SQL_CANT_CON", error );
#endif
// Make sure that the users.ini file exists.
new configsDir[ 64 ];
get_configsdir( configsDir, 63 );
format( configsDir, 63, "%s/users.ini", configsDir );

if( !file_exists( configsDir ) ) {

console_print( id, "%s File ^"%s^" doesn't exist.", g_szTag, configsDir );
return;
}

// Make sure steamid isn't already in file.
new line = 0, textline[ 256 ], len;
const SIZE = 63;
new line_steamid[ SIZE + 1 ], line_password[ SIZE + 1 ], line_accessflags[ SIZE + 1 ], line_flags[ SIZE + 1 ], parsedParams;

// <name|ip|steamid> <password> <access flags> <account flags>
while( ( line = read_file( configsDir, line, textline, 255, len ) ) ) {

if ( len == 0 || equal( textline, ";", 1 ) )
continue; // comment line

parsedParams = parse( textline, line_steamid, SIZE, line_password, SIZE, line_accessflags, SIZE, line_flags, SIZE );

if( parsedParams != 4 )
continue; // Send warning/error?

if( containi( line_flags, flags ) != -1 && equal( line_steamid, name ) ) {

console_print( id, "%s %s already exists!", g_szTag, name );
return;
}
}

// If we came here, steamid doesn't exist in users.ini. Add it.
new linetoadd[ 512 ];

if( comment[ 0 ]==0 )
formatex( linetoadd, 511, "^r^n^"%s^" ^"%s^" ^"%s^" ^"%s^"", name, password, accessflags, flags );

else
formatex( linetoadd, 511, "^r^n^"%s^" ^"%s^" ^"%s^" ^"%s^" ; %s", name, password, accessflags, flags, comment );

console_print( id, "Adding:^n%s", linetoadd );

if( !write_file( configsDir, linetoadd ) )
console_print( id, "%s Failed writing to %s!", g_szTag, configsDir );
#if defined USING_SQL
}

new table[ 32 ];

get_cvar_string( "amx_sql_table", table, 31 );

new Handle:query = SQL_PrepareQuery( sql, "SELECT * FROM `%s` WHERE (`auth` = '%s')", table, name );

if( !SQL_Execute( query ) ) {

SQL_QueryError( query, error, 127 );
server_print( "[AMXX] %L", LANG_SERVER, "SQL_CANT_LOAD_ADMINS", error );
console_print( id, "[AMXX] %L", LANG_SERVER, "SQL_CANT_LOAD_ADMINS", error );
}

else if( SQL_NumResults( query ) )
console_print( id, "%s %s already exists!", g_szTag, name );

else {

console_print( id, "Adding to database:^n^"%s^" ^"%s^" ^"%s^" ^"%s^"", name, password, accessflags, flags );

SQL_QueryAndIgnore( sql, "REPLACE INTO `%s` (`name`, `password`, `access`, `flags`) VALUES ('%s', '%s', '%s', '%s')", table, name, password, accessflags, flags );
}

SQL_FreeHandle( query );
SQL_FreeHandle( sql);
SQL_FreeHandle( info );
#endif
}

/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/[/sursa]
Nume: Complex VIP System( SQL Version )
Versiune: 1.0.2
Link oficial: Aici.

Instalare:
1. Fisierul VipSystem.sma il puneti in addons/amxmodx/scripting !
2. Fisierul VipSystem.amxx il puneti in addons/amxmodx/plugins !
3. Fisierul vip.html il puneti in addons/amxmodx/configs !
4. Fisierul .mdl le puneti in cstrike/models !
New: 5. Fisierul vip_system.cfg il puneti in addons/amxmodx/configs !
6. Intrati in fisierul addons/amxmodx/configs/plugins.ini si adaugati la urma:
Cod:
VipSystem.amxx
7. Alti pasi necesari...
Cvar-uri (se adauga in fisierul amxmodx\configs\amxx.cfg):
    vip_ultra_speed "400.0" - viteza pe care o primeste vip-ul la spawn( sa fie cu zecimala.0 )
    vip_health_spawn "200" - viata pe care o primeste vip-ul la spawn
    vip_armor_spawn "150" - armura pe care o primeste vip-ul la spawn
    vip_gravity_spawn "0.85" - gravitatea pe care o primeste vip-ul la spawn
    vip_multi_dmg "2.0" - vip-ul are dmg mai mare la toate armele
    vip_enable_glow "1" - 1 - Fiecare VIP are glow in functie de echipa( CT - Blue ) | ( T - Red )
    vip_hp_kill_reward "15" - cata viata sa primeasca vip-ul cand face un kill
    vip_hp_hs_reward "25" - cata viata sa primeasca vip-ul cand face un headshot
    vip_maxhealth "300" - viata maxima a vip-ului
    vip_kill_money "1000" - Cati bani sa primeasca Vip-ul pe un frag
    vip_show_messages "30.0" - la ce interval de timp.0 sa apara mesajele in chat despre VIP (lasati asa, 30.0 pentru ca vot fi afisate 3 mesaje in chat la inceput de runda)
    vip_show_dmg "1" - afiseaza vip-ului dmg-ul facut de victima si dmg-ul pe care i la facut victimei
    vip_on_scoreboard "1" - 1 - vip-ii apar in scoreboard ca "VIP" | 0 - dezactivat
    vip_imune_flashbang "1" - 1 - Vip-ul este imun la flash-uri | 0 - Nu este
    vip_enable_multijump "1" - 1 - Vip-ul beneficiaza de multi jump | 0 - Nu beneficiaza
    vip_enable_vip_event "1" - 1 - Intre anumite ore toti jucatorii au VIP | 0 dezactivat
    vip_enable_model "1" - 1 - VIP-ul are alt model pe server | 0 - Nu are


Comenzi administrative (se tasteaza in consola si trebuie sa fiti administrator):
    amx_addvips < nume > - cu aceasta comanda puteti adauga membrii VIP direct din consola fara a mai deschide "users.ini". Numele | Parola | Flagurile sunt direct trecute in "users.ini" la tastarea comenzii.


Comenzi publice (se tasteaza in joc prin apasarea tastei Y):
    /wantvip - se deschide un modt cu beneficiile pe care le are VIP-ul pe server;
    /resetd - iti resetezi decesele( Only VIP );


Module necesare (se sterge ; din fata modulului de mai jos; acestea le gasiti in fisierul amxmodx\configs\modules.ini):
- CStrike;
- Fakemeta;
- Hamsandwich;
- Fun;

[sursa=Imagini]- Mesaj la adaugarea unui VIP:
VIP System( SQL Version ) [Support for Nobs] [16.02.2014] 1-1391766842

- Cele 3 mesaje care apar in chat:
VIP System( SQL Version ) [Support for Nobs] [16.02.2014] 2-1391766871
VIP System( SQL Version ) [Support for Nobs] [16.02.2014] 4-1391767049

- VIP Event
VIP System( SQL Version ) [Support for Nobs] [16.02.2014] 3-1391766896
- Reset Death
VIP System( SQL Version ) [Support for Nobs] [16.02.2014] 5-1391767073

- Glow-ul VIP-ului, in functie de echipa:
VIP System( SQL Version ) [Support for Nobs] [16.02.2014] 6-1391767105
VIP System( SQL Version ) [Support for Nobs] [16.02.2014] 7-1391767138

- Modelele VIP-ilor in functie de echipa:
VIP System( SQL Version ) [Support for Nobs] [16.02.2014] 8-1391767156
VIP System( SQL Version ) [Support for Nobs] [16.02.2014] 9-1391767192[/sursa]

[sursa=Credite]Exolent - VIP in Scoreboard
pharse - x2 Jump for VIP( for ZP 5.0.5 )
Sn!ff3r - Show bullet dmg in HUD only VIP
Askhanar - Change Model to VIP
cheap.suit - No VIP Flash( extracted on Biohazard v2.00 beta )
AMXX Dev Team - Add VIP's
cyby - VIP Event[/sursa]

Informatii: Pentru Update-uri / Imbunatatiri sau erori intalnite pe parcursul jocului din cauza acestui plugin, postati in acest topic! Am postat acest plugin deoarece multi il cauta si in fiecare zi se fac aproximativ 10 cereri legate de un plugin VIP.

New
[sursa=Alte informatii:][code=php]In sursa veti gasii urmatoarele linii: //#define USING_SQL - daca eliminati "//" din fata liniei atunci veti folosi metoda "sql" de adaugare a adminilor
#define VIP_FLAGS "bit" // Aici setati flagurile VIP-ului
#define VIP_FLAGS_TYPE "a" // a - deconecteaza VIP-ii cu parola invalida( Alte flaguri gasiti in "users.ini" )
#define VIP_PASSWORD "parola" // Aici setati parola oricarui VIP
new const g_szTag[ ] = "[TAG]"; // aici schimbati prefixul din fata mesajelor
new const YourNick[ ] = "AICI PUNETI NUMELE VOSRTU CU CARE JUCATI PE SERVER",
YourMessenger[ ] = "ADRESA VOASTRA DE MESS@yahoo.com"; ( De ce? Pentru ca la fiecare in ceput de runda vor aparea 3 mesaje( 1. contact daca vrei sa cunmperi VIP | 2. Comanda cu care sa vezi beneficiile vip-ului | 3. Veti vedea VIP-ii online fara a mai scrie "vips". Puteti schimba intervalul de timp modificand valoarea urmatorului cvar: vip_show_messages "30.0"
// Aici schimbati orele cand jucatorii pot avea VIP free( pentru a dezactiva setati caloarea 0 cvar-ului "vip_enable_vip_event" )
#define FIRST_HOUR 12
#define LAST_HOUR 13 [/code][/sursa]

[sursa=Changelogs]v1.0.0 - Prima lansare
v1.0.1 - Fixare bugurui si trecerea functiilor pe modulul FUN
v1.0.2 - Fixare cvar-uri, optimizare cod, eliminarea glow-ului, adaugare refil ammo cand da headshot, executarea cvar-urilor dintr-un fisier extern.[/sursa]

New
[sursa=Ce este nou in ultima versiune:]* puteti seta cvar-urile direct din fisierul vip_system.cfg pe care il gasiti in amxmodx/configs
* atunci cand face un frag cu arma AK-47, M4a1, Deagle, USP i se va incarca arma respectiva cu gloantele necesare
* puteti seta orele cand jucatorii pot avea VIP Free( vedeti mai sus )
* am scos glow-ul si comanda /resetd pentru ca erau inutile[/sursa]

[size=200]
Suport for Nobs!!!
[/size]
Sus In jos
 
VIP System( SQL Version ) [Support for Nobs] [16.02.2014]
Sus 
Pagina 1 din 1
 Subiecte similare
-
» the best aim 2014 work o
» CDHACK 2014
» VIP Sistem + Shop(UPDATE 27 Ianuarie 2014) Credite/Bani.CSO

Permisiunile acestui forum:Nu puteti raspunde la subiectele acestui forum
qStrike :: Gaming :: Counter-Strike 1.6 :: Plugin-uri-
Mergi direct la: