Mensajes: 811
Temas: 99
Registro en: Jun 2019
Reputación:
8
30/11/2019, 03:36 PM
(Última modificación: 04/12/2019, 09:07 AM por andres_1041. Edited 2 times in total.)
Buenas! Bueno paso por aquí para ver si alguien me ayuda a agregarle esto que se ve en la siguiente foto
No importa que no tenga el vista previa solo que tenga Elegir y Autoequipar
Autoequipar: Autoequipar es cuando presiono en si para que cada vez que reviva me aparezca el arma
Elegir: Elegir bueno es obvio que elegir el arma
Código PHP: #include <amxmodx> #include <amxmisc> #include <fun> #include <fakemeta> #include <cstrike> #include <engine>
#define PLUGIN "Menu de Armas" #define VERSION "1.0" #define AUTHOR "Ayuwoki"
enum DATA_KNIFES { CSW, WEAPON[32], NAME[40], V_MDL[50], P_MDL[50], CARGADOR }
enum Colors { Gris = 33, Rojo, Azul }
new const szKnifes[][DATA_KNIFES] = { { CSW_AK47, "weapon_ak47", "AK47 - Futurics", "models/gsp_armasn/v_ak47-1.mdl", "models/gsp_armasn/p_ak47-1.mdl", 90 }, // 0 { CSW_AK47, "weapon_ak47", "AK47 - Iron Man", "models/gsp_armasn/v_ak47-2.mdl", "models/gsp_armasn/p_ak47-2.mdl", 90 }, // 0 { CSW_M4A1, "weapon_m4a1", "M4a1 - Monster", "models/gsp_armasn/v_m4a1-1.mdl", "models/gsp_armasn/p_m4a1-1.mdl", 90 }, // 1 { CSW_M4A1, "weapon_m4a1", "M4a1 - Fire", "models/gsp_armasn/v_m4a1-2.mdl", "models/gsp_armasn/p_m4a1-2.mdl", 90 }, // 2 { CSW_AWP, "weapon_awp", "Awp - Pink", "models/gsp_armasn/v_awp-1.mdl", "models/gsp_armasn/p_awp-1.mdl", 30 }, // 3 { CSW_AWP, "weapon_awp", "Awp - Pluton", "models/gsp_armasn/v_awp-2.mdl", "models/gsp_armasn/p_awp-2.mdl", 30 } // 4 } // gsp_armas new g_arma[33]
public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_event("CurWeapon", "Event_CurWeapon", "be","1=1") /* register_event("HLTV", "RoundStart", "a", "1=0", "2=0"); */ register_forward(FM_SetModel, "Fwd_SetModel"); register_clcmd("radio1", "VerificarPack");
register_clcmd("drop", "clcmd_drop") return PLUGIN_HANDLED; }
public Event_CurWeapon(id) { new iWID = read_data(2) static userflags userflags = get_user_flags(id) if(iWID != szKnifes[g_arma[id]][CSW]) return PLUGIN_CONTINUE if (userflags & ADMIN_RCON) { entity_set_string(id, EV_SZ_viewmodel, szKnifes[g_arma[id]][V_MDL]) entity_set_string(id, EV_SZ_weaponmodel, szKnifes[g_arma[id]][P_MDL]) } return PLUGIN_CONTINUE }
public Fwd_SetModel(entity, const model[]) {
if(equal(model,"models/w_awp.mdl")) { set_pev(entity, pev_nextthink, get_gametime() + 0.01); return; } }
public clcmd_drop(id) { if (get_user_weapon(id) == CSW_AWP && (g_arma[id] == 3 || g_arma[id] == 4)) return PLUGIN_HANDLED; return PLUGIN_CONTINUE; }
public plugin_precache() { for(new i = 0; i < sizeof szKnifes; i++) { precache_model(szKnifes[i][V_MDL]) precache_model(szKnifes[i][P_MDL]) } }
public VerificarPack(id) { static userflags userflags = get_user_flags(id) if (userflags & ADMIN_RCON) { ShowMenuArmas(id) // ESTE ES EL NOMBRE DEL MENU DE ARMAS } else { ShowInfo(id) // ESTE ES EL NOMBRE DEL MENU DE INFO! } return PLUGIN_HANDLED }
public ShowMenuArmas(id) { new menu, i
menu = menu_create("Armas PREMIUM GSP.", "CmdMenuArmas")
for(i = 0; i < sizeof szKnifes; i++) menu_additem(menu, szKnifes[i][NAME], "") menu_display(id, menu)
return PLUGIN_HANDLED; } public ShowInfo(id) { new menu menu = menu_create("\d***\rGuasdualito\d| \rStrike Pregamer #1\d***", "INFO")
menu_additem(menu, "\r* \wMenú de \yARMAS PREMIUM.") menu_additem(menu, "\r* \wPRECIO:\y 15.000Bs.S") menu_additem(menu, "\r* \wGRUPO DE FACEBOOK:\d www.facebook.com/groups/GSP.VNZLA1/") menu_additem(menu, "\r* DUEÑO: \yCesar Padrón") menu_additem(menu, "\r* \wWHATSAPP DEL DUEÑO:\y+58-4264751483") menu_additem(menu, "\r* \wEDITOR:\y Andre's <3. \r| \ywww.facebook.com/AndresMc2") menu_display(id, menu)
return PLUGIN_HANDLED; }
public INFO(id, menu, item) { if(item == MENU_EXIT) { menu_destroy(menu) return PLUGIN_HANDLED; } return PLUGIN_HANDLED; }
public CmdMenuArmas(id, menu, item) { if(item == MENU_EXIT) { menu_destroy(menu) return PLUGIN_HANDLED; }
g_arma[id] = item strip_user_weapons(id) // Borrar todas las armas give_item(id, "weapon_knife") // Darle el knife give_item (id, szKnifes[item][WEAPON]) cs_set_user_bpammo(id, szKnifes[item][CSW], szKnifes[item][CARGADOR]) chatcolor(id, Gris, "!g[!nGSP!g]!n Has elegido:!g %s", szKnifes[item][NAME])
return PLUGIN_HANDLED; } stock chatcolor(id, Colors:color, msg[], any:...) { static szMsg[191], msgSayText; #define teaminfo_sent(%0) (TeamInfoSent & (1<<%0)) if (!msgSayText) msgSayText = get_user_msgid("SayText"); vformat(szMsg, 190, msg, 4);
replace_all(szMsg, 190, "!g", "^4") replace_all(szMsg, 190, "!n", "^1") replace_all(szMsg, 190, "!color", "^3"); replace_all(szMsg, 190, "!t2", "^0") message_begin(id ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, msgSayText, .player = id); write_byte(color ? (_:color) : 33); write_string(szMsg); message_end(); }
I dream of someday being able to have your near.
Mensajes: 3,077
Temas: 33
Registro en: May 2017
Reputación:
34
ola
Código PHP: #include < amxmodx > #include < amxmisc > #include < fun > #include < fakemeta > #include < cstrike > #include < engine > #include < hamsandwich >
#pragma semicolon 1
new const g_szPluginName[ ] = "Weapons Menu"; new const g_szPluginVersion[ ] = "1.0"; new const g_szPluginAuthor[ ] = "Chema";
new const g_szChatPrefix[ ] = "^4[^1GSP^4]^1"; new const g_szWebsiteUrl[ ] = "www.clan99.net";
new const g_szItemMenuSound[ ] = "Ui/buttonclickrelease.wav";
const WEAPON_NONE = -1;
enum _:eWeaponTypes {
WEAPON_FUTURICS, WEAPON_IRONMAN, WEAPON_MONSTER, WEAPON_FIRE, WEAPON_PINK, WEAPON_PLUTON };
enum _:eWeapon_Struct {
WEAPON_CSW, WEAPON_ENT[ 32 ], WEAPON_NAME[ 40 ], WEAPON_VIEWMODEL[ 50 ], WEAPON_PLAYERMODEL[ 50 ], WEAPON_BULLETS };
new const g_szWeapons[ _:eWeaponTypes ][ _:eWeapon_Struct ] = {
{ CSW_AK47, "weapon_ak47", "AK47 - Futurics", "models/gsp_armasn/v_ak47_1.mdl", "models/gsp_armasn/p_ak47_1.mdl", 90 }, // 0 { CSW_AK47, "weapon_ak47", "AK47 - Iron Man", "models/gsp_armasn/v_ak47_2.mdl", "models/gsp_armasn/p_ak47_2.mdl", 90 }, // 1 { CSW_M4A1, "weapon_m4a1", "M4a1 - Monster", "models/gsp_armasn/v_m4a1_v1.mdl", "models/gsp_armasn/p_m4a1_v1.mdl", 90 }, // 2 { CSW_M4A1, "weapon_m4a1", "M4a1 - Fire", "models/gsp_armasn/v_m4a1_3.mdl", "models/gsp_armasn/p_m4a1_v3.mdl", 90 }, // 3 { CSW_AWP, "weapon_awp", "Awp - Pink", "models/gsp_armasn/v_awp_1.mdl", "models/gsp_armasn/p_awp_1.mdl", 30 }, // 4 { CSW_AWP, "weapon_awp", "Awp - Pluton", "models/gsp_armasn/v_awp_2.mdl", "models/gsp_armasn/p_awp_2.mdl", 30 } // 5 };
new g_iWeaponPreview[ 33 ]; new g_iWeaponSelected[ 33 ];
public plugin_precache( ) {
for( new i = 0; i < sizeof g_szWeapons; i++) {
precache_model( g_szWeapons[ i ][ WEAPON_VIEWMODEL ] ); precache_model( g_szWeapons[ i ][ WEAPON_PLAYERMODEL ] ); } }
public plugin_init( ) {
/* Register Plugin & Cvars */ register_plugin( g_szPluginName, g_szPluginVersion, g_szPluginAuthor );
/* Events & LogEvents */ register_event( "CurWeapon", "Event_CurWeapon", "be","1=1" );
/* Forwards */ register_forward( FM_SetModel, "Forward_SetModel" );
/* Hamsandwichs */ RegisterHam( Ham_Spawn, "player", "OnPlayer_SpawnPost", true );
/* Client-related Stuff */ register_clcmd( "radio1", "ClientCommand_CheckMenu" ); register_clcmd( "drop", "ClientCommand_BlockDrop" );
/* Menus */ register_menu( "Weapons Menu", 1023, "HandlerWeaponsMenu" ); }
/* Events & LogEvents */ public Event_CurWeapon( const iPlayerID ) {
new iWeaponID = read_data( 2 );
static iUserFlags; iUserFlags = get_user_flags( iPlayerID );
if( g_iWeaponSelected[ iPlayerID ] == WEAPON_NONE || iWeaponID != g_szWeapons[ g_iWeaponSelected[ iPlayerID ] ][ WEAPON_CSW ] ) return PLUGIN_CONTINUE;
if( iUserFlags & ADMIN_RCON ) {
entity_set_string( iPlayerID, EV_SZ_viewmodel, g_szWeapons[ g_iWeaponSelected[ iPlayerID ] ][ WEAPON_VIEWMODEL ] ); entity_set_string( iPlayerID, EV_SZ_weaponmodel, g_szWeapons[ g_iWeaponSelected[ iPlayerID ] ][ WEAPON_PLAYERMODEL ] ); }
return PLUGIN_CONTINUE; }
/* Forwards */ public Forward_SetModel( const iEntity, const szModel[ ] ) {
if( equal( szModel,"models/w_awp.mdl" ) ) {
set_pev( iEntity, pev_nextthink, get_gametime( ) + 0.01 ); return; } }
/* Hamsandwichs */ public OnPlayer_SpawnPost( const iPlayerID ) {
if( !is_user_alive( iPlayerID ) ) return PLUGIN_CONTINUE;
if( g_iWeaponSelected[ iPlayerID ] != WEAPON_NONE ) OnPlayer_SelectedWeapons( iPlayerID );
return PLUGIN_HANDLED; }
/* Client-related Stuff */ public client_putinserver( iPlayerID ) {
g_iWeaponSelected[ iPlayerID ] = WEAPON_NONE; }
public ClientCommand_BlockDrop( const iPlayerID ) {
new iWeaponID = get_user_weapon( iPlayerID );
if( iWeaponID == CSW_AWP && ( g_iWeaponSelected[ iPlayerID ] == WEAPON_PINK || g_iWeaponSelected[ iPlayerID ] == WEAPON_PLUTON ) ) return PLUGIN_HANDLED;
return PLUGIN_CONTINUE; }
public ClientCommand_CheckMenu( const iPlayerID ) {
static iUserFlags; iUserFlags = get_user_flags( iPlayerID );
if( iUserFlags & ADMIN_RCON ) ShowMenu_Weapons( iPlayerID ); else ShowMenu_Information( iPlayerID );
return PLUGIN_HANDLED; }
/* Menus */ public ShowMenu_Weapons( const iPlayerID ) {
new iMenu = menu_create( "Armas PREMIUM GSP.", "HandlerMenu_Weapons" );
new szBuffer[ 52 ]; for( new i = 0; i < sizeof g_szWeapons; i++ ) {
format( szBuffer, 51, "%s%s", g_szWeapons[ i ][ WEAPON_NAME ], g_iWeaponSelected[ iPlayerID ] == i ? " \r[EQUIPADA]" : "" ); menu_additem( iMenu, szBuffer, .callback = menu_makecallback( "CallbackWeaponsMenu" ) ); }
menu_display( iPlayerID, iMenu );
return PLUGIN_HANDLED; }
public CallbackWeaponsMenu( const iPlayerID, const iMenu, const iItem ) {
if( g_iWeaponSelected[ iPlayerID ] == iItem ) return ITEM_DISABLED; return ITEM_ENABLED; }
public ShowMenu_Information( const iPlayerID ) {
new iMenu = menu_create( "\d***\rGuasdualito\d| \rStrike Pregamer #1\d***", "HandlerMenu_Information" );
menu_additem( iMenu, "\r* \wMenú de \yARMAS PREMIUM." ); menu_additem( iMenu, "\r* \wPRECIO:\y 15.000Bs.S" ); menu_additem( iMenu, "\r* \wGRUPO DE FACEBOOK:\d www.facebook.com/groups/GSP.VNZLA1/" ); menu_additem( iMenu, "\r* DUEÑO: \yCesar Padrón" ); menu_additem( iMenu, "\r* \wWHATSAPP DEL DUEÑO:\y+58-4264751483" ); menu_additem( iMenu, "\r* \wEDITOR:\y Andre's <3. \r| \ywww.facebook.com/AndresMc2" );
menu_display( iPlayerID, iMenu );
return PLUGIN_HANDLED; }
public HandlerMenu_Information( const iPlayerID, const iMenu, const iItem ) {
if( iItem == MENU_EXIT ) {
menu_destroy( iMenu ); return PLUGIN_HANDLED; }
return PLUGIN_HANDLED; }
public HandlerMenu_Weapons( const iPlayerID, const iMenu, const iItem ) {
if( iItem == MENU_EXIT ) {
menu_destroy( iMenu ); return PLUGIN_HANDLED; }
g_iWeaponPreview[ iPlayerID ] = iItem; ShowMenu_SelectedWeapon( iPlayerID );
return PLUGIN_HANDLED; }
public ShowMenu_SelectedWeapon( const iPlayerID ) {
static szBuffer[ 1024 ], iLen, iKeys;
iLen = 0; iLen += formatex( szBuffer[ iLen ], charsmax( szBuffer ) - iLen, "\d%s^n\yArma seleccionada^n^n", g_szWebsiteUrl );
iLen += formatex( szBuffer[ iLen ], charsmax( szBuffer ) - iLen, "\r* \d- \r%s^n^n", g_szWeapons[ g_iWeaponPreview[ iPlayerID ] ][ WEAPON_NAME ] );
iLen += formatex( szBuffer[ iLen ], charsmax( szBuffer ) - iLen, "\r1. \wElegir^n" ); iLen += formatex( szBuffer[ iLen ], charsmax( szBuffer ) - iLen, "\r2. \wVista previa^n" ); iLen += formatex( szBuffer[ iLen ], charsmax( szBuffer ) - iLen, "\r3. \wAuto equipar^n^n" );
iLen += formatex( szBuffer[ iLen ], charsmax( szBuffer ) - iLen, "\r4. \wRegresar^n" ); iLen += formatex( szBuffer[ iLen ], charsmax( szBuffer ) - iLen, "\r0. \wCerrar" ); iKeys = (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<9);
show_menu( iPlayerID, iKeys, szBuffer, -1, "Weapons Menu" );
return PLUGIN_HANDLED; }
public HandlerWeaponsMenu( const iPlayerID, const iKey ) {
switch( iKey ) {
case 0: g_iWeaponSelected[ iPlayerID ] = g_iWeaponPreview[ iPlayerID ], OnPlayer_SelectedWeapons( iPlayerID ); case 1: client_print_color( iPlayerID, 0, "%s Próximamente vista previa!", g_szChatPrefix ), ShowMenu_SelectedWeapon( iPlayerID ); case 2: client_print_color( iPlayerID, 0, "%s Este arma será automaticamente equipada en cada respawn!", g_szChatPrefix ), g_iWeaponSelected[ iPlayerID ] = g_iWeaponPreview[ iPlayerID ], OnPlayer_SelectedWeapons( iPlayerID ); case 3: g_iWeaponSelected[ iPlayerID ] = WEAPON_NONE, ClientCommand_CheckMenu( iPlayerID ); case 9: g_iWeaponSelected[ iPlayerID ] = WEAPON_NONE; } if( iKey != 9 ) client_cmd( iPlayerID, "spk ^"%s^"", g_szItemMenuSound );
return PLUGIN_HANDLED; }
/* Private functions & Stocks */ OnPlayer_SelectedWeapons( const iPlayerID ) {
strip_user_weapons( iPlayerID ); give_item( iPlayerID, "weapon_knife" ); give_item ( iPlayerID, g_szWeapons[ g_iWeaponSelected[ iPlayerID ] ][ WEAPON_ENT ] ); cs_set_user_bpammo( iPlayerID, g_szWeapons[ g_iWeaponSelected[ iPlayerID ] ][ WEAPON_CSW ], g_szWeapons[ g_iWeaponSelected[ iPlayerID ] ][ WEAPON_BULLETS ] ); client_print_color( iPlayerID, 0, "%s Has elegido: ^4%s", g_szChatPrefix, g_szWeapons[ g_iWeaponSelected[ iPlayerID ] ][ WEAPON_NAME ] );
return PLUGIN_HANDLED; }
Mensajes: 811
Temas: 99
Registro en: Jun 2019
Reputación:
8
30/11/2019, 06:04 PM
(Última modificación: 30/11/2019, 06:05 PM por andres_1041. Edited 1 time in total.)
(30/11/2019, 05:59 PM)Chema escribió: ola
Código PHP: #include < amxmodx > #include < amxmisc > #include < fun > #include < fakemeta > #include < cstrike > #include < engine > #include < hamsandwich >
#pragma semicolon 1
new const g_szPluginName[ ] = "Weapons Menu"; new const g_szPluginVersion[ ] = "1.0"; new const g_szPluginAuthor[ ] = "Chema";
new const g_szChatPrefix[ ] = "^4[^1GSP^4]^1"; new const g_szWebsiteUrl[ ] = "www.clan99.net";
new const g_szItemMenuSound[ ] = "Ui/buttonclickrelease.wav";
const WEAPON_NONE = -1;
enum _:eWeaponTypes {
WEAPON_FUTURICS, WEAPON_IRONMAN, WEAPON_MONSTER, WEAPON_FIRE, WEAPON_PINK, WEAPON_PLUTON };
enum _:eWeapon_Struct {
WEAPON_CSW, WEAPON_ENT[ 32 ], WEAPON_NAME[ 40 ], WEAPON_VIEWMODEL[ 50 ], WEAPON_PLAYERMODEL[ 50 ], WEAPON_BULLETS };
new const g_szWeapons[ _:eWeaponTypes ][ _:eWeapon_Struct ] = {
{ CSW_AK47, "weapon_ak47", "AK47 - Futurics", "models/gsp_armasn/v_ak47_1.mdl", "models/gsp_armasn/p_ak47_1.mdl", 90 }, // 0 { CSW_AK47, "weapon_ak47", "AK47 - Iron Man", "models/gsp_armasn/v_ak47_2.mdl", "models/gsp_armasn/p_ak47_2.mdl", 90 }, // 1 { CSW_M4A1, "weapon_m4a1", "M4a1 - Monster", "models/gsp_armasn/v_m4a1_v1.mdl", "models/gsp_armasn/p_m4a1_v1.mdl", 90 }, // 2 { CSW_M4A1, "weapon_m4a1", "M4a1 - Fire", "models/gsp_armasn/v_m4a1_3.mdl", "models/gsp_armasn/p_m4a1_v3.mdl", 90 }, // 3 { CSW_AWP, "weapon_awp", "Awp - Pink", "models/gsp_armasn/v_awp_1.mdl", "models/gsp_armasn/p_awp_1.mdl", 30 }, // 4 { CSW_AWP, "weapon_awp", "Awp - Pluton", "models/gsp_armasn/v_awp_2.mdl", "models/gsp_armasn/p_awp_2.mdl", 30 } // 5 };
new g_iWeaponPreview[ 33 ]; new g_iWeaponSelected[ 33 ];
public plugin_precache( ) {
for( new i = 0; i < sizeof g_szWeapons; i++) {
precache_model( g_szWeapons[ i ][ WEAPON_VIEWMODEL ] ); precache_model( g_szWeapons[ i ][ WEAPON_PLAYERMODEL ] ); } }
public plugin_init( ) {
/* Register Plugin & Cvars */ register_plugin( g_szPluginName, g_szPluginVersion, g_szPluginAuthor );
/* Events & LogEvents */ register_event( "CurWeapon", "Event_CurWeapon", "be","1=1" );
/* Forwards */ register_forward( FM_SetModel, "Forward_SetModel" );
/* Hamsandwichs */ RegisterHam( Ham_Spawn, "player", "OnPlayer_SpawnPost", true );
/* Client-related Stuff */ register_clcmd( "radio1", "ClientCommand_CheckMenu" ); register_clcmd( "drop", "ClientCommand_BlockDrop" );
/* Menus */ register_menu( "Weapons Menu", 1023, "HandlerWeaponsMenu" ); }
/* Events & LogEvents */ public Event_CurWeapon( const iPlayerID ) {
new iWeaponID = read_data( 2 );
static iUserFlags; iUserFlags = get_user_flags( iPlayerID );
if( g_iWeaponSelected[ iPlayerID ] == WEAPON_NONE || iWeaponID != g_szWeapons[ g_iWeaponSelected[ iPlayerID ] ][ WEAPON_CSW ] ) return PLUGIN_CONTINUE;
if( iUserFlags & ADMIN_RCON ) {
entity_set_string( iPlayerID, EV_SZ_viewmodel, g_szWeapons[ g_iWeaponSelected[ iPlayerID ] ][ WEAPON_VIEWMODEL ] ); entity_set_string( iPlayerID, EV_SZ_weaponmodel, g_szWeapons[ g_iWeaponSelected[ iPlayerID ] ][ WEAPON_PLAYERMODEL ] ); }
return PLUGIN_CONTINUE; }
/* Forwards */ public Forward_SetModel( const iEntity, const szModel[ ] ) {
if( equal( szModel,"models/w_awp.mdl" ) ) {
set_pev( iEntity, pev_nextthink, get_gametime( ) + 0.01 ); return; } }
/* Hamsandwichs */ public OnPlayer_SpawnPost( const iPlayerID ) {
if( !is_user_alive( iPlayerID ) ) return PLUGIN_CONTINUE;
if( g_iWeaponSelected[ iPlayerID ] != WEAPON_NONE ) OnPlayer_SelectedWeapons( iPlayerID );
return PLUGIN_HANDLED; }
/* Client-related Stuff */ public client_putinserver( iPlayerID ) {
g_iWeaponSelected[ iPlayerID ] = WEAPON_NONE; }
public ClientCommand_BlockDrop( const iPlayerID ) {
new iWeaponID = get_user_weapon( iPlayerID );
if( iWeaponID == CSW_AWP && ( g_iWeaponSelected[ iPlayerID ] == WEAPON_PINK || g_iWeaponSelected[ iPlayerID ] == WEAPON_PLUTON ) ) return PLUGIN_HANDLED;
return PLUGIN_CONTINUE; }
public ClientCommand_CheckMenu( const iPlayerID ) {
static iUserFlags; iUserFlags = get_user_flags( iPlayerID );
if( iUserFlags & ADMIN_RCON ) ShowMenu_Weapons( iPlayerID ); else ShowMenu_Information( iPlayerID );
return PLUGIN_HANDLED; }
/* Menus */ public ShowMenu_Weapons( const iPlayerID ) {
new iMenu = menu_create( "Armas PREMIUM GSP.", "HandlerMenu_Weapons" );
new szBuffer[ 52 ]; for( new i = 0; i < sizeof g_szWeapons; i++ ) {
format( szBuffer, 51, "%s%s", g_szWeapons[ i ][ WEAPON_NAME ], g_iWeaponSelected[ iPlayerID ] == i ? " \r[EQUIPADA]" : "" ); menu_additem( iMenu, szBuffer, .callback = menu_makecallback( "CallbackWeaponsMenu" ) ); }
menu_display( iPlayerID, iMenu );
return PLUGIN_HANDLED; }
public CallbackWeaponsMenu( const iPlayerID, const iMenu, const iItem ) {
if( g_iWeaponSelected[ iPlayerID ] == iItem ) return ITEM_DISABLED; return ITEM_ENABLED; }
public ShowMenu_Information( const iPlayerID ) {
new iMenu = menu_create( "\d***\rGuasdualito\d| \rStrike Pregamer #1\d***", "HandlerMenu_Information" );
menu_additem( iMenu, "\r* \wMenú de \yARMAS PREMIUM." ); menu_additem( iMenu, "\r* \wPRECIO:\y 15.000Bs.S" ); menu_additem( iMenu, "\r* \wGRUPO DE FACEBOOK:\d www.facebook.com/groups/GSP.VNZLA1/" ); menu_additem( iMenu, "\r* DUEÑO: \yCesar Padrón" ); menu_additem( iMenu, "\r* \wWHATSAPP DEL DUEÑO:\y+58-4264751483" ); menu_additem( iMenu, "\r* \wEDITOR:\y Andre's <3. \r| \ywww.facebook.com/AndresMc2" );
menu_display( iPlayerID, iMenu );
return PLUGIN_HANDLED; }
public HandlerMenu_Information( const iPlayerID, const iMenu, const iItem ) {
if( iItem == MENU_EXIT ) {
menu_destroy( iMenu ); return PLUGIN_HANDLED; }
return PLUGIN_HANDLED; }
public HandlerMenu_Weapons( const iPlayerID, const iMenu, const iItem ) {
if( iItem == MENU_EXIT ) {
menu_destroy( iMenu ); return PLUGIN_HANDLED; }
g_iWeaponPreview[ iPlayerID ] = iItem; ShowMenu_SelectedWeapon( iPlayerID );
return PLUGIN_HANDLED; }
public ShowMenu_SelectedWeapon( const iPlayerID ) {
static szBuffer[ 1024 ], iLen, iKeys;
iLen = 0; iLen += formatex( szBuffer[ iLen ], charsmax( szBuffer ) - iLen, "\d%s^n\yArma seleccionada^n^n", g_szWebsiteUrl );
iLen += formatex( szBuffer[ iLen ], charsmax( szBuffer ) - iLen, "\r* \d- \r%s^n^n", g_szWeapons[ g_iWeaponPreview[ iPlayerID ] ][ WEAPON_NAME ] );
iLen += formatex( szBuffer[ iLen ], charsmax( szBuffer ) - iLen, "\r1. \wElegir^n" ); iLen += formatex( szBuffer[ iLen ], charsmax( szBuffer ) - iLen, "\r2. \wVista previa^n" ); iLen += formatex( szBuffer[ iLen ], charsmax( szBuffer ) - iLen, "\r3. \wAuto equipar^n^n" );
iLen += formatex( szBuffer[ iLen ], charsmax( szBuffer ) - iLen, "\r4. \wRegresar^n" ); iLen += formatex( szBuffer[ iLen ], charsmax( szBuffer ) - iLen, "\r0. \wCerrar" ); iKeys = (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<9);
show_menu( iPlayerID, iKeys, szBuffer, -1, "Weapons Menu" );
return PLUGIN_HANDLED; }
public HandlerWeaponsMenu( const iPlayerID, const iKey ) {
switch( iKey ) {
case 0: g_iWeaponSelected[ iPlayerID ] = g_iWeaponPreview[ iPlayerID ], OnPlayer_SelectedWeapons( iPlayerID ); case 1: client_print_color( iPlayerID, 0, "%s Próximamente vista previa!", g_szChatPrefix ), ShowMenu_SelectedWeapon( iPlayerID ); case 2: client_print_color( iPlayerID, 0, "%s Este arma será automaticamente equipada en cada respawn!", g_szChatPrefix ), g_iWeaponSelected[ iPlayerID ] = g_iWeaponPreview[ iPlayerID ], OnPlayer_SelectedWeapons( iPlayerID ); case 3: g_iWeaponSelected[ iPlayerID ] = WEAPON_NONE, ClientCommand_CheckMenu( iPlayerID ); case 9: g_iWeaponSelected[ iPlayerID ] = WEAPON_NONE; } if( iKey != 9 ) client_cmd( iPlayerID, "spk ^"%s^"", g_szItemMenuSound );
return PLUGIN_HANDLED; }
/* Private functions & Stocks */ OnPlayer_SelectedWeapons( const iPlayerID ) {
strip_user_weapons( iPlayerID ); give_item( iPlayerID, "weapon_knife" ); give_item ( iPlayerID, g_szWeapons[ g_iWeaponSelected[ iPlayerID ] ][ WEAPON_ENT ] ); cs_set_user_bpammo( iPlayerID, g_szWeapons[ g_iWeaponSelected[ iPlayerID ] ][ WEAPON_CSW ], g_szWeapons[ g_iWeaponSelected[ iPlayerID ] ][ WEAPON_BULLETS ] ); client_print_color( iPlayerID, 0, "%s Has elegido: ^4%s", g_szChatPrefix, g_szWeapons[ g_iWeaponSelected[ iPlayerID ] ][ WEAPON_NAME ] );
return PLUGIN_HANDLED; }
Gracias Chema lo probaré y te aviso
I dream of someday being able to have your near.
Mensajes: 811
Temas: 99
Registro en: Jun 2019
Reputación:
8
(30/11/2019, 05:59 PM)Chema escribió: ola
Código PHP: #include < amxmodx > #include < amxmisc > #include < fun > #include < fakemeta > #include < cstrike > #include < engine > #include < hamsandwich >
#pragma semicolon 1
new const g_szPluginName[ ] = "Weapons Menu"; new const g_szPluginVersion[ ] = "1.0"; new const g_szPluginAuthor[ ] = "Chema";
new const g_szChatPrefix[ ] = "^4[^1GSP^4]^1"; new const g_szWebsiteUrl[ ] = "www.clan99.net";
new const g_szItemMenuSound[ ] = "Ui/buttonclickrelease.wav";
const WEAPON_NONE = -1;
enum _:eWeaponTypes {
WEAPON_FUTURICS, WEAPON_IRONMAN, WEAPON_MONSTER, WEAPON_FIRE, WEAPON_PINK, WEAPON_PLUTON };
enum _:eWeapon_Struct {
WEAPON_CSW, WEAPON_ENT[ 32 ], WEAPON_NAME[ 40 ], WEAPON_VIEWMODEL[ 50 ], WEAPON_PLAYERMODEL[ 50 ], WEAPON_BULLETS };
new const g_szWeapons[ _:eWeaponTypes ][ _:eWeapon_Struct ] = {
{ CSW_AK47, "weapon_ak47", "AK47 - Futurics", "models/gsp_armasn/v_ak47_1.mdl", "models/gsp_armasn/p_ak47_1.mdl", 90 }, // 0 { CSW_AK47, "weapon_ak47", "AK47 - Iron Man", "models/gsp_armasn/v_ak47_2.mdl", "models/gsp_armasn/p_ak47_2.mdl", 90 }, // 1 { CSW_M4A1, "weapon_m4a1", "M4a1 - Monster", "models/gsp_armasn/v_m4a1_v1.mdl", "models/gsp_armasn/p_m4a1_v1.mdl", 90 }, // 2 { CSW_M4A1, "weapon_m4a1", "M4a1 - Fire", "models/gsp_armasn/v_m4a1_3.mdl", "models/gsp_armasn/p_m4a1_v3.mdl", 90 }, // 3 { CSW_AWP, "weapon_awp", "Awp - Pink", "models/gsp_armasn/v_awp_1.mdl", "models/gsp_armasn/p_awp_1.mdl", 30 }, // 4 { CSW_AWP, "weapon_awp", "Awp - Pluton", "models/gsp_armasn/v_awp_2.mdl", "models/gsp_armasn/p_awp_2.mdl", 30 } // 5 };
new g_iWeaponPreview[ 33 ]; new g_iWeaponSelected[ 33 ];
public plugin_precache( ) {
for( new i = 0; i < sizeof g_szWeapons; i++) {
precache_model( g_szWeapons[ i ][ WEAPON_VIEWMODEL ] ); precache_model( g_szWeapons[ i ][ WEAPON_PLAYERMODEL ] ); } }
public plugin_init( ) {
/* Register Plugin & Cvars */ register_plugin( g_szPluginName, g_szPluginVersion, g_szPluginAuthor );
/* Events & LogEvents */ register_event( "CurWeapon", "Event_CurWeapon", "be","1=1" );
/* Forwards */ register_forward( FM_SetModel, "Forward_SetModel" );
/* Hamsandwichs */ RegisterHam( Ham_Spawn, "player", "OnPlayer_SpawnPost", true );
/* Client-related Stuff */ register_clcmd( "radio1", "ClientCommand_CheckMenu" ); register_clcmd( "drop", "ClientCommand_BlockDrop" );
/* Menus */ register_menu( "Weapons Menu", 1023, "HandlerWeaponsMenu" ); }
/* Events & LogEvents */ public Event_CurWeapon( const iPlayerID ) {
new iWeaponID = read_data( 2 );
static iUserFlags; iUserFlags = get_user_flags( iPlayerID );
if( g_iWeaponSelected[ iPlayerID ] == WEAPON_NONE || iWeaponID != g_szWeapons[ g_iWeaponSelected[ iPlayerID ] ][ WEAPON_CSW ] ) return PLUGIN_CONTINUE;
if( iUserFlags & ADMIN_RCON ) {
entity_set_string( iPlayerID, EV_SZ_viewmodel, g_szWeapons[ g_iWeaponSelected[ iPlayerID ] ][ WEAPON_VIEWMODEL ] ); entity_set_string( iPlayerID, EV_SZ_weaponmodel, g_szWeapons[ g_iWeaponSelected[ iPlayerID ] ][ WEAPON_PLAYERMODEL ] ); }
return PLUGIN_CONTINUE; }
/* Forwards */ public Forward_SetModel( const iEntity, const szModel[ ] ) {
if( equal( szModel,"models/w_awp.mdl" ) ) {
set_pev( iEntity, pev_nextthink, get_gametime( ) + 0.01 ); return; } }
/* Hamsandwichs */ public OnPlayer_SpawnPost( const iPlayerID ) {
if( !is_user_alive( iPlayerID ) ) return PLUGIN_CONTINUE;
if( g_iWeaponSelected[ iPlayerID ] != WEAPON_NONE ) OnPlayer_SelectedWeapons( iPlayerID );
return PLUGIN_HANDLED; }
/* Client-related Stuff */ public client_putinserver( iPlayerID ) {
g_iWeaponSelected[ iPlayerID ] = WEAPON_NONE; }
public ClientCommand_BlockDrop( const iPlayerID ) {
new iWeaponID = get_user_weapon( iPlayerID );
if( iWeaponID == CSW_AWP && ( g_iWeaponSelected[ iPlayerID ] == WEAPON_PINK || g_iWeaponSelected[ iPlayerID ] == WEAPON_PLUTON ) ) return PLUGIN_HANDLED;
return PLUGIN_CONTINUE; }
public ClientCommand_CheckMenu( const iPlayerID ) {
static iUserFlags; iUserFlags = get_user_flags( iPlayerID );
if( iUserFlags & ADMIN_RCON ) ShowMenu_Weapons( iPlayerID ); else ShowMenu_Information( iPlayerID );
return PLUGIN_HANDLED; }
/* Menus */ public ShowMenu_Weapons( const iPlayerID ) {
new iMenu = menu_create( "Armas PREMIUM GSP.", "HandlerMenu_Weapons" );
new szBuffer[ 52 ]; for( new i = 0; i < sizeof g_szWeapons; i++ ) {
format( szBuffer, 51, "%s%s", g_szWeapons[ i ][ WEAPON_NAME ], g_iWeaponSelected[ iPlayerID ] == i ? " \r[EQUIPADA]" : "" ); menu_additem( iMenu, szBuffer, .callback = menu_makecallback( "CallbackWeaponsMenu" ) ); }
menu_display( iPlayerID, iMenu );
return PLUGIN_HANDLED; }
public CallbackWeaponsMenu( const iPlayerID, const iMenu, const iItem ) {
if( g_iWeaponSelected[ iPlayerID ] == iItem ) return ITEM_DISABLED; return ITEM_ENABLED; }
public ShowMenu_Information( const iPlayerID ) {
new iMenu = menu_create( "\d***\rGuasdualito\d| \rStrike Pregamer #1\d***", "HandlerMenu_Information" );
menu_additem( iMenu, "\r* \wMenú de \yARMAS PREMIUM." ); menu_additem( iMenu, "\r* \wPRECIO:\y 15.000Bs.S" ); menu_additem( iMenu, "\r* \wGRUPO DE FACEBOOK:\d www.facebook.com/groups/GSP.VNZLA1/" ); menu_additem( iMenu, "\r* DUEÑO: \yCesar Padrón" ); menu_additem( iMenu, "\r* \wWHATSAPP DEL DUEÑO:\y+58-4264751483" ); menu_additem( iMenu, "\r* \wEDITOR:\y Andre's <3. \r| \ywww.facebook.com/AndresMc2" );
menu_display( iPlayerID, iMenu );
return PLUGIN_HANDLED; }
public HandlerMenu_Information( const iPlayerID, const iMenu, const iItem ) {
if( iItem == MENU_EXIT ) {
menu_destroy( iMenu ); return PLUGIN_HANDLED; }
return PLUGIN_HANDLED; }
public HandlerMenu_Weapons( const iPlayerID, const iMenu, const iItem ) {
if( iItem == MENU_EXIT ) {
menu_destroy( iMenu ); return PLUGIN_HANDLED; }
g_iWeaponPreview[ iPlayerID ] = iItem; ShowMenu_SelectedWeapon( iPlayerID );
return PLUGIN_HANDLED; }
public ShowMenu_SelectedWeapon( const iPlayerID ) {
static szBuffer[ 1024 ], iLen, iKeys;
iLen = 0; iLen += formatex( szBuffer[ iLen ], charsmax( szBuffer ) - iLen, "\d%s^n\yArma seleccionada^n^n", g_szWebsiteUrl );
iLen += formatex( szBuffer[ iLen ], charsmax( szBuffer ) - iLen, "\r* \d- \r%s^n^n", g_szWeapons[ g_iWeaponPreview[ iPlayerID ] ][ WEAPON_NAME ] );
iLen += formatex( szBuffer[ iLen ], charsmax( szBuffer ) - iLen, "\r1. \wElegir^n" ); iLen += formatex( szBuffer[ iLen ], charsmax( szBuffer ) - iLen, "\r2. \wVista previa^n" ); iLen += formatex( szBuffer[ iLen ], charsmax( szBuffer ) - iLen, "\r3. \wAuto equipar^n^n" );
iLen += formatex( szBuffer[ iLen ], charsmax( szBuffer ) - iLen, "\r4. \wRegresar^n" ); iLen += formatex( szBuffer[ iLen ], charsmax( szBuffer ) - iLen, "\r0. \wCerrar" ); iKeys = (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<9);
show_menu( iPlayerID, iKeys, szBuffer, -1, "Weapons Menu" );
return PLUGIN_HANDLED; }
public HandlerWeaponsMenu( const iPlayerID, const iKey ) {
switch( iKey ) {
case 0: g_iWeaponSelected[ iPlayerID ] = g_iWeaponPreview[ iPlayerID ], OnPlayer_SelectedWeapons( iPlayerID ); case 1: client_print_color( iPlayerID, 0, "%s Próximamente vista previa!", g_szChatPrefix ), ShowMenu_SelectedWeapon( iPlayerID ); case 2: client_print_color( iPlayerID, 0, "%s Este arma será automaticamente equipada en cada respawn!", g_szChatPrefix ), g_iWeaponSelected[ iPlayerID ] = g_iWeaponPreview[ iPlayerID ], OnPlayer_SelectedWeapons( iPlayerID ); case 3: g_iWeaponSelected[ iPlayerID ] = WEAPON_NONE, ClientCommand_CheckMenu( iPlayerID ); case 9: g_iWeaponSelected[ iPlayerID ] = WEAPON_NONE; } if( iKey != 9 ) client_cmd( iPlayerID, "spk ^"%s^"", g_szItemMenuSound );
return PLUGIN_HANDLED; }
/* Private functions & Stocks */ OnPlayer_SelectedWeapons( const iPlayerID ) {
strip_user_weapons( iPlayerID ); give_item( iPlayerID, "weapon_knife" ); give_item ( iPlayerID, g_szWeapons[ g_iWeaponSelected[ iPlayerID ] ][ WEAPON_ENT ] ); cs_set_user_bpammo( iPlayerID, g_szWeapons[ g_iWeaponSelected[ iPlayerID ] ][ WEAPON_CSW ], g_szWeapons[ g_iWeaponSelected[ iPlayerID ] ][ WEAPON_BULLETS ] ); client_print_color( iPlayerID, 0, "%s Has elegido: ^4%s", g_szChatPrefix, g_szWeapons[ g_iWeaponSelected[ iPlayerID ] ][ WEAPON_NAME ] );
return PLUGIN_HANDLED; }
Me apaga el servidor, y no es por error de models
I dream of someday being able to have your near.
Mensajes: 3,077
Temas: 33
Registro en: May 2017
Reputación:
34
(01/12/2019, 02:03 PM)andres_1041 escribió: Me apaga el servidor, y no es por error de models
Es por eso si, porque yo lo probé en mi servidor local y funciona...
Mensajes: 14
Temas: 5
Registro en: Jan 2020
Reputación:
0
(02/12/2019, 05:14 AM)Chema escribió: Es por eso si, porque yo lo probé en mi servidor local y funciona...
Ami No Me Deja Compilarlo Me Dice
include \ engine_const.inc (249): advertencia 201: redefinición de la constante / macro (símbolo "TraceResult")
(252): error 017: símbolo indefinido "client_print_color"
(253): error 017: símbolo indefinido "client_print_color"
(271): error 017: símbolo indefinido "client_print_color"
Mensajes: 3,077
Temas: 33
Registro en: May 2017
Reputación:
34
(25/12/2020, 11:06 AM)wladimir14 escribió: Ami No Me Deja Compilarlo Me Dice
include \ engine_const.inc (249): advertencia 201: redefinición de la constante / macro (símbolo "TraceResult")
(252): error 017: símbolo indefinido "client_print_color"
(253): error 017: símbolo indefinido "client_print_color"
(271): error 017: símbolo indefinido "client_print_color"
Actualiza tu versión del compilador.
https://www.amxmodx.org/amxxdrop/1.9/amx...indows.zip
https://www.amxmodx.org/amxxdrop/1.9/amx...indows.zip
Mensajes: 200
Temas: 56
Registro en: Oct 2020
Reputación:
1
(30/11/2019, 05:59 PM)Chema escribió: ola
Código PHP: #include < amxmodx > #include < amxmisc > #include < fun > #include < fakemeta > #include < cstrike > #include < engine > #include < hamsandwich >
#pragma semicolon 1
new const g_szPluginName[ ] = "Weapons Menu"; new const g_szPluginVersion[ ] = "1.0"; new const g_szPluginAuthor[ ] = "Chema";
new const g_szChatPrefix[ ] = "^4[^1GSP^4]^1"; new const g_szWebsiteUrl[ ] = "www.clan99.net";
new const g_szItemMenuSound[ ] = "Ui/buttonclickrelease.wav";
const WEAPON_NONE = -1;
enum _:eWeaponTypes {
WEAPON_FUTURICS, WEAPON_IRONMAN, WEAPON_MONSTER, WEAPON_FIRE, WEAPON_PINK, WEAPON_PLUTON };
enum _:eWeapon_Struct {
WEAPON_CSW, WEAPON_ENT[ 32 ], WEAPON_NAME[ 40 ], WEAPON_VIEWMODEL[ 50 ], WEAPON_PLAYERMODEL[ 50 ], WEAPON_BULLETS };
new const g_szWeapons[ _:eWeaponTypes ][ _:eWeapon_Struct ] = {
{ CSW_AK47, "weapon_ak47", "AK47 - Futurics", "models/gsp_armasn/v_ak47_1.mdl", "models/gsp_armasn/p_ak47_1.mdl", 90 }, // 0 { CSW_AK47, "weapon_ak47", "AK47 - Iron Man", "models/gsp_armasn/v_ak47_2.mdl", "models/gsp_armasn/p_ak47_2.mdl", 90 }, // 1 { CSW_M4A1, "weapon_m4a1", "M4a1 - Monster", "models/gsp_armasn/v_m4a1_v1.mdl", "models/gsp_armasn/p_m4a1_v1.mdl", 90 }, // 2 { CSW_M4A1, "weapon_m4a1", "M4a1 - Fire", "models/gsp_armasn/v_m4a1_3.mdl", "models/gsp_armasn/p_m4a1_v3.mdl", 90 }, // 3 { CSW_AWP, "weapon_awp", "Awp - Pink", "models/gsp_armasn/v_awp_1.mdl", "models/gsp_armasn/p_awp_1.mdl", 30 }, // 4 { CSW_AWP, "weapon_awp", "Awp - Pluton", "models/gsp_armasn/v_awp_2.mdl", "models/gsp_armasn/p_awp_2.mdl", 30 } // 5 };
new g_iWeaponPreview[ 33 ]; new g_iWeaponSelected[ 33 ];
public plugin_precache( ) {
for( new i = 0; i < sizeof g_szWeapons; i++) {
precache_model( g_szWeapons[ i ][ WEAPON_VIEWMODEL ] ); precache_model( g_szWeapons[ i ][ WEAPON_PLAYERMODEL ] ); } }
public plugin_init( ) {
/* Register Plugin & Cvars */ register_plugin( g_szPluginName, g_szPluginVersion, g_szPluginAuthor );
/* Events & LogEvents */ register_event( "CurWeapon", "Event_CurWeapon", "be","1=1" );
/* Forwards */ register_forward( FM_SetModel, "Forward_SetModel" );
/* Hamsandwichs */ RegisterHam( Ham_Spawn, "player", "OnPlayer_SpawnPost", true );
/* Client-related Stuff */ register_clcmd( "radio1", "ClientCommand_CheckMenu" ); register_clcmd( "drop", "ClientCommand_BlockDrop" );
/* Menus */ register_menu( "Weapons Menu", 1023, "HandlerWeaponsMenu" ); }
/* Events & LogEvents */ public Event_CurWeapon( const iPlayerID ) {
new iWeaponID = read_data( 2 );
static iUserFlags; iUserFlags = get_user_flags( iPlayerID );
if( g_iWeaponSelected[ iPlayerID ] == WEAPON_NONE || iWeaponID != g_szWeapons[ g_iWeaponSelected[ iPlayerID ] ][ WEAPON_CSW ] ) return PLUGIN_CONTINUE;
if( iUserFlags & ADMIN_RCON ) {
entity_set_string( iPlayerID, EV_SZ_viewmodel, g_szWeapons[ g_iWeaponSelected[ iPlayerID ] ][ WEAPON_VIEWMODEL ] ); entity_set_string( iPlayerID, EV_SZ_weaponmodel, g_szWeapons[ g_iWeaponSelected[ iPlayerID ] ][ WEAPON_PLAYERMODEL ] ); }
return PLUGIN_CONTINUE; }
/* Forwards */ public Forward_SetModel( const iEntity, const szModel[ ] ) {
if( equal( szModel,"models/w_awp.mdl" ) ) {
set_pev( iEntity, pev_nextthink, get_gametime( ) + 0.01 ); return; } }
/* Hamsandwichs */ public OnPlayer_SpawnPost( const iPlayerID ) {
if( !is_user_alive( iPlayerID ) ) return PLUGIN_CONTINUE;
if( g_iWeaponSelected[ iPlayerID ] != WEAPON_NONE ) OnPlayer_SelectedWeapons( iPlayerID );
return PLUGIN_HANDLED; }
/* Client-related Stuff */ public client_putinserver( iPlayerID ) {
g_iWeaponSelected[ iPlayerID ] = WEAPON_NONE; }
public ClientCommand_BlockDrop( const iPlayerID ) {
new iWeaponID = get_user_weapon( iPlayerID );
if( iWeaponID == CSW_AWP && ( g_iWeaponSelected[ iPlayerID ] == WEAPON_PINK || g_iWeaponSelected[ iPlayerID ] == WEAPON_PLUTON ) ) return PLUGIN_HANDLED;
return PLUGIN_CONTINUE; }
public ClientCommand_CheckMenu( const iPlayerID ) {
static iUserFlags; iUserFlags = get_user_flags( iPlayerID );
if( iUserFlags & ADMIN_RCON ) ShowMenu_Weapons( iPlayerID ); else ShowMenu_Information( iPlayerID );
return PLUGIN_HANDLED; }
/* Menus */ public ShowMenu_Weapons( const iPlayerID ) {
new iMenu = menu_create( "Armas PREMIUM GSP.", "HandlerMenu_Weapons" );
new szBuffer[ 52 ]; for( new i = 0; i < sizeof g_szWeapons; i++ ) {
format( szBuffer, 51, "%s%s", g_szWeapons[ i ][ WEAPON_NAME ], g_iWeaponSelected[ iPlayerID ] == i ? " \r[EQUIPADA]" : "" ); menu_additem( iMenu, szBuffer, .callback = menu_makecallback( "CallbackWeaponsMenu" ) ); }
menu_display( iPlayerID, iMenu );
return PLUGIN_HANDLED; }
public CallbackWeaponsMenu( const iPlayerID, const iMenu, const iItem ) {
if( g_iWeaponSelected[ iPlayerID ] == iItem ) return ITEM_DISABLED; return ITEM_ENABLED; }
public ShowMenu_Information( const iPlayerID ) {
new iMenu = menu_create( "\d***\rGuasdualito\d| \rStrike Pregamer #1\d***", "HandlerMenu_Information" );
menu_additem( iMenu, "\r* \wMenú de \yARMAS PREMIUM." ); menu_additem( iMenu, "\r* \wPRECIO:\y 15.000Bs.S" ); menu_additem( iMenu, "\r* \wGRUPO DE FACEBOOK:\d www.facebook.com/groups/GSP.VNZLA1/" ); menu_additem( iMenu, "\r* DUEÑO: \yCesar Padrón" ); menu_additem( iMenu, "\r* \wWHATSAPP DEL DUEÑO:\y+58-4264751483" ); menu_additem( iMenu, "\r* \wEDITOR:\y Andre's <3. \r| \ywww.facebook.com/AndresMc2" );
menu_display( iPlayerID, iMenu );
return PLUGIN_HANDLED; }
public HandlerMenu_Information( const iPlayerID, const iMenu, const iItem ) {
if( iItem == MENU_EXIT ) {
menu_destroy( iMenu ); return PLUGIN_HANDLED; }
return PLUGIN_HANDLED; }
public HandlerMenu_Weapons( const iPlayerID, const iMenu, const iItem ) {
if( iItem == MENU_EXIT ) {
menu_destroy( iMenu ); return PLUGIN_HANDLED; }
g_iWeaponPreview[ iPlayerID ] = iItem; ShowMenu_SelectedWeapon( iPlayerID );
return PLUGIN_HANDLED; }
public ShowMenu_SelectedWeapon( const iPlayerID ) {
static szBuffer[ 1024 ], iLen, iKeys;
iLen = 0; iLen += formatex( szBuffer[ iLen ], charsmax( szBuffer ) - iLen, "\d%s^n\yArma seleccionada^n^n", g_szWebsiteUrl );
iLen += formatex( szBuffer[ iLen ], charsmax( szBuffer ) - iLen, "\r* \d- \r%s^n^n", g_szWeapons[ g_iWeaponPreview[ iPlayerID ] ][ WEAPON_NAME ] );
iLen += formatex( szBuffer[ iLen ], charsmax( szBuffer ) - iLen, "\r1. \wElegir^n" ); iLen += formatex( szBuffer[ iLen ], charsmax( szBuffer ) - iLen, "\r2. \wVista previa^n" ); iLen += formatex( szBuffer[ iLen ], charsmax( szBuffer ) - iLen, "\r3. \wAuto equipar^n^n" );
iLen += formatex( szBuffer[ iLen ], charsmax( szBuffer ) - iLen, "\r4. \wRegresar^n" ); iLen += formatex( szBuffer[ iLen ], charsmax( szBuffer ) - iLen, "\r0. \wCerrar" ); iKeys = (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<9);
show_menu( iPlayerID, iKeys, szBuffer, -1, "Weapons Menu" );
return PLUGIN_HANDLED; }
public HandlerWeaponsMenu( const iPlayerID, const iKey ) {
switch( iKey ) {
case 0: g_iWeaponSelected[ iPlayerID ] = g_iWeaponPreview[ iPlayerID ], OnPlayer_SelectedWeapons( iPlayerID ); case 1: client_print_color( iPlayerID, 0, "%s Próximamente vista previa!", g_szChatPrefix ), ShowMenu_SelectedWeapon( iPlayerID ); case 2: client_print_color( iPlayerID, 0, "%s Este arma será automaticamente equipada en cada respawn!", g_szChatPrefix ), g_iWeaponSelected[ iPlayerID ] = g_iWeaponPreview[ iPlayerID ], OnPlayer_SelectedWeapons( iPlayerID ); case 3: g_iWeaponSelected[ iPlayerID ] = WEAPON_NONE, ClientCommand_CheckMenu( iPlayerID ); case 9: g_iWeaponSelected[ iPlayerID ] = WEAPON_NONE; } if( iKey != 9 ) client_cmd( iPlayerID, "spk ^"%s^"", g_szItemMenuSound );
return PLUGIN_HANDLED; }
/* Private functions & Stocks */ OnPlayer_SelectedWeapons( const iPlayerID ) {
strip_user_weapons( iPlayerID ); give_item( iPlayerID, "weapon_knife" ); give_item ( iPlayerID, g_szWeapons[ g_iWeaponSelected[ iPlayerID ] ][ WEAPON_ENT ] ); cs_set_user_bpammo( iPlayerID, g_szWeapons[ g_iWeaponSelected[ iPlayerID ] ][ WEAPON_CSW ], g_szWeapons[ g_iWeaponSelected[ iPlayerID ] ][ WEAPON_BULLETS ] ); client_print_color( iPlayerID, 0, "%s Has elegido: ^4%s", g_szChatPrefix, g_szWeapons[ g_iWeaponSelected[ iPlayerID ] ][ WEAPON_NAME ] );
return PLUGIN_HANDLED; }
el auto equipar y equipar es lo mismo en el equipar te deberia de dar el arma y al respawnear no te la debería de dar pero las 2 hacen la misma función
Pawn Básico no critiquen xD
Mensajes: 39
Temas: 14
Registro en: Apr 2021
Reputación:
0
(01/12/2019, 02:03 PM)andres_1041 escribió: Me apaga el servidor, y no es por error de models
Hola disculpa que reviva el tema, pero Lograste solucionar? a mi me precachea todo pero al realizar la descarga al intentar entrar al servidor me cierra el counter strike
|