PremiumCs
VA AJUTAM CU ORICE PROBLEMA DOAR FACETI-VA CONT !


CAUTAM SERVERE DE ORICE FEL+VA OFERIM AJUTOR DACA E VORBA DESPRE CS/SAU VIATA DE ZI CU ZI!
 
AcasaAcasa  CalendarCalendar  GalerieGalerie  FAQFAQ  MembriMembri  GrupuriGrupuri  InregistrareInregistrare  ConectareConectare  

SPER SA ITI PLACA COMUNITATEA SPUNE CELORLATI !

Distribuiţi | 
 

 Plugin shop Vip

In jos 
AutorMesaj
Vizitator
Vizitator
avatar


MesajSubiect: Plugin shop Vip   Dum Mai 11, 2014 5:36 am

Descriere: Este un plugin VIP cu un meniu si cateva beneficii

Descarcare: Link!

Nume: VIP
Versiune: 1.0
Autor: Gabriel a.k.a Turbo19973
Link oficial: Aici

Sursa:
SMA | Ascunde codul
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fakemeta>
#include <fakemeta_util>
#include <hamsandwich>
#include <fun>

#define PLUGIN "VIP JB"
#define VERSION "1.0"
#define AUTHOR "Gabriel"

#define VIP_ACCESS ADMIN_LEVEL_H

new bool: WeaponChoosed[ 33 ], bool: Topor [ 33 ], bool: Chitara [ 33 ], bool: Xmen [33],bool: Axe [33], bool: SuperCiocan [33], bool: Katana [33]
new szGravityPlayer[ 33 ], szSpeedPlayer[ 33 ];

new VipWeaponsMenu
new const g_Tag [] = "[VIP]"
new limita[33];

enum Color{NORMAL = 1,GREEN,TEAM_COLOR,RED,BLUE,GREY}
new TeamName[][] = {"","TERRORIST","CT","SPECTATOR"}

new ToporModel [ 66 ] = "models/jb/v_topor.mdl";
new ChitaraModel [ 66 ] = "models/jb/v_chitara.mdl";
new XmenModel [ 66 ] = "models/jb/v_xmen.mdl";
new AxeModel [ 66 ] = "models/jb/v_axe.mdl";
new SuperCiocanModel [ 66 ] = "models/jb/v_superciocan.mdl";
new KatanaModel [ 66 ] = "models/jb/v_katana.mdl";

public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
RegisterHam(Ham_Spawn, "player", "PlayerSpawn", 1);
RegisterHam( Ham_Item_PreFrame, "player", "ExtraItem", true );
register_message(get_user_msgid("ScoreAttrib"),"ScoreBoard");
register_event("CurWeapon", "CurrentWeapon", "be", "1=1")
register_logevent("round_start", 2, "1=Round_Start")
register_event("ResetHUD", "resetModel", "b")
register_clcmd( "say /menu", "check_acces" )
register_clcmd( "say_team /menu", "check_acces" )
}
public plugin_precache ( ) {

precache_model ( ToporModel )
precache_model ( ChitaraModel )
precache_model ( XmenModel )
precache_model ( AxeModel )
precache_model ( SuperCiocanModel )
precache_model ( KatanaModel )
precache_model("models/player/vip_new/vipnew.mdl")
precache_model("models/player/vip_new/vipnew.mdl")

return PLUGIN_CONTINUE
}

