•  
     

Menu /vip - Plugin

VIP
HE,2 FLASH
Colete FULL
Say Verde
um menu para ele escolher três tipo de faca .



Código: Selecionar todos

#include <amxmodx>
#include <fakemeta>
#include <fun>

#define PLUGIN "VIP"
#define VERSION "1.0"
#define AUTHOR "Victor #"

new szKnifes[][] = {
"models/v_knife",
"models/v_knife1.mdl",
"models/v_knife2.mdl",
"models/v_knife3.mdl"
}

new szOptions[][] = {
"Knife Normal",
"Knife 1",
"Knife 2",
"Knife 3"

}

new szKnife

public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /vip" , "CmdVip")

register_event( "CurWeapon", "FwdCurWeapon", "be", "1=1" );
register_event( "HLTV", "FwdRoundStart", "a", "1=0", "2=0" );

}

public plugin_precache() {
for(new i = 0; i <= sizeof( szKnifes ); i++)
precache_model(szKnifes[ i ])
}

public FwdCurWeapon( id ) {
if(!is_user_alive( id ) || !is_user_connected( id ) )
return PLUGIN_HANDLED

new WeaponID = read_data( 2 )

if(WeaponID == CSW_KNIFE) 
set_pev( id, pev_viewmodel2, szKnifes[ szKnife ] );

return PLUGIN_CONTINUE

}

public FwdRoundStart() {
new iPlayers[32], tNum, TempId
get_players(iPlayers, tNum)

for(new i = 0; i <= tNum; i++) {
TempId = iPlayers[ i ]

if(get_user_flags( TempId ) & ADMIN_RESERVATION) {
give_item(TempId, "weapon_hegrenade")
give_item(TempId, "weapon_flashbang")
give_item(TempId, "item_kevlar")


}
}
}

public CmdVip( id ) {
new szMenu = menu_create("\yEscolha sua Faca:" , "MenuVIPHandler")

new szNum[ 128 ]

for(new i = 0; i <= sizeof( szOptions ); i++ ) {
num_to_str( i + 1, szNum, 127 )
menu_additem( szMenu, szOptions[ i ], szNum, 0 )
}

menu_display( id, szMenu );

}



public MenuVIPHandler( id, szMenu, iItem ) {
if( iItem == MENU_EXIT ) 
return PLUGIN_HANDLED; 

new szData[ 6 ], szName[ 64 ];
new iAccess, iCallBack;
menu_item_getinfo( szMenu, iItem, iAccess, szData,5, szName, 63, iCallBack );

new Key = str_to_num( szData );

szKnife = Key

new WeaponID = get_user_weapon( id )

if(WeaponID == CSW_KNIFE) 
set_pev( id, pev_viewmodel2, szKnifes[ Key ] );

menu_destroy( szMenu );
return PLUGIN_HANDLED;
}