pregunta
#1
hola queria preguntar que al compilar un codigo de sistema de habilidades en mi server voy a la parte de plugins y me muestra que esta funcionando y a pesar que lo compilo y le cambio nombre me sale con este nombre cuando veo donde estan todos los plugins New Plug-In pero no me sirve el plugin lo compilo y pego el codigo correctamente y todo pero no me funciona y el plugin aparece como funcionando pero no sirbe que podria ser si alguien me podria mandar el sma para probarlo para ver si funciona porfavor.

PD: EL PLUGIN ES DE
Spasforever

PD2: SI ALGUIEN ME PUEDE MANDAR EL SMA POR ACA, PORQUE AMI SEGURAMENTE ME SIGA TIRANDO
ERROR

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <adv_vault>
#include <fakemeta>
#include <fun>
#include <cstrike>

#define PLUGIN "Mejoras"
#define VERSION "1.0"
#define AUTHOR "Spasforever"

#define TAG "[SpecialGames]"

new g_puntos[33]
new g_mejora[33][4]
new Float: g_velocidad[33]
new g_vida[33]
new Float: g_gravedad[33]
new Float: g_danio[33]
new Ham:Ham_Player_ResetMaxSpeed = Ham_Item_PreFrame;
new g_gastados[33]

new g_vault

enum
{
CAMPO_MEJORA1,
CAMPO_MEJORA2,
CAMPO_MEJORA3,
CAMPO_MEJORA4,
CAMPO_PUNTOS,
CAMPO_VIDA,
CAMPO_DANIO,
CAMPO_VELOCIDAD,
CAMPO_GRAVEDAD,
CAMPO_GASTADOS,
CAMPO_MAX
}
new g_campos[CAMPO_MAX]

const KEYSMENU = MENU_KEY_1 | MENU_KEY_2 | MENU_KEY_3 | MENU_KEY_4 | MENU_KEY_5 | MENU_KEY_0

public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)

RegisterHam(Ham_Player_ResetMaxSpeed, "player", "fw_ResetMaxSpeed_Post", 1),
RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage", 0),
RegisterHam(Ham_Spawn, "player", "fw_PlayerSpawn_Post", 1),
RegisterHam(Ham_Killed, "player", "Ham_PlayerKilled", 1),
register_menu("Mejoras", KEYSMENU, "HandMejoras"),
register_clcmd("say /mejoras", "Mejoras"),
g_vault = adv_vault_open("Mejoras", false),
g_campos[CAMPO_MEJORA1] = adv_vault_register_field(g_vault, "MEJORA1"),
g_campos[CAMPO_MEJORA2] = adv_vault_register_field(g_vault, "MEJORA2"),
g_campos[CAMPO_MEJORA3] = adv_vault_register_field(g_vault, "MEJORA3"),
g_campos[CAMPO_MEJORA4] = adv_vault_register_field(g_vault, "MEJORA4"),
g_campos[CAMPO_PUNTOS] = adv_vault_register_field(g_vault, "PUNTOS"),
g_campos[CAMPO_VIDA] = adv_vault_register_field(g_vault, "VIDA"),
g_campos[CAMPO_DANIO] = adv_vault_register_field(g_vault, "DANIO"),
g_campos[CAMPO_VELOCIDAD] = adv_vault_register_field(g_vault, "VELOCIDAD"),
g_campos[CAMPO_GRAVEDAD] = adv_vault_register_field(g_vault, "GRAVEDAD"),
g_campos[CAMPO_GASTADOS] = adv_vault_register_field(g_vault, "GASTADOS"),
adv_vault_init(g_vault)
}

public client_putinserver(id)
{
g_velocidad[id] = 240.00
g_vida[id] = 100
g_gravedad[id] = 1.00
Cargar(id)
}

public client_disconnect(id)
{
Guardar(id)
}

public Ham_PlayerKilled(victim, attacker, shouldgib, id)
{
if (victim == attacker || !is_user_connected(attacker)) return;
g_puntos[attacker]++
ChatColor(attacker, "!g%s !yGanaste !g1 Punto", TAG)
}

public Mejoras(id)
{
new menu[500], len

len = 0

len += formatex(menu[len], sizeof menu - 1 - len, "\rMenu Mejoras ^n\wGanas \y1 Punto\w Cuando \yMatas a un enemigo.^n\wTienes \y%d \wPuntos Para Gastar, \yPuntos Gastados \r%d^n^n", g_puntos[id], g_gastados[id])
if (g_mejora[id][0] <= 9)
{
len += formatex(menu[len], sizeof menu - 1 - len, "\y[1] \wDaño \r(%s) \y(%d/10)^n^n", g_mejora[id][0] == 10? "MAXIMO" : "1 PUNTO", g_mejora[id][0])
}
else
{
len += formatex(menu[len], sizeof menu - 1 - len, "\d[1] Daño (%s) (%d/10)^n^n", g_mejora[id][0] == 10? "MAXIMO" : "1 PUNTO", g_mejora[id][0])
}
if (g_mejora[id][1] <= 9)
{
len += formatex(menu[len], sizeof menu - 1 - len, "\y[2] \wVida \r(%s) \y(%d/10)^n^n", g_mejora[id][1] == 10? "MAXIMO" : "1 PUNTO", g_mejora[id][1])
}
else
{
len += formatex(menu[len], sizeof menu - 1 - len, "\d[2] Vida (%s) (%d/10)^n^n", g_mejora[id][1] == 10? "MAXIMO" : "1 PUNTO", g_mejora[id][1])
}
if (g_mejora[id][2] <= 9)
{
len += formatex(menu[len], sizeof menu - 1 - len, "\y[3] \wVelocidad \r(%s) \y(%d/10)^n^n", g_mejora[id][2] == 10? "MAXIMO" : "1 PUNTO", g_mejora[id][2])
}
else
{
len += formatex(menu[len], sizeof menu - 1 - len, "\d[3] Velocidad (%s) (%d/10)^n^n", g_mejora[id][2] == 10? "MAXIMO" : "1 PUNTO", g_mejora[id][2])
}
if (g_mejora[id][3] <= 9)
{
len += formatex(menu[len], sizeof menu - 1 - len, "\y[4] \wGravedad \r(%s) \y(%d/10)^n^n", g_mejora[id][3] == 10? "MAXIMO" : "1 PUNTO", g_mejora[id][3])
}
else
{
len += formatex(menu[len], sizeof menu - 1 - len, "\d[4] Gravedad (%s) (%d/10)^n^n", g_mejora[id][3] == 10? "MAXIMO" : "1 PUNTO", g_mejora[id][3])
}
len += formatex(menu[len], sizeof menu - 1 - len, "\y[5] \wResetear \yMejoras^n^n^n")
len += formatex(menu[len], sizeof menu - 1 - len, "\y[0] \wSALIR")

show_menu(id, KEYSMENU, menu, -1, "Mejoras")
}

public HandMejoras(id, keys, menu)
{
switch(keys)
{
case 0:
{
if (g_mejora[id][0] >= 10)
{
Mejoras(id)
}
else
{
if (g_puntos[id] <= 0)
{
Mejoras(id)
ChatColor(id, "!g%s !yNo Tienes Puntos", TAG)
}
else
{
g_gastados[id]++
g_danio[id] +=5.50
g_mejora[id][0]++
g_puntos[id]--
Mejoras(id)
}
}
}
case 1:
{
if (g_mejora[id][1] >= 10)
{
Mejoras(id)
}
else
{
if (g_puntos[id] <= 0)
{
Mejoras(id)
ChatColor(id, "!g%s !yNo Tienes Puntos", TAG)
}
else
{
g_gastados[id]++
g_mejora[id][1]++
g_puntos[id]--
g_vida[id] += 20
Mejoras(id)
}
}
}
case 2:
{
if (g_mejora[id][2] >= 10)
{
Mejoras(id)
}
else
{
if (g_puntos[id] <= 0)
{
Mejoras(id)
ChatColor(id, "!g%s !yNo Tienes Puntos", TAG)
}
else
{
g_gastados[id]++
g_mejora[id][2]++
g_puntos[id]--
Mejoras(id)
g_velocidad[id] += 60.60
}
}
}
case 3:
{
if (g_mejora[id][3] >= 10)
{
Mejoras(id)
}
else
{
if (g_puntos[id] <= 0)
{
ChatColor(id, "!g%s !yNo Tienes Puntos", TAG)
Mejoras(id)
}
else
{
g_gastados[id]++
g_mejora[id][3]++
g_puntos[id]--
g_gravedad[id] -= 0.07
Mejoras(id)
}
}
}
case 4:
{
if (g_gastados[id] >= 1)
{
g_puntos[id] += g_gastados[id]
g_mejora[id][0] = 0
g_mejora[id][1] = 0
g_mejora[id][2] = 0
g_mejora[id][3] = 0
g_velocidad[id] = 240.00
g_vida[id] = 100
g_gravedad[id] = 1.00
g_danio[id] = 0.0
g_gastados[id] = 0
Mejoras(id)
}
else
{
Mejoras(id)
}
}
case 6: menu_destroy(menu)
}
}

