AcasaAcasa  PortalPortal  CalendarCalendar  FAQFAQ  CautareCautare  MembriMembri  GrupuriGrupuri  InregistrareInregistrare  ConectareConectare  

Distribuiţi | 
 

 vipmenu 1.0

In jos 
AutorMesaj
Vizitator
Vizitator
avatar


MesajSubiect: vipmenu 1.0   Joi Feb 05, 2015 9:24 pm

#include <amxmodx>
#include <fun>
#include <fakemeta>
#include <fakemeta_util>
#include <cstrike>
#include <hamsandwich>
#include <alt_chat>

#define PLUGIN "Vipmenu"
#define VERSION "1.0"
#define AUTHOR "xerd"

#define numar_maxim 2

new g_iRunda[ 33 ];
new gMsgScoreAttrib;
new pcvar_Display


public plugin_init () {

register_plugin ("PLUGIN", "VERSION", "AUTHOR");
register_clcmd ("say /vipmenu","drvip");
register_clcmd("say /rsd", "reset_dead");
register_clcmd("say /vip","ShowMotd")
register_clcmd("say_team /vip","ShowMotd")
g_msgsaytext = get_user_msgid( "SayText" );
register_logevent("roundstart", 2, "1=Round_Start");
RegisterHam(Ham_Spawn, "player", "fwHamPlayerSpawnPost", 1);
gMsgScoreAttrib = get_user_msgid("ScoreAttrib");
register_message(gMsgScoreAttrib, "HookScoreAttrib");
}

public drvip ( id )
{
if (get_user_flags(id) & ADMIN_LEVEL_H){

ShowMenu(id);
}else{
print (id, "^x04 [VIP] ^x01 Nu ai acces la ^x03 /vipmenu.")
return 1;
}
return 0;
}

public roundstart( )
{
new iPlayers[ 32 ], iNum;

get_players( iPlayers, iNum, "c" );

for( new i = 0; i < iNum; i++ )
{
g_iRunda[ iPlayers[ i ] ] = 0;
}
}


public ShowMenu ( id )
{
if (!is_user_alive ( id )|| is_user_bot ( id )||!is_user_connected ( id ))
return 1;

if( g_iRunda[ id ] >= numar_maxim )
{
print(id, "^x04 [VIP] ^x01 Ai folosit deja de %i ori aceasta comanda, asteapta pana runda urmatoare.",numar_maxim);
return 1;
}

static menu;
menu = menu_create ("\ Meniu V.I.P","meniu_vip");

menu_additem ( menu,"\ Deagle - 5GL","1", 0 );
menu_additem ( menu,"\ AWP - 1GL","2", 0 );
menu_additem ( menu,"\ Invizibilitate - 15 sec.","3", 0 );
menu_additem ( menu,"\ Gravitatie [400] - 15 sec.","4", 0 );
menu_additem ( menu,"\ GodMode - 15 sec.","5", 0 );

menu_setprop ( menu, MPROP_NUMBER_COLOR,"\y");
menu_setprop ( menu, MPROP_EXIT, MEXIT_ALL );

menu_display ( id, menu, 0 );
return 0;
}

public meniu_vip ( id, menu, item )
{
if ( item == MENU_EXIT )
{
menu_destroy ( menu );
return 1;
}

new data [ 6 ], szName [ 64 ];
new access, callback;

menu_item_getinfo ( menu, item, access, data, charsmax ( data ), szName, charsmax ( szName ), callback );

new key = str_to_num ( data );

switch ( key )
{
case 1:
{
print (id, "^x04 [VIP] ^x01 Ti-ai ales ^x03 deagle ^x01 cu 5 gloante.")
cs_set_weapon_ammo( give_item(id, "weapon_deagle"), 5)
g_iRunda[ id ] ++;

}
case 2:
{
print (id, "^x04 [VIP] ^x01 Ti-ai ales ^x03 AWP ^x01 cu 1 glont.")
cs_set_weapon_ammo( give_item(id, "weapon_awp"), 1)
g_iRunda[ id ] ++;
}
case 3:
{
print (id, "^x04 [VIP] ^x01 Ti-ai ales ^x03 invizibilitate ^x01 15 secunde.")
set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 0);
set_task(15.0, "remove_invizibility",id);
g_iRunda[ id ] ++;
}
case 4:
{
print (id, "^x04 [VIP] ^x01 Ti-ai ales ^x03 gravitatie [400] ^x01 pentru 15 secunde.")
fm_set_user_gravity( id, 0.50 );
set_task(15.0, "remove_gravity",id);
g_iRunda[ id ] ++;
}
case 5:
{
print (id, "^x04 [VIP] ^x01 Ti-ai ales ^x03 GodMode ^x01 15 secunde.")
set_user_godmode ( id, 1 );
set_task ( 15.0,"remove_godmode", id );
g_iRunda[ id ] ++;
}
}
menu_destroy ( menu );
return 1;
}

