Como poner Xp Doble Por tipo de admin
#1
Hola Querido Foro Aquí vengo a serle una pregunta Como puedo poner este Sistema de ganancia de Admin Kikizon al Mod de Surf+Rango de Nizi

Mod:
Código PHP:
/*
Creditos:
1-Destro (Por si guardado adv_vault)
2-Kikizon (Por su sistema de cuentas)
3-NkkI (aclare dudas de item deploy)
*/

#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <colorchat>
#include <dhudmessage>
#include <cstrike>
#include hamsandwich
#include fakemeta
#include adv_vault

#define NivelSiguente(%1) (%1 * 400 + 200)
#define NivelMax 400

new Nivel[33], exp[33], Rango[33], gBlock[33]
new 
g_maxplayerscvar_expHS

new g_contra[33][20], g_contra2[33][20], g_cuenta[33][32];

new 
g_vault,g_MsgVguig_MsgShowMenu;
new 
g_Estado[33], g_Can[33], g_Fecha[33][32];

// CONST & ENUMS
enum _:rango rangos_nombre[64], rango_requerido }

enum {
    
LVL,
    
RG,
    
EXP,
    
FECHA,
    
PASSWORD,
    
DATA_M
};
enum {
    
NOREGISTRADO 0,
    
REGISTRADO,
    
LOGUEADO,
    
ESTADOS
};
new const 
Estado[ESTADOS][] = { "Sin Registrar""Registrado""Logueado" };
new 
g_campo[DATA_M];

new const 
horas[] = { 0002101218192221 }
new 
boolg_happytime 

new const rangos[][rango] = {
    { 
"Recien llegado"}, { "Aventurero"}, { "Principiante"10 }, { "Experimentado"15 } , { "Civil I"20 },
    { 
"Civil II"25 }, { "Soldado "30 }, { "Distinguido"35 }, { "Cabo II"40 }, { "Cabo I"45 }, { "Sargento I"50 },
    { 
"Sargento II"55 }, { "Sargento Mayor I"60 }, { "Sargento Mayor II"65 }, { "Sargento Mayor III"70 } , 
    { 
"Sargento Ayudante"75 }, { "Sargento Supervisor"80 }, { "Sargento Técnico I"85 }, { "Sargento Técnico II"90 }, 
    { 
"Sargento Técnico III"95 }, { "Maestro Técnico I"100 }, { "Maestro Técnico II"105 }, { "Maestro Técnico III"110 }, 
    { 
"Maestro Técnico Supervisor"115 }, { "Sub-Teniente I"120 }, { "Sub-Teniente II"125 } , { "Sub-Teniente III"130 }, 
    { 
"Teniente I"135 }, { "Teniente II"140 }, { "Teniente III"145 }, { "Capitán I"150 }, { "Capitán II"200 }, { "Capitán III"210 },
    { 
"Teniente Coronel"220 }, { "Coronel I"230 }, { "Coronel II"240 }, { "Coronel III"250 } , { "General de Brigada I"260 },
    { 
"General de Brigada II"270 }, { "General de Brigada III"280 }, { "General de División"290 }, { "General en Jefe I"300 }, 
    { 
"General en Jefe II"320 }, { "General en Jefe III"340 }, { "Perra"360 }, { "Puta"380 }, { "Mega Puta"400 }
}

new const 
WEAPONENTNAMES[][] = { """weapon_hegrenade""weapon_xm1014""weapon_usp""weapon_glock18""weapon_awp""weapon_mp5navy""weapon_m249",
    
"weapon_m3""weapon_m4a1""weapon_g3sg1""weapon_deagle""weapon_ak47""weapon_knife"
}

// MODELS & SOUND
new const Glock181[] = "models/Surf/v_Glock18-1.mdl"USP[] = "models/Surf/v_Usp-1.mdl"Knife1[] = "models/Surf/v_Knife-1.mdl"
Knife2[] = "models/Surf/v_Knife-2.mdl"Knife3[] = "models/Surf/v_Knife-3.mdl"Knife4[] = "models/Surf/v_Knife-4.mdl"
Deagle1[] = "models/Surf/v_Deagle-1.mdl"Deagle2[] = "models/Surf/v_Deagle-2.mdl"Deagle3[] = "models/Surf/v_Deagle-3.mdl"
MP51[] = "models/Surf/v_Mp5-1.mdl"Ak471[] = "models/Surf/v_Ak47-1.mdl"Ak472[] = "models/Surf/v_Ak47-2.mdl",  
M4a11[] = "models/Surf/v_M4a1-1.mdl"M4a12[] = "models/Surf/v_M4a1-2.mdl"M31[] = "models/Surf/v_M3-1.mdl",
M32[] = "models/Surf/v_M3-2.mdl"M33[] = "models/Surf/v_M3-3.mdl"M34[] = "models/Surf/v_M3-4.mdl",
Awp1[] = "models/Surf/v_Awp-1.mdl"Awp2[] = "models/Surf/v_Awp-2.mdl"Awp3[] = "models/Surf/v_Awp-3.mdl"
Taka1[] = "models/Surf/v_Taka-1.mdl"Taka2[] = "models/Surf/v_Taka-2.mdl"Taka3[] = "models/Surf/v_Taka-3.mdl"
Xm10141[] = "models/Surf/v_Xm1014-1.mdl"Xm10142[] = "models/Surf/v_Xm1014-2.mdl"Xm10143[] = "models/Surf/v_Xm1014-3.mdl",   
He1[] = "models/Surf/v_Hegranade-1.mdl"He2[] = "models/Surf/v_Hegranade-2.mdl"He3[] = "models/Surf/v_Hegranade-3.mdl"M249[] = "models/Surf/v_m249.mdl"

new const sonido[] = "Nivel/Nivel.wav"
new const Ambient[] = "sound/surfSound/ambient.mp3"

public plugin_init()
{
    
register_plugin("Surf""2.0""Nazi.-")
    
    
register_event("HLTV""event_round_start""a""1=0""2=0")
    
register_event("DeathMsg""EventoMuerte""a")
    
    
RegisterHam(Ham_TakeDamage"player""fwHamTakeDamage");
    for (new 
1sizeof WEAPONENTNAMESi++)
        if (
WEAPONENTNAMES[i][0]) RegisterHam(Ham_Item_DeployWEAPONENTNAMES[i], "fw_Item_Deploy_Post"1)
        
    
register_concmd("sf_lvl""cmd_lvl"ADMIN_RCON"<Nombre> <Nivel>")
    
register_concmd("sf_exp""cmd_exp"ADMIN_RCON"<Nombre> <Experiencia>")
    
    
register_clcmd("INGRESAR_PASSWORD""Contra");
    
register_clcmd("nightvision""menuprim")
    
    
g_maxplayers get_maxplayers()
    
cvar_expHS register_cvar("Puntos_HS""3");
    
    
g_MsgVgui get_user_msgid("VGUIMenu");
    
g_MsgShowMenu get_user_msgid("ShowMenu");
    
register_message(g_MsgVgui"message_VGUImenu");
    
register_message(g_MsgShowMenu"message_VGUImenu");
    
register_forward(FM_ClientUserInfoChanged"fw_clientinfo_changed");
    
    
g_vault adv_vault_open("Cuentas"false);
    
g_campo[EXP] = adv_vault_register_field(g_vault"EXP")
    
g_campo[LVL] = adv_vault_register_field(g_vault"LVL")
    
g_campo[RG] = adv_vault_register_field(g_vault"RG")
    
g_campo[FECHA] = adv_vault_register_field(g_vault"FECHA"DATATYPE_STRING32);
    
g_campo[PASSWORD] = adv_vault_register_field(g_vault"PW"DATATYPE_STRING20);
    
adv_vault_init(g_vault);
    
    
set_task(0.9,"hudjuego",_,_,_,"b")
}

public 
plugin_cfg() {
    
server_cmd("mp_autoteambalance 1")
    
server_cmd("mp_startmoney 16000")
    
server_cmd("mp_freezetime 0")
}

public 
plugin_precache() {
    
set_lights("h")
    
precache_model(Glock181)
    
precache_model(USP)
    
precache_model(Knife1)
    
precache_model(Knife2)
    
precache_model(Knife3)
    
precache_model(Knife4)
    
precache_model(Deagle1)
    
precache_model(Deagle2)
    
precache_model(Deagle3)
    
precache_model(MP51)
    
precache_model(Ak471)
    
precache_model(Ak472)
    
precache_model(M4a11)
    
precache_model(M4a12)
    
precache_model(M31)
    
precache_model(M32)
    
precache_model(M33)
    
precache_model(M34)
    
precache_model(Awp1)
    
precache_model(Awp2)
    
precache_model(Awp3)
    
precache_model(Taka1)
    
precache_model(Taka2)
    
precache_model(Taka3)
    
precache_model(Xm10141)
    
precache_model(Xm10142)
    
precache_model(Xm10143)
    
precache_model(He1)
    
precache_model(He2)
    
precache_model(He3)
    
precache_model(M249)
    
precache_generic(Ambient)
    
precache_sound(sonido)
}
public 
client_putinserver(id) {
    
get_user_name(idg_cuenta[id], 31);
    
get_time("%c"g_Fecha[id], 31);
    
g_contra[id][0] = '^0';
    
g_Estado[id] = NOREGISTRADO;
    
    
g_Can[id] = 0;
    
Nivel[id] = 
    exp
[id] = 0
    Rango
[id] = 0
    
    Cargar
(id);
}
public 
client_disconnect(id) {
    
Guardar(id);
    
    if(
g_happytime) {
        
client_cmd(0"mp3 stop")
    }
}

public 
event_round_start() {
    
set_task(0.1,"happyhour")
    if(
g_happytime) {
        
client_cmd(0"mp3 stop")
    }
    
    for(new 
1<= get_maxplayers();i++) {
        if(!
is_user_connected(i))continue
        
gBlock[i] = 0
    
}
}

public 
EventoMuerte() {
    new 
attacker read_data(1)
    new 
victim read_data(2
    new 
hs read_data(3)
    new 
weaponid get_user_weapon(attacker);
    
    if(
attacker == victim || !is_user_connected(attacker) || !is_user_connected(victim)) 
        return 
        
    
exp[attacker]+= g_happytime 60 30
    
if(get_pcvar_num(cvar_expHS)) {
        if(
hsexp[attacker]+= 10
    
}
    
    if(
weaponid == CSW_KNIFE) {
        
exp[attacker]+= 15
    
}
        
    
ver_nivel(attacker)
}

public 
ver_nivel(id) {
    new 
subido false
    
while(exp[id] >= NivelSiguente(Nivel[id]) && Nivel[id] < NivelMax) {
        
Nivel[id]++ 
        
subido true;
    }

    if(
subido) {
        
client_cmd(id"spk ^"%s^""sonido);
        
ColorChat(idNORMAL"^3Felicitaciones, subiste al nivel ^4%d"Nivel[id])
        
ver_rango(id)
        
subido false
    
}
}

public 
ver_rango(id) {
    new 
Rsubido false
    
while(Nivel[id] >= rangos[Rango[id] + 1][rango_requerido]) {
        
Rango[id]++
        
Rsubido true
    
}
    if(
Rsubido) {
        
ColorChat(idNORMAL"^3Felicitaciones, subiste al rango ^4%s"rangos[Rango[id]][rangos_nombre])
        
Rsubido false
    
}
}

public 
fw_Item_Deploy_Post(wpn) {
    static 
idid get_weapon_ent_owner(wpn);
    
    if (!
pev_valid(id) || !is_user_aliveid )) return;
    
    static 
WeaponIDWeaponID cs_get_weapon_id(wpn); 
    
    if(
WeaponID == CSW_KNIFE) if(Nivel[id] >= 10set_pev(idpev_viewmodel2Knife1);
    if(
WeaponID == CSW_GLOCK18) if(Nivel[id] >= 10set_pev(idpev_viewmodel2Glock181);
    if(
WeaponID == CSW_USP) if(Nivel[id] >= 10set_pev(idpev_viewmodel2USP);
    if(
WeaponID == CSW_DEAGLE) if(Nivel[id] >= 15set_pev(idpev_viewmodel2Deagle1);
    if(
WeaponID == CSW_MP5NAVY) if(Nivel[id] >= 60set_pev(idpev_viewmodel2MP51);
    if(
WeaponID == CSW_AK47) if(Nivel[id] >= 50set_pev(idpev_viewmodel2Ak471);
    if(
WeaponID == CSW_M4A1) if(Nivel[id] >= 60set_pev(idpev_viewmodel2M4a11);
    if(
WeaponID == CSW_M3) if(Nivel[id] >= 40set_pev(idpev_viewmodel2M31);
    if(
WeaponID == CSW_AWP) if(Nivel[id] >= 100set_pev(idpev_viewmodel2Awp1);
    if(
WeaponID == CSW_G3SG1) if(Nivel[id] >= 100set_pev(idpev_viewmodel2Taka1);
    if(
WeaponID == CSW_XM1014) if(Nivel[id] >= 70set_pev(idpev_viewmodel2Xm10141);
    if(
WeaponID == CSW_HEGRENADE) if(Nivel[id] >= 25set_pev(idpev_viewmodel2He1);
    if(
WeaponID == CSW_M249) if(Nivel[id] >= 320set_pev(idpev_viewmodel2M249);
    
    if(
WeaponID == CSW_KNIFE) if(Nivel[id] >= 110set_pev(idpev_viewmodel2Knife2);
    if(
WeaponID == CSW_DEAGLE) if(Nivel[id] >= 250set_pev(idpev_viewmodel2Deagle2);
    if(
WeaponID == CSW_AK47) if(Nivel[id] >= 240set_pev(idpev_viewmodel2Ak472);
    if(
WeaponID == CSW_M4A1) if(Nivel[id] >= 250set_pev(idpev_viewmodel2M4a12);
    if(
WeaponID == CSW_M3) if(Nivel[id] >= 130set_pev(idpev_viewmodel2M32);
    if(
WeaponID == CSW_AWP) if(Nivel[id] >= 200set_pev(idpev_viewmodel2Awp2);
    if(
WeaponID == CSW_G3SG1) if(Nivel[id] >= 130set_pev(idpev_viewmodel2Taka2);
    if(
WeaponID == CSW_XM1014) if(Nivel[id] >= 150set_pev(idpev_viewmodel2Xm10142);
    if(
WeaponID == CSW_HEGRENADE) if(Nivel[id] >= 170set_pev(idpev_viewmodel2He2);
    
    if(
WeaponID == CSW_KNIFE) if(Nivel[id] >= 250set_pev(idpev_viewmodel2Knife3);
    if(
WeaponID == CSW_DEAGLE) if(Nivel[id] >= 340set_pev(idpev_viewmodel2Deagle3);
    if(
WeaponID == CSW_M3) if(Nivel[id] >= 260set_pev(idpev_viewmodel2M33);
    if(
WeaponID == CSW_AWP) if(Nivel[id] >= 380set_pev(idpev_viewmodel2Awp3);
    if(
WeaponID == CSW_G3SG1) if(Nivel[id] >= 300set_pev(idpev_viewmodel2Taka3);
    if(
WeaponID == CSW_XM1014) if(Nivel[id] >= 400set_pev(idpev_viewmodel2Xm10143);
    if(
WeaponID == CSW_HEGRENADE) if(Nivel[id] >= 260set_pev(idpev_viewmodel2He3);
    
    if(
WeaponID == CSW_KNIFE) if(Nivel[id] >= 350set_pev(idpev_viewmodel2Knife4);
    if(
WeaponID == CSW_M3) if(Nivel[id] >= 380set_pev(idpev_viewmodel2M34);
}

public 
fwHamTakeDamage(victiminflictorattackerFloat:damagedamagebits)
{
    if(!
is_user_connected(attacker))
    return 
HAM_IGNORED 
    
    
new weapon get_user_weapon(attacker)
    
    switch(
weapon)
    {
        case 
CSW_GLOCK18 : if(Nivelattacker ] >= 10)SetHamParamFloat(4damage 1.2)
        case 
CSW_USP : if(Nivelattacker ] >= 10)SetHamParamFloat(4damage 1.2)
        case 
CSW_KNIFE : if(Nivelattacker ] >= 10)SetHamParamFloat(4damage 1.2)
        case 
CSW_DEAGLE : if(Nivelattacker ] >= 15)SetHamParamFloat(4damage 1.2)
        case 
CSW_MP5NAVY : if(Nivelattacker ] >= 60)SetHamParamFloat(4damage 1.2)
        case 
CSW_AK47 : if(Nivelattacker ] >= 50)SetHamParamFloat(4damage 1.2)
        case 
CSW_M4A1 : if(Nivelattacker ] >= 60)SetHamParamFloat(4damage 1.2)
        case 
CSW_M3 : if(Nivelattacker ] >= 40)SetHamParamFloat(4damage 1.2)
        case 
CSW_AWP : if(Nivelattacker ] >= 100)SetHamParamFloat(4damage 1.2)
        case 
CSW_G3SG1 : if(Nivelattacker ] >= 100)SetHamParamFloat(4damage 1.2)
        case 
CSW_XM1014 : if(Nivelattacker ] >= 70)SetHamParamFloat(4damage 1.2)
        case 
CSW_HEGRENADE : if(Nivelattacker ] >= 25)SetHamParamFloat(4damage 1.2)
        case 
CSW_M249 : if(Nivelattacker ] >= 330)SetHamParamFloat(4damage 1.2)
    }
    switch(
weapon)
    {
        case 
CSW_KNIFE : if(Nivelattacker ] >= 110)SetHamParamFloat(4damage 1.4)
        case 
CSW_DEAGLE : if(Nivelattacker ] >= 250)SetHamParamFloat(4damage 1.4)
        case 
CSW_AK47 : if(Nivelattacker ] >= 240)SetHamParamFloat(4damage 1.4)
        case 
CSW_M4A1 : if(Nivelattacker ] >= 250)SetHamParamFloat(4damage 1.4)
        case 
CSW_M3 : if(Nivelattacker ] >= 130)SetHamParamFloat(4damage 1.4)
        case 
CSW_AWP : if(Nivelattacker ] >= 200)SetHamParamFloat(4damage 1.4)
        case 
CSW_G3SG1 : if(Nivelattacker ] >= 130)SetHamParamFloat(4damage 1.4)
        case 
CSW_XM1014 : if(Nivelattacker ] >= 150)SetHamParamFloat(4damage 1.4)
        case 
CSW_HEGRENADE : if(Nivelattacker ] >= 170)SetHamParamFloat(4damage 1.4)
    }
    switch(
weapon)
    {
        case 
CSW_KNIFE : if(Nivelattacker ] >= 240)SetHamParamFloat(4damage 1.6)
        case 
CSW_DEAGLE : if(Nivelattacker ] >= 340)SetHamParamFloat(4damage 1.6)
        case 
CSW_M3 : if(Nivelattacker ] >= 260)SetHamParamFloat(4damage 1.6)
        case 
CSW_AWP : if(Nivelattacker ] >= 380)SetHamParamFloat(4damage 1.6)
        case 
CSW_G3SG1 : if(Nivelattacker ] >= 300)SetHamParamFloat(4damage 1.6)
        case 
CSW_XM1014 : if(Nivelattacker ] >= 400)SetHamParamFloat(4damage 1.6)
        case 
CSW_HEGRENADE : if(Nivelattacker ] >= 260)SetHamParamFloat(4damage 1.6)
    }
    switch(
weapon)
    {
        case 
CSW_KNIFE : if(Nivelattacker ] >= 350)SetHamParamFloat(4damage 2.0)
        case 
CSW_M3 : if(Nivelattacker ] >= 380)SetHamParamFloat(4damage 2.0)
    }
    return 
PLUGIN_CONTINUE;
}

public 
hudjuego(id) {
    for(new 
id 1id <= g_maxplayersid++) {
        if(!
is_user_connected(id)) continue;
        
        new 
name[33]
        
get_user_name(id,name,32)
        
        if(
is_user_alive(id)) {
            
set_dhudmessage(17200, -1.00.7906.01.0)
            
show_dhudmessage(id"[Informacion]^n[Nivel: %d/%d]^n[Exp: %d/%d]"Nivel[id], NivelMaxexp[id], NivelSiguente(Nivel[id]))
            
            
set_dhudmessage(0311840.00.2106.01.0)
            
show_dhudmessage(id"[Nombre: %s]^n[Rango: %s]^n[Hora Feliz: %s]"namerangos[Rango[id]][rangos_nombre], g_happytime "On" "Off")
        } else {
            new 
spect pev(idpev_iuser2);
                
            if(!
spect) return;
                
            new 
nombre[32]
            
get_user_name(spectnombrecharsmax(nombre))
            new 
salud get_user_health(spect)
            new 
armor get_user_armor(spect)
            
            
set_dhudmessage(1901901900.00.2106.01.0)
            
show_dhudmessage(id"Espiando ---> %s^nSalud: %d^nArmadura: %d^nNivel: %d^nRango: %s"nombresaludarmorNivel[spect], rangos[Rango[spect]][rangos_nombre])
        }
    }
}

public 
happyhour(id) {
    new 
data[12]
    
get_time("%H"data12)
    new 
Tiempo str_to_num(data)
 
    for(new 
i=0;<= sizeof horas 1;i++) {
        if(
Tiempo != horas[i]) continue
        
g_happytime true
        client_cmd
(0"mp3 play ^"%s^""Ambient)
        break;
    }
}

public 
ShowLogMenu(id) {
    new 
Tit[128];
    
formatex(Titcharsmax(Tit), "Sistema de cuentas by \dkikizon^n\wBienvenido \r%s^n\wESTADO: \r%s^n\wTu ultima visita fue: \r%s"g_cuenta[id], Estado[g_Estado[id]], g_Fecha[id]);
    
    new 
menu menu_create(Tit,"menu_log");
    
    
menu_additem(menu, (g_Estado[id] == REGISTRADO && adv_vault_get_prepare(g_vault_g_cuenta[id]))?"Loguearse":"\dLoguearse""1");
    
menu_additem(menu, (g_Estado[id] == NOREGISTRADO && !adv_vault_get_prepare(g_vault_g_cuenta[id]))?"Registrarse^n":"\dRegistrarse^n""2");
    
menu_additem(menu, (g_Estado[id] == LOGUEADO && !g_Can[id])?"Cambiar Contra":"\dCambiar Contra""3");
    
    
menu_display(idmenu0);
}
public 
menu_log(idmenuitem) {
    if(
item == MENU_EXIT) {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }
    
    switch(
item) {
        case 
0: {
            if(
g_Estado[id] == REGISTRADO && adv_vault_get_prepare(g_vault_g_cuenta[id])) {
                
client_print(idprint_center"Ingresa tu PASSWORD para entrar a tu cuenta");
                
client_cmd(id,"messagemode INGRESAR_PASSWORD");
            } else {
                
client_print(idprint_center"No puedes elegir esta opcion");
                return 
PLUGIN_HANDLED;
            }
        }
        case 
1: {
            if(
g_Estado[id] == NOREGISTRADO && !adv_vault_get_prepare(g_vault_g_cuenta[id])) {
                
client_print(idprint_center"Ingresa una PASSWORD para crear una cuenta");
                
client_cmd(id,"messagemode INGRESAR_PASSWORD");
            } else {
                
client_print(idprint_center"No puedes elegir esta opcion");
                return 
PLUGIN_HANDLED;
            }    
        }
        case 
2: {
            if(
g_Estado[id] == LOGUEADO && !g_Can[id]) {
                
client_print(idprint_center"Ingresa tu nueva PASSWORD");
                
client_cmd(id,"messagemode INGRESAR_PASSWORD");
            } else {
                
client_print(idprint_center"No estas logueado o ya cambiaste tu password durante el mapa");
                return 
PLUGIN_HANDLED;
            }
        }
    }
    return 
PLUGIN_HANDLED;
}

public 
Confirmar(id) {
    new 
Tit[128];
    
formatex(Titcharsmax(Tit),"La password sera \r%s^n^n\yConfirmar?"g_contra2[id]);
    
    new 
menu menu_create(Tit,"menu_confirmar");
    
    
menu_additem(menu,"\rSi\w, confirmar","1");
    
menu_additem(menu,"\rNo\w, deseo reescribirla","2");
    
    
menu_setprop(menuMPROP_EXITMEXIT_NEVER);
    
    
menu_display(idmenu0);
}
public 
menu_confirmar(idmenuitem) {
    switch(
item) {
        case 
0: {
            switch(
g_Estado[id]) {
                case 
LOGUEADO: {
                    
copy(g_contra[id], 19 ,g_contra2[id]);
                    
Guardar(id);
                    
client_print(idprint_center"Tu password ha sido cambiada satisfactoriamente");
                    
g_Can[id] = 1;
                }
                case 
NOREGISTRADO: {    
                    
client_print(idprint_center"Tu cuenta ha sido creada satisfactoriamente");
                    
client_cmd(id"spk ^"%s^""sonido)
                    
copy(g_contra[id], 31g_contra2[id]);
                    
Guardar(id);
                    
jTeam(id);
                }
            }
        }
        case 
1: {
            
menu_destroy(menu);
            
client_cmd(id,"messagemode INGRESAR_PASSWORD");
            if(
g_Estado[id] == LOGUEADO)
                
client_print(idprint_center"Ingresa tu nueva PASSWORD");
            else
                
client_print(idprint_center"Ingresa la PASSWORD para tu nueva cuenta");
        }
    }
    return 
PLUGIN_HANDLED;
}

public 
menuprim(id) {
    new 
menu menu_create("\wMenu\r Surf""handlerprim")
    
menu_additem(menu"\wCuenta\d (Datos)""1")
    
menu_additem(menu"\wCambiar\r Equipo""2")
    
menu_additem(menu"\wGuardar\d (Datos)""3")
    
    
menu_display(idmenu0)
}

public 
handlerprim(idmenuitem) {
    if(
item == MENU_EXIT) {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }
    
    switch(
item) {
        case 
0ShowLogMenu(id)
        case 
1mostrar_team(id)
        case 
2: {
            
Guardar(id)
            
ColorChat(idNORMAL"^4DATOS GUARDADOS^3 CORRECTAMENTE")
        }
    }
    
menu_destroy(menu)
    return 
PLUGIN_HANDLED;
}

public 
mostrar_team(id) {
    new 
menu menu_create("\wElije un\r Equipo:""menu_handler")
    
menu_additem(menu"\wAnti-Terroristas""1")
    
menu_additem(menu"\wTerroristas""2")
    
menu_additem(menu"\wEspectador""3")
    
    
menu_display(idmenu0);
}

public 
menu_handler(idmenuitem) {
    if(
gBlock[id]) {
        
ColorChat(idNORMAL"^4No puedes cambiar de equipo durante esta^3 Ronda")
        return 
PLUGIN_HANDLED
    
}
    
    switch(
item) {
        case 
MENU_EXIT:{
            
menu_destroy(menu)
            return 
PLUGIN_HANDLED
        
}
        case 
0: {
            
user_silentkill(id)
            
cs_set_user_team(id,CS_TEAM_CT)
            
ColorChat(idNORMAL"^4Ahora estas en el equipo ^3Anti-Terroristas")
        }
        case 
1: {
            
user_silentkill(id)
            
cs_set_user_team(id,CS_TEAM_T)
            
ColorChat(idNORMAL"^4Ahora estas en el equipo ^3Terroristas")
        }
        case 
2: {
            if(
cs_set_user_team(id,CS_TEAM_SPECTATOR)) {
                
user_silentkill(id)
                
cs_set_user_team(id,CS_TEAM_SPECTATOR)
                
ColorChat(idNORMAL"^4Ahora estas como ^3Espectador")
            }
        }
    }
    
gBlock[id] = 1;
    
menu_destroymenu );
    return 
PLUGIN_HANDLED
}

public 
fw_clientinfo_changed(idbuffer) {
    if(
is_user_connected(id)) {
        if(
g_Estado[id] == LOGUEADO) {
            static 
OldName[33];
            
            
engfunc(EngFunc_InfoKeyValuebuffer"name"OldNamesizeof OldName 1);
            
            if(
equal(OldNameg_cuenta[id])) 
                return 
FMRES_IGNORED;
            
            
set_user_info(id"name"g_cuenta[id]);
            
client_cmd(id"setinfo ^"name^" ^"%s^""g_cuenta[id]);
        }
    }
    return 
FMRES_IGNORED;    
}

public 
Guardar(id) {
    if(!
is_user_connected(id)) return;
    
    
adv_vault_set_start(g_vault);
    
adv_vault_set_field(g_vaultg_campo[EXP], exp[id])
    
adv_vault_set_field(g_vaultg_campo[LVL], Nivel[id])
    
adv_vault_set_field(g_vaultg_campo[RG], Rango[id])
    
adv_vault_set_field(g_vaultg_campo[FECHA], g_Fecha[id]);
    
adv_vault_set_field(g_vaultg_campo[PASSWORD], g_contra[id]);
    
adv_vault_set_end(g_vault0g_cuenta[id]);
}
public 
Cargar(id) {
    if(!
adv_vault_get_prepare(g_vault_g_cuenta[id])) {
        
g_Estado[id] = NOREGISTRADO;
        return;
    } else {
        
g_Estado[id] = REGISTRADO;
        
exp[id] = adv_vault_get_field(g_vaultg_campo[EXP]);
        
Nivel[id] = adv_vault_get_field(g_vaultg_campo[LVL]);
        
Rango[id] = adv_vault_get_field(g_vaultg_campo[RG]);
        
adv_vault_get_field(g_vaultg_campo[FECHA], g_Fecha[id], charsmax(g_Fecha[]));
        
adv_vault_get_field(g_vaultg_campo[PASSWORD], g_contra[id], charsmax(g_contra[]));
    }
    
}

public 
Contra(id) {
    
read_args(g_contra[id], charsmax(g_contra));
    
remove_quotes(g_contra[id]);trim(g_contra[id]);
    
    if(
equal(g_contra[id],"") || containi(g_contra[id]," ") != -) {
        
client_print(idprint_center"Tu password contiene errores");
        return 
1;
    }
    
    switch(
g_Estado[id]) {
        case 
NOREGISTRADO: {
            
client_print(idprint_center"Confirma tu password para proseguir");
            
copy(g_contra2[id], 19g_contra[id]);
            
Confirmar(id);
        }
        case 
REGISTRADO: {
            new 
buffer[40];
            
adv_vault_get_prepare(g_vault_g_cuenta[id]);
            
adv_vault_get_field(g_vaultg_campo[PASSWORD], buffercharsmax(buffer));
            
            if(
equal(bufferg_contra[id])) {
                
Guardar(id);
                
client_print(idprint_center"Te logueaste satisfactoriamente en tu cuenta");
                
client_cmd(id"spk ^"%s^""sonido)
                
jTeam(id);
            } else {
                
ShowLogMenu(id);
                
client_print(idprint_center"Password Incorrecta.");
            }
        }
        case 
LOGUEADO: {
            if(
g_Can[id]) {
                
client_print(idprint_center"Ya cambiaste tu contra en este mapa");
                return 
PLUGIN_HANDLED;
            }
            
client_print(idprint_center"Confirma tu password para cambiarla...");
            
copy(g_contra2[id], 19g_contra[id]);
            
Confirmar(id);
        }
    }
    return 
PLUGIN_HANDLED;
}
public 
message_VGUImenu(msgiddestid) {
    if(
g_Estado[id] != LOGUEADO)
        
ShowLogMenu(id);

    return 
1;
}
public 
jTeam(id){
    static 
teammsg_blockteammsg_block_vguirestorevgui;
    
    
restore get_pdata_int(id510);
    
vgui restore & (1<<0);
    
    if (
vgui)
        
set_pdata_int(id510restore & ~(1<<0));
    
    
teammsg_block get_msg_block(g_MsgShowMenu);
    
teammsg_block_vgui get_msg_block(g_MsgVgui);
    
    
set_msg_block(g_MsgShowMenuBLOCK_ONCE);
    
set_msg_block(g_MsgVguiBLOCK_ONCE);
    
    
engclient_cmd(id"jointeam""5");
    
engclient_cmd(id"joinclass""5");
    
    
set_msg_block(g_MsgShowMenuteammsg_block);
    
set_msg_block(g_MsgVguiteammsg_block_vgui);
    
    if (
vgui
        
set_pdata_int(id510restore);
        
    
g_Estado[id] = LOGUEADO;
}

public 
cmd_lvl (idlevelcid)
{
    if (!
cmd_access(idlevelcid3))
        return 
PLUGIN_HANDLED;
    
    new 
arg[33], arg2[10]
    
read_argv(1argcharsmax(arg))
    
read_argv(2arg2charsmax(arg2))
    
    new 
Player cmd_target(idarg,CMDTARGET_ONLY_ALIVE)
    
    if (!
Player)
    {
        
client_print(idprint_console"Player no esta.")
        return 
PLUGIN_HANDLED;
    }
    
    
Nivel[Player] = str_to_num(arg2)
    
    return 
PLUGIN_HANDLED;
}

public 
cmd_exp (idlevelcid)
{
    if (!
cmd_access(idlevelcid3))
        return 
PLUGIN_HANDLED;
    
    new 
arg[33], arg2[10]
    
read_argv(1argcharsmax(arg))
    
read_argv(2arg2charsmax(arg2))
    
    new 
Player cmd_target(idarg,CMDTARGET_ONLY_ALIVE)
    
    if (!
Player)
    {
        
client_print(idprint_console"Player no esta.")
        return 
PLUGIN_HANDLED;
    }
    
    
exp[Player]+= str_to_num(arg2)
    
ver_nivel(id)
    
    return 
PLUGIN_HANDLED;


stock get_weapon_ent_owner(ent){
    if (
pev_valid(ent) != 2)
        return -
1;
    
    return 
get_pdata_cbase(ent414);


Sistema De Ganancia de Admin:
https://amxmodx-es.com/Thread-Guia-Ganan...o-de-admin


Gracias Por la ayuda- Otra Cosa Cual es el Flags que me recomiendan para un Sub Dueño?
[Imagen: 738.gif]
(11/05/2017, 02:13 PM)FreDDy escribió:
(11/05/2017, 02:08 PM)Dieguito escribió: Tienes que estar bromeando, todos los zp traen para que pongas tus sonidos (así sea BB, una extensión más del ZP), y si no los trae pues fuiste timado, no te queda otra cosa que revisar el BaseBuilder.ini y buscar donde estén los sonidos, o crearlos tú mismo dentro del BB.

BaseBuilder.ini? Vos estás drogado? El bb 6.5 no trae nada de eso. Te fumaste del bueno.


(08/11/2016, 10:14 PM)FreDDy escribió: Cómo mierda querés aprender si estás a cada 2 segundos pidiendo mierda tras mierda.
Responder
#2
Código PHP:
/*
Creditos:
1-Destro (Por si guardado adv_vault)
2-Kikizon (Por su sistema de cuentas)
3-NkkI (aclare dudas de item deploy)
*/

#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <colorchat>
#include <dhudmessage>
#include <cstrike>
#include hamsandwich
#include fakemeta
#include adv_vault

new kGanancia[33], kAccountType[33][20];

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

new const 
Ganancias[][GANANCIA_DATA] = {
    
//|    TIPO DE ADM     |     FLAGS    | GANANCIA NORMAL | GANANCIA EN HH
    
"ADMIN VIP",         ADMIN_LEVEL_F,         2,         3     },
    { 
"ADMIN PRO",         ADMIN_LEVEL_G,         3,         4     },
    { 
"ADMIN PLATINO",     ADMIN_LEVELH,         4,         5     }


#define NivelSiguente(%1) (%1 * 400 + 200)
#define NivelMax 400

new Nivel[33], exp[33], Rango[33], gBlock[33]
new 
g_maxplayerscvar_expHS

new g_contra[33][20], g_contra2[33][20], g_cuenta[33][32];

new 
g_vault,g_MsgVguig_MsgShowMenu;
new 
g_Estado[33], g_Can[33], g_Fecha[33][32];

// CONST & ENUMS
enum _:rango rangos_nombre[64], rango_requerido }

enum {
    
LVL,
    
RG,
    
EXP,
    
FECHA,
    
PASSWORD,
    
DATA_M
};
enum {
    
NOREGISTRADO 0,
    
REGISTRADO,
    
LOGUEADO,
    
ESTADOS
};
new const 
Estado[ESTADOS][] = { "Sin Registrar""Registrado""Logueado" };
new 
g_campo[DATA_M];

new const 
horas[] = { 0002101218192221 }
new 
boolg_happytime 

new const rangos[][rango] = {
    { 
"Recien llegado"}, { "Aventurero"}, { "Principiante"10 }, { "Experimentado"15 } , { "Civil I"20 },
    { 
"Civil II"25 }, { "Soldado "30 }, { "Distinguido"35 }, { "Cabo II"40 }, { "Cabo I"45 }, { "Sargento I"50 },
    { 
"Sargento II"55 }, { "Sargento Mayor I"60 }, { "Sargento Mayor II"65 }, { "Sargento Mayor III"70 } , 
    { 
"Sargento Ayudante"75 }, { "Sargento Supervisor"80 }, { "Sargento Técnico I"85 }, { "Sargento Técnico II"90 }, 
    { 
"Sargento Técnico III"95 }, { "Maestro Técnico I"100 }, { "Maestro Técnico II"105 }, { "Maestro Técnico III"110 }, 
    { 
"Maestro Técnico Supervisor"115 }, { "Sub-Teniente I"120 }, { "Sub-Teniente II"125 } , { "Sub-Teniente III"130 }, 
    { 
"Teniente I"135 }, { "Teniente II"140 }, { "Teniente III"145 }, { "Capitán I"150 }, { "Capitán II"200 }, { "Capitán III"210 },
    { 
"Teniente Coronel"220 }, { "Coronel I"230 }, { "Coronel II"240 }, { "Coronel III"250 } , { "General de Brigada I"260 },
    { 
"General de Brigada II"270 }, { "General de Brigada III"280 }, { "General de División"290 }, { "General en Jefe I"300 }, 
    { 
"General en Jefe II"320 }, { "General en Jefe III"340 }, { "Perra"360 }, { "Puta"380 }, { "Mega Puta"400 }
}

new const 
WEAPONENTNAMES[][] = { """weapon_hegrenade""weapon_xm1014""weapon_usp""weapon_glock18""weapon_awp""weapon_mp5navy""weapon_m249",
    
"weapon_m3""weapon_m4a1""weapon_g3sg1""weapon_deagle""weapon_ak47""weapon_knife"
}

// MODELS & SOUND
new const Glock181[] = "models/Surf/v_Glock18-1.mdl"USP[] = "models/Surf/v_Usp-1.mdl"Knife1[] = "models/Surf/v_Knife-1.mdl"
Knife2[] = "models/Surf/v_Knife-2.mdl"Knife3[] = "models/Surf/v_Knife-3.mdl"Knife4[] = "models/Surf/v_Knife-4.mdl"
Deagle1[] = "models/Surf/v_Deagle-1.mdl"Deagle2[] = "models/Surf/v_Deagle-2.mdl"Deagle3[] = "models/Surf/v_Deagle-3.mdl"
MP51[] = "models/Surf/v_Mp5-1.mdl"Ak471[] = "models/Surf/v_Ak47-1.mdl"Ak472[] = "models/Surf/v_Ak47-2.mdl",  
M4a11[] = "models/Surf/v_M4a1-1.mdl"M4a12[] = "models/Surf/v_M4a1-2.mdl"M31[] = "models/Surf/v_M3-1.mdl",
M32[] = "models/Surf/v_M3-2.mdl"M33[] = "models/Surf/v_M3-3.mdl"M34[] = "models/Surf/v_M3-4.mdl",
Awp1[] = "models/Surf/v_Awp-1.mdl"Awp2[] = "models/Surf/v_Awp-2.mdl"Awp3[] = "models/Surf/v_Awp-3.mdl"
Taka1[] = "models/Surf/v_Taka-1.mdl"Taka2[] = "models/Surf/v_Taka-2.mdl"Taka3[] = "models/Surf/v_Taka-3.mdl"
Xm10141[] = "models/Surf/v_Xm1014-1.mdl"Xm10142[] = "models/Surf/v_Xm1014-2.mdl"Xm10143[] = "models/Surf/v_Xm1014-3.mdl",   
He1[] = "models/Surf/v_Hegranade-1.mdl"He2[] = "models/Surf/v_Hegranade-2.mdl"He3[] = "models/Surf/v_Hegranade-3.mdl"M249[] = "models/Surf/v_m249.mdl"

new const sonido[] = "Nivel/Nivel.wav"
new const Ambient[] = "sound/surfSound/ambient.mp3"

public plugin_init()
{
    
register_plugin("Surf""2.0""Nazi.-")
    
    
register_event("HLTV""event_round_start""a""1=0""2=0")
    
register_event("DeathMsg""EventoMuerte""a")
    
    
RegisterHam(Ham_TakeDamage"player""fwHamTakeDamage");
    for (new 
1sizeof WEAPONENTNAMESi++)
        if (
WEAPONENTNAMES[i][0]) RegisterHam(Ham_Item_DeployWEAPONENTNAMES[i], "fw_Item_Deploy_Post"1)
        
    
register_concmd("sf_lvl""cmd_lvl"ADMIN_RCON"<Nombre> <Nivel>")
    
register_concmd("sf_exp""cmd_exp"ADMIN_RCON"<Nombre> <Experiencia>")
    
    
register_clcmd("INGRESAR_PASSWORD""Contra");
    
register_clcmd("nightvision""menuprim")
    
    
g_maxplayers get_maxplayers()
    
cvar_expHS register_cvar("Puntos_HS""3");
    
    
g_MsgVgui get_user_msgid("VGUIMenu");
    
g_MsgShowMenu get_user_msgid("ShowMenu");
    
register_message(g_MsgVgui"message_VGUImenu");
    
register_message(g_MsgShowMenu"message_VGUImenu");
    
register_forward(FM_ClientUserInfoChanged"fw_clientinfo_changed");
    
    
g_vault adv_vault_open("Cuentas"false);
    
g_campo[EXP] = adv_vault_register_field(g_vault"EXP")
    
g_campo[LVL] = adv_vault_register_field(g_vault"LVL")
    
g_campo[RG] = adv_vault_register_field(g_vault"RG")
    
g_campo[FECHA] = adv_vault_register_field(g_vault"FECHA"DATATYPE_STRING32);
    
g_campo[PASSWORD] = adv_vault_register_field(g_vault"PW"DATATYPE_STRING20);
    
adv_vault_init(g_vault);
    
    
set_task(0.9,"hudjuego",_,_,_,"b")
}

public 
plugin_cfg() {
    
server_cmd("mp_autoteambalance 1")
    
server_cmd("mp_startmoney 16000")
    
server_cmd("mp_freezetime 0")
}

public 
plugin_precache() {
    
set_lights("h")
    
precache_model(Glock181)
    
precache_model(USP)
    
precache_model(Knife1)
    
precache_model(Knife2)
    
precache_model(Knife3)
    
precache_model(Knife4)
    
precache_model(Deagle1)
    
precache_model(Deagle2)
    
precache_model(Deagle3)
    
precache_model(MP51)
    
precache_model(Ak471)
    
precache_model(Ak472)
    
precache_model(M4a11)
    
precache_model(M4a12)
    
precache_model(M31)
    
precache_model(M32)
    
precache_model(M33)
    
precache_model(M34)
    
precache_model(Awp1)
    
precache_model(Awp2)
    
precache_model(Awp3)
    
precache_model(Taka1)
    
precache_model(Taka2)
    
precache_model(Taka3)
    
precache_model(Xm10141)
    
precache_model(Xm10142)
    
precache_model(Xm10143)
    
precache_model(He1)
    
precache_model(He2)
    
precache_model(He3)
    
precache_model(M249)
    
precache_generic(Ambient)
    
precache_sound(sonido)
}
public 
client_putinserver(id) {
    
get_user_name(idg_cuenta[id], 31);
    
get_time("%c"g_Fecha[id], 31);
    
g_contra[id][0] = '^0';
    
g_Estado[id] = NOREGISTRADO;
    
    
g_Can[id] = 0;
    
Nivel[id] = 
    exp
[id] = 0
    Rango
[id] = 0
    
    Cargar
(id);
}
public 
client_disconnect(id) {
    
Guardar(id);
    
    if(
g_happytime) {
        
client_cmd(0"mp3 stop")
    }
}

public 
event_round_start() {
    
set_task(0.1,"happyhour")
    if(
g_happytime) {
        
client_cmd(0"mp3 stop")
    }
    
    for(new 
1<= get_maxplayers();i++) {
        if(!
is_user_connected(i))continue
        
gBlock[i] = 0
    
}
}

public 
EventoMuerte() {
    new 
attacker read_data(1)
    new 
victim read_data(2
    new 
hs read_data(3)
    new 
weaponid get_user_weapon(attacker);
    
    if(
attacker == victim || !is_user_connected(attacker) || !is_user_connected(victim)) 
        return 
        
    
exp[attacker]+= g_happytime 60 30 kGanancia[Attacker]
    if(
get_pcvar_num(cvar_expHS)) 
    {
        if(
hsexp[attacker]+= 10 kGanancia[Attacker]
    }
    
    if(
weaponid == CSW_KNIFE) {
        
exp[attacker]+= 15 kGanancia[Attacker]
    }
        
    
ver_nivel(attacker)
}

public 
ver_nivel(id) {
    new 
subido false
    
while(exp[id] >= NivelSiguente(Nivel[id]) && Nivel[id] < NivelMax) {
        
Nivel[id]++ 
        
subido true;
    }

    if(
subido) {
        
client_cmd(id"spk ^"%s^""sonido);
        
ColorChat(idNORMAL"^3Felicitaciones, subiste al nivel ^4%d"Nivel[id])
        
ver_rango(id)
        
subido false
    
}
}

public 
ver_rango(id) {
    new 
Rsubido false
    
while(Nivel[id] >= rangos[Rango[id] + 1][rango_requerido]) {
        
Rango[id]++
        
Rsubido true
    
}
    if(
Rsubido) {
        
ColorChat(idNORMAL"^3Felicitaciones, subiste al rango ^4%s"rangos[Rango[id]][rangos_nombre])
        
Rsubido false
    
}
}

public 
fw_Item_Deploy_Post(wpn) {
    static 
idid get_weapon_ent_owner(wpn);
    
    if (!
pev_valid(id) || !is_user_aliveid )) return;
    
    static 
WeaponIDWeaponID cs_get_weapon_id(wpn); 
    
    if(
WeaponID == CSW_KNIFE) if(Nivel[id] >= 10set_pev(idpev_viewmodel2Knife1);
    if(
WeaponID == CSW_GLOCK18) if(Nivel[id] >= 10set_pev(idpev_viewmodel2Glock181);
    if(
WeaponID == CSW_USP) if(Nivel[id] >= 10set_pev(idpev_viewmodel2USP);
    if(
WeaponID == CSW_DEAGLE) if(Nivel[id] >= 15set_pev(idpev_viewmodel2Deagle1);
    if(
WeaponID == CSW_MP5NAVY) if(Nivel[id] >= 60set_pev(idpev_viewmodel2MP51);
    if(
WeaponID == CSW_AK47) if(Nivel[id] >= 50set_pev(idpev_viewmodel2Ak471);
    if(
WeaponID == CSW_M4A1) if(Nivel[id] >= 60set_pev(idpev_viewmodel2M4a11);
    if(
WeaponID == CSW_M3) if(Nivel[id] >= 40set_pev(idpev_viewmodel2M31);
    if(
WeaponID == CSW_AWP) if(Nivel[id] >= 100set_pev(idpev_viewmodel2Awp1);
    if(
WeaponID == CSW_G3SG1) if(Nivel[id] >= 100set_pev(idpev_viewmodel2Taka1);
    if(
WeaponID == CSW_XM1014) if(Nivel[id] >= 70set_pev(idpev_viewmodel2Xm10141);
    if(
WeaponID == CSW_HEGRENADE) if(Nivel[id] >= 25set_pev(idpev_viewmodel2He1);
    if(
WeaponID == CSW_M249) if(Nivel[id] >= 320set_pev(idpev_viewmodel2M249);
    
    if(
WeaponID == CSW_KNIFE) if(Nivel[id] >= 110set_pev(idpev_viewmodel2Knife2);
    if(
WeaponID == CSW_DEAGLE) if(Nivel[id] >= 250set_pev(idpev_viewmodel2Deagle2);
    if(
WeaponID == CSW_AK47) if(Nivel[id] >= 240set_pev(idpev_viewmodel2Ak472);
    if(
WeaponID == CSW_M4A1) if(Nivel[id] >= 250set_pev(idpev_viewmodel2M4a12);
    if(
WeaponID == CSW_M3) if(Nivel[id] >= 130set_pev(idpev_viewmodel2M32);
    if(
WeaponID == CSW_AWP) if(Nivel[id] >= 200set_pev(idpev_viewmodel2Awp2);
    if(
WeaponID == CSW_G3SG1) if(Nivel[id] >= 130set_pev(idpev_viewmodel2Taka2);
    if(
WeaponID == CSW_XM1014) if(Nivel[id] >= 150set_pev(idpev_viewmodel2Xm10142);
    if(
WeaponID == CSW_HEGRENADE) if(Nivel[id] >= 170set_pev(idpev_viewmodel2He2);
    
    if(
WeaponID == CSW_KNIFE) if(Nivel[id] >= 250set_pev(idpev_viewmodel2Knife3);
    if(
WeaponID == CSW_DEAGLE) if(Nivel[id] >= 340set_pev(idpev_viewmodel2Deagle3);
    if(
WeaponID == CSW_M3) if(Nivel[id] >= 260set_pev(idpev_viewmodel2M33);
    if(
WeaponID == CSW_AWP) if(Nivel[id] >= 380set_pev(idpev_viewmodel2Awp3);
    if(
WeaponID == CSW_G3SG1) if(Nivel[id] >= 300set_pev(idpev_viewmodel2Taka3);
    if(
WeaponID == CSW_XM1014) if(Nivel[id] >= 400set_pev(idpev_viewmodel2Xm10143);
    if(
WeaponID == CSW_HEGRENADE) if(Nivel[id] >= 260set_pev(idpev_viewmodel2He3);
    
    if(
WeaponID == CSW_KNIFE) if(Nivel[id] >= 350set_pev(idpev_viewmodel2Knife4);
    if(
WeaponID == CSW_M3) if(Nivel[id] >= 380set_pev(idpev_viewmodel2M34);
}

public 
fwHamTakeDamage(victiminflictorattackerFloat:damagedamagebits)
{
    if(!
is_user_connected(attacker))
    return 
HAM_IGNORED 
    
    
new weapon get_user_weapon(attacker)
    
    switch(
weapon)
    {
        case 
CSW_GLOCK18 : if(Nivelattacker ] >= 10)SetHamParamFloat(4damage 1.2)
        case 
CSW_USP : if(Nivelattacker ] >= 10)SetHamParamFloat(4damage 1.2)
        case 
CSW_KNIFE : if(Nivelattacker ] >= 10)SetHamParamFloat(4damage 1.2)
        case 
CSW_DEAGLE : if(Nivelattacker ] >= 15)SetHamParamFloat(4damage 1.2)
        case 
CSW_MP5NAVY : if(Nivelattacker ] >= 60)SetHamParamFloat(4damage 1.2)
        case 
CSW_AK47 : if(Nivelattacker ] >= 50)SetHamParamFloat(4damage 1.2)
        case 
CSW_M4A1 : if(Nivelattacker ] >= 60)SetHamParamFloat(4damage 1.2)
        case 
CSW_M3 : if(Nivelattacker ] >= 40)SetHamParamFloat(4damage 1.2)
        case 
CSW_AWP : if(Nivelattacker ] >= 100)SetHamParamFloat(4damage 1.2)
        case 
CSW_G3SG1 : if(Nivelattacker ] >= 100)SetHamParamFloat(4damage 1.2)
        case 
CSW_XM1014 : if(Nivelattacker ] >= 70)SetHamParamFloat(4damage 1.2)
        case 
CSW_HEGRENADE : if(Nivelattacker ] >= 25)SetHamParamFloat(4damage 1.2)
        case 
CSW_M249 : if(Nivelattacker ] >= 330)SetHamParamFloat(4damage 1.2)
    }
    switch(
weapon)
    {
        case 
CSW_KNIFE : if(Nivelattacker ] >= 110)SetHamParamFloat(4damage 1.4)
        case 
CSW_DEAGLE : if(Nivelattacker ] >= 250)SetHamParamFloat(4damage 1.4)
        case 
CSW_AK47 : if(Nivelattacker ] >= 240)SetHamParamFloat(4damage 1.4)
        case 
CSW_M4A1 : if(Nivelattacker ] >= 250)SetHamParamFloat(4damage 1.4)
        case 
CSW_M3 : if(Nivelattacker ] >= 130)SetHamParamFloat(4damage 1.4)
        case 
CSW_AWP : if(Nivelattacker ] >= 200)SetHamParamFloat(4damage 1.4)
        case 
CSW_G3SG1 : if(Nivelattacker ] >= 130)SetHamParamFloat(4damage 1.4)
        case 
CSW_XM1014 : if(Nivelattacker ] >= 150)SetHamParamFloat(4damage 1.4)
        case 
CSW_HEGRENADE : if(Nivelattacker ] >= 170)SetHamParamFloat(4damage 1.4)
    }
    switch(
weapon)
    {
        case 
CSW_KNIFE : if(Nivelattacker ] >= 240)SetHamParamFloat(4damage 1.6)
        case 
CSW_DEAGLE : if(Nivelattacker ] >= 340)SetHamParamFloat(4damage 1.6)
        case 
CSW_M3 : if(Nivelattacker ] >= 260)SetHamParamFloat(4damage 1.6)
        case 
CSW_AWP : if(Nivelattacker ] >= 380)SetHamParamFloat(4damage 1.6)
        case 
CSW_G3SG1 : if(Nivelattacker ] >= 300)SetHamParamFloat(4damage 1.6)
        case 
CSW_XM1014 : if(Nivelattacker ] >= 400)SetHamParamFloat(4damage 1.6)
        case 
CSW_HEGRENADE : if(Nivelattacker ] >= 260)SetHamParamFloat(4damage 1.6)
    }
    switch(
weapon)
    {
        case 
CSW_KNIFE : if(Nivelattacker ] >= 350)SetHamParamFloat(4damage 2.0)
        case 
CSW_M3 : if(Nivelattacker ] >= 380)SetHamParamFloat(4damage 2.0)
    }
    return 
PLUGIN_CONTINUE;
}

public 
hudjuego(id) {
    for(new 
id 1id <= g_maxplayersid++) {
        if(!
is_user_connected(id)) continue;
        
        new 
name[33]
        
get_user_name(id,name,32)
        
        if(
is_user_alive(id)) {
            
set_dhudmessage(17200, -1.00.7906.01.0)
            
show_dhudmessage(id"[Informacion]^n[Nivel: %d/%d]^n[Exp: %d/%d]"Nivel[id], NivelMaxexp[id], NivelSiguente(Nivel[id]))
            
            
set_dhudmessage(0311840.00.2106.01.0)
            
show_dhudmessage(id"[Nombre: %s]^n[Rango: %s]^n[Hora Feliz: %s]"namerangos[Rango[id]][rangos_nombre], g_happytime "On" "Off")
        } else {
            new 
spect pev(idpev_iuser2);
                
            if(!
spect) return;
                
            new 
nombre[32]
            
get_user_name(spectnombrecharsmax(nombre))
            new 
salud get_user_health(spect)
            new 
armor get_user_armor(spect)
            
            
set_dhudmessage(1901901900.00.2106.01.0)
            
show_dhudmessage(id"Espiando ---> %s^nSalud: %d^nArmadura: %d^nNivel: %d^nRango: %s"nombresaludarmorNivel[spect], rangos[Rango[spect]][rangos_nombre])
        }
    }
}

public 
happyhour(id) {
    new 
data[12]
    
get_time("%H"data12)
    new 
Tiempo str_to_num(data)
 
    for(new 
i=0;<= sizeof horas 1;i++) {
        if(
Tiempo != horas[i]) continue
        
g_happytime true
        client_cmd
(0"mp3 play ^"%s^""Ambient)
        break;
    }
}

public 
ShowLogMenu(id) {
    new 
Tit[128];
    
formatex(Titcharsmax(Tit), "Sistema de cuentas by \dkikizon^n\wBienvenido \r%s^n\wESTADO: \r%s^n\wTu ultima visita fue: \r%s"g_cuenta[id], Estado[g_Estado[id]], g_Fecha[id]);
    
    new 
menu menu_create(Tit,"menu_log");
    
    
menu_additem(menu, (g_Estado[id] == REGISTRADO && adv_vault_get_prepare(g_vault_g_cuenta[id]))?"Loguearse":"\dLoguearse""1");
    
menu_additem(menu, (g_Estado[id] == NOREGISTRADO && !adv_vault_get_prepare(g_vault_g_cuenta[id]))?"Registrarse^n":"\dRegistrarse^n""2");
    
menu_additem(menu, (g_Estado[id] == LOGUEADO && !g_Can[id])?"Cambiar Contra":"\dCambiar Contra""3");
    
    
menu_display(idmenu0);
}
public 
menu_log(idmenuitem) {
    if(
item == MENU_EXIT) {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }
    
    switch(
item) {
        case 
0: {
            if(
g_Estado[id] == REGISTRADO && adv_vault_get_prepare(g_vault_g_cuenta[id])) {
                
client_print(idprint_center"Ingresa tu PASSWORD para entrar a tu cuenta");
                
client_cmd(id,"messagemode INGRESAR_PASSWORD");
            } else {
                
client_print(idprint_center"No puedes elegir esta opcion");
                return 
PLUGIN_HANDLED;
            }
        }
        case 
1: {
            if(
g_Estado[id] == NOREGISTRADO && !adv_vault_get_prepare(g_vault_g_cuenta[id])) {
                
client_print(idprint_center"Ingresa una PASSWORD para crear una cuenta");
                
client_cmd(id,"messagemode INGRESAR_PASSWORD");
            } else {
                
client_print(idprint_center"No puedes elegir esta opcion");
                return 
PLUGIN_HANDLED;
            }    
        }
        case 
2: {
            if(
g_Estado[id] == LOGUEADO && !g_Can[id]) {
                
client_print(idprint_center"Ingresa tu nueva PASSWORD");
                
client_cmd(id,"messagemode INGRESAR_PASSWORD");
            } else {
                
client_print(idprint_center"No estas logueado o ya cambiaste tu password durante el mapa");
                return 
PLUGIN_HANDLED;
            }
        }
    }
    return 
PLUGIN_HANDLED;
}

public 
Confirmar(id) {
    new 
Tit[128];
    
formatex(Titcharsmax(Tit),"La password sera \r%s^n^n\yConfirmar?"g_contra2[id]);
    
    new 
menu menu_create(Tit,"menu_confirmar");
    
    
menu_additem(menu,"\rSi\w, confirmar","1");
    
menu_additem(menu,"\rNo\w, deseo reescribirla","2");
    
    
menu_setprop(menuMPROP_EXITMEXIT_NEVER);
    
    
menu_display(idmenu0);
}
public 
menu_confirmar(idmenuitem) {
    switch(
item) {
        case 
0: {
            switch(
g_Estado[id]) {
                case 
LOGUEADO: {
                    
copy(g_contra[id], 19 ,g_contra2[id]);
                    
Guardar(id);
                    
client_print(idprint_center"Tu password ha sido cambiada satisfactoriamente");
                    
g_Can[id] = 1;
                }
                case 
NOREGISTRADO: {    
                    
client_print(idprint_center"Tu cuenta ha sido creada satisfactoriamente");
                    
client_cmd(id"spk ^"%s^""sonido)
                    
copy(g_contra[id], 31g_contra2[id]);
                    
Guardar(id);
                    
jTeam(id);
                }
            }
        }
        case 
1: {
            
menu_destroy(menu);
            
client_cmd(id,"messagemode INGRESAR_PASSWORD");
            if(
g_Estado[id] == LOGUEADO)
                
client_print(idprint_center"Ingresa tu nueva PASSWORD");
            else
                
client_print(idprint_center"Ingresa la PASSWORD para tu nueva cuenta");
        }
    }
    return 
PLUGIN_HANDLED;
}

public 
menuprim(id) {
    new 
menu menu_create("\wMenu\r Surf""handlerprim")
    
menu_additem(menu"\wCuenta\d (Datos)""1")
    
menu_additem(menu"\wCambiar\r Equipo""2")
    
menu_additem(menu"\wGuardar\d (Datos)""3")
    
    
menu_display(idmenu0)
}

public 
handlerprim(idmenuitem) {
    if(
item == MENU_EXIT) {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }
    
    switch(
item) {
        case 
0ShowLogMenu(id)
        case 
1mostrar_team(id)
        case 
2: {
            
Guardar(id)
            
ColorChat(idNORMAL"^4DATOS GUARDADOS^3 CORRECTAMENTE")
        }
    }
    
menu_destroy(menu)
    return 
PLUGIN_HANDLED;
}

public 
mostrar_team(id) {
    new 
menu menu_create("\wElije un\r Equipo:""menu_handler")
    
menu_additem(menu"\wAnti-Terroristas""1")
    
menu_additem(menu"\wTerroristas""2")
    
menu_additem(menu"\wEspectador""3")
    
    
menu_display(idmenu0);
}

public 
menu_handler(idmenuitem) {
    if(
gBlock[id]) {
        
ColorChat(idNORMAL"^4No puedes cambiar de equipo durante esta^3 Ronda")
        return 
PLUGIN_HANDLED
    
}
    
    switch(
item) {
        case 
MENU_EXIT:{
            
menu_destroy(menu)
            return 
PLUGIN_HANDLED
        
}
        case 
0: {
            
user_silentkill(id)
            
cs_set_user_team(id,CS_TEAM_CT)
            
ColorChat(idNORMAL"^4Ahora estas en el equipo ^3Anti-Terroristas")
        }
        case 
1: {
            
user_silentkill(id)
            
cs_set_user_team(id,CS_TEAM_T)
            
ColorChat(idNORMAL"^4Ahora estas en el equipo ^3Terroristas")
        }
        case 
2: {
            if(
cs_set_user_team(id,CS_TEAM_SPECTATOR)) {
                
user_silentkill(id)
                
cs_set_user_team(id,CS_TEAM_SPECTATOR)
                
ColorChat(idNORMAL"^4Ahora estas como ^3Espectador")
            }
        }
    }
    
gBlock[id] = 1;
    
menu_destroymenu );
    return 
PLUGIN_HANDLED
}

public 
fw_clientinfo_changed(idbuffer) {
    if(
is_user_connected(id)) {
        if(
g_Estado[id] == LOGUEADO) {
            static 
OldName[33];
            
            
engfunc(EngFunc_InfoKeyValuebuffer"name"OldNamesizeof OldName 1);
            
            if(
equal(OldNameg_cuenta[id])) 
                return 
FMRES_IGNORED;
            
            
set_user_info(id"name"g_cuenta[id]);
            
client_cmd(id"setinfo ^"name^" ^"%s^""g_cuenta[id]);
        }
    }
    return 
FMRES_IGNORED;    
}

public 
Guardar(id) {
    if(!
is_user_connected(id)) return;
    
    
adv_vault_set_start(g_vault);
    
adv_vault_set_field(g_vaultg_campo[EXP], exp[id])
    
adv_vault_set_field(g_vaultg_campo[LVL], Nivel[id])
    
adv_vault_set_field(g_vaultg_campo[RG], Rango[id])
    
adv_vault_set_field(g_vaultg_campo[FECHA], g_Fecha[id]);
    
adv_vault_set_field(g_vaultg_campo[PASSWORD], g_contra[id]);
    
adv_vault_set_end(g_vault0g_cuenta[id]);
}
public 
Cargar(id) {
    if(!
adv_vault_get_prepare(g_vault_g_cuenta[id])) {
        
g_Estado[id] = NOREGISTRADO;
        return;
    } else {
        
g_Estado[id] = REGISTRADO;
        
exp[id] = adv_vault_get_field(g_vaultg_campo[EXP]);
        
Nivel[id] = adv_vault_get_field(g_vaultg_campo[LVL]);
        
Rango[id] = adv_vault_get_field(g_vaultg_campo[RG]);
        
adv_vault_get_field(g_vaultg_campo[FECHA], g_Fecha[id], charsmax(g_Fecha[]));
        
adv_vault_get_field(g_vaultg_campo[PASSWORD], g_contra[id], charsmax(g_contra[]));
    }
    
}

