Solucion a este comando?
#1

Buenas, estoy "arreglando" una GM y le estoy poniendo un sistema de accesorios.

Hice el comando y todo, luego de varios intentos, y no me da errores a la hora de compilar, pero cuando coloco el CMD en SAMP, me tira este error en el samp-server.exe



Код:
[17/09/2017 21:45:04] [join] Steven_Dominguez has joined the server (2:192.168.0.102)
[17/09/2017 21:45:18] - Cuenta cargada ('Steven_Dominguez' - 1 ms).
[17/09/2017 21:45:25] [debug] Run time error 4: "Array index out of bounds"
[17/09/2017 21:45:25] [debug]  Attempted to read/write array element at index 5 in array of size 5
[17/09/2017 21:45:25] [debug] AMX backtrace:
[17/09/2017 21:45:25] [debug] #0 00276304 in public cmd_haber (2, 31969428) from optimusv3.amx
[17/09/2017 21:45:25] [debug] #1 native CallLocalFunction () from samp-server.exe
[17/09/2017 21:45:25] [debug] #2 0001d4bc in ?? (2, 31969400) from optimusv3.amx
[17/09/2017 21:45:25] [debug] #3 00011418 in public FIXES_OnPlayerCommandText (2, 31969400) from optimusv3.amx
[17/09/2017 21:45:25] [debug] #4 00003684 in public OnPlayerCommandText (2, 31969400) from optimusv3.amx
[17/09/2017 21:45:25] [CMD] Steven_Dominguez: /haber
[17/09/2017 21:45:30] [part] Steven_Dominguez has left the server (2:1)


Mientras que el comando en .pwn es asн.



PHP код:
CMD:haber(playerid, params[]) //Volvertosta
    
{
    new 
stringg[JUGUETES_MAXIMOS*(55)], name[30];
    
foreachEx(x:JUGUETES_MAXIMOS)
    {
//
    
format(name, sizeof(name), "Nada");
    for(new 
i;i<sizeof(Toys_Compra);i++)
    {
//
    
if(Toys_Compra[i][hmodelid] == Juguetes[playerid][x][j@modelid])
    {
    
format(name, sizeof(name), "%s", Toys_Compra[i][hmodelname]);
    }
    
format(stringg, sizeof(stringg), "%s(%d) %s (Parte: %s)   -   Usado: %s", stringg, x, name, Juguetes[playerid][x][j@bone],macro(Juguetes[playerid][i][j@ocultado]==1,""colorlima"Si",""colorrojo"No") );
    }
//
    
ShowPlayerDialog(playerid,DIALOGO_MIS_JUGUETES,DIALOG_STYLE_LIST,"{FFFFFF}Mis objetos - {1F98D5}"NOMBRE_SERVIDOR"",stringg,"Siguiente","Salir");
    }
//
    
return 1;
    } 
Reply
#2

Si no vas a ayudar no hace falta que comentes, gracias.
Reply
#3

Cуmo definiste
Quote:

Toys_Compra

?
Reply
#4

Asн