//Reseteaza doar decesele nu si fragurile
public reset_dead(id)
{
if( get_user_flags(id) & ADMIN_LEVEL_H)
{
cs_set_user_deaths(id, 0)
cs_set_user_deaths(id, 0)

if(get_pcvar_num(pcvar_Display) == 1)
{
client_print(id,print_chat,"^x04 [VIP] ^x01 Ti-ai resetat ^x03 Decesele")
}

}

if(!(get_user_flags(id) & ADMIN_LEVEL_H)) {

client_print(id,print_chat,"^x04 [VIP] ^x01 Nu ai acces la comanda pentru ca nu esti ^x03 V.I.P")

}
}

//Motd
public ShowMotd(id)
{
show_motd(id, "cstrike/addons/amxmodx/configs/vip.html")
}
public client_authorized(id)
{
set_task(30.0, "PrintText" ,id)
}
public PrintText(id)
{
client_print(id,print_chat,"^x04 [VIP] ^x01 Tasteaza ^x03 /vip ^x01 pentru a vedea detalii despre ^x03 V.I.P")
}

//Vip Tab
public HookScoreAttrib(osef2talife, osef3talife, osef4talife)
{
new id = get_msg_arg_int(1);

if(get_pdata_int(id, 114) != 2)
return PLUGIN_CONTINUE;

new adminflags = get_user_flags(id);

if(!adminflags || adminflags & ADMIN_LEVEL_H)
return PLUGIN_CONTINUE;

if(get_msg_arg_int(2) )
return PLUGIN_CONTINUE;

set_pdata_int(id, 126, 9);
dllfunc(DLLFunc_ClientUserInfoChanged, id);

set_msg_arg_int(2, 0, (1<<2) );

return PLUGIN_CONTINUE;
}

//Invizibilitate expirata
public remove_invizibility(id){
set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 255);
print (id, "^x04 [VIP] ^x01 Ti-a expirat ^x03 invizibilitatea.")
}
//Gravitate expirata
public remove_gravity(id){
fm_set_user_gravity( id, 1.0 );
print (id, "^x04 [VIP] ^x01 Ti-a expirat ^x03 gravitatia.")
}
//GodMode expirat
public remove_godmode(id){
set_user_godmode ( id, 0 );
print (id, "^x04 [VIP] ^x01 Ti-a expirat ^x03 godmode-ul.")
}

//Auto give PackGrenazi si Viata,Armura
public fwHamPlayerSpawnPost(id) {
if (get_user_flags(id) & ADMIN_LEVEL_H) {

set_user_health(id, 150)
set_user_armor(id, 150)
give_item ( id,"weapon_hegrenade" );
give_item ( id,"weapon_flashbang" );
give_item ( id,"weapon_flashbang" );
give_item ( id,"weapon_smokegrenade" );
g_iRunda[ id ] = false
}
}


Instalare:
1. Fisierul vipmenu.amxx il puneti in addons/amxmodx/plugins
2. Intrati in fisierul addons/amxmodx/configs/plugins.ini si adaugati la urma:
Code:
vipmenu.amxx


3. Fisierul alt_chat.ini il puneti in addons/amxmodx/scripting/include
1. Fisierul vip.html il puneti in addons/amxmodx/configs

Cvar-uri (se adauga in fisierul amxmodx\configs\amxx.cfg):
Nu necestia

Comenzi administrative (se tasteaza in chat trebuie sa ai acces la flagul H):
/vipmenu - iti afiseaza meniul V.I.P
/rsd - iti reseteaza doar Decesele

Comenzi publice (se tasteaza in chat):
/vip - iti afiseaza motd cu Beneficiile+Costul V.I.P

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

Meniu:
Deagle - 5GL
AWP - 1GL
Invizibilitate - 15 sec.
Gravitatie [400] - 15 sec.
GodMode - 15 sec.
Sus In jos
 
vipmenu 1.0
Sus 
Pagina 1 din 1

Permisiunile acestui forum:Nu puteti raspunde la subiectele acestui forum
 :: Diverse tutoriale :: Tutoriale Cs 1.6 :: Pluginuri-
Mergi direct la: