Raised This Month: $ Target: $400
 0% 

[ES] ¿Cómo agrego una array como additem?


  
 
 
Thread Tools Display Modes
Author Message
g_often
Senior Member
Join Date: Jan 2010
Location: In your mind
Old 03-01-2010 , 14:39   [ES] ¿Cómo agrego una array como additem?
#1

¿Cómo agrego una array en additem? Ejemplo

menu_additem(menu, "Array" // etc etc
__________________
Reality is wrong, dreams are for real.
g_often is offline
fezh
Veteran Member
Join Date: Dec 2008
Location: BANNED
Old 03-01-2010 , 15:05   Re: [ES] ¿Cómo agrego una array como additem?
#2

Querés agregar un array o un string?
__________________
"There is no knowledge, that is not power"
fezh is offline
g_often
Senior Member
Join Date: Jan 2010
Location: In your mind
Old 03-01-2010 , 15:17   Re: [ES] ¿Cómo agrego una array como additem?
#3

un array, ejemplo

new Array:asd

en plugin init

asd = ArrayCreate(32, 1)

dsp

menu_additem(menu, asd // aca el array
__________________
Reality is wrong, dreams are for real.
g_often is offline
fezh
Veteran Member
Join Date: Dec 2008
Location: BANNED
Old 03-01-2010 , 17:00   Re: [ES] ¿Cómo agrego una array como additem?
#4

ArrayGetString?
__________________
"There is no knowledge, that is not power"
fezh is offline
g_often
Senior Member
Join Date: Jan 2010
Location: In your mind
Old 03-01-2010 , 17:14   Re: [ES] ¿Cómo agrego una array como additem?
#5

me das un ejemplo? sé que esto no funciona xD , como seria la forma correcta?

PHP Code:
#include <amxmodx>

new Array:asd
new buffer32 ]

public 
plugin_init() {
    
register_plugin("#Ejemplo""-""-")
    
    
asd ArrayCreate(321)
    
    
register_clcmd("say /asd""menu")
}

public 
menu(id)
{
    new 
Menu menu_create("\yEjemplo""Handle")
    
    static 
inum[10]
    for(
0<   ArraySizeasd ); i++)
    {
        
ArrayGetStringasd buffer 31 )
        
num_to_str(inum9)
        
menu_additem(Menubuffer num0)
    }
    
    
menu_setprop(Menu,MPROP_EXITNAME,"Salir")
    
    
menu_display(idMenu0)

pd: ya se que falta el handle.
__________________
Reality is wrong, dreams are for real.

Last edited by g_often; 03-01-2010 at 17:18.
g_often is offline
L//
Senior Member
Join Date: Aug 2008
Location: Not found
Old 03-01-2010 , 18:43   Re: [ES] ¿Cómo agrego una array como additem?
#6

Eso esta correcto, solo que no vas a ver resultados porque estas obteniendo valores de un array vacio. Antes tenes que cargarlo, podes usar ArrayPushString. Una sugerencia, el array buffer hacelo local.
__________________
L// is offline
Send a message via MSN to L//
g_often
Senior Member
Join Date: Jan 2010
Location: In your mind
Old 03-02-2010 , 03:22   Re: [ES] ¿Cómo agrego una array como additem?
#7

ok gracias, y como hago por ejemplo para hacer

asd[hola[hola[i]] <-- un ejemplo, o no se puedE?
__________________
Reality is wrong, dreams are for real.
g_often 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 14:40.


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