public round_start()
{
new iPlayers[32]
new iNum

get_players( iPlayers, iNum )

for( new i = 0; i < iNum; i++ )
{
limita[iPlayers[i]] = 0;
}
}
public PlayerSpawn( id )
{
if(!is_user_alive( id ) )
return;

if( get_user_flags(id) & VIP_ACCESS ) {

WeaponChoosed [ id ] = false;
Topor [ id ] = false
Chitara [ id ] = false
Xmen [ id ] = false
Axe [ id ] = false
SuperCiocan [ id ] = false
Katana [ id ] = false
szSpeedPlayer [ id ] = false
szGravityPlayer [ id ] = false
give_item( id, "weapon_hegrenade" )
give_item( id, "weapon_flashbang" )
give_item( id, "weapon_smokegrenade" )
set_user_health(id, 180)
}
}
public ExtraItem(id)
{
if(is_user_alive(id) && is_user_connected(id))
{
if(szGravityPlayer[id])
{
set_user_gravity ( id, 0.5 );
}
if(szSpeedPlayer[id])
{
set_user_maxspeed(id , get_user_maxspeed( id ) + 200.0)
}
}
}
public check_acces(id) {
if( !is_user_alive( id ) ) {
ColorChat( id, GREEN, "^4%s^1 Nu iti poti alege arma atunci cand esti mort!", g_Tag)
return PLUGIN_HANDLED
}
if(limita[id] == 1) {
ColorChat(id,GREEN,"^4%s^x01 Ai folosit deja meniul rund asta, asteapta pana runda urmatoare !", g_Tag);
return 1
}
if(get_user_flags(id) & VIP_ACCESS) {
set_task(0.1, "VipMenu", id)
}
else
{
ColorChat(id, GREEN, "^4%s^x01 Trebuie sa fi membru ^4VIP pentru a utiliza ^x01VIP Weapons !", g_Tag)
}
return PLUGIN_CONTINUE
}
public VipMenu( id )
{
menu_display( id, VipWeaponsMenu, 0 );
}
public plugin_cfg( )
{
VipWeaponsMenu = menu_create( "\yVIP \rWeapons Menu", "VipWeaponsHandler" )

menu_additem( VipWeaponsMenu, "\rGlock", "1", 0 )
menu_additem( VipWeaponsMenu, "\rDeagle", "2", 0 )
menu_additem( VipWeaponsMenu, "\rScout", "3", 0 )
menu_additem( VipWeaponsMenu, "\rScut", "4", 0 )
menu_additem( VipWeaponsMenu, "\rGravity", "5", 0 )
menu_additem( VipWeaponsMenu, "\rSpeed", "6", 0 )
menu_additem( VipWeaponsMenu, "\rHP", "7", 0 )
menu_additem( VipWeaponsMenu, "\rTopor", "8", 0 )
menu_additem( VipWeaponsMenu, "\rChitara", "9", 0 )
menu_additem( VipWeaponsMenu, "\rX-Men", "10", 0 )
menu_additem( VipWeaponsMenu, "\rAxe", "11", 0 )
menu_additem( VipWeaponsMenu, "\rSuper-Ciocan", "12", 0 )
menu_additem( VipWeaponsMenu, "\rKatana", "13", 0 )
}
public VipWeaponsHandler( id, menu, item )
{
switch( item ) {
case 0:
{
strip_user_weapons(id)
give_item (id, "weapon_glock18")
give_item (id, "weapon_knife")
ColorChat(id, GREEN, "%s^x01 Ai primit Glock !", g_Tag)
limita[id] = 1
return 1
}
case 1:
{
strip_user_weapons(id)
give_item (id, "weapon_deagle")
give_item (id, "weapon_knife")
cs_set_user_bpammo( id, CSW_DEAGLE, 35 )
ColorChat(id, GREEN, "%s^x01 Ai primit Deagle!", g_Tag)
limita[id] = 1
return 1
}
case 2:
{
strip_user_weapons(id)
give_item (id, "weapon_scout")
give_item (id, "weapon_knife")
cs_set_user_bpammo( id, CSW_SCOUT, 90 )
ColorChat(id, GREEN, "%s^x01 Ai primit Scout!", g_Tag)
limita[id] = 1
return 1
}
case 3:
{
give_item (id, "weapon_shield")
ColorChat(id, GREEN, "%s^x01 Ai primit Scut!", g_Tag)
limita[id] = 1
return 1
}
case 4:
{
szGravityPlayer[id] = true
ColorChat(id, GREEN, "%s^x01 Ai primit 600 Gravity!", g_Tag)
limita[id] = 1
return 1
}
case 5:
{
szSpeedPlayer[id] = true
ColorChat(id, GREEN, "%s^x01 Ai primit 200 Speed!", g_Tag)
limita[id] = 1
return 1
}
case 6:
{
set_user_health(id, 200)
ColorChat(id, GREEN, "%s^x01 Ai primit 200 HP!", g_Tag)
limita[id] = 1
return 1
}
case 7:
{
Topor [ id ] = true
ColorChat(id, GREEN, "%s^x01 Ai primit Topor!", g_Tag)
CurrentWeapon ( id );
limita[id] = 1
return 1
}
case 8:
{
Chitara [ id ] = true
ColorChat(id, GREEN, "%s^x01 Ai primit Chitara!", g_Tag)
CurrentWeapon ( id );
limita[id] = 1
return 1
}
case 9:
{
Xmen [ id ] = true
ColorChat(id, GREEN, "%s^x01 Ai primit X-Menu!", g_Tag)
CurrentWeapon ( id );
limita[id] = 1
return 1
}
case 10:
{
Axe [ id ] = true
ColorChat(id, GREEN, "%s^x01 Ai primit Axe!", g_Tag)
CurrentWeapon ( id );
limita[id] = 1
return 1
}
case 11:
{
SuperCiocan [ id ] = true
ColorChat(id, GREEN, "%s^x01 Ai primit Super-Ciocan!", g_Tag)
CurrentWeapon ( id );
limita[id] = 1
return 1
}
case 12:
{
Katana [ id ] = true
ColorChat(id, GREEN, "%s^x01 Ai primit Katana!", g_Tag)
CurrentWeapon ( id );
limita[id] = 1
return 1
}
}
return PLUGIN_CONTINUE;
}
public CurrentWeapon ( id ) {

if ( Topor [ id ] && get_user_weapon ( id ) == CSW_KNIFE ) {

set_pev ( id, pev_viewmodel2, ToporModel );
}
if ( Chitara [ id ] && get_user_weapon ( id ) == CSW_KNIFE ) {

set_pev ( id, pev_viewmodel2, ChitaraModel );
}
if ( Xmen[ id ] && get_user_weapon ( id ) == CSW_KNIFE ) {

set_pev ( id, pev_viewmodel2, XmenModel );
}
if ( Axe[ id ] && get_user_weapon ( id ) == CSW_KNIFE ) {

set_pev ( id, pev_viewmodel2, AxeModel );
}
if ( SuperCiocan[ id ] && get_user_weapon ( id ) == CSW_KNIFE ) {

set_pev ( id, pev_viewmodel2, SuperCiocanModel );
}
if ( Katana[ id ] && get_user_weapon ( id ) == CSW_KNIFE ) {

set_pev ( id, pev_viewmodel2, KatanaModel );
}
}
public resetModel(id, level, cid) {
if( get_user_flags(id) & VIP_ACCESS) {
new CsTeams:userTeam = cs_get_user_team(id)
if (userTeam == CS_TEAM_T) {
cs_set_user_model(id, "vip_new")
}
else if(userTeam == CS_TEAM_CT) {
cs_set_user_model(id, "vip_new")
}
else {
cs_reset_user_model(id)
}
}

return PLUGIN_CONTINUE
}
public ScoreBoard(const MsgId, const MsgType, const MsgDest) {
static id;
id = get_msg_arg_int(1);
if(get_user_flags(id) & VIP_ACCESS)
set_msg_arg_int(2, ARG_BYTE, (1 << 2 ));
}
ColorChat(id, Color:type, const msg[], {Float,Sql,Result,_}:...)
{
new message[256];

switch(type)
{
case NORMAL:
{
message[0] = 0x01;
}
case GREEN:
{
message[0] = 0x04;
}
default:
{
message[0] = 0x03;
}
}

vformat(message[1], 251, msg, 4);

// Make sure message is not longer than 192 character. Will crash the server.
message[192] = '^0';

new team, ColorChange, index, MSG_Type;

if(id)
{
MSG_Type = MSG_ONE;
index = id;
} else {
index = FindPlayer();
MSG_Type = MSG_ALL;
}

team = get_user_team(index);
ColorChange = ColorSelection(index, MSG_Type, type);

ShowColorMessage(index, MSG_Type, message);

if(ColorChange)
{
Team_Info(index, MSG_Type, TeamName[team]);
}
}

ShowColorMessage(id, type, message[])
{
static bool:saytext_used;
static get_user_msgid_saytext;
if(!saytext_used)
{
get_user_msgid_saytext = get_user_msgid("SayText");
saytext_used = true;
}
message_begin(type, get_user_msgid_saytext, _, id);
write_byte(id)
write_string(message);
message_end();
}

Team_Info(id, type, team[])
{
static bool:teaminfo_used;
static get_user_msgid_teaminfo;
if(!teaminfo_used)
{
get_user_msgid_teaminfo = get_user_msgid("TeamInfo");
teaminfo_used = true;
}
message_begin(type, get_user_msgid_teaminfo, _, id);
write_byte(id);
write_string(team);
message_end();

return 1;
}

ColorSelection(index, type, Color:Type)
{
switch(Type)
{
case RED:
{
return Team_Info(index, type, TeamName[1]);
}
case BLUE:
{
return Team_Info(index, type, TeamName[2]);
}
case GREY:
{
return Team_Info(index, type, TeamName[0]);
}
}

return 0;
}

FindPlayer()
{
new i = -1;

while(i <= get_maxplayers())
{
if(is_user_connected(++i))
return i;
}

return -1;
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1049\\ f0\\ fs16 \n\\ par }
*/


Instalare:
1. Fisierul vip.sma il puneti in addons/amxmodx/scripting
2. Fisierul vip.amxx il puneti in addons/amxmodx/plugins
3. Intrati in fisierul addons/amxmodx/configs/plugins.ini si adaugati la urma:
Cod:
vip.amxx

4. Alti pasi necesari....

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


Comenzi administrative (se tasteaza in consola si trebuie sa fiti administrator):
Cod:
Nu necesita


Comenzi publice (se tasteaza in joc prin apasarea tastei Y):
/menu - afiseaza meniul de privilegii

Module necesare (se sterge ; din fata modulului de mai jos; acestea le gasiti in fisierul amxmodx\configs\modules.ini):
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fakemeta>
#include <fakemeta_util>
#include <hamsandwich>
#include <fun>
Sus In jos
 
Plugin shop Vip
Sus 
Pagina 1 din 1

Permisiunile acestui forum:Nu puteti raspunde la subiectele acestui forum
PremiumCs :: Counter-Strike 1.6 :: Pluginuri :: PLUGINURI FURIEN-
Mergi direct la: