Adaptación de un plugin a otro
#1
Pregunta 
Buen día gente, todo bien? Como mencioné en mi post anterior estoy en pleno proceso de edición de un ZP, el cual a veces por mi poco conocimiento de programación se me hace inevitable el pedir un poco de ayuda. El tema es que estoy adaptando un sistema de armas por niveles (https://amxmodx-es.com/showthread.php?tid=1717) a un sistema de rangos y niveles (https://forums.alliedmods.net/showthread.php?t=308540), por el momento todo bien hasta el momento de compilar, el cual me sale este error:

Código:
//AMXXPC compile.exe
// by the AMX Mod X Dev Team


//// crx_ranksystem.sma
//
// D:\Zombie Plague3\cstrike\addons\amxmodx\scripting\crx_ranksystem.sma(367) : error 012: invalid function call, not a valid address
// D:\Zombie Plague3\cstrike\addons\amxmodx\scripting\crx_ranksystem.sma(367) : warning 215: expression has no effect
// D:\Zombie Plague3\cstrike\addons\amxmodx\scripting\crx_ranksystem.sma(367) : error 001: expected token: ";", but found ")"
// D:\Zombie Plague3\cstrike\addons\amxmodx\scripting\crx_ranksystem.sma(367) : error 029: invalid expression, assumed zero
// D:\Zombie Plague3\cstrike\addons\amxmodx\scripting\crx_ranksystem.sma(367) : fatal error 107: too many error messages on one line
//
// Compilation aborted.
// 4 Errors.
// Could not locate output file D:\Zombie Plague3\cstrike\addons\amxmodx\scripting\compiled\crx_ranksystem.amx (compile failed).
//
// Compilation Time: 0,5 sec
// ----------------------------------------

Press enter to exit ...

Código:
show_guns_prim(id) {
    new len[50], menu = menu_create("Eliga su arma primaria", "handler_prim") // creamos el menu en la variable menu
    for(new i = 0; i < sizeof g_armas_prim; i++) { // lopearemos entre todas las armas primarias que hay
        // si el level del usuario es mayor o igual al del arma ...
        if(g_aLevels(id) >= g_armas_prim[i][LEVEL]) menu_additem(menu, g_armas_prim[i][NOMBRE], "") // agregamos el item normal ##(LINEA QUE SALTA ERROR)##
        else { // y si no lo es
            formatex(len, charsmax(len), "\r[ \yNivel Requerido: \d%d \r]", g_armas_prim[i][LEVEL])
            menu_additem(menu, len, "")
        }
    }
    menu_display(id, menu, 0) // le mostramos el menu al usuario en la pagina 1
}

También les dejo el .sma para que puedan verlo mejor, en los links que les dejé pueden descargar el código original de cada uno por separado, si necesitan de algo más, no dude en decirmelo, les agradezco su tiempo. Saludos!


Archivos adjuntos
.sma   Descargar AMXX / crx_ranksystem.sma (Tamaño: 57.27 KB / Descargas: 7)
Responder
#2
Por lo que veo es la variable
Código:
g_aLevels(id)

seria:

Código PHP:
g_aLevels[id
___________________________________
SI NECESITAS UN PLUGIN TE LO HAGO $$$
COMUNICATE A MI DISCORD: emanuelitop15
Responder
#3
(26/11/2021, 04:07 PM)[E]manuelitop15 escribió: Por lo que veo es la variable
Código:
g_aLevels(id)

seria:

Código PHP:
g_aLevels[id

Funcionó! Me arreglo ese problema, habían un par de variables más que estaban iguales y tuve que cambiarlas, pero lamentablemente me saltaron otros al solucionar este. Al compilar ahora sale:

Código:
//AMXXPC compile.exe
// by the AMX Mod X Dev Team


//// crx_ranksystem.sma
//
// D:\Zombie Plague3\cstrike\addons\amxmodx\scripting\crx_ranksystem.sma(451 -- 452) : error 033: array must be indexed (variable "g_aLevels")
// D:\Zombie Plague3\cstrike\addons\amxmodx\scripting\crx_ranksystem.sma(452) : error 035: argument type mismatch (argument 1)
// D:\Zombie Plague3\cstrike\addons\amxmodx\scripting\crx_ranksystem.sma(474) : error 035: argument type mismatch (argument 1)
// D:\Zombie Plague3\cstrike\addons\amxmodx\scripting\crx_ranksystem.sma(815) : error 035: argument type mismatch (argument 1)
// D:\Zombie Plague3\cstrike\addons\amxmodx\scripting\crx_ranksystem.sma(1606) : error 035: argument type mismatch (argument 2)
// D:\Zombie Plague3\cstrike\addons\amxmodx\scripting\crx_ranksystem.sma(1609) : error 035: argument type mismatch (argument 3)
// D:\Zombie Plague3\cstrike\addons\amxmodx\scripting\crx_ranksystem.sma(1638) : error 035: argument type mismatch (argument 1)
// D:\Zombie Plague3\cstrike\addons\amxmodx\scripting\crx_ranksystem.sma(1654) : error 035: argument type mismatch (argument 1)
// D:\Zombie Plague3\cstrike\addons\amxmodx\scripting\crx_ranksystem.sma(1660) : error 035: argument type mismatch (argument 1)
// D:\Zombie Plague3\cstrike\addons\amxmodx\scripting\crx_ranksystem.sma(1877) : error 035: argument type mismatch (argument 1)
// D:\Zombie Plague3\cstrike\addons\amxmodx\scripting\crx_ranksystem.sma(52) : warning 203: symbol is never used: "ARG_LEVEL"
//
// 10 Errors.
// Could not locate output file D:\Zombie Plague3\cstrike\addons\amxmodx\scripting\compiled\crx_ranksystem.amx (compile failed).
//
// Compilation Time: 0,58 sec
// ----------------------------------------

Press enter to exit ...
Responder


Salto de foro:


Usuarios navegando en este tema: 1 invitado(s)