Raised This Month: $51 Target: $400
 12% 

Menu para agregar armas echas con bools


  
 
 
Thread Tools Display Modes
Shion
Senior Member
Join Date: Dec 2008
Old 09-04-2011 , 10:22   Re: Menu para agregar armas echas con bools
#11

Vos lee mi comentario denuevo
__________________
Shion is offline
Desktop
AlliedModders Donor
Join Date: Sep 2009
Location: C:\Users\Default\
Old 09-04-2011 , 12:42   Re: Menu para agregar armas echas con bools
#12

Mira te digo, no te voy a pasar como hacerlo pero se pueden agregar mas armas al menu sin necesidad de usar bools u otro menu
__________________
Massive Infection:: Piu-Games
Desktop is offline
fpA
Senior Member
Join Date: May 2011
Location: Zaragoza
Old 09-04-2011 , 20:52   Re: Menu para agregar armas echas con bools
#13

Quote:
Originally Posted by Shion View Post
Vos lee mi comentario denuevo
No te vamos a dar un menu con 13561561 armas nuevas para tu server.

Si no quieres aprender es tu problema, no vengas a pedir todo hecho.
fpA is offline
Send a message via Skype™ to fpA
Sambuseti
Member
Join Date: Jun 2011
Location: Chile
Old 09-05-2011 , 23:03   Re: Menu para agregar armas echas con bools
#14

