Raised This Month: $ Target: $400
 0% 

Obtener un array bidimensional en una native.


  
 
 
Thread Tools Display Modes
Author Message
XINLEI
me too
Join Date: Jun 2011
Location: Colombian Coffee storage
Old 02-26-2012 , 15:42   Obtener un array bidimensional en una native.
#1

Estaba haciendo un plugin que agarre un array bidimensional y desde mi plugin, sacar un menu de seleccion que cambie los valores de la segunda dimension.

Pero no se como carajos obtengo un array de 2 dimensiones en una native.
PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "ZP_Color_Changer"
#define VERSION "0.0001"
#define AUTHOR "Makiza"

new const color_name[][]=
{
    
"rojo",
    
"rosa",
    
"rojo oscuro",
    
"rojo claro",
    
"azul",
    
"azul oscuro",
    
"azul claro",
    
"aquamarina",
    
"verde",
    
"verde claro",
    
"verde oscuro",
    
"cafe",
    
"cafe claro",
    
"blanco",
    
"amarillo",
    
"amarillo oscuro",
    
"amarillo claro",
    
"naranja",
    
"naranja claro",
    
"naranja oscuro",
    
"purpura",
    
"purpura oscuro",
    
"violeta",
    
"marron",
    
"oro",
    
"plata",
    
"bronce",
    
"gris"
}

new const 
color_data[][3]=
{
    {
255,0,0},
    {
255,190,190},
    {
165,0,0},
    {
255,100,100},
    {
0,0,255},
    {
0,0,136},
    {
95,200,255},
    {
0,150,255},
    {
0,255,0},
    {
180,255,175},
    {
0,155,0},
    {
150,63,0},
    {
205,123,64},
    {
255,255,255},
    {
255,255,0},
    {
189,182,0},
    {
255,255,109},
    {
255,150,0},
    {
255,190,90},
    {
222,110,0},
    {
243,138,255},
    {
255,0,255},
    {
150,0,150},
    {
100,0,100},
    {
200,0,0},
    {
220,220,0},
    {
192,192,192},
    {
190,100,10},
    {
114,114,114}
}

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
}

public 
plugin_natives()
{
    
register_native("zp_color_change""color_get",1)
}

public 
color_get(???)
{
    
// new current_color[id][???] = ( ¯\(°_o)/¯ )
}

public 
show_color_menu(id)
{
    new 
menumenu1[50]
    
formatex(menu149"Color Actual^n\yR: \r%d \yG: \r%d \yB: \r%d"current_color[id][0], current_color[id][1], current_color[id][2])
    
    
menu menu_create(menu1"color_menu")
    
    new 
ipos[10]
    for (
010i++)
    {
        
num_to_str(ipos9)
        
menu_additem(menuCOLOR_NAMES[i], pos)
    }
    
menu_setprop(menu,MPROP_EXITNAME,"\y Salir")
    
menu_setprop(menuMPROP_EXITMEXIT_ALL)
    
menu_display(idmenu0)
    return 
PLUGIN_HANDLED
}
public 
color_menu(idmenuitem)
{
    if (
item == MENU_EXIT)
    {
        
menu_destroy(menu)        
        return 
PLUGIN_HANDLED;
    }
    
    new 
Data[6], Name[64]
    new 
AccessCallback
    menu_item_getinfo
(menuitemAccessDatasizeof(Data)-1Namesizeof(Name)-1Callback)
    
    new 
i
    
new KeyKey str_to_num(Data)
    
    for (
03i++)
        
current_color[id][i] = color_data[Key][i]
        
    
menu_destroy(menu)    
    
show_color_menu(id)    
    return 
PLUGIN_HANDLED;

¿Como le hago ahi?, yo falte a esa clase en java.

Gracias de Antemano.
XINLEI is offline
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 02-26-2012 , 15:47   Re: Obtener un array bidimensional en una native.
#2

Intenta mirar esto y fijate si te puede ayudar http://forums.alliedmods.net/showpos...4&postcount=13
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
 



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 17:54.


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