public 
Contra(id) {
    
read_args(g_contra[id], charsmax(g_contra));
    
remove_quotes(g_contra[id]);trim(g_contra[id]);
    
    if(
equal(g_contra[id],"") || containi(g_contra[id]," ") != -) {
        
client_print(idprint_center"Tu password contiene errores");
        return 
1;
    }
    
    switch(
g_Estado[id]) {
        case 
NOREGISTRADO: {
            
client_print(idprint_center"Confirma tu password para proseguir");
            
copy(g_contra2[id], 19g_contra[id]);
            
Confirmar(id);
        }
        case 
REGISTRADO: {
            new 
buffer[40];
            
adv_vault_get_prepare(g_vault_g_cuenta[id]);
            
adv_vault_get_field(g_vaultg_campo[PASSWORD], buffercharsmax(buffer));
            
            if(
equal(bufferg_contra[id])) {
                
Guardar(id);
                
client_print(idprint_center"Te logueaste satisfactoriamente en tu cuenta");
                
client_cmd(id"spk ^"%s^""sonido)
                
jTeam(id);
            } else {
                
ShowLogMenu(id);
                
client_print(idprint_center"Password Incorrecta.");
            }
        }
        case 
LOGUEADO: {
            if(
g_Can[id]) {
                
client_print(idprint_center"Ya cambiaste tu contra en este mapa");
                return 
PLUGIN_HANDLED;
            }
            
client_print(idprint_center"Confirma tu password para cambiarla...");
            
copy(g_contra2[id], 19g_contra[id]);
            
Confirmar(id);
        }
    }
    return 
PLUGIN_HANDLED;
}
public 
message_VGUImenu(msgiddestid) {
    if(
g_Estado[id] != LOGUEADO)
        
ShowLogMenu(id);

    return 
1;
}
public 
jTeam(id){
    static 
teammsg_blockteammsg_block_vguirestorevgui;
    
    
restore get_pdata_int(id510);
    
vgui restore & (1<<0);
    
    if (
vgui)
        
set_pdata_int(id510restore & ~(1<<0));
    
    
teammsg_block get_msg_block(g_MsgShowMenu);
    
teammsg_block_vgui get_msg_block(g_MsgVgui);
    
    
set_msg_block(g_MsgShowMenuBLOCK_ONCE);
    
set_msg_block(g_MsgVguiBLOCK_ONCE);
    
    
engclient_cmd(id"jointeam""5");
    
engclient_cmd(id"joinclass""5");
    
    
set_msg_block(g_MsgShowMenuteammsg_block);
    
set_msg_block(g_MsgVguiteammsg_block_vgui);
    
    if (
vgui
        
set_pdata_int(id510restore);
        
    
g_Estado[id] = LOGUEADO;
}

public 
cmd_lvl (idlevelcid)
{
    if (!
cmd_access(idlevelcid3))
        return 
PLUGIN_HANDLED;
    
    new 
arg[33], arg2[10]
    
read_argv(1argcharsmax(arg))
    
read_argv(2arg2charsmax(arg2))
    
    new 
Player cmd_target(idarg,CMDTARGET_ONLY_ALIVE)
    
    if (!
Player)
    {
        
client_print(idprint_console"Player no esta.")
        return 
PLUGIN_HANDLED;
    }
    
    
Nivel[Player] = str_to_num(arg2)
    
    return 
PLUGIN_HANDLED;
}

public 
cmd_exp (idlevelcid)
{
    if (!
cmd_access(idlevelcid3))
        return 
PLUGIN_HANDLED;
    
    new 
arg[33], arg2[10]
    
read_argv(1argcharsmax(arg))
    
read_argv(2arg2charsmax(arg2))
    
    new 
Player cmd_target(idarg,CMDTARGET_ONLY_ALIVE)
    
    if (!
Player)
    {
        
client_print(idprint_console"Player no esta.")
        return 
PLUGIN_HANDLED;
    }
    
    
exp[Player]+= str_to_num(arg2)
    
ver_nivel(id)
    
    return 
PLUGIN_HANDLED;


stock get_weapon_ent_owner(ent){
    if (
pev_valid(ent) != 2)
        return -
1;
    
    return 
get_pdata_cbase(ent414);

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]) // Si las flags del player es igual a las que definimos arriba
            

                
// cambian "has_happyhour" por su variable de happyhour
                
if(has_happyhour// Si esta la Happy Hour activa
                    
kGanancia[id] = Ganancias[i][GD_ADM_GHH]; // le damos la ganancia del admin en HH;
                
else // Si no esta activa la Happy Hour
                    
kGanancia[id] = Ganancias[i][GD_ADM_GN]; // Le damos la ganancia Normal
                    
                
formatex(kAccountType[id], charsmax(kAccountType), "%s"Ganancias[i][GD_ADM_TYPE]); // Le damos formato a 'kAccountType'
                
                
                
break; // Salimos del Loopeo
            
}
        }
    }
    else 
// Si no es admin
    
{
        if(
has_happyhour// Si es HappyHour
            
kGanancia[id] = 2// Le damos Ganancia por 2 a los users normales
        
else // Si no es Happy Hour
            
kGanancia[id] = 1// Ganancia por 1 (que seria lo normal)
            
        
formatex(kAccountType[id], charsmax(kAccountType), "Usuario Normal"); // Le damos formato a 'kAccountType'
    
}


La flag escoje la a tu gusto
Responder
#3
Gracias Pana! lo estaba asiendo y era puro error XD. Igual gracias
[Imagen: 738.gif]
(11/05/2017, 02:13 PM)FreDDy escribió:
(11/05/2017, 02:08 PM)Dieguito escribió: Tienes que estar bromeando, todos los zp traen para que pongas tus sonidos (así sea BB, una extensión más del ZP), y si no los trae pues fuiste timado, no te queda otra cosa que revisar el BaseBuilder.ini y buscar donde estén los sonidos, o crearlos tú mismo dentro del BB.

BaseBuilder.ini? Vos estás drogado? El bb 6.5 no trae nada de eso. Te fumaste del bueno.


(08/11/2016, 10:14 PM)FreDDy escribió: Cómo mierda querés aprender si estás a cada 2 segundos pidiendo mierda tras mierda.
Responder
#4
Te recomiendo hacer un nuevo surf level, es por que ese mod no está tan optimizado y hay otras cosas que se pueden mejorar ^^

Responder
#5
(18/11/2016, 09:41 PM)Skylar escribió: Te recomiendo hacer un nuevo surf level, es por que ese mod no está tan optimizado y hay otras cosas que se pueden mejorar ^^

Gracias Si, voy a tratar optimizarlo.
[Imagen: 738.gif]
(11/05/2017, 02:13 PM)FreDDy escribió:
(11/05/2017, 02:08 PM)Dieguito escribió: Tienes que estar bromeando, todos los zp traen para que pongas tus sonidos (así sea BB, una extensión más del ZP), y si no los trae pues fuiste timado, no te queda otra cosa que revisar el BaseBuilder.ini y buscar donde estén los sonidos, o crearlos tú mismo dentro del BB.

BaseBuilder.ini? Vos estás drogado? El bb 6.5 no trae nada de eso. Te fumaste del bueno.


(08/11/2016, 10:14 PM)FreDDy escribió: Cómo mierda querés aprender si estás a cada 2 segundos pidiendo mierda tras mierda.
Responder
#6
Alguien me ayuda? tengo este surf mod +level quiero adaptarle ganancia por tipo de admin con experiencia multiplicada x2, x3 etc, al yo seguir el tutorial me copilo bien pero me da 1 de xp al yo matar siendo user normal o admin, alguien me ayuda se muy poco de pluginsCutecry

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

#define PLUGIN "Surf Xp MOD"
#define AUTHOR "Ardivaba"
#define VERSION "1.0"

/* Lets define some illegal stuff */
#define TUTORIAL 1001
#define TASK_TUT 1111

/* What is the sound of the message? */
#define MSOUND "items/nvg_off.wav"

/* Some new stuff for tutor */
new g_MsgTutor
new g_MsgTutClose

new const g_szPrefix[] = "]TopGun'S[";

/* gCvars Triste */
new gCvarNozoom

/* So many levels...oh my f**in god */
new const LEVELS[821] =
{
50,
80,
90,
100,
150,
200,
250,
300,
350,
400,
450,
500,
550,
600,
650,
700,
750,
800,
850,
900,
950,
1000,
1100,
1200,
1300,
1400,
1500,
1600,
1700,
1800,
1900,
2000,
2100,
2200,
2300,
2400,
2500,
...
}

new PXP[ 33 ]
new PLEVEL[ 33 ]
new PKS[ 33 ]
new g_vault
new g_VerHud
new chatcolor

new kGanancia[33], kAccountType[33][20];

enum _: GANANCIA_DATA
{
GD_ADM_TYPE[20],
GD_ADM_FLAG,
GD_ADM_GN,
GD_ADM_GHH
}

new const Ganancias[][GANANCIA_DATA] = {
//| TIPO DE ADM | FLAGS | GANANCIA NORMAL | GANANCIA EN HH
{ "ADMIN VIP", ADMIN_LEVEL_E, 2, },
{ "ADMIN FULL", ADMIN_LEVEL_F, 3, },
{ "ADMIN SOCIO", ADMIN_LEVEL_G, 3, },
{ "ADMIN OWNER", ADMIN_LEVEL_H, 4, }
}

public plugin_init()

{
//You want credits? Take credits...you stealz0rs
register_plugin(PLUGIN, VERSION, AUTHOR)

register_concmd("fg_bombillo", "cmd_exp", ADMIN_CVAR, " - LVL [Nombre] [Cantidad]")
register_concmd("fg_bombilla", "cmd_exp2", ADMIN_CVAR, " - EXP [Nombre] [Cantidad]")

//You poor little guy died, what we gonna do now?
register_event( "DeathMsg", "EventDeathMsg", "a" )

//All kinds of information
register_clcmd( "say /xp", "printXp", -1, "Print player Xp" )
register_clcmd( "say /newlevel", "printNewLevel", -1, "Print player how many xp left to new level" )
register_clcmd( "say /level", "info_menu");

//Nozoom stuff
register_event("CurWeapon","ev_CurWeapon", "be", "1=1")

register_event("HLTV", "RoundStart", "a", "1=0", "2=0");

//Meat...mmmm, delicious ham
RegisterHam(Ham_Spawn, "player", "EventPlayerSpawn", 1)
RegisterHam(Ham_TakeDamage, "player", "fwHamTakeDamage")

RegisterHam(Ham_Killed, "player", "fw_playerkilled", 1)

//nVault stuff
g_vault = nvault_open("SURFXPMOD")


//Tutor stuff
g_MsgTutor = get_user_msgid("TutorText")
g_MsgTutClose = get_user_msgid("TutorClose")

//Those annoying cvars...for the community Triste
gCvarNozoom = register_cvar("sxm_nozoom", "0", 0, 0.0)
}

/* Precache resources */
public plugin_precache()
{

precache_model("models/TopGunS/v_Knife-5.mdl")

precache_model("models/TopGunS/v_Glock18-10.mdl")

precache_model("models/TopGunS/v_Usp-10.mdl")

precache_model("models/TopGunS/v_Hegrenade-15.mdl")

precache_model("models/TopGunS/v_Deagle-20.mdl")

precache_model("models/TopGunS/v_Elite-30.mdl")

precache_model("models/TopGunS/v_M249-180.mdl")

precache_model("models/TopGunS/v_Ak47-50.mdl")

precache_model("models/TopGunS/v_M4a1-50.mdl")

precache_model("models/TopGunS/v_Xm1014-60.mdl")

precache_model("models/TopGunS/v_M3-70.mdl")

precache_model("models/TopGunS/v_G3sg1-100.mdl")

precache_model("models/TopGunS/v_Sg550-100.mdl")

precache_model("models/TopGunS/v_Awp-120.mdl")

precache_model("models/TopGunS/v_Knife-200.mdl")

precache_model("models/TopGunS/v_Deagle-250.mdl")

precache_model("models/TopGunS/v_M3-280.mdl")

precache_model("models/TopGunS/v_Hegrenade-280.mdl")

precache_model("models/TopGunS/v_Knife-300.mdl")

precache_model("models/TopGunS/v_Ak47-350.mdl")

precache_model("models/TopGunS/v_M4a1-350.mdl")

precache_model("models/TopGunS/v_Awp-380.mdl")

precache_model("models/TopGunS/v_Xm1014-400.mdl")

precache_model("models/TopGunS/v_M3-450.mdl")

precache_model("models/TopGunS/v_Sg550-500.mdl")

precache_model("models/TopGunS/v_M3-560.mdl")

precache_model("models/TopGunS/v_Mp5-150.mdl")

precache_model("models/TopGunS/v_G3sg1-600.mdl")

precache_model("models/TopGunS/v_Knife-600.mdl")

precache_model("models/TopGunS/v_Awp-700.mdl")

precache_model("models/TopGunS/v_M3-810.mdl")

}

public client_connect( id )
{
PXP[ id ] = 0
LoadData( id )
}

public client_disconnect( id )
{
SaveData( id )
PXP[ id ] = 0
PLEVEL[ id ] = 0
PKS[ id ] = 0
}

public client_putinserver(id)
{
set_task(1.0, "hud", id, _, _, "b")
}

public EventPlayerSpawn( id )
{
new money
new newmoney

money = cs_get_user_money( id )
newmoney = money + (PLEVEL[ id ] * 16000)
cs_set_user_money( id, newmoney)
}

public hud(id)
{
if(!is_user_alive(id))
{
new target = pev(id, pev_iuser2);

if(!target)
return PLUGIN_CONTINUE;

new nombre[32]
new newlevel = LEVELS[PLEVEL[ target ]]-PXP[ target ]
get_user_name(target,nombre,charsmax(nombre))

set_hudmessage(0, 100, 255, 0.02, 0.1, 0, 0.0, 3.0, 0.0, 0.0, 1)
show_hudmessage(id, "^n]TopGun'S[ Surf+Level^n|=======================|^n**Detalles Del Jugador**^n1- Nombre: %s^n2- Nivel: %i / 820^n3- Experiencia: %i / %i^n|=======================|", nombre, PLEVEL[ target ], PXP[ target ], newlevel)
}
return PLUGIN_CONTINUE;
}

public EventDeathMsg()
{
new killer = read_data( 1 )
new victim = read_data( 2 )
new headshot = read_data( 3 )
new xp
new hs

if(PLEVEL[ killer ] > PLEVEL[ victim ])
{
xp = 14 * kGanancia[victim];
}

if(PLEVEL[ killer ] < PLEVEL[ victim ])
{
xp = 15 * kGanancia[victim];
}

if(PLEVEL[ killer ] == PLEVEL[ victim ])
{
xp = 17 * kGanancia[victim];
}

PKS[ victim ] = 0

if( victim == killer )
{
return PLUGIN_CONTINUE
}

if(headshot)
{
xp = xp + 14
hs = 1
}

if(PKS[ killer ] < 10)
{
PKS[ killer ]++
}

xp = xp + PKS[ killer ]

add_xp( killer, xp, hs )
check_level( killer )

new Text[ 100 ]
print_color(victim, "^x04%s^x3 Estas muerto y perdiste tu^x04 Racha de Experiencia!", g_szPrefix)
}

/* Add xp */
public add_xp( id, xp, hs )
{
new newlevel = LEVELS[PLEVEL[ id ]]-PXP[ id ]

PXP[ id ] = PXP[ id ] + xp

if(hs)
{
print_color(id, "!t]!gTopGun!t'!gS!t[ !nObtuviste !g%d !nxp ^nKillstreak: !g%d^n !nxp para nuevo nivel !g%d", xp, PKS[ id ], newlevel)
}
else
{
print_color(id, "!t]!gTopGun!t'!gS!t[ !nObtuviste !g%d !nxp ^nKillstreak: !g%d^n !nxp para nuevo nivel !g%d", xp, PKS[ id ], newlevel)
}
}

/* Lets check if player got a new level */
public check_level( id )
{
if(PXP[ id ] >= LEVELS[PLEVEL[ id ]])
{
PLEVEL[ id ]++
print_color(id, "!t]!gTopGun!t'!gS!t[ !nAhora eres nivel !g%d!", PLEVEL[ id ])
}
}

/* Lets print players ammount of xp */
public printXp( id )
{
print_color(id, "!t]!gTopGun!t'!gS!t[ !nTienes !g%d !nde xp!", PXP[ id ])
}

/* Lets print when player get's new level */
public printNewLevel( id )
{
new newlevel = LEVELS[PLEVEL[ id ]]-PXP[ id ]
print_color(id, "!g]!tTopGun'S!g[ !nNuevo nivel despues de !g%d exp!", newlevel)
}

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

replace_all(msg, 190, "!g", "^4") // Color Verde
replace_all(msg, 190, "!n", "^1") // Deje Incumplido Color
replace_all(msg, 190, "!t", "^3") // Color del Equipo

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();
}
}
}
}

public info_menu(id)
{
new newlevel = LEVELS[PLEVEL[ id ]]-PXP[ id ]
new keys = MENU_KEY_0
new infomenu[999], len; len = 0
new nombre[32]
get_user_name(id, nombre, charsmax(nombre))

len += formatex(infomenu[len], charsmax(infomenu) - len, "\r]\wTopGuns\y'\wS\r[\w Tu Cuenta^n")
len += formatex(infomenu[len], charsmax(infomenu) - len, "|=======================|^n")
len += formatex(infomenu[len], charsmax(infomenu) - len, "\r1- \wNombre: %s^n", nombre)
len += formatex(infomenu[len], charsmax(infomenu) - len, "\r2- \wNivel: %d / 820^n", PLEVEL[ id ]);
len += formatex(infomenu[len], charsmax(infomenu) - len, "\r3- \wExp: %d / %d^n", PXP[ id ], newlevel);
len += formatex(infomenu[len], charsmax(infomenu) - len, "|=======================|");
len += formatex(infomenu[len], charsmax(infomenu) - len, "^n^n\y0. \rSalir");

show_menu(id, keys, infomenu)
return PLUGIN_CONTINUE
}

/* Save Data to nVault */
public SaveData(id)
{
new AuthID[35]
get_user_name(id,AuthID,34)

new vaultkey[64],vaultdata[256]
format(vaultkey,63,"%s-Mod",AuthID)
format(vaultdata,255,"%i#%i#",PXP[id],PLEVEL[id])
nvault_set(g_vault,vaultkey,vaultdata)
return PLUGIN_CONTINUE
}

/* Load Data from nVault */
public LoadData(id)
{
new AuthID[35]
get_user_name(id,AuthID,34)

new vaultkey[64],vaultdata[256]
format(vaultkey,63,"%s-Mod",AuthID)
format(vaultdata,255,"%i#%i#",PXP[id],PLEVEL[id])
nvault_get(g_vault,vaultkey,vaultdata,255)

replace_all(vaultdata, 255, "#", " ")

new playerxp[32], playerlevel[32]

parse(vaultdata, playerxp, 31, playerlevel, 31)

PXP[id] = str_to_num(playerxp)
PLEVEL[id] = str_to_num(playerlevel)

return PLUGIN_CONTINUE
}

public cmd_exp(id, level, cid)
{
// Check for access flag
if (!cmd_access(id, level, cid, 2))
return PLUGIN_HANDLED;

// Retrieve arguments
static arg[32], arg2[6], player, asd
read_argv(1, arg, sizeof arg - 1)
read_argv(2, arg2, sizeof arg2 - 1)
player = cmd_target(id, arg, CMDTARGET_NO_BOTS | CMDTARGET_ALLOW_SELF)

// Invalid target
if (!player) return PLUGIN_HANDLED;

// Increase Points
asd = (str_to_num(arg2))

print_color(id, "!t]!gTopGun!t'!gS!t[ Le diste !g%d !ta !g%s", asd, arg)
print_color(player, "!t]!gTopGun!t'!gS!t[ Te dieron !g%d niveles", asd)
PLEVEL[player] = asd

return PLUGIN_HANDLED;
}

public cmd_exp2(id, level, cid)
{
// Check for access flag
if (!cmd_access(id, level, cid, 2))
return PLUGIN_HANDLED;

// Retrieve arguments
static arg[32], arg2[6], player, asd
read_argv(1, arg, sizeof arg - 1)
read_argv(2, arg2, sizeof arg2 - 1)
player = cmd_target(id, arg, CMDTARGET_NO_BOTS | CMDTARGET_ALLOW_SELF)

// Invalid target
if (!player) return PLUGIN_HANDLED;

// Increase Points
asd = (str_to_num(arg2))

print_color(id, "!t]!gTopGun!t'!gS!t[ Le diste !g%d !txp a !g%s", asd, arg)
print_color(player, "!t]!gTopGun!t'!gS!t[ Te han dado !g%d !tde experiencia", asd)
PXP[player] = asd

return PLUGIN_HANDLED;
}

public zoom( id )
{
if(gCvarNozoom)
{
client_cmd( id, "drop" )
}
}

/* Golden Weapons */


public ev_CurWeapon(id)
{
if(!is_user_connected(id) || !is_user_alive(id))
{
return PLUGIN_HANDLED;
}

new Weapon_Id = read_data(2)

/* knife */
if(Weapon_Id == CSW_KNIFE && PLEVEL[ id ] >= 5 )
{
set_pev(id, pev_viewmodel2, "models/TopGunS/v_Knife-5.mdl")
}

/* glock18 */
if(Weapon_Id == CSW_GLOCK18 && PLEVEL[ id ] >= 10 )
{
set_pev(id, pev_viewmodel2, "models/TopGunS/v_Glock18-10.mdl")
}

/* usp */
if(Weapon_Id == CSW_USP && PLEVEL[ id ] >= 10 )
{
set_pev(id, pev_viewmodel2, "models/TopGunS/v_Usp-10.mdl")
}

/* granada */
if(Weapon_Id == CSW_HEGRENADE && PLEVEL[ id ] >= 15 )
{
set_pev(id, pev_viewmodel2, "models/TopGunS/v_Hegrenade-15.mdl")
}

/* deagle */
if(Weapon_Id == CSW_DEAGLE && PLEVEL[ id ] >= 20 )
{
set_pev(id, pev_viewmodel2, "models/TopGunS/v_Deagle-20.mdl")
}

/* deagle */
if(Weapon_Id == CSW_ELITE && PLEVEL[ id ] >= 30 )
{
set_pev(id, pev_viewmodel2, "models/TopGunS/v_Elite-30.mdl")
}

/* deagle */
if(Weapon_Id == CSW_M249 && PLEVEL[ id ] >= 180 )
{
set_pev(id, pev_viewmodel2, "models/TopGunS/v_M249-180.mdl")
}

/* deagle */
if(Weapon_Id == CSW_MP5NAVY && PLEVEL[ id ] >= 150 )
{
set_pev(id, pev_viewmodel2, "models/TopGunS/v_Mp5-150.mdl")
}

/* ak47 */
if(Weapon_Id == CSW_AK47 && PLEVEL[ id ] >= 50 )
{
set_pev(id, pev_viewmodel2, "models/TopGunS/v_Ak47-50.mdl")
}

/* m4a1 */
if(Weapon_Id == CSW_M4A1 && PLEVEL[ id ] >= 50 )
{
set_pev(id, pev_viewmodel2, "models/TopGunS/v_M4a1-50.mdl")
}

/* xm1014 */
if(Weapon_Id == CSW_XM1014 && PLEVEL[ id ] >= 60 )
{
set_pev(id, pev_viewmodel2, "models/TopGunS/v_Xm1014-60.mdl")
}

/* m3 */
if(Weapon_Id == CSW_M3 && PLEVEL[ id ] >= 70 )
{
set_pev(id, pev_viewmodel2, "models/TopGunS/v_M3-70.mdl")
}

/* taka */
if(Weapon_Id == CSW_G3SG1 && PLEVEL[ id ] >= 100 )
{
set_pev(id, pev_viewmodel2, "models/TopGunS/v_G3sg1-100.mdl")
}

/* knife4 */
if(Weapon_Id == CSW_G3SG1 && PLEVEL[ id ] >= 130 )
{
set_pev(id, pev_viewmodel2, "models/TopGunS/v_Sg550-100.mdl")
}

/* awp */
if(Weapon_Id == CSW_AWP && PLEVEL[ id ] >= 120 )
{
set_pev(id, pev_viewmodel2, "models/TopGunS/v_Awp-120.mdl")
}

/* knife2 */
if(Weapon_Id == CSW_KNIFE && PLEVEL[ id ] >= 200 )
{
set_pev(id, pev_viewmodel2, "models/TopGunS/v_Knife-200.mdl")
}

/* deagle2 */
if(Weapon_Id == CSW_DEAGLE && PLEVEL[ id ] >= 250 )
{
set_pev(id, pev_viewmodel2, "models/TopGunS/v_Deagle-250.mdl")
}

/* usp */
if(Weapon_Id == CSW_M3 && PLEVEL[ id ] >= 280 )
{
set_pev(id, pev_viewmodel2, "models/TopGunS/v_M3-280.mdl")
}

/* hegrenade2 */
if(Weapon_Id == CSW_HEGRENADE && PLEVEL[ id ] >= 280 )
{
set_pev(id, pev_viewmodel2, "models/TopGunS/v_Hegrenade-280.mdl")
}

/* knife3 */
if(Weapon_Id == CSW_KNIFE && PLEVEL[ id ] >= 300 )
{
set_pev(id, pev_viewmodel2, "models/TopGunS/v_Knife-300.mdl")
}


/* ak47 */
if(Weapon_Id == CSW_AK47 && PLEVEL[ id ] >= 350 )
{
set_pev(id, pev_viewmodel2, "models/TopGunS/v_Ak47-350.mdl")
}

/* m4a1 */
if(Weapon_Id == CSW_M4A1 && PLEVEL[ id ] >= 350 )
{
set_pev(id, pev_viewmodel2, "models/TopGunS/v_M4a1-350.mdl")
}

/* awp2 */
if(Weapon_Id == CSW_AWP && PLEVEL[ id ] >= 380 )
{
set_pev(id, pev_viewmodel2, "models/TopGunS/v_Awp-380.mdl")
}

/* xm1014 */
if(Weapon_Id == CSW_XM1014 && PLEVEL[ id ] >= 400 )
{
set_pev(id, pev_viewmodel2, "models/TopGunS/v_Xm1014-400.mdl")
}

/* m33 */
if(Weapon_Id == CSW_M3 && PLEVEL[ id ] >= 450 )
{
set_pev(id, pev_viewmodel2, "models/TopGunS/v_M3-450.mdl")
}

/* ak47 */
if(Weapon_Id == CSW_SG550 && PLEVEL[ id ] >= 500 )
{
set_pev(id, pev_viewmodel2, "models/TopGunS/v_Sg550-500.mdl")
}

/* m34 */
if(Weapon_Id == CSW_M3 && PLEVEL[ id ] >= 560 )
{
set_pev(id, pev_viewmodel2, "models/TopGunS/v_M3-560.mdl")
}

/* knife4 */
if(Weapon_Id == CSW_G3SG1 && PLEVEL[ id ] >= 600 )
{
set_pev(id, pev_viewmodel2, "models/TopGunS/v_G3sg1-600.mdl")
}

/* knife4 */
if(Weapon_Id == CSW_KNIFE && PLEVEL[ id ] >= 600 )
{
set_pev(id, pev_viewmodel2, "models/TopGunS/v_Knife-600.mdl")
}

/* awp2 */
if(Weapon_Id == CSW_AWP && PLEVEL[ id ] >= 700 )
{
set_pev(id, pev_viewmodel2, "models/TopGunS/v_Awp-700.mdl")
}

/* xm1014 */
if(Weapon_Id == CSW_M3 && PLEVEL[ id ] >= 810 )
{
set_pev(id, pev_viewmodel2, "models/TopGunS/v_M3-810.mdl")
}

return PLUGIN_CONTINUE;
}

printf_do(id, sender, const data[], MsgID) {

message_begin(id ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, MsgID, _, id)

write_byte(sender)

write_string(data)

message_end()

}

public fwHamTakeDamage(victim, inflictor, attacker, Float:damage, damagebits)
{

/* knife */
if(get_user_weapon(attacker) == CSW_KNIFE && PLEVEL[ attacker ] >= 5)
{
SetHamParamFloat(4, damage * 1.0)
return HAM_HANDLED
}

/* Glock18 */
if(get_user_weapon(attacker) == CSW_GLOCK18 && PLEVEL[ attacker ] >= 10)
{
SetHamParamFloat(4, damage * 1.2)
return HAM_HANDLED
}

/* Usp */
if(get_user_weapon(attacker) == CSW_USP && PLEVEL[ attacker ] >= 10)
{
SetHamParamFloat(4, damage * 1.2)
return HAM_HANDLED
}

/* Granada */
if(get_user_weapon(attacker) == CSW_HEGRENADE && PLEVEL[ attacker ] >= 15)
{
SetHamParamFloat(4, damage * 1.0)
return HAM_HANDLED
}

/* Granada */
if(get_user_weapon(attacker) == CSW_DEAGLE && PLEVEL[ attacker ] >= 20)
{
SetHamParamFloat(4, damage * 1.4)
return HAM_HANDLED
}

/* Granada */
if(get_user_weapon(attacker) == CSW_ELITE && PLEVEL[ attacker ] >= 30)
{
SetHamParamFloat(4, damage * 1.1)
return HAM_HANDLED
}

/* Granada */
if(get_user_weapon(attacker) == CSW_MP5NAVY && PLEVEL[ attacker ] >= 150)
{
SetHamParamFloat(4, damage * 1.4)
return HAM_HANDLED
}

/* Granada */
if(get_user_weapon(attacker) == CSW_M249 && PLEVEL[ attacker ] >= 180)
{
SetHamParamFloat(4, damage * 1.4)
return HAM_HANDLED
}

/* Deagle */
if(get_user_weapon(attacker) == CSW_AK47 && PLEVEL[ attacker ] >= 50)
{
SetHamParamFloat(4, damage * 1.7)
return HAM_HANDLED
}

/* m4a1 */
if(get_user_weapon(attacker) == CSW_M4A1 && PLEVEL[ attacker ] >= 50)
{
SetHamParamFloat(4, damage * 1.7)
return HAM_HANDLED
}

/* xm1014 */
if(get_user_weapon(attacker) == CSW_XM1014 && PLEVEL[ attacker ] >= 60)
{
SetHamParamFloat(4, damage * 1.6)
return HAM_HANDLED
}

/* m3 */
if(get_user_weapon(attacker) == CSW_M3 && PLEVEL[ attacker ] >= 70)
{
SetHamParamFloat(4, damage * 1.7)
return HAM_HANDLED
}

/* takact */
if(get_user_weapon(attacker) == CSW_SG550 && PLEVEL[ attacker ] >= 130)
{
SetHamParamFloat(4, damage * 1.5)
return HAM_HANDLED
}

/* taka */
if(get_user_weapon(attacker) == CSW_G3SG1 && PLEVEL[ attacker ] >= 100)
{
SetHamParamFloat(4, damage * 1.6)
return HAM_HANDLED
}

/* awp */
if(get_user_weapon(attacker) == CSW_AWP && PLEVEL[ attacker ] >= 120)
{
SetHamParamFloat(4, damage * 1.8)
return HAM_HANDLED
}

/* knife2 */
if(get_user_weapon(attacker) == CSW_KNIFE && PLEVEL[ attacker ] >= 200)
{
SetHamParamFloat(4, damage * 1.1)
return HAM_HANDLED
}

/* deagle */
if(get_user_weapon(attacker) == CSW_DEAGLE && PLEVEL[ attacker ] >= 250)
{
SetHamParamFloat(4, damage * 1.8)
return HAM_HANDLED
}

/* m32 */
if(get_user_weapon(attacker) == CSW_HEGRENADE && PLEVEL[ attacker ] >= 280)
{
SetHamParamFloat(4, damage * 1.2)
return HAM_HANDLED
}

/* m32 */
if(get_user_weapon(attacker) == CSW_M3 && PLEVEL[ attacker ] >= 280)
{
SetHamParamFloat(4, damage * 1.9)
return HAM_HANDLED
}

/* knife3 */
if(get_user_weapon(attacker) == CSW_KNIFE && PLEVEL[ attacker ] >= 300)
{
SetHamParamFloat(4, damage * 1.2)
return HAM_HANDLED
}

/* ak477 */
if(get_user_weapon(attacker) == CSW_AK47 && PLEVEL[ attacker ] >= 350)
{
SetHamParamFloat(4, damage * 2.1)
return HAM_HANDLED
}

/* m4a11 */
if(get_user_weapon(attacker) == CSW_M4A1 && PLEVEL[ attacker ] >= 350)
{
SetHamParamFloat(4, damage * 2.0)
return HAM_HANDLED
}

/* awp2 */
if(get_user_weapon(attacker) == CSW_AWP && PLEVEL[ attacker ] >= 380)
{
SetHamParamFloat(4, damage * 2.0)
return HAM_HANDLED
}

/* xm1014 */
if(get_user_weapon(attacker) == CSW_XM1014 && PLEVEL[ attacker ] >= 400)
{
SetHamParamFloat(4, damage * 2.0)
return HAM_HANDLED
}

/* M33 */
if(get_user_weapon(attacker) == CSW_M3 && PLEVEL[ attacker ] >= 450)
{
SetHamParamFloat(4, damage * 2.1)
return HAM_HANDLED
}

/* takact */
if(get_user_weapon(attacker) == CSW_SG550 && PLEVEL[ attacker ] >= 500)
{
SetHamParamFloat(4, damage * 2.0)
return HAM_HANDLED
}

/* m34 */
if(get_user_weapon(attacker) == CSW_M3 && PLEVEL[ attacker ] >= 560)
{
SetHamParamFloat(4, damage * 2.3)
return HAM_HANDLED
}

/* knife4 */
if(get_user_weapon(attacker) == CSW_G3SG1 && PLEVEL[ attacker ] >= 600)
{
SetHamParamFloat(4, damage * 2.2)
return HAM_HANDLED
}


/* knife4 */
if(get_user_weapon(attacker) == CSW_KNIFE && PLEVEL[ attacker ] >= 600)
{
SetHamParamFloat(4, damage * 1.3)
return HAM_HANDLED
}

/* awp2 */
if(get_user_weapon(attacker) == CSW_AWP && PLEVEL[ attacker ] >= 700)
{
SetHamParamFloat(4, damage * 2.4)
return HAM_HANDLED
}

/* m34 */
if(get_user_weapon(attacker) == CSW_M3 && PLEVEL[ attacker ] >= 810)
{
SetHamParamFloat(4, damage * 2.6)
return HAM_HANDLED
}

return HAM_IGNORED
}

Load_AdminTypes(id)
{
if(is_user_admin(id)) // Si es admin
{
new i, flags = get_user_flags(id);

for(i = 0 ; i < sizeof Ganancias ; i++ )
{
if(flags & Ganancias[i][GD_ADM_FLAG]) // Si las flags del player es igual a las que definimos arriba
{
kGanancia[id] = Ganancias[i][GD_ADM_GN]; // Le damos la ganancia Normal

formatex(kAccountType[id], charsmax(kAccountType), "%s", Ganancias[i][GD_ADM_TYPE]); // Le damos formato a 'kAccountType'


break; // Salimos del Loopeo
}
}
}
else // Si no es admin
{
kGanancia[id] = 1; // Le damos Ganancia por 2 a los users normales

formatex(kAccountType[id], charsmax(kAccountType), "Usuario Normal"); // Le damos formato a 'kAccountType'
}
}
Responder
#7
(25/02/2020, 10:50 PM)Josue escribió: Alguien me ayuda? tengo este surf mod +level quiero adaptarle ganancia por tipo de admin con experiencia multiplicada x2, x3 etc, al yo seguir el tutorial me copilo bien pero me da 1 de xp al yo matar siendo user normal o admin, alguien me ayuda se muy poco de pluginsCutecry

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

#define PLUGIN "Surf Xp MOD"
#define AUTHOR "Ardivaba"
#define VERSION "1.0"

/* Lets define some illegal stuff */
#define TUTORIAL 1001
#define TASK_TUT 1111

/* What is the sound of the message? */
#define MSOUND "items/nvg_off.wav"

/* Some new stuff for tutor */
new g_MsgTutor
new g_MsgTutClose

new const g_szPrefix[] = "]TopGun'S[";

/* gCvars Triste */
new gCvarNozoom

/* So many levels...oh my f**in god */
new const LEVELS[821] =
{
50,
80,
90,
100,
150,
200,
250,
300,
350,
400,
450,
500,
550,
600,
650,
700,
750,
800,
850,
900,
950,
1000,
1100,
1200,
1300,
1400,
1500,
1600,
1700,
1800,
1900,
2000,
2100,
2200,
2300,
2400,
2500,
...
}

new PXP[ 33 ]
new PLEVEL[ 33 ]
new PKS[ 33 ]
new g_vault
new g_VerHud
new chatcolor

new kGanancia[33], kAccountType[33][20];

enum _: GANANCIA_DATA
{
GD_ADM_TYPE[20],
GD_ADM_FLAG,
GD_ADM_GN,
GD_ADM_GHH
}

new const Ganancias[][GANANCIA_DATA] = {
//| TIPO DE ADM | FLAGS | GANANCIA NORMAL | GANANCIA EN HH
{ "ADMIN VIP", ADMIN_LEVEL_E, 2, },
{ "ADMIN FULL", ADMIN_LEVEL_F, 3, },
{ "ADMIN SOCIO", ADMIN_LEVEL_G, 3, },
{ "ADMIN OWNER", ADMIN_LEVEL_H, 4, }
}

public plugin_init()

{
//You want credits? Take credits...you stealz0rs
register_plugin(PLUGIN, VERSION, AUTHOR)

register_concmd("fg_bombillo", "cmd_exp", ADMIN_CVAR, " - LVL [Nombre] [Cantidad]")
register_concmd("fg_bombilla", "cmd_exp2", ADMIN_CVAR, " - EXP [Nombre] [Cantidad]")

//You poor little guy died, what we gonna do now?
register_event( "DeathMsg", "EventDeathMsg", "a" )

//All kinds of information
register_clcmd( "say /xp", "printXp", -1, "Print player Xp" )
register_clcmd( "say /newlevel", "printNewLevel", -1, "Print player how many xp left to new level" )
register_clcmd( "say /level", "info_menu");

//Nozoom stuff
register_event("CurWeapon","ev_CurWeapon", "be", "1=1")

register_event("HLTV", "RoundStart", "a", "1=0", "2=0");

//Meat...mmmm, delicious ham
RegisterHam(Ham_Spawn, "player", "EventPlayerSpawn", 1)
RegisterHam(Ham_TakeDamage, "player", "fwHamTakeDamage")

RegisterHam(Ham_Killed, "player", "fw_playerkilled", 1)

//nVault stuff
g_vault = nvault_open("SURFXPMOD")


//Tutor stuff
g_MsgTutor = get_user_msgid("TutorText")
g_MsgTutClose = get_user_msgid("TutorClose")

//Those annoying cvars...for the community Triste
gCvarNozoom = register_cvar("sxm_nozoom", "0", 0, 0.0)
}

/* Precache resources */
public plugin_precache()
{

precache_model("models/TopGunS/v_Knife-5.mdl")

precache_model("models/TopGunS/v_Glock18-10.mdl")

precache_model("models/TopGunS/v_Usp-10.mdl")

precache_model("models/TopGunS/v_Hegrenade-15.mdl")

precache_model("models/TopGunS/v_Deagle-20.mdl")

precache_model("models/TopGunS/v_Elite-30.mdl")

precache_model("models/TopGunS/v_M249-180.mdl")

precache_model("models/TopGunS/v_Ak47-50.mdl")

precache_model("models/TopGunS/v_M4a1-50.mdl")

precache_model("models/TopGunS/v_Xm1014-60.mdl")

precache_model("models/TopGunS/v_M3-70.mdl")

precache_model("models/TopGunS/v_G3sg1-100.mdl")

precache_model("models/TopGunS/v_Sg550-100.mdl")

precache_model("models/TopGunS/v_Awp-120.mdl")

precache_model("models/TopGunS/v_Knife-200.mdl")

precache_model("models/TopGunS/v_Deagle-250.mdl")

precache_model("models/TopGunS/v_M3-280.mdl")

precache_model("models/TopGunS/v_Hegrenade-280.mdl")

precache_model("models/TopGunS/v_Knife-300.mdl")

precache_model("models/TopGunS/v_Ak47-350.mdl")

precache_model("models/TopGunS/v_M4a1-350.mdl")

precache_model("models/TopGunS/v_Awp-380.mdl")

precache_model("models/TopGunS/v_Xm1014-400.mdl")

precache_model("models/TopGunS/v_M3-450.mdl")

precache_model("models/TopGunS/v_Sg550-500.mdl")

precache_model("models/TopGunS/v_M3-560.mdl")

precache_model("models/TopGunS/v_Mp5-150.mdl")

precache_model("models/TopGunS/v_G3sg1-600.mdl")

precache_model("models/TopGunS/v_Knife-600.mdl")

precache_model("models/TopGunS/v_Awp-700.mdl")

precache_model("models/TopGunS/v_M3-810.mdl")

}

public client_connect( id )
{
PXP[ id ] = 0
LoadData( id )
}

public client_disconnect( id )
{
SaveData( id )
PXP[ id ] = 0
PLEVEL[ id ] = 0
PKS[ id ] = 0
}

public client_putinserver(id)
{
set_task(1.0, "hud", id, _, _, "b")
}

public EventPlayerSpawn( id )
{
new money
new newmoney

money = cs_get_user_money( id )
newmoney = money + (PLEVEL[ id ] * 16000)
cs_set_user_money( id, newmoney)
}

public hud(id)
{
if(!is_user_alive(id))
{
new target = pev(id, pev_iuser2);

if(!target)
return PLUGIN_CONTINUE;

new nombre[32]
new newlevel = LEVELS[PLEVEL[ target ]]-PXP[ target ]
get_user_name(target,nombre,charsmax(nombre))

set_hudmessage(0, 100, 255, 0.02, 0.1, 0, 0.0, 3.0, 0.0, 0.0, 1)
show_hudmessage(id, "^n]TopGun'S[ Surf+Level^n|=======================|^n**Detalles Del Jugador**^n1- Nombre: %s^n2- Nivel: %i / 820^n3- Experiencia: %i / %i^n|=======================|", nombre, PLEVEL[ target ], PXP[ target ], newlevel)
}
return PLUGIN_CONTINUE;
}

public EventDeathMsg()
{
new killer = read_data( 1 )
new victim = read_data( 2 )
new headshot = read_data( 3 )
new xp
new hs

if(PLEVEL[ killer ] > PLEVEL[ victim ])
{
xp = 14 * kGanancia[victim];
}

if(PLEVEL[ killer ] < PLEVEL[ victim ])
{
xp = 15 * kGanancia[victim];
}

if(PLEVEL[ killer ] == PLEVEL[ victim ])
{
xp = 17 * kGanancia[victim];
}

PKS[ victim ] = 0

if( victim == killer )
{
return PLUGIN_CONTINUE
}

if(headshot)
{
xp = xp + 14
hs = 1
}

if(PKS[ killer ] < 10)
{
PKS[ killer ]++
}

xp = xp + PKS[ killer ]

add_xp( killer, xp, hs )
check_level( killer )

new Text[ 100 ]
print_color(victim, "^x04%s^x3 Estas muerto y perdiste tu^x04 Racha de Experiencia!", g_szPrefix)
}

/* Add xp */
public add_xp( id, xp, hs )
{
new newlevel = LEVELS[PLEVEL[ id ]]-PXP[ id ]

PXP[ id ] = PXP[ id ] + xp

if(hs)
{
print_color(id, "!t]!gTopGun!t'!gS!t[ !nObtuviste !g%d !nxp ^nKillstreak: !g%d^n !nxp para nuevo nivel !g%d", xp, PKS[ id ], newlevel)
}
else
{
print_color(id, "!t]!gTopGun!t'!gS!t[ !nObtuviste !g%d !nxp ^nKillstreak: !g%d^n !nxp para nuevo nivel !g%d", xp, PKS[ id ], newlevel)
}
}

/* Lets check if player got a new level */
public check_level( id )
{
if(PXP[ id ] >= LEVELS[PLEVEL[ id ]])
{
PLEVEL[ id ]++
print_color(id, "!t]!gTopGun!t'!gS!t[ !nAhora eres nivel !g%d!", PLEVEL[ id ])
}
}

/* Lets print players ammount of xp */
public printXp( id )
{
print_color(id, "!t]!gTopGun!t'!gS!t[ !nTienes !g%d !nde xp!", PXP[ id ])
}

/* Lets print when player get's new level */
public printNewLevel( id )
{
new newlevel = LEVELS[PLEVEL[ id ]]-PXP[ id ]
print_color(id, "!g]!tTopGun'S!g[ !nNuevo nivel despues de !g%d exp!", newlevel)
}

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

replace_all(msg, 190, "!g", "^4") // Color Verde
replace_all(msg, 190, "!n", "^1") // Deje Incumplido Color
replace_all(msg, 190, "!t", "^3") // Color del Equipo

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();
}
}
}
}

public info_menu(id)
{
new newlevel = LEVELS[PLEVEL[ id ]]-PXP[ id ]
new keys = MENU_KEY_0
new infomenu[999], len; len = 0
new nombre[32]
get_user_name(id, nombre, charsmax(nombre))

len += formatex(infomenu[len], charsmax(infomenu) - len, "\r]\wTopGuns\y'\wS\r[\w Tu Cuenta^n")
len += formatex(infomenu[len], charsmax(infomenu) - len, "|=======================|^n")
len += formatex(infomenu[len], charsmax(infomenu) - len, "\r1- \wNombre: %s^n", nombre)
len += formatex(infomenu[len], charsmax(infomenu) - len, "\r2- \wNivel: %d / 820^n", PLEVEL[ id ]);
len += formatex(infomenu[len], charsmax(infomenu) - len, "\r3- \wExp: %d / %d^n", PXP[ id ], newlevel);
len += formatex(infomenu[len], charsmax(infomenu) - len, "|=======================|");
len += formatex(infomenu[len], charsmax(infomenu) - len, "^n^n\y0. \rSalir");

show_menu(id, keys, infomenu)
return PLUGIN_CONTINUE
}

/* Save Data to nVault */
public SaveData(id)
{
new AuthID[35]
get_user_name(id,AuthID,34)

new vaultkey[64],vaultdata[256]
format(vaultkey,63,"%s-Mod",AuthID)
format(vaultdata,255,"%i#%i#",PXP[id],PLEVEL[id])
nvault_set(g_vault,vaultkey,vaultdata)
return PLUGIN_CONTINUE
}

/* Load Data from nVault */
public LoadData(id)
{
new AuthID[35]
get_user_name(id,AuthID,34)

new vaultkey[64],vaultdata[256]
format(vaultkey,63,"%s-Mod",AuthID)
format(vaultdata,255,"%i#%i#",PXP[id],PLEVEL[id])
nvault_get(g_vault,vaultkey,vaultdata,255)

replace_all(vaultdata, 255, "#", " ")

new playerxp[32], playerlevel[32]

parse(vaultdata, playerxp, 31, playerlevel, 31)

PXP[id] = str_to_num(playerxp)
PLEVEL[id] = str_to_num(playerlevel)

return PLUGIN_CONTINUE
}

public cmd_exp(id, level, cid)
{
// Check for access flag
if (!cmd_access(id, level, cid, 2))
return PLUGIN_HANDLED;

// Retrieve arguments
static arg[32], arg2[6], player, asd
read_argv(1, arg, sizeof arg - 1)
read_argv(2, arg2, sizeof arg2 - 1)
player = cmd_target(id, arg, CMDTARGET_NO_BOTS | CMDTARGET_ALLOW_SELF)

// Invalid target
if (!player) return PLUGIN_HANDLED;

// Increase Points
asd = (str_to_num(arg2))

print_color(id, "!t]!gTopGun!t'!gS!t[ Le diste !g%d !ta !g%s", asd, arg)
print_color(player, "!t]!gTopGun!t'!gS!t[ Te dieron !g%d niveles", asd)
PLEVEL[player] = asd

return PLUGIN_HANDLED;
}