public fw_TakeDamage(victim, inflictor, attacker, Float:damage, damage_type)
{

damage += g_danio[attacker]
SetHamParamFloat(4, damage)
return HAM_IGNORED
}

public fw_PlayerSpawn_Post(id)
{
if (!is_user_alive(id) || !get_user_team(id)) return
set_user_health(id, g_vida[id])
set_user_gravity(id, Float: g_gravedad[id])
ExecuteHamB(Ham_Player_ResetMaxSpeed, id)
}

public fw_ResetMaxSpeed_Post(id)
{
if (is_user_alive(id))
set_player_maxspeed(id)
return;
}

set_player_maxspeed(id)
{
set_user_maxspeed(id, g_velocidad[id])
}

public Guardar(id)
{
static name[32]
get_user_name(id, name, sizeof name - 1)
adv_vault_set_start(g_vault)

adv_vault_set_field(g_vault, g_campos[CAMPO_MEJORA1], g_mejora[id][0])
adv_vault_set_field(g_vault, g_campos[CAMPO_MEJORA2], g_mejora[id][1])
adv_vault_set_field(g_vault, g_campos[CAMPO_MEJORA3], g_mejora[id][2])
adv_vault_set_field(g_vault, g_campos[CAMPO_MEJORA4], g_mejora[id][3])
adv_vault_set_field(g_vault, g_campos[CAMPO_PUNTOS], g_puntos[id])
adv_vault_set_field(g_vault, g_campos[CAMPO_VIDA], g_vida[id])
adv_vault_set_field(g_vault, g_campos[CAMPO_DANIO],Float: g_danio[id])
adv_vault_set_field(g_vault, g_campos[CAMPO_VELOCIDAD],Float: g_velocidad[id])
adv_vault_set_field(g_vault, g_campos[CAMPO_GRAVEDAD],Float: g_gravedad[id])
adv_vault_set_field(g_vault, g_campos[CAMPO_GASTADOS], g_gastados[id])
adv_vault_set_end(g_vault, 0, name)
}

public Cargar(id)
{
static name[32]
get_user_name(id, name, sizeof name - 1)

if(!adv_vault_get_prepare(g_vault, _, name))
return;

g_mejora[id][0] = adv_vault_get_field(g_vault, g_campos[CAMPO_MEJORA1]);
g_mejora[id][1] = adv_vault_get_field(g_vault, g_campos[CAMPO_MEJORA2]);
g_mejora[id][2] = adv_vault_get_field(g_vault, g_campos[CAMPO_MEJORA3]);
g_mejora[id][3] = adv_vault_get_field(g_vault, g_campos[CAMPO_MEJORA4]);
g_puntos[id] = adv_vault_get_field(g_vault, g_campos[CAMPO_PUNTOS]);
g_vida[id] = adv_vault_get_field(g_vault, g_campos[CAMPO_VIDA]);
g_danio[id] = Float: adv_vault_get_field(g_vault, g_campos[CAMPO_DANIO]);
g_velocidad[id] = Float: adv_vault_get_field(g_vault, g_campos[CAMPO_VELOCIDAD]);
g_gravedad[id] = Float: adv_vault_get_field(g_vault, g_campos[CAMPO_GRAVEDAD]);
g_gastados[id] = adv_vault_get_field(g_vault, g_campos[CAMPO_GASTADOS]);
}

stock ChatColor(const id, const input[], any:...)
{
new count = 1, players[32]
static msg[191]
vformat(msg, 190, input, 3)

replace_all(msg, 190, "!g", "^4") // Green Color
replace_all(msg, 190, "!y", "^1") // Default Color
replace_all(msg, 190, "!t", "^3") // Team Color
replace_all(msg, 190, "!team", "^0") // Team2 Color

if (id) players[0] = id; else get_players(players, count, "ch")
{
for (new i = 0; i < count; i++)
{
if (is_user_connected(players[i]))
{
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
write_byte(players[i]);
write_string(msg);
message_end();
}
}
}
}
El conocimiento es Libre.Fuck yeah
Responder
#2
que errores te tira ? se especifico ya que no somos adivinos esto va en scripting ponlo en php

ejemplo

