Mensajes: 42
Temas: 23
Registro en: May 2019
Reputación:
0
busco plugins modelos de armas , la idea es que solo sea para los admines
si quiero dar un skins a un player de una m4 yo pueda poner su nombre y nombre de modelos
un ejemplo armascfg.ini
//agregar nombre o ID
"jose" "m4.dl" "m4_1.dl" jose
"STEAM_0:0:8217372" "m4.dl" "m4_2.dl" TOMY
Y HACI ME ENTIENDEN ?
ALGUIEN TIENE PLUGIN QUE ME LO PASE PORFAVOR
Mensajes: 400
Temas: 112
Registro en: Mar 2019
Reputación:
1
(26/07/2019, 10:04 PM)potato02 escribió: busco plugins modelos de armas , la idea es que solo sea para los admines
si quiero dar un skins a un player de una m4 yo pueda poner su nombre y nombre de modelos
un ejemplo armascfg.ini
//agregar nombre o ID
"jose" "m4.dl" "m4_1.dl" jose
"STEAM_0:0:8217372" "m4.dl" "m4_2.dl" TOMY
Y HACI ME ENTIENDEN ?
ALGUIEN TIENE PLUGIN QUE ME LO PASE PORFAVOR
Creo que esto te servira, es para dar arma a cualquier persona que este dentro del servidor alli sale todos los tipos de armas.!
Debes poner en console amx_weaponmenu
Código PHP: /* AMX Mod script. * * Weapon Menu * by Mattcook & xeroblood * * Description: Gives clients weapons via a menu. * * Command: * amx_weaponmenu * or * weaponmenu * * Example: * bind "f" "amx_weaponmenu" * * Info: Weapon Menu is a re-make of my plugin Admin Weapon which gives players in the server weapons for free. * With Weapon Menu you can give any gun to any player in the server via a menu instead of the console commands. * * Credit: * xeroblood (Thank You soo much for all the help you have given me with the menu, and the plugin in general) * F1del1ty (Thanks for the great idea of this plugin) * */
#include <amxmodx> #include <amxmisc>
// This is ONLY Required to Compile for AMX Mod X v1.0 // Comment or Remove to compile for AMX 0.9.9 #include <fun>
// Max Values for Building Menus #define MAX_PLAYERS 32 #define MAX_WEAPONS 24 #define MAX_AMMO 11 #define MAX_ITEMS 8 #define MAX_DISPLAY 8
// Menu Type Indexes #define MT_PISTOL 0 #define MT_SHOTGUN 1 #define MT_SMG 2 #define MT_RIFLE 3 #define MT_MACHINE 4 #define MT_PAMMO 5 #define MT_SAMMO 6 #define MT_EQUIP 7 #define MT_EXTRA 8
// Array Index Offsets for Pin-pointing correct weapon #define OFFSET_SHOTGUN 6 #define OFFSET_SMG 8 #define OFFSET_RIFLE 13 #define OFFSET_MACHINE 23
// Max Menu Options for Each Menu // (Machine Gun Menu is Only 1 Option, so no array needed for it) #define MO_MAX_MAIN 9 #define MO_MAX_PISTOL 6 #define MO_MAX_SHOTGUN 2 #define MO_MAX_SMG 5 #define MO_MAX_RIFLE 10 #define MO_MAX_EQUIP 8 #define MO_MAX_EXTRA 14
// Main Menu Text new g_szMainMenuTxt[MO_MAX_MAIN][] = { "Pistols", "Shotguns", "SMGs", "Rifles", "Machine Guns", "Primary Ammo", "Secondary Ammo", "Equipment", "Extras Menu" }
// Pistols Menu Text new g_szPistolMenuTxt[MO_MAX_PISTOL][] = { "USP", "Glock", "Deagle", "228 Compact", "Dual Elites", "Five-Seven" }
//Shotguns Section new g_szShotgunMenuTxt[MO_MAX_SHOTGUN][] = { "Pump Shotgun", "Auto Shotgun" }
//SMG Section new g_szSmgMenuTxt[MO_MAX_SMG][] = { "MP5", "TMP", "C90", "Mac10", "UMP" }
//Rifles Section new g_szRifleMenuTxt[MO_MAX_RIFLE][] = { "Clarion", "Krieg SG552", "AK47", "M4A1", "Bullpup", "Scout", "AWP", "CT AutoSniper", "T AutoSniper", "Galil" }
//Machine Guns Section new g_szMachineMenuTxt[] = "M249 (Para)"
//Equipment Section new g_szEquipMenuTxt[MO_MAX_EQUIP][] = { "Kevlar", "Kevlar + Helmet", "Flashbang Grenade", "HE Grenade", "Smoke Grenade", "Defusal Kit", "Nighvision Goggles", "Shield" }
//Extras Section new g_szExtraMenuTxt[MO_MAX_EXTRA][] = { "All Weapons", "M3 Set", "MP5 Navy Set", "Clarion Set", "Galil Set", "M4A1 Set", "AK47 Set", "Krieg SG552 Set", "Bullpup Set", "M249 Set", "Scout Set", "AutoSniper Set", "AWP Set", "Nades Set" }
// Names of Weapons for give_item() native new g_szWeaponList[MAX_WEAPONS][] = { "weapon_usp", "weapon_glock18", "weapon_deagle", "weapon_p228", "weapon_elite", "weapon_fiveseven", "weapon_m3", "weapon_xm1014", "weapon_mp5navy", "weapon_tmp", "weapon_p90", "weapon_mac10", "weapon_ump45", "weapon_famas", "weapon_sg552", "weapon_ak47", "weapon_m4a1", "weapon_aug", "weapon_scout", "weapon_awp", "weapon_g3sg1", "weapon_sg550", "weapon_galil", "weapon_m249" }
// Names of Equipment Items for give_item() native new g_szItemsList[MAX_ITEMS][] = { "item_kevlar", "item_assaultsuit", "weapon_flashbang", "weapon_hegrenade", "weapon_smokegrenade", "item_thighpack", "item_nvgs", "weapon_shield" }
// Names of Ammo Packs for give_item() native new g_szAmmoList[MAX_AMMO][] = { "ammo_45acp", "ammo_9mm", "ammo_50ae", "ammo_357sig", "ammo_57mm", "ammo_buckshot", "ammo_556nato", "ammo_762nato", "ammo_338magnum", "ammo_308", "ammo_556natobox" }
new g_nWeaponData[MAX_WEAPONS][2] = { { 0, 8 }, { 1, 8 }, { 2, 5 }, { 3, 6 }, { 1, 4 }, { 4, 4 }, { 5, 4 }, { 5, 4 }, { 1, 4 }, { 1, 4 }, { 4, 4 }, { 0, 6 }, { 0, 6 }, { 6, 3 }, { 6, 3 }, { 7, 3 }, { 6, 3 }, { 6, 3 }, { 7, 3 }, { 8, 3 }, { 7, 3 }, { 6, 3 }, { 9, 3 }, { 10, 7 } }
// Tracks what page in menu you're on in Multi-Page Menus (Like Rifles and Players Menu) // Multiple players may open menu at same time, so we keep an array of MAX_PLAYERS (32) // to track each individual's menu page. // Player IDs range from 1-32 but our Array ranges from 0-31 so we minus 1 from PlayerID // when we use this array. Example: g_nMenuPosition[ id - 1 ] new g_nMenuPosition[MAX_PLAYERS]
// We use this to track what menu the user is actually in so we can determine which menu // to display next. Different Menu types are: Main, Pistols, Shotguns, SMGs, Rifles, etc.. new g_nMenuType[MAX_PLAYERS]
// Tracks which option in the menu was chosen new g_nMenuOption[MAX_PLAYERS]
// The following are used for the Players Menu to Track Player Chosen new g_nMenuPlayers[MAX_PLAYERS][MAX_PLAYERS] new g_nMenuPlayersNum[MAX_PLAYERS]
public plugin_init() { register_plugin( "Weapon Menu", "1.0", "Mattcook & xeroblood" )
register_clcmd( "amx_weaponmenu", "ShowWeaponMenu", ADMIN_MENU, "Shows The Weapon Menu" ) register_clcmd( "weaponmenu", "ShowWeaponMenu", ADMIN_MENU, "Shows The Weapon Menu" )
register_cvar( "sv_weaponmenu_smoke", "1" ) // Give Smoke Nades? (1 = Yes, 0 = No) register_cvar( "sv_weaponmenu_state", "1" ) // Weapon Menu Return State // 0 = Exit Menu After Give-Item // 1 = Return to Players Menu // 2 = Return to Weapons Menu
register_menucmd( register_menuid("Weapons Menu:"), 1023, "MainMenuCmd" ) register_menucmd( register_menuid("Pistols Menu:"), 1023, "RegularMenuCmd" ) register_menucmd( register_menuid("Shotguns Menu:"), 1023, "RegularMenuCmd" ) register_menucmd( register_menuid("SMGs Menu:"), 1023, "RegularMenuCmd" ) register_menucmd( register_menuid("Rifles Menu:"), 1023, "RifleMenuCmd" ) register_menucmd( register_menuid("Machine Guns Menu:"), 1023, "RegularMenuCmd" ) register_menucmd( register_menuid("Equipment Menu:"), 1023, "RegularMenuCmd" ) register_menucmd( register_menuid("Extras Menu:"), 1023, "ExtraMenuCmd" ) register_menucmd( register_menuid("Players Menu:"), 1023, "PlayerMenuCmd" )
return PLUGIN_CONTINUE }
public ShowWeaponMenu( id, lvl, cid ) { if( cmd_access( id, lvl, cid, 0 ) ) { g_nMenuPosition[id-1] = 0 ShowMainMenu( id ) } return PLUGIN_HANDLED }
/////////////////////////////////////////////////////////////////////////////////////////// // // Menu Handling Code Below // ///////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////// // Handles Menu Menu public MainMenuCmd( id, key ) { // Track which Menu Type was chosen g_nMenuType[id-1] = key
switch( key ) { case 0: ShowPistolMenu( id ) case 1: ShowShotgunMenu( id ) case 2: ShowSmgMenu( id ) case 3: ShowRifleMenu( id, g_nMenuPosition[id-1] = 0 ) case 4: ShowMachineMenu( id ) case 5: ShowPlayerMenu( id, g_nMenuPosition[id-1] = 0 ) case 6: ShowPlayerMenu( id, g_nMenuPosition[id-1] = 0 ) case 7: ShowEquipMenu( id ) case 8: ShowExtraMenu( id, g_nMenuPosition[id-1] = 0 ) default: { /* Do Nothing Here (Exit Option) */ } } return PLUGIN_HANDLED } // ///////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////// // Handles all Weapon Menus Except Multi-Page ones like Rifles Menu public RegularMenuCmd( id, key ) { // Track which Option was chosen g_nMenuOption[id-1] = key
switch( key ) { case 9: { // User Chose to go Back to Previous Menu ShowMainMenu( id ) } default: ShowPlayerMenu( id, g_nMenuPosition[id-1] = 0 ) } return PLUGIN_HANDLED } // ///////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////// // Handles Multi-Page Rifles Menu public RifleMenuCmd( id, key ) { // Track which Option was chosen g_nMenuOption[id-1] = g_nMenuPosition[id-1] * MAX_DISPLAY + key
switch( key ) { case 8: { // User Selected "More..." Option ShowRifleMenu( id, ++g_nMenuPosition[id-1] ) } case 9: { // User Chose to go Back to Previous Menu if( g_nMenuPosition[id-1] ) { ShowRifleMenu( id, --g_nMenuPosition[id-1] ) }else { ShowMainMenu( id ) } } default: ShowPlayerMenu( id, g_nMenuPosition[id-1] = 0 ) } return PLUGIN_HANDLED } // ///////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////// // Handles Multi-Page Players Menu public PlayerMenuCmd( id, key ) { switch( key ) { case 8: { // User Selected "More..." Option ShowPlayerMenu( id, ++g_nMenuPosition[id-1] ) } case 9: { // User Chose to go Back to Previous Menu if( g_nMenuPosition[id-1] ) { ShowPlayerMenu( id, --g_nMenuPosition[id-1] ) }else { ShowMainMenu( id ) } } default: { // Find which Player was chosen new nPlayerID = g_nMenuPlayers[id-1][g_nMenuPosition[id-1] * MAX_DISPLAY + key]
// Give Player Selected Item GiveMenuItem( id, nPlayerID )
// Check which Menu to Re-Open (if any) switch( clamp(get_cvar_num("sv_weaponmenu_state"), 0, 2) ) { case 1: ShowPlayerMenu( id, g_nMenuPosition[id-1] ) // Players Menu (At Last Position) case 2: ShowMainMenu( id ) // Weapons Menu } } } return PLUGIN_HANDLED } // ///////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////// // Handles Multi-Page Extras Menu public ExtraMenuCmd( id, key ) { // Track which Option was chosen g_nMenuOption[id-1] = g_nMenuPosition[id-1] * MAX_DISPLAY + key
switch( key ) { case 8: { // User Selected "More..." Option ShowExtraMenu( id, ++g_nMenuPosition[id-1] ) } case 9: { // User Chose to go Back to Previous Menu if( g_nMenuPosition[id-1] ) { ShowExtraMenu( id, --g_nMenuPosition[id-1] ) }else { ShowMainMenu( id ) } } default: ShowPlayerMenu( id, g_nMenuPosition[id-1] = 0 ) } return PLUGIN_HANDLED } // ///////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////// // // Menu Building Code Below // ///////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////// // Build Main Menu Section public ShowMainMenu( id ) { new i, nLen, nKeys = (1<<9) new szMenuBody[256]
nLen = format( szMenuBody, 255, "\yWeapons Menu:\w^n" ) for( i = 0; i < MO_MAX_MAIN; i++ ) { nKeys |= (1<<i) nLen += format( szMenuBody[nLen], (255-nLen), "%d. %s^n", (i+1), g_szMainMenuTxt[i] ) } format( szMenuBody[nLen], (255-nLen), "^n0. Exit" )
show_menu( id, nKeys, szMenuBody, -1 ) return } // ///////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////// // Build Pistol Menu Section public ShowPistolMenu( id ) { new i, nLen, nKeys = (1<<9) new szMenuBody[256]
nLen = format( szMenuBody, 255, "\yPistols Menu:\w^n" ) for( i = 0; i < MO_MAX_PISTOL; i++ ) { nKeys |= (1<<i) nLen += format( szMenuBody[nLen], (255-nLen), "%d. %s^n", (i+1), g_szPistolMenuTxt[i] ) } format( szMenuBody[nLen], (255-nLen), "^n0. Back" )
show_menu( id, nKeys, szMenuBody, -1 ) return } // ///////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////// // Build Shotgun Menu Section public ShowShotgunMenu( id ) { new i, nLen, nKeys = (1<<9) new szMenuBody[256]
nLen = format( szMenuBody, 255, "\yShotguns Menu:\w^n" ) for( i = 0; i < MO_MAX_SHOTGUN; i++ ) { nKeys |= (1<<i) nLen += format( szMenuBody[nLen], (255-nLen), "%d. %s^n", (i+1), g_szShotgunMenuTxt[i] ) } format( szMenuBody[nLen], (255-nLen), "^n0. Back" )
show_menu( id, nKeys, szMenuBody, -1 ) return } // ///////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////// // Build SMG Menu Section public ShowSmgMenu( id ) { new i, nLen, nKeys = (1<<9) new szMenuBody[2256]
nLen = format( szMenuBody, 255, "\ySMGs Menu:\w^n" ) for( i = 0; i < MO_MAX_SMG; i++ ) { nKeys |= (1<<i) nLen += format( szMenuBody[nLen], (255-nLen), "%d. %s^n", (i+1), g_szSmgMenuTxt[i] ) } format( szMenuBody[nLen], (255-nLen), "^n0. Back" )
show_menu( id, nKeys, szMenuBody, -1 ) return } // ///////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////// // Build Rifle Menu Section public ShowRifleMenu( id, pos ) { if( pos < 0 ) return
new i, j = 0, nStart, nEnd, nLen, nKeys = (1<<9) new szMenuBody[512]
nStart = pos * MAX_DISPLAY
if( nStart >= MO_MAX_RIFLE ) nStart = pos = g_nMenuPosition[id-1] = 0
nLen = format( szMenuBody, 511, "\yRifles Menu:\R%d/2^n\w^n", pos + 1 )
nEnd = nStart + MAX_DISPLAY if( nEnd > MO_MAX_RIFLE ) nEnd = MO_MAX_RIFLE
for( i = nStart; i < nEnd; i++ ) { nKeys |= (1<<j++) nLen += format( szMenuBody[nLen], (511-nLen), "%d. %s^n", j, g_szRifleMenuTxt[i] ) }
if( nEnd != MO_MAX_RIFLE ) { format( szMenuBody[nLen], (511-nLen), "^n9. More...^n0. Back" ) nKeys |= (1<<8) } else format( szMenuBody[nLen], (511-nLen), "^n0. Back" )
show_menu( id, nKeys, szMenuBody, -1 ) return } // ///////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////// // Build Machine Gun Menu Section public ShowMachineMenu( id ) { new nLen, nKeys = (1<<0|1<<9) new szMenuBody[256]
nLen = format( szMenuBody, 255, "\yMachine Guns Menu:\w^n" ) nLen += format( szMenuBody[nLen], (255-nLen), "%d. %s^n", 1, g_szMachineMenuTxt ) format( szMenuBody[nLen], (255-nLen), "^n0. Back" )
show_menu( id, nKeys, szMenuBody, -1 ) return } // ///////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////// // Build Equipment Menu Section public ShowEquipMenu( id ) { new i, nLen, nKeys = (1<<9) new szMenuBody[256]
nLen = format( szMenuBody, 255, "\yEquipment Menu:\w^n" ) for( i = 0; i < MO_MAX_EQUIP; i++ ) { nKeys |= (1<<i) nLen += format( szMenuBody[nLen], (255-nLen), "%d. %s^n", (i+1), g_szEquipMenuTxt[i] ) } format( szMenuBody[nLen], (255-nLen), "^n0. Back" )
show_menu( id, nKeys, szMenuBody, -1 ) return } // ///////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////// // Build Extras Menu Section /* public ShowExtraMenu( id ) { new i, nLen, nKeys = (1<<9) new szMenuBody[256]
nLen = format( szMenuBody, 255, "\yExtras Menu:\w^n" ) for( i = 0; i < MO_MAX_EXTRA; i++ ) { nKeys |= (1<<i) nLen += format( szMenuBody[nLen], (255-nLen), "%d. %s^n", (i+1), g_szExtraMenuTxt[i] ) } format( szMenuBody[nLen], (255-nLen), "^n0. Back" )
show_menu( id, nKeys, szMenuBody, -1 ) return }*/
public ShowExtraMenu( id, pos ) { if( pos < 0 ) return
new i, j = 0, nStart, nEnd, nLen, nKeys = (1<<9) new szMenuBody[512]
nStart = pos * MAX_DISPLAY
if( nStart >= MO_MAX_EXTRA ) nStart = pos = g_nMenuPosition[id-1] = 0
nLen = format( szMenuBody, 511, "\yExtras Menu:\R%d/2^n\w^n", pos + 1 )
nEnd = nStart + MAX_DISPLAY if( nEnd > MO_MAX_EXTRA ) nEnd = MO_MAX_EXTRA
for( i = nStart; i < nEnd; i++ ) { nKeys |= (1<<j++) nLen += format( szMenuBody[nLen], (511-nLen), "%d. %s^n", j, g_szExtraMenuTxt[i] ) }
if( nEnd != MO_MAX_EXTRA ) { format( szMenuBody[nLen], (511-nLen), "^n9. More...^n0. Back" ) nKeys |= (1<<8) } else format( szMenuBody[nLen], (511-nLen), "^n0. Back" )
show_menu( id, nKeys, szMenuBody, -1 ) return }
// ///////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////// // Build Player Menu Section public ShowPlayerMenu( id, pos ) { if( pos < 0 ) return
get_players( g_nMenuPlayers[id-1], g_nMenuPlayersNum[id-1] )
new i, j = 0, idx new szUserName[32], szMenuBody[512] new nStart = pos * MAX_DISPLAY
if( nStart >= g_nMenuPlayersNum[id-1] ) nStart = pos = g_nMenuPosition[id-1] = 0
new nLen = format( szMenuBody, 511, "\yPlayers Menu:\R%d/%d^n\w^n", (pos+1), (g_nMenuPlayersNum[id-1] / MAX_DISPLAY + ((g_nMenuPlayersNum[id-1] % MAX_DISPLAY) ? 1 : 0 )) ) new nEnd = nStart + MAX_DISPLAY new nKeys = (1<<9)
if( nEnd > g_nMenuPlayersNum[id-1] ) nEnd = g_nMenuPlayersNum[id-1]
for( i = nStart; i < nEnd; i++ ) { idx = g_nMenuPlayers[id-1][i] get_user_name( idx, szUserName, 31 )
nKeys |= (1<<j++) nLen += format( szMenuBody[nLen], (511-nLen), "%d. %s^n", j, szUserName ) }
if( nEnd != g_nMenuPlayersNum[id-1] ) { nKeys |= (1<<8) format( szMenuBody[nLen], (511-nLen), "^n9. More...^n0. Back" ) } else format( szMenuBody[nLen], (511-nLen), "^n0. Back" )
show_menu( id, nKeys, szMenuBody ) return } // ///////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////// // // Weapon Giving Code Below // ///////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////// // Following Functions Actually Give The Items // stock GiveMenuItem( id, p_nPlayerID ) { new szUserName[32] get_user_name( p_nPlayerID, szUserName, 31 )
switch( g_nMenuType[id-1] ) { case MT_PISTOL: GivePlayerWeapon( p_nPlayerID, g_nMenuOption[id-1] ) case MT_SHOTGUN: GivePlayerWeapon( p_nPlayerID, (OFFSET_SHOTGUN + g_nMenuOption[id-1]) ) case MT_SMG: GivePlayerWeapon( p_nPlayerID, (OFFSET_SMG + g_nMenuOption[id-1]) ) case MT_RIFLE: GivePlayerWeapon( p_nPlayerID, (OFFSET_RIFLE + g_nMenuOption[id-1]) ) case MT_MACHINE: GivePlayerWeapon( p_nPlayerID, (OFFSET_MACHINE + g_nMenuOption[id-1]) ) case MT_PAMMO: GivePrimaryAmmo( p_nPlayerID ) case MT_SAMMO: GiveSecondaryAmmo( p_nPlayerID ) case MT_EQUIP: GivePlayerItem( p_nPlayerID, g_nMenuOption[id-1] ) case MT_EXTRA: GivePlayerExtra( p_nPlayerID, g_nMenuOption[id-1] ) } return }
stock GivePlayerWeapon( id, nWeaponIdx ) { if( !is_user_alive(id) || (nWeaponIdx < 0) || (nWeaponIdx >= MAX_WEAPONS) ) return // Invalid User or Weapon
give_item( id, g_szWeaponList[nWeaponIdx] ) for( new i = 0; i < g_nWeaponData[nWeaponIdx][1]; i++ ) give_item( id, g_szAmmoList[g_nWeaponData[nWeaponIdx][0]] )
return }
stock GivePlayerExtra( id, nExtraIdx ) { if( !is_user_alive(id) || (nExtraIdx < 0) || (nExtraIdx >= MO_MAX_EXTRA) ) return
new i, j switch( nExtraIdx ) { case 0: // Give Player All Weapons (+Ammo) { for( i = 0; i < MAX_WEAPONS; i++ ) { give_item( id, g_szWeaponList[i] ) for( j = 0; j < g_nWeaponData[i][1]; j++ ) give_item( id, g_szAmmoList[g_nWeaponData[i][0]] ) } } case 1: // Give Player M3 Set { GivePlayerWeapon( id, 6 ) // [6] = M3 GivePlayerWeapon( id, 2 ) // [2] = Deagle for( i = 1; i < 6; i++ ) GivePlayerItem( id, i ) // Kevlar, Flash/HE/Smoke Grenade, Defuse Kit } case 2: // Give Player MP5 Navy Set { GivePlayerWeapon( id, 8 ) // [8] = MP5 Navy GivePlayerWeapon( id, 2 ) // [2] = Deagle for( i = 1; i < 6; i++ ) GivePlayerItem( id, i ) // Kevlar, Flash/HE/Smoke Grenade, Defuse Kit } case 3: // Give Player Clarion Set { GivePlayerWeapon( id, 13 ) // [13] = Clarion (Famas) GivePlayerWeapon( id, 2 ) // [2] = Deagle for( i = 1; i < 6; i++ ) GivePlayerItem( id, i ) // Kevlar, Flash/HE/Smoke Grenade, Defuse Kit } case 4: // Give Player Galil Set { GivePlayerWeapon( id, 22 ) // [22] = Galil GivePlayerWeapon( id, 2 ) // [2] = Deagle for( i = 1; i < 6; i++ ) GivePlayerItem( id, i ) // Kevlar, Flash/HE/Smoke Grenade, Defuse Kit } case 5: // Give Player M4A1 Set { GivePlayerWeapon( id, 16 ) // [16] = M4A1 GivePlayerWeapon( id, 2 ) // [2] = Deagle for( i = 1; i < 6; i++ ) GivePlayerItem( id, i ) // Kevlar, Flash/HE/Smoke Grenade, Defuse Kit } case 6: // Give Player AK47 Set { GivePlayerWeapon( id, 15 ) // [15] = AK47 GivePlayerWeapon( id, 2 ) // [2] = Deagle for( i = 1; i < 6; i++ ) GivePlayerItem( id, i ) // Kevlar, Flash/HE/Smoke Grenade, Defuse Kit } case 7: // Give Player Krieg SG552 Set { GivePlayerWeapon( id, 14 ) // [14] = Krieg SG552 GivePlayerWeapon( id, 2 ) // [2] = Deagle for( i = 1; i < 6; i++ ) GivePlayerItem( id, i ) // Kevlar, Flash/HE/Smoke Grenade, Defuse Kit } case 8: // Give Player Bullpup Set { GivePlayerWeapon( id, 17 ) // [17] = Bullpup GivePlayerWeapon( id, 2 ) // [2] = Deagle for( i = 1; i < 6; i++ ) GivePlayerItem( id, i ) // Kevlar, Flash/HE/Smoke Grenade, Defuse Kit } case 9: // Give Player M249 Set { GivePlayerWeapon( id, 23 ) // [23] = M249 GivePlayerWeapon( id, 2 ) // [2] = Deagle for( i = 1; i < 6; i++ ) GivePlayerItem( id, i ) // Kevlar, Flash/HE/Smoke Grenade, Defuse Kit } case 10: // Give Player Scout Set { GivePlayerWeapon( id, 16 ) // [18] = Scout GivePlayerWeapon( id, 2 ) // [2] = Deagle for( i = 1; i < 6; i++ ) GivePlayerItem( id, i ) // Kevlar, Flash/HE/Smoke Grenade, Defuse Kit } case 11: // Give Player AutoSniper Set { GivePlayerWeapon( id, 20 ) // [20] = CT AutoSniper (G3SG1) //GivePlayerWeapon( id, 21 ) // [21] = T AutoSniper (SG550) GivePlayerWeapon( id, 2 ) // [2] = Deagle for( i = 1; i < 6; i++ ) GivePlayerItem( id, i ) // Kevlar, Flash/HE/Smoke Grenade, Defuse Kit } case 12: // Give Player AWP Set { GivePlayerWeapon( id, 19 ) // [19] = AWP GivePlayerWeapon( id, 2 ) // [2] = Deagle for( i = 1; i < 6; i++ ) GivePlayerItem( id, i ) // Kevlar, Flash/HE/Smoke Grenade, Defuse Kit } case 13: // Give Player Nades Set { for( i = 2; i < 5; i++ ) GivePlayerItem( id, i ) // Flash/HE/Smoke Grenades } } return }
stock GivePlayerItem( id, nItemIdx ) { if( !is_user_alive(id) || (nItemIdx < 0) || (nItemIdx >= MAX_ITEMS) ) return // Invalid User or Item
if( (nItemIdx == 4) && (get_cvar_num("sv_weaponmenu_smoke") < 1) ) return // Smoke Nades Restricted
if( nItemIdx == 2 ) // If item is Flashbang, give it twice give_item( id, g_szItemsList[nItemIdx] ) give_item( id, g_szItemsList[nItemIdx] )
return }
stock GivePrimaryAmmo( id ) { new nWeapons[32], nNum, i, j, k new szWeaponName[32]
// Only give Primary Ammo for Guns Carried get_user_weapons( id, nWeapons, nNum ) for( i = 0; i < nNum; i++ ) { get_weaponname( nWeapons[i], szWeaponName, 31 ) for( j = OFFSET_SHOTGUN; j < MAX_WEAPONS; j++ ) { if( equali( szWeaponName, g_szWeaponList[j] ) ) { for( k = 0; k < g_nWeaponData[j][1]; k++ ) give_item( id, g_szAmmoList[g_nWeaponData[j][0]] ) } } } return }
stock GiveSecondaryAmmo( id ) { new nWeapons[32], nNum, i, j, k new szWeaponName[32]
// Only give Secondary Ammo for Pistols Carried get_user_weapons( id, nWeapons, nNum ) for( i = 0; i < nNum; i++ ) { get_weaponname( nWeapons[i], szWeaponName, 31 ) for( j = 0; j < OFFSET_SHOTGUN; j++ ) { if( equali( szWeaponName, g_szWeaponList[j] ) ) { for( k = 0; k < g_nWeaponData[j][1]; k++ ) give_item( id, g_szAmmoList[g_nWeaponData[j][0]] ) } } } return } // // ///////////////////////////////////////////////////////////////////////////////////////////
____________________________________________________________
Aprendiendo Mapping y Scripting
Red Social: https://www.facebook.com/Rambo.cstrike
SI NO VAS AYUDAR, POR FAVOR NO COMENTAR
Mensajes: 42
Temas: 23
Registro en: May 2019
Reputación:
0
si pero es para ponerle modelos de armas no armas
Mensajes: 3,238
Temas: 47
Registro en: Feb 2015
Reputación:
34
Mensajes: 42
Temas: 23
Registro en: May 2019
Reputación:
0
28/07/2019, 05:26 AM
(Última modificación: 28/07/2019, 05:28 AM por potato02. Edited 1 time in total.)
hola me gustaria editar este plugins
me gustaria hacer que el plugins funciona por ID o nombre de cada player
este plugins tiene una funciona similar pero por team ct - tt tonces me gustaria cambiarles a nombres y ID de cada player que quiera agregar skins a su arma
me ayudan
ejemplo
new_weapons.ini
"modelos / model.mdl" "modelos / new1model.mdl" STEAM_0:012321
"modelos / model.mdl" "modelos / new3model.mdl" juan
"modelos / model.mdl" "modelos / new2model.mdl" PEDRO
https://forums.alliedmods.net/showthread.php?t=43979
Código PHP: /* * _______ _ _ __ __ * | _____/ | | | | \ \ __ / / * | | | | | | | | / \ | | * | | | |____| | | |/ __ \| | * | | ___ | ______ | | / \ | * | | |_ | | | | | | / \ | * | | | | | | | | | | | | * | |____| | | | | | | | | | * |_______/ |_| |_| \_/ \_/ * * * * Last Edited: 06-12-08 * * ============ * Changelog: * ============ * * v1.3 * -Bug Fixes * * v1.0 * -Initial Release * */
#define VERSION "1.3"
#include <amxmodx> #include <amxmisc> #include <fakemeta>
#define MAX_SOUNDS 50 #define MAX_p_MODELS 50 #define MAX_v_MODELS 50 #define MAX_w_MODELS 50
#define MAP_CONFIGS 1
new new_sounds[MAX_SOUNDS][48] new old_sounds[MAX_SOUNDS][48] new sounds_team[MAX_SOUNDS] new soundsnum
new new_p_models[MAX_p_MODELS][48] new old_p_models[MAX_p_MODELS][48] new p_models_team[MAX_p_MODELS] new p_modelsnum
new new_v_models[MAX_v_MODELS][48] new old_v_models[MAX_v_MODELS][48] new v_models_team[MAX_p_MODELS] new v_modelsnum
new new_w_models[MAX_w_MODELS][48] new old_w_models[MAX_w_MODELS][48] new w_models_team[MAX_p_MODELS] new w_modelsnum
new maxplayers
public plugin_init() { register_plugin("Weapon Model + Sound Replacement",VERSION,"GHW_Chronic") register_forward(FM_EmitSound,"Sound_Hook") register_forward(FM_SetModel,"W_Model_Hook",1) register_logevent("newround",2,"1=Round_Start") register_event("CurWeapon","Changeweapon_Hook","be","1=1") maxplayers = get_maxplayers() }
public plugin_precache() { new configfile[200] new configsdir[200] new map[32] get_configsdir(configsdir,199) get_mapname(map,31) format(configfile,199,"%s/new_weapons_%s.ini",configsdir,map) if(file_exists(configfile)) { load_models(configfile) } else { format(configfile,199,"%s/new_weapons.ini",configsdir) load_models(configfile) } }
public load_models(configfile[]) { if(file_exists(configfile)) { new read[96], left[48], right[48], right2[32], trash, team for(new i=0;i<file_size(configfile,1);i++) { read_file(configfile,i,read,95,trash) if(containi(read,";")!=0 && containi(read," ")!=-1) { strbreak(read,left,47,right,47) team=0 if(containi(right," ")!=-1) { strbreak(right,right,47,right2,31) replace_all(right2,31,"^"","") if( equali(right2,"T") || equali(right2,"Terrorist") || equali(right2,"Terrorists") || equali(right2,"Blue") || equali(right2,"B") || equali(right2,"Allies") || equali(right2,"1") ) team=1 else if( equali(right2,"CT") || equali(right2,"Counter") || equali(right2,"Counter-Terrorist") || equali(right2,"Counter-Terrorists") || equali(right2,"CounterTerrorists") || equali(right2,"CounterTerrorist") || equali(right2,"Red") || equali(right2,"R") || equali(right2,"Axis") || equali(right2,"2") ) team=2 else if( equali(right2,"Yellow") || equali(right2,"Y") || equali(right2,"3") ) team=3 else if( equali(right2,"Green") || equali(right2,"G") || equali(right2,"4") ) team=4 } replace_all(right,47,"^"","") if(file_exists(right)) { if(containi(right,".mdl")==strlen(right)-4) { if(!precache_model(right)) { log_amx("Error attempting to precache model: ^"%s^" (Line %d of new_weapons.ini)",right,i+1) } else if(containi(left,"models/p_")==0) { format(new_p_models[p_modelsnum],47,right) format(old_p_models[p_modelsnum],47,left) p_models_team[p_modelsnum]=team p_modelsnum++ } else if(containi(left,"models/v_")==0) { format(new_v_models[v_modelsnum],47,right) format(old_v_models[v_modelsnum],47,left) v_models_team[v_modelsnum]=team v_modelsnum++ } else if(containi(left,"models/w_")==0) { format(new_w_models[w_modelsnum],47,right) format(old_w_models[w_modelsnum],47,left) w_models_team[w_modelsnum]=team w_modelsnum++ } else { log_amx("Model type(p_ / v_ / w_) unknown for model: ^"%s^" (Line %d of new_weapons.ini)",right,i+1) } } else if(containi(right,".wav")==strlen(right)-4 || containi(right,".mp3")==strlen(right)-4) { replace(right,47,"sound/","") replace(left,47,"sound/","") if(!precache_sound(right)) { log_amx("Error attempting to precache sound: ^"%s^" (Line %d of new_weapons.ini)",right,i+1) } else { format(new_sounds[soundsnum],47,right) format(old_sounds[soundsnum],47,left) sounds_team[soundsnum]=team soundsnum++ } } else { log_amx("Invalid File: ^"%s^" (Line %d of new_weapons.ini)",right,i+1) } } else { log_amx("File Inexistent: ^"%s^" (Line %d of new_weapons.ini)",right,i+1) } /*if(!file_exists(left)) { log_amx("Warning: File Inexistent: ^"%s^" (Line %d of new_weapons.ini). ONLY A WARNING. PLUGIN WILL STILL WORK!!!!",left,i+1) }*/ } } } }
public Changeweapon_Hook(id) { if(!is_user_alive(id)) { return PLUGIN_CONTINUE } static model[32], i, team
team = get_user_team(id)
pev(id,pev_viewmodel2,model,31) for(i=0;i<v_modelsnum;i++) { if(equali(model,old_v_models[i])) { if(v_models_team[i]==team || !v_models_team[i]) { set_pev(id,pev_viewmodel2,new_v_models[i]) break; } } }
pev(id,pev_weaponmodel2,model,31) for(i=0;i<p_modelsnum;i++) { if(equali(model,old_p_models[i])) { if(p_models_team[i]==team || !p_models_team[i]) { set_pev(id,pev_weaponmodel2,new_p_models[i]) break; } } } return PLUGIN_CONTINUE }
public Sound_Hook(id,channel,sample[]) { if(!is_user_alive(id)) { return FMRES_IGNORED } if(channel!=CHAN_WEAPON && channel!=CHAN_ITEM) { return FMRES_IGNORED }
static i, team
team = get_user_team(id)
for(i=0;i<soundsnum;i++) { if(equali(sample,old_sounds[i])) { if(sounds_team[i]==team || !sounds_team[i]) { engfunc(EngFunc_EmitSound,id,CHAN_WEAPON,new_sounds[i],1.0,ATTN_NORM,0,PITCH_NORM) return FMRES_SUPERCEDE } } } return FMRES_IGNORED }
public W_Model_Hook(ent,model[]) { if(!pev_valid(ent)) { return FMRES_IGNORED } static i for(i=0;i<w_modelsnum;i++) { if(equali(model,old_w_models[i])) { engfunc(EngFunc_SetModel,ent,new_w_models[i]) return FMRES_SUPERCEDE } } return FMRES_IGNORED }
public newround() { static ent, classname[8], model[32] ent = engfunc(EngFunc_FindEntityInSphere,maxplayers,Float:{0.0,0.0,0.0},4800.0) while(ent) { if(pev_valid(ent)) { pev(ent,pev_classname,classname,7) if(containi(classname,"armoury")!=-1) { pev(ent,pev_model,model,31) W_Model_Hook(ent,model) } } ent = engfunc(EngFunc_FindEntityInSphere,ent,Float:{0.0,0.0,0.0},4800.0) } }
Mensajes: 115
Temas: 10
Registro en: Feb 2016
Reputación:
5
(28/07/2019, 05:26 AM)potato02 escribió: hola me gustaria editar este plugins
me gustaria hacer que el plugins funciona por ID o nombre de cada player
este plugins tiene una funciona similar pero por team ct - tt tonces me gustaria cambiarles a nombres y ID de cada player que quiera agregar skins a su arma
me ayudan
ejemplo
new_weapons.ini
"modelos / model.mdl" "modelos / new1model.mdl" STEAM_0:012321
"modelos / model.mdl" "modelos / new3model.mdl" juan
"modelos / model.mdl" "modelos / new2model.mdl" PEDRO
https://forums.alliedmods.net/showthread.php?t=43979
Código PHP: /* * _______ _ _ __ __ * | _____/ | | | | \ \ __ / / * | | | | | | | | / \ | | * | | | |____| | | |/ __ \| | * | | ___ | ______ | | / \ | * | | |_ | | | | | | / \ | * | | | | | | | | | | | | * | |____| | | | | | | | | | * |_______/ |_| |_| \_/ \_/ * * * * Last Edited: 06-12-08 * * ============ * Changelog: * ============ * * v1.3 * -Bug Fixes * * v1.0 * -Initial Release * */
#define VERSION "1.3"
#include <amxmodx> #include <amxmisc> #include <fakemeta>
#define MAX_SOUNDS 50 #define MAX_p_MODELS 50 #define MAX_v_MODELS 50 #define MAX_w_MODELS 50
#define MAP_CONFIGS 1
new new_sounds[MAX_SOUNDS][48] new old_sounds[MAX_SOUNDS][48] new sounds_team[MAX_SOUNDS] new soundsnum
new new_p_models[MAX_p_MODELS][48] new old_p_models[MAX_p_MODELS][48] new p_models_team[MAX_p_MODELS] new p_modelsnum
new new_v_models[MAX_v_MODELS][48] new old_v_models[MAX_v_MODELS][48] new v_models_team[MAX_p_MODELS] new v_modelsnum
new new_w_models[MAX_w_MODELS][48] new old_w_models[MAX_w_MODELS][48] new w_models_team[MAX_p_MODELS] new w_modelsnum
new maxplayers
public plugin_init() { register_plugin("Weapon Model + Sound Replacement",VERSION,"GHW_Chronic") register_forward(FM_EmitSound,"Sound_Hook") register_forward(FM_SetModel,"W_Model_Hook",1) register_logevent("newround",2,"1=Round_Start") register_event("CurWeapon","Changeweapon_Hook","be","1=1") maxplayers = get_maxplayers() }
public plugin_precache() { new configfile[200] new configsdir[200] new map[32] get_configsdir(configsdir,199) get_mapname(map,31) format(configfile,199,"%s/new_weapons_%s.ini",configsdir,map) if(file_exists(configfile)) { load_models(configfile) } else { format(configfile,199,"%s/new_weapons.ini",configsdir) load_models(configfile) } }
public load_models(configfile[]) { if(file_exists(configfile)) { new read[96], left[48], right[48], right2[32], trash, team for(new i=0;i<file_size(configfile,1);i++) { read_file(configfile,i,read,95,trash) if(containi(read,";")!=0 && containi(read," ")!=-1) { strbreak(read,left,47,right,47) team=0 if(containi(right," ")!=-1) { strbreak(right,right,47,right2,31) replace_all(right2,31,"^"","") if( equali(right2,"T") || equali(right2,"Terrorist") || equali(right2,"Terrorists") || equali(right2,"Blue") || equali(right2,"B") || equali(right2,"Allies") || equali(right2,"1") ) team=1 else if( equali(right2,"CT") || equali(right2,"Counter") || equali(right2,"Counter-Terrorist") || equali(right2,"Counter-Terrorists") || equali(right2,"CounterTerrorists") || equali(right2,"CounterTerrorist") || equali(right2,"Red") || equali(right2,"R") || equali(right2,"Axis") || equali(right2,"2") ) team=2 else if( equali(right2,"Yellow") || equali(right2,"Y") || equali(right2,"3") ) team=3 else if( equali(right2,"Green") || equali(right2,"G") || equali(right2,"4") ) team=4 } replace_all(right,47,"^"","") if(file_exists(right)) { if(containi(right,".mdl")==strlen(right)-4) { if(!precache_model(right)) { log_amx("Error attempting to precache model: ^"%s^" (Line %d of new_weapons.ini)",right,i+1) } else if(containi(left,"models/p_")==0) { format(new_p_models[p_modelsnum],47,right) format(old_p_models[p_modelsnum],47,left) p_models_team[p_modelsnum]=team p_modelsnum++ } else if(containi(left,"models/v_")==0) { format(new_v_models[v_modelsnum],47,right) format(old_v_models[v_modelsnum],47,left) v_models_team[v_modelsnum]=team v_modelsnum++ } else if(containi(left,"models/w_")==0) { format(new_w_models[w_modelsnum],47,right) format(old_w_models[w_modelsnum],47,left) w_models_team[w_modelsnum]=team w_modelsnum++ } else { log_amx("Model type(p_ / v_ / w_) unknown for model: ^"%s^" (Line %d of new_weapons.ini)",right,i+1) } } else if(containi(right,".wav")==strlen(right)-4 || containi(right,".mp3")==strlen(right)-4) { replace(right,47,"sound/","") replace(left,47,"sound/","") if(!precache_sound(right)) { log_amx("Error attempting to precache sound: ^"%s^" (Line %d of new_weapons.ini)",right,i+1) } else { format(new_sounds[soundsnum],47,right) format(old_sounds[soundsnum],47,left) sounds_team[soundsnum]=team soundsnum++ } } else { log_amx("Invalid File: ^"%s^" (Line %d of new_weapons.ini)",right,i+1) } } else { log_amx("File Inexistent: ^"%s^" (Line %d of new_weapons.ini)",right,i+1) } /*if(!file_exists(left)) { log_amx("Warning: File Inexistent: ^"%s^" (Line %d of new_weapons.ini). ONLY A WARNING. PLUGIN WILL STILL WORK!!!!",left,i+1) }*/ } } } }
public Changeweapon_Hook(id) { if(!is_user_alive(id)) { return PLUGIN_CONTINUE } static model[32], i, team
team = get_user_team(id)
pev(id,pev_viewmodel2,model,31) for(i=0;i<v_modelsnum;i++) { if(equali(model,old_v_models[i])) { if(v_models_team[i]==team || !v_models_team[i]) { set_pev(id,pev_viewmodel2,new_v_models[i]) break; } } }
pev(id,pev_weaponmodel2,model,31) for(i=0;i<p_modelsnum;i++) { if(equali(model,old_p_models[i])) { if(p_models_team[i]==team || !p_models_team[i]) { set_pev(id,pev_weaponmodel2,new_p_models[i]) break; } } } return PLUGIN_CONTINUE }
public Sound_Hook(id,channel,sample[]) { if(!is_user_alive(id)) { return FMRES_IGNORED } if(channel!=CHAN_WEAPON && channel!=CHAN_ITEM) { return FMRES_IGNORED }
static i, team
team = get_user_team(id)
for(i=0;i<soundsnum;i++) { if(equali(sample,old_sounds[i])) { if(sounds_team[i]==team || !sounds_team[i]) { engfunc(EngFunc_EmitSound,id,CHAN_WEAPON,new_sounds[i],1.0,ATTN_NORM,0,PITCH_NORM) return FMRES_SUPERCEDE } } } return FMRES_IGNORED }
public W_Model_Hook(ent,model[]) { if(!pev_valid(ent)) { return FMRES_IGNORED } static i for(i=0;i<w_modelsnum;i++) { if(equali(model,old_w_models[i])) { engfunc(EngFunc_SetModel,ent,new_w_models[i]) return FMRES_SUPERCEDE } } return FMRES_IGNORED }
public newround() { static ent, classname[8], model[32] ent = engfunc(EngFunc_FindEntityInSphere,maxplayers,Float:{0.0,0.0,0.0},4800.0) while(ent) { if(pev_valid(ent)) { pev(ent,pev_classname,classname,7) if(containi(classname,"armoury")!=-1) { pev(ent,pev_model,model,31) W_Model_Hook(ent,model) } } ent = engfunc(EngFunc_FindEntityInSphere,ent,Float:{0.0,0.0,0.0},4800.0) } }
Y que esperas, que te detiene que no lo editas?
Mensajes: 42
Temas: 23
Registro en: May 2019
Reputación:
0
Mensajes: 42
Temas: 23
Registro en: May 2019
Reputación:
0
quien me ayuda con este plugins la idea es que solo sean los admin con las skins
no todos
|