PHP код:
enum Toys_Info
{
hmodelid,
hprice,
hmodelname[30]
};
//Volvertosta
static const Toys_Compra[][Toys_Info] =
{
{
19161, 300, "Sombrero de policia 1"},
{
19162, 300, "Sombrero de policia 2"},
{
19093, 250, "Sombrero 1"},
{
19160, 250, "Sombrero 2"},
{
18639, 250, "Sombrero negro"},
{
18640, 300, "Peluca"},
{
18975, 300, "Peluca 2"},
{
19136, 300, "Peluca 3"},
{
19274, 300, "Peluca 4"},
{
19516, 300, "Peluca gris"},
{
18641, 800, "Linterna"},
{
18891, 300, "Bandana 1"},
{
18892, 300, "Bandana 2"},
{
18893, 300, "Bandana 3"},
{
18894, 300, "Bandana 4"},
{
18895, 300, "Bandana 5"},
{
18896, 300, "Bandana 6"},
{
18897, 300, "Bandana 7"},
{
18898, 300, "Bandana 8"},
{
18899, 300, "Bandana 9"},
{
18900, 300, "Bandana 10"},
{
18901, 300, "Bandana 11"},
{
18902, 300, "Bandana 12"},
{
18903, 300, "Bandana 13"},
{
18904, 300, "Bandana 14"},
{
18905, 300, "Bandana 15"},
{
18906, 300, "Bandana 16"},
{
18907, 300, "Bandana 17"},
{
18908, 300, "Bandana 18"},
{
18909, 300, "Bandana 19"},
{
18910, 300, "Bandana 20"},
{
18911, 300, "Mascara 1"},
{
18912, 300, "Mascara 2"},
{
18913, 300, "Mascara 3"},
{
18914, 300, "Mascara 4"},
{
18915, 300, "Mascara 5"},
{
18916, 300, "Mascara 6"},
{
18917, 300, "Mascara 7"},
{
18918, 300, "Mascara 8"},
{
18919, 300, "Mascara 9"},
{
18920, 300, "Mascara 10"},
{
18921, 300, "Beret 1"},
{
18922, 300, "Beret 2"},
{
18923, 400, "Beret 3"},
{
18924, 400, "Beret 4"},
{
18925, 400, "Beret 5"},
{
18926, 300, "Sombrero 1"},
{
18927, 300, "Sombrero 2"},
{
18928, 300, "Sombrero 3"},
{
18929, 300, "Sombrero 4"},
{
18930, 300, "Sombrero 5"},
{
18931, 300, "Sombrero 6"},
{
18932, 300, "Sombrero 7"},
{
18933, 300, "Sombrero 8"},
{
18934, 300, "Sombrero 9"},
{
18935, 300, "Sombrero 10"},
{
18939, 300, "Gorra 1"},
{
18944, 300, "Sombrero1"},
{
18945, 300, "Sombrero2"},
{
18946, 300, "Sombrero3"},
{
18947, 300, "Sombrero4"},
{
18948, 300, "Sombrero5"},
{
18949, 300, "Sombrero6"},
{
18950, 300, "Sombrero7"},
{
18951, 300, "Sombrero8"}, //
{18953, 300, "Gorra1"},
{
18954, 300, "Gorra2"},
{
18955, 300, "Gorra3"},
{
18956, 300, "Gorra4"},
{
18957, 300, "Gorra5"},
{
18958, 300, "Gorra6"},
{
18959, 300, "Gorra7"},
{
18960, 300, "Gorra8"},
{
18961, 300, "Gorra9"},
{
18964, 300, "Gorra Skully"},
{
18965, 300, "Gorra Sully2"},
{
18966, 300, "Gorra Skully3"},
{
18967, 300, "Gorro 1"},
{
18968, 300, "Gorro 2"},
{
18969, 300, "Gorro 3"},
{
18970, 300, "Gorro atigrado"},//
{18971, 300, "HatCool1"},
{
18972, 350, "HatCool2"},
{
18973, 300, "HatCool3"},
{
18974, 300, "MaskZorro"},
{
18976, 450, "CascoMoto-1"},
{
18977, 450, "CascoMoto-2"},
{
18978, 450, "CascoMoto-3"},
{
18979, 450, "CascoMoto-4"},
{
19006, 300, "Lentes1"},
{
19007, 300, "Lentes2"},
{
19008, 300, "Lentes3"},
{
19009, 300, "Lentes4"},
{
19010, 300, "Lentes5"},
{
19011, 300, "Lentes6"},
{
19012, 300, "Lentes7"},
{
19013, 300, "Lentes8"},
{
19014, 300, "Lentes9"},
{
19015, 300, "Lentes10"},
{
19016, 300, "Lentes11"},
{
19017, 300, "Lentes12"},
{
19018, 300, "Lentes13"},
{
19019, 300, "Lentes14"},
{
19020, 300, "Lentes15"},
{
19021, 300, "Lentes16"},
{
19022, 300, "Lentes17"},
{
19023, 300, "Lentes18"},
{
19024, 300, "Lentes19"},
{
19025, 300, "Lentes20"},
{
19026, 300, "Lentes21"},
{
19027, 300, "Lentes22"},
{
19028, 300, "Lentes23"},
{
19029, 300, "Lentes24"},
{
19030, 300, "Lentes25"},
{
19031, 300, "Lentes26"},
{
19032, 300, "Lentes27"},
{
19033, 300, "Lentes28"},
{
19034, 300, "Lentes29"},
{
19035, 300, "Lentes30"},
{
19039, 300, "Reloj1"},
{
19040, 300, "Reloj2"},
{
19041, 300, "Reloj3"},
{
19042, 300, "Reloj4"},
{
19043, 300, "Reloj5"},
{
19044, 300, "Reloj6"},
{
19045, 300, "Reloj7"},
{
19046, 300, "Reloj8"},
{
19047, 300, "Reloj9"},
{
19048, 300, "Reloj10"},
{
19049, 300, "Reloj11"},
{
19050, 300, "Reloj12"},
{
19051, 300, "Reloj13"},
{
19052, 300, "Reloj14"},
{
19053, 300, "Reloj15"}
}; 
Reply
#5

Remplaza
PHP код:
foreachEx(x:JUGUETES_MAXIMOS) 
Por
PHP код:
for(new x = 0, jm = JUGUETES_MAXIMOS; x <= jm; x++) 
E intenta de nuevo.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)