[/php] CODIGO ACA [/php] a la primera quitale el /
Trolleyes
Responder
#3
(13/05/2017, 09:48 PM)FrancoX escribió: que errores te tira ? se especifico ya que no somos adivinos esto va en scripting ponlo en php

ejemplo

[/php] CODIGO ACA [/php] a la primera quitale el /

nose como hacer eso podrias echarme una manito D: pero el error que me tira esque me sale en la parte de plugins con otro nombre y me aparece on y no me funciona.
El conocimiento es Libre.Fuck yeah
Responder
#4
Pone un titulo descriptivo y no la erres

capas que te falta la librería adv_vault.inc

te adjunto el sma y el inc

el inc lo instalas en (amxmodx/scripting/includes)


Archivos adjuntos
.inc   adv_vault.inc (Tamaño: 10.06 KB / Descargas: 3)
.sma   Descargar AMXX / sistema.sma (Tamaño: 9.08 KB / Descargas: 58)
Responder
#5
(13/05/2017, 10:04 PM)Kross escribió: Pone un titulo descriptivo y no la erres

capas que te falta la librería adv_vault.inc

te adjunto el sma y el inc

el inc lo instalas en (amxmodx/scripting/includes)

error al compilarlo:


Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright © 1997-2013 ITB CompuPhase, AMX Mod X Team

Error: Cannot read from file: "adv_vault" on line 6

Compilation aborted.
1 Error.
Could not locate output file C:\Users\Nico\Desktop\sistema.amx (compile failed).
El conocimiento es Libre.Fuck yeah
Responder
#6
(13/05/2017, 10:09 PM)IceFreak! escribió:
(13/05/2017, 10:04 PM)Kross escribió: Pone un titulo descriptivo y no la erres

capas que te falta la librería adv_vault.inc

te adjunto el sma y el inc

el inc lo instalas en (amxmodx/scripting/includes)

error al compilarlo:


Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright © 1997-2013 ITB CompuPhase, AMX Mod X Team

Error: Cannot read from file: "adv_vault" on line 6

Compilation aborted.
1 Error.
Could not locate output file C:\Users\Nico\Desktop\sistema.amx (compile failed).

Eso es por que te falta la librería adv_vault.inc hay arriba te adjunte el sma y el inc y donde lo debes instalar.
Responder
#7
(13/05/2017, 10:12 PM)Kross escribió:
(13/05/2017, 10:09 PM)IceFreak! escribió:
(13/05/2017, 10:04 PM)Kross escribió: Pone un titulo descriptivo y no la erres

capas que te falta la librería adv_vault.inc

te adjunto el sma y el inc

el inc lo instalas en (amxmodx/scripting/includes)

error al compilarlo:


Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright © 1997-2013 ITB CompuPhase, AMX Mod X Team

Error: Cannot read from file: "adv_vault" on line 6

Compilation aborted.
1 Error.
Could not locate output file C:\Users\Nico\Desktop\sistema.amx (compile failed).

Eso es por que te falta la librería adv_vault.inc hay arriba te adjunte el sma y el inc y donde lo debes instalar.

ahi me compilo pero al verlo en plugins sale como unkown off que hago ayuda
El conocimiento es Libre.Fuck yeah
Responder
#8
Instala también este


Archivos adjuntos
.sma   Descargar AMXX / adv_vault.sma (Tamaño: 41.55 KB / Descargas: 81)
Responder
#9
(13/05/2017, 10:21 PM)Kross escribió: Instala también este

me tomo este pero aun no me deja acceder al menu de puntos no me aparece

agrega a steam D:
El conocimiento es Libre.Fuck yeah
Responder
#10
te tira logs en consola?
Responder
#11
(13/05/2017, 11:14 PM)Kross escribió: te tira logs en consola?

no me tira ningun logs D:
El conocimiento es Libre.Fuck yeah
Responder
#12
(14/05/2017, 11:03 AM)IceFreak! escribió:
(13/05/2017, 11:14 PM)Kross escribió: te tira logs en consola?

no me tira ningun logs D:

revisa hasta arriba de todo..

el adv_vault instalalo encima de ese plugin, es decir:

Cita:adv_vault.amxx debug
tuplugin.amxx debug

Pd; no me leí todo el tema, me dio cosa ver el código sin php y descargarlo que pereza xd
[Imagen: zcsztw-4.png] [Imagen: 6u5fj2-4.png]
[Imagen: linkedin_thumb_image.png][Imagen: 76561198283253977.png][Imagen: linkedin_thumb_image.png]
Responder


Salto de foro:


Usuarios navegando en este tema: 1 invitado(s)