PHP Code:
new bool:g_superm4a1[33]
new const 
lvlarmas[] = { 0515253446698598111125142161189202235254300 // ay te agrege el nivel para el arma nueva

new const g_primary_items[][] = { "weapon_mac10""weapon_tmp""weapon_ak47""weapon_p90""weapon_sg552""weapon_xm1014""weapon_mp5navy""weapon_m249""weapon_galil""weapon_famas""weapon_awp""weapon_aug""weapon_sg550""weapon_g3sg1""weapon_m4a1""weapon_ump45""weapon_m3""weapon_m4a1" // agregas el arma nueva

new const ArmasName[][] = { "Ingram MAC-10""Schmidt TMP""AK-47 Kalashnikov""P90d&K""Delta G11""Super Serbu""Dual Navy""Minigun""Endfiel L85""F1-Famas""Awp Fire""EO-Tech G36c""Satanic Presicion Rifle""Damn Auto-Sniper""Fire Deamon""Tactical VTAC""Spass-12",  "Super M4a1 Nueva" // y el name XD 
Busca:
public show_menu_buy1(taskid)

Y Remplaza Todo Ese Public Por Este

PHP Code:
public show_menu_buy1(taskid)
{
// Get player id
static id
(taskid g_maxplayers) ? (id ID_SPAWN) : (id taskid);

// Zombies or survivors get no guns
if (g_zombie[id] || g_survivor[id] || !is_user_alive(id))
return;

// Bots pick their weapons randomly
if (is_user_bot(id))
{
buy_primary_weapon(idrandom_num(0sizeof g_primary_items 1))
menu_buy2(idrandom_num(0sizeof g_secondary_items 1))
return;
}

// Automatic selection enabled for player and menu called on spawn event
if (WPN_AUTO_ON && taskid g_maxplayers)
{
buy_primary_weapon(idWPN_AUTO_PRI)
menu_buy2(idWPN_AUTO_SEC)
return;
}

static 
menu[999], lenweap
len 
0

// Title
len += formatex(menu[len], sizeof menu len"\y%L \r[%d-%d]^n^n"id"MENU_BUY1_TITLE"WPN_STARTID+1min(WPN_STARTID+7WPN_MAXIDS))

// 1-7. Weapon List
for (weap WPN_STARTIDweap min(WPN_STARTID+7WPN_MAXIDS); weap++)
if (
g_level[id] >= lvlarmas[weap])
len += formatex(menu[len], sizeof menu len"\r%d.\w %s^n"weap-WPN_STARTID+1ArmasName[weap])
else
len += formatex(menu[len], sizeof menu len"\r%d.\d %s\d (\rMin %d\d)^n"weap-WPN_STARTID+1ArmasName[weap], lvlarmas[weap])  

// 8. Auto Select
len += formatex(menu[len], sizeof menu len"^n\r8.\w %L \y[%L]"id"MENU_AUTOSELECT"id, (WPN_AUTO_ON) ? "MOTD_ENABLED" "MOTD_DISABLED")

// 9. Next/Back - 0. Exit
len += formatex(menu[len], sizeof menu len"^n^n\r9.\w %L/%L^n^n\r0.\w %L"id"MENU_NEXT"id"MENU_BACK"id"MENU_EXIT")

show_menu(idKEYSMENUmenu, -1"Buy Menu 1")

Luego Busca :

public fw_PlayerSpawn_Post(id)

Y Abajo Del return; Agrega

PHP Code:
g_superm4a1[id] = false 
Luego Busca:
buy_primary_weapon(id, selection)
Y Avajo De
g_canbuy[id] = false Agrega

PHP Code:

switch (selection)
{
case 
18g_superm4a1[id] = true

Compila Y Proba
Sambuseti is offline
Send a message via MSN to Sambuseti Send a message via Skype™ to Sambuseti
Shion
Senior Member
Join Date: Dec 2008
Old 09-06-2011 , 12:48   Re: Menu para agregar armas echas con bools
#15

Bueno alparecer funciona, pero tengo un prolema, al agregar el nobmre de la "super m4a1" aca:

new const ArmasName[][] = { "", "P228 Compact", "", "Schmidt Scout", "", "XM1014 M4", "", "Ingram MAC-10", "Steyr AUG A1",
"", "Dual Elite Berettas", "FiveseveN", "UMP 45", "SG-550 Auto-Sniper", "IMI Galil", "Famas",
"USP .45 ACP Tactical", "Glock 18C", "AWP Magnum Sniper", "MP5 Navy", "M249 Para Machinegun",
"M3 Super 90", "M4A1 Carbine", "Schmidt TMP", "G3SG1 Auto-Sniper", "", "Desert Eagle .50 AE",
"SG-552 Commando", "AK-47 Kalashnikov", "", "ES P90", "", "Super m4a1" }

Funciona todo mal, se mescla el menu, de armas primarias cn el de segundaria osae por ej aparece Deagle y si la compras es una colt o lo qe sea. eso lo tengo asi por que asi vino con el 4.2 y si lo cambio a como vos me lo pasaste, no funcionaria por qe ahi estan las armas primarias y segundarias :/


Claramente se qe hay "", y no se bien por qe

el menu de armas segundarias sale bien igual.
Dejo IMG:
[IMG]http://**************/photo/my-images/51/problempaa.jpg/[/IMG]
http://**************/photo/my-images/51/problempaa.jpg/

En 1 hora vuelvo y si respondiste te respondo seguro
__________________

Last edited by Shion; 09-06-2011 at 12:59.
Shion is offline
xhiino
Senior Member
Join Date: Oct 2009
Location: santiasko
Old 09-06-2011 , 14:22   Re: Menu para agregar armas echas con bools
#16

no te entiendo

tu dices agregar un arma haci ...?

case 1: g_variablearma[id] = true

o no DD:
__________________
xhiino is offline
Send a message via MSN to xhiino
_Venganza_
Senior Member
Join Date: Apr 2011
Location: Valparaiso, Chile
Old 09-06-2011 , 15:45   Re: Menu para agregar armas echas con bools
#17

Quote:
Originally Posted by Sambuseti View Post
PHP Code:
new bool:g_superm4a1[33]
new const 
lvlarmas[] = { 0515253446698598111125142161189202235254300 // ay te agrege el nivel para el arma nueva

new const g_primary_items[][] = { "weapon_mac10""weapon_tmp""weapon_ak47""weapon_p90""weapon_sg552""weapon_xm1014""weapon_mp5navy""weapon_m249""weapon_galil""weapon_famas""weapon_awp""weapon_aug""weapon_sg550""weapon_g3sg1""weapon_m4a1""weapon_ump45""weapon_m3""weapon_m4a1" // agregas el arma nueva

new const ArmasName[][] = { "Ingram MAC-10""Schmidt TMP""AK-47 Kalashnikov""P90d&K""Delta G11""Super Serbu""Dual Navy""Minigun""Endfiel L85""F1-Famas""Awp Fire""EO-Tech G36c""Satanic Presicion Rifle""Damn Auto-Sniper""Fire Deamon""Tactical VTAC""Spass-12",  "Super M4a1 Nueva" // y el name XD 
Busca:
public show_menu_buy1(taskid)

Y Remplaza Todo Ese Public Por Este

PHP Code:
public show_menu_buy1(taskid)
{
// Get player id
static id
(taskid g_maxplayers) ? (id ID_SPAWN) : (id taskid);

// Zombies or survivors get no guns
if (g_zombie[id] || g_survivor[id] || !is_user_alive(id))
return;

// Bots pick their weapons randomly
if (is_user_bot(id))
{
buy_primary_weapon(idrandom_num(0sizeof g_primary_items 1))
menu_buy2(idrandom_num(0sizeof g_secondary_items 1))
return;
}

// Automatic selection enabled for player and menu called on spawn event
if (WPN_AUTO_ON && taskid g_maxplayers)
{
buy_primary_weapon(idWPN_AUTO_PRI)
menu_buy2(idWPN_AUTO_SEC)
return;
}

static 
menu[999], lenweap
len 
0

// Title
len += formatex(menu[len], sizeof menu len"\y%L \r[%d-%d]^n^n"id"MENU_BUY1_TITLE"WPN_STARTID+1min(WPN_STARTID+7WPN_MAXIDS))

// 1-7. Weapon List
for (weap WPN_STARTIDweap min(WPN_STARTID+7WPN_MAXIDS); weap++)
if (
g_level[id] >= lvlarmas[weap])
len += formatex(menu[len], sizeof menu len"\r%d.\w %s^n"weap-WPN_STARTID+1ArmasName[weap])
else
len += formatex(menu[len], sizeof menu len"\r%d.\d %s\d (\rMin %d\d)^n"weap-WPN_STARTID+1ArmasName[weap], lvlarmas[weap])  

// 8. Auto Select
len += formatex(menu[len], sizeof menu len"^n\r8.\w %L \y[%L]"id"MENU_AUTOSELECT"id, (WPN_AUTO_ON) ? "MOTD_ENABLED" "MOTD_DISABLED")

// 9. Next/Back - 0. Exit
len += formatex(menu[len], sizeof menu len"^n^n\r9.\w %L/%L^n^n\r0.\w %L"id"MENU_NEXT"id"MENU_BACK"id"MENU_EXIT")

show_menu(idKEYSMENUmenu, -1"Buy Menu 1")

Luego Busca :

public fw_PlayerSpawn_Post(id)

Y Abajo Del return; Agrega

PHP Code:
g_superm4a1[id] = false 
Luego Busca:
buy_primary_weapon(id, selection)
Y Avajo De
g_canbuy[id] = false Agrega

PHP Code:

switch (selection)
{
case 
18g_superm4a1[id] = true

Compila Y Proba
En algún momento le dijiste para que versión del ZP servía ?
_Venganza_ is offline
Shion
Senior Member
Join Date: Dec 2008
Old 09-06-2011 , 16:45   Re: Menu para agregar armas echas con bools
#18

Quote:
Originally Posted by _Venganza_ View Post
En algún momento le dijiste para que versión del ZP servía ?
Interesante comentario
__________________
Shion is offline
Sambuseti
Member
Join Date: Jun 2011
Location: Chile
Old 09-06-2011 , 17:38   Re: Menu para agregar armas echas con bools
#19

Quote:
Originally Posted by _Venganza_ View Post
En algún momento le dijiste para que versión del ZP servía ?
Perdonen por no responder me fui a dormir y recien yego del cole bueno primero es para 4.2 :S igual es facil adaptarlo a 4.3 despues lo paso

Y Se Te Mesclan Las Armas Por Ke Estas Usando Los Names De Antes No Te Procupes No Afecta En Nada A Las Armas Secundarias Esto Lo Que Hace Es Asignarle Un Nombre A Las Armas Primarias
Nunca Tocamos Nada De Las Secundarias

Osea

PHP Code:

new const ArmasName[][] = { """P228 Compact""""Schmidt Scout""""XM1014 M4""""Ingram MAC-10""Steyr AUG A1",
            
"""Dual Elite Berettas""FiveseveN""UMP 45""SG-550 Auto-Sniper""IMI Galil""Famas",
            
"USP .45 ACP Tactical""Glock 18C""AWP Magnum Sniper""MP5 Navy""M249 Para Machinegun",
            
"M3 Super 90""M4A1 Carbine""Schmidt TMP""G3SG1 Auto-Sniper""""Desert Eagle .50 AE",
            
"SG-552 Commando""AK-47 Kalashnikov""""ES P90""""Super m4a1" 
Ese No Va Pone Como Dije Yo Osea

PHP Code:
new const ArmasName[][] = { "Ingram MAC-10""Schmidt TMP""AK-47 Kalashnikov""P90d&K""Delta G11""Super Serbu""Dual Navy""Minigun""Endfiel L85""F1-Famas""Awp Fire""EO-Tech G36c""Satanic Presicion Rifle""Damn Auto-Sniper""Fire Deamon""Tactical VTAC""Spass-12",  "Super M4a1 Nueva" // y el name XD 
Este Es Uno Totalmente Nuevo Que Nada Que ver Con El Otro Cualkier Cosa Suvo Un Zp Que Tenga Para Agregar Mas Armas

Y Si Te Sigue Molestando Hace Lo Mismo Para La Secundarias

Y Los Levels Se Hace igual al comun avisen si ay problemas


Aclaro Antes De Que Digan Que Esta Bug Yo Solo Les Explique Como Hacer El Menu Para Agregar Mas Armas Le Falta La Restrincion De Niveles Si Quieren Que Les Ante Bm Vayan A

public menu_buy1(id, key)

y Cambian Ese Public Por Este
PHP Code:

public menu_buy1(idkey)
{
// Zombies or survivors get no guns
if (g_zombie[id] || g_survivor[id] || !is_user_alive(id))
return 
PLUGIN_HANDLED;

// Special keys / weapon list exceeded
if (key >= MENU_KEY_AUTOSELECT || WPN_SELECTION >= WPN_MAXIDS)
{
switch (
key)
{
case 
MENU_KEY_AUTOSELECT// toggle auto select
{
WPN_AUTO_ON WPN_AUTO_ON
}
case 
MENU_KEY_NEXT// next/back
{
if (
WPN_STARTID+WPN_MAXIDS)
WPN_STARTID += 7
else
WPN_STARTID 0
}
case 
MENU_KEY_EXIT// exit
{
return 
PLUGIN_HANDLED;
}
}

// Show buy menu again
show_menu_buy1(id)
return 
PLUGIN_HANDLED;
}

if(
g_level[id] >= lvlarmas[WPN_SELECTION])
{
// Store selected weapon id
WPN_AUTO_PRI WPN_SELECTION

// Buy primary weapon
buy_primary_weapon(idWPN_AUTO_PRI)

// Show pistols menu
show_menu_buy2(id)
}
else
show_menu_buy1(id)

return 
PLUGIN_HANDLED;

Por Que Si Lo Dejan Comos Les Dije Por mas Que DIga Ke Nesesitas Nivel 15 La Podes Comprar Igual





Last edited by Sambuseti; 09-06-2011 at 17:54.
Sambuseti is offline
Send a message via MSN to Sambuseti Send a message via Skype™ to Sambuseti
Shion
Senior Member
Join Date: Dec 2008
Old 09-06-2011 , 18:27   Re: Menu para agregar armas echas con bools
#20

No entendi bien, tengo qe dejar

PHP Code:
new const WEAPONNAMES[][] = { """P228 Compact""""Schmidt Scout""""XM1014 M4""""Ingram MAC-10""Steyr AUG A1",
            
"""Dual Elite Berettas""FiveseveN""UMP 45""SG-550 Auto-Sniper""IMI Galil""Famas",
            
"USP .45 ACP Tactical""Glock 18C""AWP Magnum Sniper""MP5 Navy""M249 Para Machinegun",
            
"M3 Super 90""M4A1 Carbine""Schmidt TMP""G3SG1 Auto-Sniper""""Desert Eagle .50 AE",
            
"SG-552 Commando""AK-47 Kalashnikov""""ES P90""""Super m4a1" 
y agregar
PHP Code:
new const ArmasName[][] = { "Ingram MAC-10""Schmidt TMP""AK-47 Kalashnikov""P90d&K""Delta G11""Super Serbu""Dual Navy""Minigun""Endfiel L85""F1-Famas""Awp Fire""EO-Tech G36c""Satanic Presicion Rifle""Damn Auto-Sniper""Fire Deamon""Tactical VTAC""Spass-12",  "Super M4a1 Nueva" 
o reemplazo 1 por otro ?
</span></span>
__________________
Shion is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:07.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode