Simple SurF MOD
#1
Simple SurF MOD

¿Qué tiene de especial?
- Pues nada v:

Sólo acomode algunas cosas del Ardivaba
Le coloque el guardado AdvVault (?

Le agregue un VIP para que gane experiencia por 2

Sí tiene un bug digan me así aprendo c:

Cosas necesarias:

Código PHP:
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>
#include <hamsandwich>
#include <fakemeta>
#include <colorchat>
#include <adv_vault>

new const g_szPrefix[] = "[AMXX]";

#define NivelMaximo 800
new const Niveles[NivelMaximo] =
{
    
50,
    
100,
    
200,
    
400,
    
600,
    
800,
    ...
}

new 
experiencia[33], niveles[33], PKS[33], g_VerHud

new const Modelos[][] = 
{
    
"models/Carpeta/v_modelo.mdl",
}

new 
Ganancia[33], AccountType[33][20];

enum _GANANCIA_DATA
{
    
GD_ADM_TYPE[20],
    
GD_ADM_FLAG,
    
GD_ADM_GN
}

new const 
Ganancias[][GANANCIA_DATA] =
{
    {
"VIP"ADMIN_LEVEL_F2}
}

enum
{
    
CAMP_NIVELES 0,
    
CAMP_EXP,
    
MAX_CAMPOS
};

new 
g_iVault;
new 
g_iCampos[MAX_CAMPOS];

public 
plugin_cfg()
{
    
set_cvar_num"sv_airaccelerate"100);
}

public 
plugin_init()
{
    
/* Información del PLUGIN */
    
register_plugin("Simple SurF MOD""1.0""Ardivaba")
    
    
/* Sistema de Niveles por Experiencia */
    
register_event"DeathMsg""EventDeathMsg""a" )
    
    
/* Comando para dar nivel */
    
register_concmd("amx_darnivel""DarNivel"ADMIN_RCON"SurFXPMOD v1.0 by SoundBlaster")
    
register_concmd("amx_quitar""QuitarTodo"ADMIN_RCON"SurFXPMOD v1.0 by SoundBlaster")
    
    
/* Información */
    
register_clcmd("say /level""info_menu");
    
register_clcmd("say /info""Informacion");
    
    
/* HUD */
    
g_VerHud CreateHudSyncObj()
    
    
/* Armas por Niveles */
    
register_event("CurWeapon","ev_CurWeapon""be""1=1")
    
    
RegisterHam(Ham_TakeDamage"player""fwHamTakeDamage")
    
    
/* Guardado */
    
g_iVault adv_vault_open("SurFXPMOD"false);

    
g_iCampos[CAMP_NIVELES] = adv_vault_register_field(g_iVault"NIVELES");
    
g_iCampos[CAMP_EXP] = adv_vault_register_field(g_iVault"EXP");
    
    
adv_vault_init(g_iVault);
}

public 
plugin_precache()
{    
    new 
i
    
    
for(0sizeof(Modelos); i++)
        
precache_model(Modelos[i])
}

public 
client_putinserverid )
{    
    
CargarDatos(id);
    
Load_AdminTypes(id);
    
    
set_task(2.0,"hud",id+123,_,_,"b");
}

public 
client_disconnectid )
{
    
remove_task(id+123
    
GuardarDatos(id)
}

public 
hud(taskid)    
{
    new 
id taskid 123;
    
    if(!
is_user_alive(id))
    {
        new 
espect pev(idpev_iuser2);
        
        if(!
espect)
            return 
PLUGIN_CONTINUE;
        
        new 
nombre[33];get_user_name(espectnombrecharsmax(nombre))
        new 
nuevonivel Niveles[niveles[espect]]-experiencia[espect]
    
        
set_hudmessage(025500.150.1516.01.10.00.0, -1);
        
ShowSyncHudMsg(idg_VerHud"%s Detalles del Jugador^n1- Nombre: %s^n2- Vida: %d / Chaleco: %d^n3- Nivel: %d / %d^n4- Experiencia: %d / %d",
        
g_szPrefixnombreget_user_health(espect), get_user_armor(espect), niveles[espect], NivelMaximoexperiencia[espect], nuevonivel)
    }
    return 
PLUGIN_CONTINUE;
}

public 
EventDeathMsg()
{
    new 
killer read_data)
    new 
victim read_data)
    new 
headshot read_data)
    new 
xphs
    
    
if(niveles[killer] > niveles[victim]) xp 40 Ganancia[victim];
    if(
niveles[killer] < nivelesvictim ]) xp 60 Ganancia[victim]; 
    if(
niveles[killer] == niveles[victim]) xp 50 Ganancia[victim];
    
    
PKSvictim ] = 0
        
    
if( victim == killer ) return PLUGIN_CONTINUE;
        
    if(
headshot)
    {
        
xp xp 50 Ganancia[victim]; 
        
hs 1
    
}
    
    if(
PKS[killer] < 10PKS[killer]++
    
    
xp xp PKS[killer]
    
    
add_xp(killerxphs)
    
ChatColor(victimGREEN"^x04%s^x3 Estas muerto y perdiste tu^x04 killstreak!"g_szPrefix)
    
check_level(killer)
    
    return 
PLUGIN_CONTINUE;
}

/* Add xp */
public add_xpidxphs )
{
    new 
nuevonivel Niveles[niveles[id]]-experiencia[id]
    
    
experiencia[id] = experiencia[id] + xp
    
    
if(hs)
    {
        
ChatColor(idGREEN"^x04%s Headshot!^x03 Tu tienes ^x04%d^x03 de^x04 Experiencia! ^x01-^x03 Killstreak: ^x04%d^x03 Nuevo nivel despues de ^x04%d Experiencia."g_szPrefixxpPKSid ], nuevonivel)
    }
    else
    {
        
ChatColor(idGREEN"^x04%s^x03 Tu tienes ^x04%d^x03 de^x04 Experiencia! ^x01-^x03 Killstreak: ^x04%d^x03 Nuevo nivel despues de ^x04%d^x03 de^x04 Experiencia."g_szPrefixxpPKSid ], nuevonivel)
    }
}

public 
check_levelid )
{
    if(
niveles[id] < NivelMaximo )
    {
        while(
experiencia[id] >= Niveles[niveles[id]])
        {
            
            
niveles[id]++
            
ChatColor(idGREEN"^x04%s^x03 Ahora eres nivel^x04 %d!"g_szPrefixniveles[id])
            
GuardarDatos(id)
        }
    }
}

public 
info_menu(id)
{
    new 
keys MENU_KEY_0
    
new infomenu[999], lenlen 0
    
new nombre[32]
    
get_user_name(idnombrecharsmax(nombre))
    new 
nuevonivel Niveles[niveles[id]]-experiencia[id]
    
    
len += formatex(infomenu[len], charsmax(infomenu) - len"\r%s \wInformacion^n^n"g_szPrefix)
    
len += formatex(infomenu[len], charsmax(infomenu) - len"|=======================|^n")
    
len += formatex(infomenu[len], charsmax(infomenu) - len"\r- \wNombre: %s^n"nombre)
    
len += formatex(infomenu[len], charsmax(infomenu) - len"\r- \wNivel: %d / %d^n"niveles[id], NivelMaximo)
    
len += formatex(infomenu[len], charsmax(infomenu) - len"\r- \wExperiencia: %d / %d^n"experiencia[id], nuevonivel)
    
len += formatex(infomenu[len], charsmax(infomenu) - len"|=======================|")
    
len += formatex(infomenu[len], charsmax(infomenu) - len"^n^n\y0. \rSalir")

    
show_menu(idkeysinfomenu)
    return 
PLUGIN_CONTINUE
}
public 
GuardarDatos(id)
{
    
adv_vault_set_start(g_iVault);
    
    
adv_vault_set_field(g_iVaultg_iCampos[CAMP_NIVELES], niveles[id]);
    
adv_vault_set_field(g_iVaultg_iCampos[CAMP_EXP], experiencia[id]);
    
    new 
g_szPlayerName[33];get_user_name(idg_szPlayerName31)
    
adv_vault_set_end(g_iVault0g_szPlayerName[id]);
}

public 
CargarDatos(id)
{
    new 
g_szPlayerName[33];get_user_name(idg_szPlayerName31)
    
    if (!
adv_vault_get_prepare(g_iVault_g_szPlayerName[id]))
    {
        
niveles[id] = experiencia[id] = 0;
        return;
    }
    
    
niveles[id] = adv_vault_get_field(g_iVaultg_iCampos[CAMP_NIVELES]);
    
experiencia[id] = adv_vault_get_field(g_iVaultg_iCampos[CAMP_EXP]);
}

public 
ev_CurWeapon(id)
{
    if (!
is_user_connected(id) || !is_user_alive(id))
    return 
PLUGIN_HANDLED;
    
    new 
wid read_data(2)
    
    switch(
wid)
    {
        case 
CSW_KNIFE : if(niveles[id] >= 5set_pev(idpev_viewmodel2"models/Carpeta/v_modelo.mdl")
    }
        
    return 
PLUGIN_CONTINUE;
}
public 
fwHamTakeDamage(victiminflictorattackerFloat:damagedamagebits)
{
    if(!
is_user_connected(attacker))
        return 
HAM_IGNORED 
    
    
new wid get_user_weapon(attacker)
    
    switch(
wid)
    {
        case 
CSW_KNIFE : if(niveles[attacker] >= 5SetHamParamFloat(4damage 1.4)
    }
    return 
HAM_IGNORED;
}

public 
QuitarTodo(idlevelcid
{
    if(!
cmd_access(idlevelcid1))
        return 
PLUGIN_HANDLED
    
    
new nombre[32], Player
    read_argv
(1nombrecharsmax(nombre))
    
    
Player cmd_target(idnombreCMDTARGET_ALLOW_SELF)
    
    if(!
Player)
        return 
PLUGIN_HANDLED
    
    niveles
[Player] = 1
    experiencia
[Player] = 0
    
    
if(id != Player)
        
ChatColor(idGREEN"^x04%s^x03 Le has Quitado^x04 Todo,^x03 Al Jugador ^x04%s"g_szPrefixnombre)
    
    
ChatColor(PlayerGREEN"^x04%s^x03 Te han Quitado todos tus^x04 niveles"g_szPrefix)
    
    
check_level(Player)
    
    return 
PLUGIN_HANDLED
}

public 
DarNivel(idlevelcid)
{
    if (!
cmd_access(idlevelcid2))
        return 
PLUGIN_HANDLED;
    
    static 
arg[32], arg2[99], playerasd
    read_argv
(1argsizeof arg 1)
    
read_argv(2arg2sizeof arg2 1)
    
player cmd_target(idargCMDTARGET_ALLOW_SELF
    
    if (!
player) return PLUGIN_HANDLED;
    
    
asd = (str_to_num(arg2))
    
    
niveles[player] = asd
    
    experiencia
[player] = Niveles[niveles[player]]
    
check_level(player)
    return 
PLUGIN_HANDLED
}

Load_AdminTypes(id)
{
    if(
is_user_admin(id)) // Si es admin
    
{        
        new 
iflags get_user_flags(id);

        for(
sizeof Ganancias i++ ) 
        {            
            if(
flags Ganancias[i][GD_ADM_FLAG])
            {                
                
Ganancia[id] = Ganancias[i][GD_ADM_GN];

                
formatex(AccountType[id], charsmax(AccountType), "%s"Ganancias[i][GD_ADM_TYPE]);

                break;
            }
        }
    }
    else
    {
        
Ganancia[id] = 1;

        
formatex(AccountType[id], charsmax(AccountType), "Usuario");
    }


Poco a Poco le agregare más cosas (?


Archivos adjuntos
.sma   Descargar AMXX / surfxpmod_amx.sma (Tamaño: 8.17 KB / Descargas: 121)
Responder
#2
Los recursos? Oh god why
Responder
#3
(24/07/2015, 01:36 PM)DeathKing escribió: Los recursos? Oh god why

Coloque allí "models/Carpeta/v_modelo.mdl", para que se guíen, y no estar yo metiendo recursos , ya que formatie mi pcRoflmao
Responder
#4
Roflmao Buen aporte
Responder
#5
Buen aporte......... a alguien le va a servir NothingdohereNothingdohereNothingdohereNothingdohereNothingdohere
Responder
#6
Genial, Aporte Yo buscaba algo como esto ya que mi amigo Zero no me quiso dar su mod Triste Gracias por el aporte Black
Responder
#7
(24/07/2015, 06:37 PM)[N]arcO-. escribió: Genial, Aporte Yo buscaba algo como esto ya que mi amigo Zero no me quiso dar su mod Triste Gracias por el aporte Black
Te puedo asegurar, que este es mejor que la mierda de Zero
Responder
#8
jajaja enserio?? Roflmao minimo cambia curweapon por item deploy Roflmao
NO RESPONDO MP POR SOPORTE
Responder
#9
Código PHP:
register_concmd("amx_darnivel""DarNivel"ADMIN_RCON"SurFXPMOD v1.0 by SoundBlaster")
register_concmd("amx_quitar""QuitarTodo"ADMIN_RCON"SurFXPMOD v1.0 by SoundBlaster"

Cita:"SurFXPMOD v1.0 by SoundBlaster"

¿Que es eso?

Buen aporte.
[Imagen: b_350_20_323957_202743_f19a15_111111.png]

(18/11/2014, 05:47 PM)Neeeeeeeeeel.- escribió: Por qué necesitan una guía para todo? Meté mano y que salga lo que salga... es la mejor forma de aprender.

(16/05/2016, 11:08 PM)kikizon2 escribió: No cabe duda que tienen mierda en vez de cerebro, par de pendejos v:
Responder
#10
No se , alguien lo me puso un comando una vez asi, y me acostumbre
Responder
#11
(24/07/2015, 08:41 PM)BlackPower1 escribió: No se , alguien lo me puso un comando una vez asi, y me acostumbre

Triste El mod de el no es tan malo pero el es una persona que no ayuda a nadie solo ayuda si le das $ o solo te ayudara para una sugerencia.
Responder
#12
Entonces Narco perderias dinero Trolleyes

Volviendo al tema buen aporte Oh god why iva a sacar mi v2 de mi surf pero ya paque A ysi

o quien sabe pacman
* Ing. Informático * Mapper * Venezolano
Responder
#13
Una pregunta.. Qué pasaría si me cambio el nombre y me desconecto?
(15/12/2020, 07:06 PM)Mario AR. escribió: Cuando tu acatante conozca de tu nuevo puerto, te volverá a atacar
Responder
#14
(24/07/2015, 11:15 PM)Cr3470r escribió: Una pregunta.. Qué pasaría si me cambio el nombre y me desconecto?

pasarías los lvls del nombre anterior al otro (?
Responder
#15
1) Pasá los niveles de const a macro por lo menos.
2) NO USES CURWEAPON!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3) Verificá si hay jugadores conectados en ciertos publics...
Pacman rip :'v
Responder
#16
(25/07/2015, 07:05 PM)Luchito escribió: 1) Pasá los niveles de const a macro por lo menos.
2) NO USES CURWEAPON!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3) Verificá si hay jugadores conectados en ciertos publics...

Oks la pondré más hermosa, cuando tenga tiempo Whatdone
Responder
#17
[AMXX] Plugin "Test.amxx" failed to load: Plugin uses an unknown function (name "adv_vault_get_field") - check your modules.ini.
Responder
#18
(25/02/2017, 03:28 PM)snitch escribió: [AMXX] Plugin "Test.amxx" failed to load: Plugin uses an unknown function (name "adv_vault_get_field") - check your modules.ini.

Te falta el adv vault
Responder
#19
(25/02/2017, 03:34 PM)SoundBlaster escribió:
(25/02/2017, 03:28 PM)snitch escribió: [AMXX] Plugin "Test.amxx" failed to load: Plugin uses an unknown function (name "adv_vault_get_field") - check your modules.ini.

Te falta el adv vault
si, Tengo, compila
Responder
#20
Código PHP:
#define NivelMaximo 800
new const Niveles[NivelMaximo] =
{
    
50,
    
100,
    
200,
    
400,
    
600,
    
800,
    ...


En que momento llegaria al nivel 800 Insecure
Responder
#21
(25/02/2017, 03:48 PM)snitch escribió:
(25/02/2017, 03:34 PM)SoundBlaster escribió:
(25/02/2017, 03:28 PM)snitch escribió: [AMXX] Plugin "Test.amxx" failed to load: Plugin uses an unknown function (name "adv_vault_get_field") - check your modules.ini.

Te falta el adv vault
si, Tengo, compila

Pero el plugin activado?
Responder
#22
Alguien me da ejemplo como agrego los modelos por niveles?
Aprendiendo.
Responder
#23
En qué línea configuro la exp de los jugadores? (la exp que recibirán por kill)
Responder
#24
cesarfeik dateline='amxmodx-es;phpfail' escribió: En qué línea configuro la exp de los jugadores? (la exp que recibirán por kill)

Código PHP:
}

public 
EventDeathMsg()
{
    new 
killer read_data)
    new 
victim read_data)
    new 
headshot read_data)
    new 
xphs
    
    
if(niveles[killer] > niveles[victim]) xp 40 Ganancia[victim];
    if(
niveles[killer] < nivelesvictim ]) xp 60 Ganancia[victim]; 
    if(
niveles[killer] == niveles[victim]) xp 50 Ganancia[victim];
    
    
PKSvictim ] = 0
        
    
if( victim == killer ) return PLUGIN_CONTINUE;
        
    if(
headshot)
    {
        
xp xp 50 Ganancia[victim]; 
        
hs 1
    
}
    
    if(
PKS[killer] < 10PKS[killer]++
    
    
xp xp PKS[killer]
    
    
add_xp(killerxphs)
    
ChatColor(victimGREEN"^x04%s^x3 Estas muerto y perdiste tu^x04 killstreak!"g_szPrefix)
    
check_level(killer)
    
    return 
PLUGIN_CONTINUE;

Responder


Salto de foro:


Usuarios navegando en este tema: 2 invitado(s)