public cmd_exp2(id, level, cid)
{
// Check for access flag
if (!cmd_access(id, level, cid, 2))
return PLUGIN_HANDLED;

// Retrieve arguments
static arg[32], arg2[6], player, asd
read_argv(1, arg, sizeof arg - 1)
read_argv(2, arg2, sizeof arg2 - 1)
player = cmd_target(id, arg, CMDTARGET_NO_BOTS | CMDTARGET_ALLOW_SELF)

// Invalid target
if (!player) return PLUGIN_HANDLED;

// Increase Points
asd = (str_to_num(arg2))

print_color(id, "!t]!gTopGun!t'!gS!t[ Le diste !g%d !txp a !g%s", asd, arg)
print_color(player, "!t]!gTopGun!t'!gS!t[ Te han dado !g%d !tde experiencia", asd)
PXP[player] = asd

return PLUGIN_HANDLED;
}

public zoom( id )
{
if(gCvarNozoom)
{
client_cmd( id, "drop" )
}
}

/* Golden Weapons */


public ev_CurWeapon(id)
{
if(!is_user_connected(id) || !is_user_alive(id))
{
return PLUGIN_HANDLED;
}

new Weapon_Id = read_data(2)

/* knife */
if(Weapon_Id == CSW_KNIFE && PLEVEL[ id ] >= 5 )
{
set_pev(id, pev_viewmodel2, "models/TopGunS/v_Knife-5.mdl")
}

/* glock18 */
if(Weapon_Id == CSW_GLOCK18 && PLEVEL[ id ] >= 10 )
{
set_pev(id, pev_viewmodel2, "models/TopGunS/v_Glock18-10.mdl")
}

/* usp */
if(Weapon_Id == CSW_USP && PLEVEL[ id ] >= 10 )
{
set_pev(id, pev_viewmodel2, "models/TopGunS/v_Usp-10.mdl")
}

/* granada */
if(Weapon_Id == CSW_HEGRENADE && PLEVEL[ id ] >= 15 )
{
set_pev(id, pev_viewmodel2, "models/TopGunS/v_Hegrenade-15.mdl")
}

/* deagle */
if(Weapon_Id == CSW_DEAGLE && PLEVEL[ id ] >= 20 )
{
set_pev(id, pev_viewmodel2, "models/TopGunS/v_Deagle-20.mdl")
}

/* deagle */
if(Weapon_Id == CSW_ELITE && PLEVEL[ id ] >= 30 )
{
set_pev(id, pev_viewmodel2, "models/TopGunS/v_Elite-30.mdl")
}

/* deagle */
if(Weapon_Id == CSW_M249 && PLEVEL[ id ] >= 180 )
{
set_pev(id, pev_viewmodel2, "models/TopGunS/v_M249-180.mdl")
}

/* deagle */
if(Weapon_Id == CSW_MP5NAVY && PLEVEL[ id ] >= 150 )
{
set_pev(id, pev_viewmodel2, "models/TopGunS/v_Mp5-150.mdl")
}

/* ak47 */
if(Weapon_Id == CSW_AK47 && PLEVEL[ id ] >= 50 )
{
set_pev(id, pev_viewmodel2, "models/TopGunS/v_Ak47-50.mdl")
}

/* m4a1 */
if(Weapon_Id == CSW_M4A1 && PLEVEL[ id ] >= 50 )
{
set_pev(id, pev_viewmodel2, "models/TopGunS/v_M4a1-50.mdl")
}

/* xm1014 */
if(Weapon_Id == CSW_XM1014 && PLEVEL[ id ] >= 60 )
{
set_pev(id, pev_viewmodel2, "models/TopGunS/v_Xm1014-60.mdl")
}

/* m3 */
if(Weapon_Id == CSW_M3 && PLEVEL[ id ] >= 70 )
{
set_pev(id, pev_viewmodel2, "models/TopGunS/v_M3-70.mdl")
}

/* taka */
if(Weapon_Id == CSW_G3SG1 && PLEVEL[ id ] >= 100 )
{
set_pev(id, pev_viewmodel2, "models/TopGunS/v_G3sg1-100.mdl")
}

/* knife4 */
if(Weapon_Id == CSW_G3SG1 && PLEVEL[ id ] >= 130 )
{
set_pev(id, pev_viewmodel2, "models/TopGunS/v_Sg550-100.mdl")
}

/* awp */
if(Weapon_Id == CSW_AWP && PLEVEL[ id ] >= 120 )
{
set_pev(id, pev_viewmodel2, "models/TopGunS/v_Awp-120.mdl")
}

/* knife2 */
if(Weapon_Id == CSW_KNIFE && PLEVEL[ id ] >= 200 )
{
set_pev(id, pev_viewmodel2, "models/TopGunS/v_Knife-200.mdl")
}

/* deagle2 */
if(Weapon_Id == CSW_DEAGLE && PLEVEL[ id ] >= 250 )
{
set_pev(id, pev_viewmodel2, "models/TopGunS/v_Deagle-250.mdl")
}

/* usp */
if(Weapon_Id == CSW_M3 && PLEVEL[ id ] >= 280 )
{
set_pev(id, pev_viewmodel2, "models/TopGunS/v_M3-280.mdl")
}

/* hegrenade2 */
if(Weapon_Id == CSW_HEGRENADE && PLEVEL[ id ] >= 280 )
{
set_pev(id, pev_viewmodel2, "models/TopGunS/v_Hegrenade-280.mdl")
}

/* knife3 */
if(Weapon_Id == CSW_KNIFE && PLEVEL[ id ] >= 300 )
{
set_pev(id, pev_viewmodel2, "models/TopGunS/v_Knife-300.mdl")
}


/* ak47 */
if(Weapon_Id == CSW_AK47 && PLEVEL[ id ] >= 350 )
{
set_pev(id, pev_viewmodel2, "models/TopGunS/v_Ak47-350.mdl")
}

/* m4a1 */
if(Weapon_Id == CSW_M4A1 && PLEVEL[ id ] >= 350 )
{
set_pev(id, pev_viewmodel2, "models/TopGunS/v_M4a1-350.mdl")
}

/* awp2 */
if(Weapon_Id == CSW_AWP && PLEVEL[ id ] >= 380 )
{
set_pev(id, pev_viewmodel2, "models/TopGunS/v_Awp-380.mdl")
}

/* xm1014 */
if(Weapon_Id == CSW_XM1014 && PLEVEL[ id ] >= 400 )
{
set_pev(id, pev_viewmodel2, "models/TopGunS/v_Xm1014-400.mdl")
}

/* m33 */
if(Weapon_Id == CSW_M3 && PLEVEL[ id ] >= 450 )
{
set_pev(id, pev_viewmodel2, "models/TopGunS/v_M3-450.mdl")
}

/* ak47 */
if(Weapon_Id == CSW_SG550 && PLEVEL[ id ] >= 500 )
{
set_pev(id, pev_viewmodel2, "models/TopGunS/v_Sg550-500.mdl")
}

/* m34 */
if(Weapon_Id == CSW_M3 && PLEVEL[ id ] >= 560 )
{
set_pev(id, pev_viewmodel2, "models/TopGunS/v_M3-560.mdl")
}

/* knife4 */
if(Weapon_Id == CSW_G3SG1 && PLEVEL[ id ] >= 600 )
{
set_pev(id, pev_viewmodel2, "models/TopGunS/v_G3sg1-600.mdl")
}

/* knife4 */
if(Weapon_Id == CSW_KNIFE && PLEVEL[ id ] >= 600 )
{
set_pev(id, pev_viewmodel2, "models/TopGunS/v_Knife-600.mdl")
}

/* awp2 */
if(Weapon_Id == CSW_AWP && PLEVEL[ id ] >= 700 )
{
set_pev(id, pev_viewmodel2, "models/TopGunS/v_Awp-700.mdl")
}

/* xm1014 */
if(Weapon_Id == CSW_M3 && PLEVEL[ id ] >= 810 )
{
set_pev(id, pev_viewmodel2, "models/TopGunS/v_M3-810.mdl")
}

return PLUGIN_CONTINUE;
}

printf_do(id, sender, const data[], MsgID) {

message_begin(id ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, MsgID, _, id)

write_byte(sender)

write_string(data)

message_end()

}

public fwHamTakeDamage(victim, inflictor, attacker, Float:damage, damagebits)
{

/* knife */
if(get_user_weapon(attacker) == CSW_KNIFE && PLEVEL[ attacker ] >= 5)
{
SetHamParamFloat(4, damage * 1.0)
return HAM_HANDLED
}

/* Glock18 */
if(get_user_weapon(attacker) == CSW_GLOCK18 && PLEVEL[ attacker ] >= 10)
{
SetHamParamFloat(4, damage * 1.2)
return HAM_HANDLED
}

/* Usp */
if(get_user_weapon(attacker) == CSW_USP && PLEVEL[ attacker ] >= 10)
{
SetHamParamFloat(4, damage * 1.2)
return HAM_HANDLED
}

/* Granada */
if(get_user_weapon(attacker) == CSW_HEGRENADE && PLEVEL[ attacker ] >= 15)
{
SetHamParamFloat(4, damage * 1.0)
return HAM_HANDLED
}

/* Granada */
if(get_user_weapon(attacker) == CSW_DEAGLE && PLEVEL[ attacker ] >= 20)
{
SetHamParamFloat(4, damage * 1.4)
return HAM_HANDLED
}

/* Granada */
if(get_user_weapon(attacker) == CSW_ELITE && PLEVEL[ attacker ] >= 30)
{
SetHamParamFloat(4, damage * 1.1)
return HAM_HANDLED
}

/* Granada */
if(get_user_weapon(attacker) == CSW_MP5NAVY && PLEVEL[ attacker ] >= 150)
{
SetHamParamFloat(4, damage * 1.4)
return HAM_HANDLED
}

/* Granada */
if(get_user_weapon(attacker) == CSW_M249 && PLEVEL[ attacker ] >= 180)
{
SetHamParamFloat(4, damage * 1.4)
return HAM_HANDLED
}

/* Deagle */
if(get_user_weapon(attacker) == CSW_AK47 && PLEVEL[ attacker ] >= 50)
{
SetHamParamFloat(4, damage * 1.7)
return HAM_HANDLED
}

/* m4a1 */
if(get_user_weapon(attacker) == CSW_M4A1 && PLEVEL[ attacker ] >= 50)
{
SetHamParamFloat(4, damage * 1.7)
return HAM_HANDLED
}

/* xm1014 */
if(get_user_weapon(attacker) == CSW_XM1014 && PLEVEL[ attacker ] >= 60)
{
SetHamParamFloat(4, damage * 1.6)
return HAM_HANDLED
}

/* m3 */
if(get_user_weapon(attacker) == CSW_M3 && PLEVEL[ attacker ] >= 70)
{
SetHamParamFloat(4, damage * 1.7)
return HAM_HANDLED
}

/* takact */
if(get_user_weapon(attacker) == CSW_SG550 && PLEVEL[ attacker ] >= 130)
{
SetHamParamFloat(4, damage * 1.5)
return HAM_HANDLED
}

/* taka */
if(get_user_weapon(attacker) == CSW_G3SG1 && PLEVEL[ attacker ] >= 100)
{
SetHamParamFloat(4, damage * 1.6)
return HAM_HANDLED
}

/* awp */
if(get_user_weapon(attacker) == CSW_AWP && PLEVEL[ attacker ] >= 120)
{
SetHamParamFloat(4, damage * 1.8)
return HAM_HANDLED
}

/* knife2 */
if(get_user_weapon(attacker) == CSW_KNIFE && PLEVEL[ attacker ] >= 200)
{
SetHamParamFloat(4, damage * 1.1)
return HAM_HANDLED
}

/* deagle */
if(get_user_weapon(attacker) == CSW_DEAGLE && PLEVEL[ attacker ] >= 250)
{
SetHamParamFloat(4, damage * 1.8)
return HAM_HANDLED
}

/* m32 */
if(get_user_weapon(attacker) == CSW_HEGRENADE && PLEVEL[ attacker ] >= 280)
{
SetHamParamFloat(4, damage * 1.2)
return HAM_HANDLED
}

/* m32 */
if(get_user_weapon(attacker) == CSW_M3 && PLEVEL[ attacker ] >= 280)
{
SetHamParamFloat(4, damage * 1.9)
return HAM_HANDLED
}

/* knife3 */
if(get_user_weapon(attacker) == CSW_KNIFE && PLEVEL[ attacker ] >= 300)
{
SetHamParamFloat(4, damage * 1.2)
return HAM_HANDLED
}

/* ak477 */
if(get_user_weapon(attacker) == CSW_AK47 && PLEVEL[ attacker ] >= 350)
{
SetHamParamFloat(4, damage * 2.1)
return HAM_HANDLED
}

/* m4a11 */
if(get_user_weapon(attacker) == CSW_M4A1 && PLEVEL[ attacker ] >= 350)
{
SetHamParamFloat(4, damage * 2.0)
return HAM_HANDLED
}

/* awp2 */
if(get_user_weapon(attacker) == CSW_AWP && PLEVEL[ attacker ] >= 380)
{
SetHamParamFloat(4, damage * 2.0)
return HAM_HANDLED
}

/* xm1014 */
if(get_user_weapon(attacker) == CSW_XM1014 && PLEVEL[ attacker ] >= 400)
{
SetHamParamFloat(4, damage * 2.0)
return HAM_HANDLED
}

/* M33 */
if(get_user_weapon(attacker) == CSW_M3 && PLEVEL[ attacker ] >= 450)
{
SetHamParamFloat(4, damage * 2.1)
return HAM_HANDLED
}

/* takact */
if(get_user_weapon(attacker) == CSW_SG550 && PLEVEL[ attacker ] >= 500)
{
SetHamParamFloat(4, damage * 2.0)
return HAM_HANDLED
}

/* m34 */
if(get_user_weapon(attacker) == CSW_M3 && PLEVEL[ attacker ] >= 560)
{
SetHamParamFloat(4, damage * 2.3)
return HAM_HANDLED
}

/* knife4 */
if(get_user_weapon(attacker) == CSW_G3SG1 && PLEVEL[ attacker ] >= 600)
{
SetHamParamFloat(4, damage * 2.2)
return HAM_HANDLED
}


/* knife4 */
if(get_user_weapon(attacker) == CSW_KNIFE && PLEVEL[ attacker ] >= 600)
{
SetHamParamFloat(4, damage * 1.3)
return HAM_HANDLED
}

/* awp2 */
if(get_user_weapon(attacker) == CSW_AWP && PLEVEL[ attacker ] >= 700)
{
SetHamParamFloat(4, damage * 2.4)
return HAM_HANDLED
}

/* m34 */
if(get_user_weapon(attacker) == CSW_M3 && PLEVEL[ attacker ] >= 810)
{
SetHamParamFloat(4, damage * 2.6)
return HAM_HANDLED
}

return HAM_IGNORED
}

Load_AdminTypes(id)
{
if(is_user_admin(id)) // Si es admin
{
new i, flags = get_user_flags(id);

for(i = 0 ; i < sizeof Ganancias ; i++ )
{
if(flags & Ganancias[i][GD_ADM_FLAG]) // Si las flags del player es igual a las que definimos arriba
{
kGanancia[id] = Ganancias[i][GD_ADM_GN]; // Le damos la ganancia Normal

formatex(kAccountType[id], charsmax(kAccountType), "%s", Ganancias[i][GD_ADM_TYPE]); // Le damos formato a 'kAccountType'


break; // Salimos del Loopeo
}
}
}
else // Si no es admin
{
kGanancia[id] = 1; // Le damos Ganancia por 2 a los users normales

formatex(kAccountType[id], charsmax(kAccountType), "Usuario Normal"); // Le damos formato a 'kAccountType'
}
}

Crea un tema pidiendo ayuda, no comentando en otros.
Responder


Salto de foro:


Usuarios navegando en este tema: 1 invitado(s)