Salut ,probleme la compilare va rog ajutor

Discutii legate de instalarea, configurarea si modificarea unui server de Counter-Strike.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Post Reply
Walfred
Membru, skill 0
Membru, skill 0
Posts: 10
Joined: 25 Mar 2020, 21:27
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Been thanked: 1 time

25 Mar 2020, 21:39

Salut , am luat o sursa de zombie plague cu level pe xp (cumperi lv pe xp) zombie plague legendary ala si nu pot compila deoarece am erori,va rog puteti sa ma ajutati ? va las sursa aici:







| Afiseaza codul
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fakemeta>
#include <engine>
#include <nvault>
#include <hamsandwich>
#include <colorchat>
#include <fun>
#include <zombie_plague_advance>

#define PLUGIN "Legendary Levels System"
#define VERSION "17.4"
#define AUTHOR "Legendary"
#define ZPA

#pragma tabsize 0

const MAX_CLASSSES = 17

new const Nume[] = { "Classic" }
new const Info[] = { "240 HP + 240 SPD" }
new const Model[] = { "human" }
const Viata = 240
const Viteza = 240
const Float:Gravitatie = 1.00
const Nivel = 1

new const Nume2[] = { "Neo" }
new const Info2[] = { "260 HP + 260 SPD" }
const Viata2 = 260
const Viteza2 = 260
const Float:Gravitatie2 = 0.98
const Nivel2 = 2

new const Nume3[] = { "SteelMan" }
new const Info3[] = { "280 HP + 280 SPD" }
const Viata3 = 280
const Viteza3 = 280
const Float:Gravitatie3 = 0.96
const Nivel3 = 3

new const Nume4[] = { "IronMan" }
new const Info4[] = { "300 HP + 300 SPD" }
const Viata4 = 300
const Viteza4 = 300
const Float:Gravitatie4 = 0.94
const Nivel4 = 4

new const Nume5[] = { "SilverMan" }
new const Info5[] = { "320 HP + 320 SPD" }
const Viata5 = 320
const Viteza5 = 320
const Float:Gravitatie5 = 0.92
const Nivel5 = 5

new const Nume6[] = { "GoldMan" }
new const Info6[] = { "340 HP + 340 SPD" }
const Viata6 = 340
const Viteza6 = 340
const Float:Gravitatie6 = 0.90
const Nivel6 = 6

new const Nume7[] = { "Wolverine" }
new const Info7[] = { "360 HP + 360 SPD" }
const Viata7 = 360
const Viteza7 = 360
const Float:Gravitatie7 = 0.88
const Nivel7 = 7

new const Nume8[] = { "SpiderMan" }
new const Info8[] = { "380 HP + 380 SPD" }
const Viata8 = 380
const Viteza8 = 380
const Float:Gravitatie8 = 0.86
const Nivel8 = 8

new const Nume9[] = { "BatMan" }
new const Info9[] = { "400 HP + 400 SPD" }
const Viata9 = 400
const Viteza9 = 400
const Float:Gravitatie9 = 0.84
const Nivel9 = 9

new const Nume10[] = { "Black Widow" }
new const Info10[] = { "420 HP + 420 SPD" }
const Viata10 = 420
const Viteza10 = 420
const Float:Gravitatie10 = 0.82
const Nivel10 = 10

new const Nume11[] = { "Thor" }
new const Info11[] = { "440 HP + 440 SPD" }
const Viata11 = 440
const Viteza11 = 440
const Float:Gravitatie11 = 0.80
const Nivel11 = 11

new const Nume12[] = { "Hulk" }
new const Info12[] = { "460 HP + 460 SPD" }
const Viata12 = 460
const Viteza12 = 460
const Float:Gravitatie12 = 0.78
const Nivel12 = 12

new const Nume13[] = { "Captain America" }
new const Info13[] = { "480 HP + 480 SPD" }
const Viata13 = 480
const Viteza13 = 480
const Float:Gravitatie13 = 0.76
const Nivel13 = 13

new const Nume14[] = { "Grinch" }
new const Info14[] = { "500 HP + 500 SPD" }
const Viata14 = 500
const Viteza14 = 500
const Float:Gravitatie14 = 0.74
const Nivel14 = 14

new const Nume15[] = { "Krawler" }
new const Info15[] = { "520 HP + 520 SPD" }
const Viata15 = 520
const Viteza15 = 520
const Float:Gravitatie15 = 0.72
const Nivel15 = 15

new const Nume16[] = { "The Killer" }
new const Info16[] = { "540 HP + 540 SPD" }
const Viata16 = 540
const Viteza16 = 540
const Float:Gravitatie16 = 0.70
const Nivel16 = 16

new const Nume17[] = { "Legendary" }
new const Info17[] = { "560 HP + 560 SPD" }
const Viata17 = 560
const Viteza17 = 560
const Float:Gravitatie17 = 0.68
const Nivel17 = 17

#define VAULT_LEVEL 0
#define VAULT_HCLASS 1
#define VAULT_ZCLASS 2

#define ZCLASSES_STARTID g_menu_data[id][0]
#define ZCLASSES_SELECTION (g_menu_data[id][0]+key)
#define HCLASSES_STARTID g_menu_data[id][1]
#define HCLASSES_SELECTION (g_menu_data[id][1]+key)
#define ID_SHOWHUD (taskid - TASK_SHOWHUD)

new bool:g_human[33];

new g_fwRoundStart, g_fwDummyResult, g_freezetime;
new userLevel[33], userAuthID[33][32], g_menu_data[33][8];

new g_zclass_name[MAX_CLASSSES][32], g_zclass_info[MAX_CLASSSES][32], g_zclass_model[MAX_CLASSSES][32], g_zclass_clawmodel[MAX_CLASSSES][32],
g_zclass_hp[MAX_CLASSSES], g_zclass_spd[MAX_CLASSSES], g_zclass_lvl[MAX_CLASSSES], Float:g_zclass_grav[MAX_CLASSSES], Float:g_zclass_kb[MAX_CLASSSES],
g_zclass_load[MAX_CLASSSES][40], g_zclass_i;

new g_hclass_name[MAX_CLASSSES][32], g_hclass_info[MAX_CLASSSES][32], g_hclass_model[MAX_CLASSSES][32], g_hclass_hp[MAX_CLASSSES],
g_hclass_spd[MAX_CLASSSES], g_hclass_lvl[MAX_CLASSSES], Float:g_hclass_grav[MAX_CLASSSES], g_hclass_load[MAX_CLASSSES][40], g_hclass_i;

new g_xp[33], g_zombieclassnext[33], g_humanclassnext[33], g_zombieclass[33], g_humanclass[33], g_resetparams[33], g_MsgSync, cvar_logcommands;
new Numee[32], NumeJucator[32], Date[256];
new nVault;

const OFFSET_CSTEAMS = 114
const OFFSET_LINUX = 5
const MENU_KEY_BACK = 7
const MENU_KEY_NEXT = 8
const MENU_KEY_EXIT = 9
const KEYSMENU = (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<7)|(1<<8)|(1<<9)
const PEV_SPEC_TARGET = pev_iuser2

const Float:HUD_SPECT_X = 0.89
const Float:HUD_SPECT_Y = 0.75

const Float:HUD_STATS_X = -1.0
const Float:HUD_STATS_Y = 0.88

enum {
CS_TEAM_UNASSIGNED = 0,
CS_TEAM_T,
CS_TEAM_CT,
CS_TEAM_SPECTATOR
}

enum (+= 100) {

TASK_SHOWHUD
}

native zp_register_human_class(const name[], const info[], const model[], hp, speed, Float:gravity, level)

public plugin_init() {

register_plugin(PLUGIN, VERSION, AUTHOR);

cvar_logcommands = register_cvar("zp_logcommands", "1");

server_print("# LOADED ZOMBIE CLASSES: %d", g_zclass_i);
server_print("# LOADED HUMAN CLASSES: %d", g_hclass_i);

register_menu("Game Menu", KEYSMENU, "menu_game");
register_menu("Zombie Class Menu", KEYSMENU, "menu_zclass");
register_menu("Human Class Menu", KEYSMENU, "menu_hclass");

RegisterHam(Ham_Spawn, "player", "fw_PlayerSpawn_Post", 1);

register_clcmd("say nivele", "handle_say");
register_clcmd("say /nivele", "handle_say");
register_clcmd("say levels", "handle_say");
register_clcmd("say /levels", "handle_say");

register_concmd("zp_setlevel", "SetLevel", ADMIN_MAP, "<nume> <nivel>");
register_concmd("zp_xp", "datxp", ADMIN_MAP, " - <nume> <xp>");
register_concmd("zp_take_xp", "luatxp", ADMIN_MAP, " - <nume> <xp>");

register_forward(FM_ClientDisconnect, "fw_ClientDisconnect")
register_forward(FM_PlayerPreThink, "fw_PlayerPreThink");
register_logevent("logevent_round_start",2, "1=Round_Start");
register_event("DeathMsg", "Death", "a")
register_event("HLTV", "event_round_start", "a", "1=0", "2=0");

g_fwRoundStart = CreateMultiForward("zp_round_started_human", ET_IGNORE, FP_CELL);
g_MsgSync = CreateHudSyncObj();

nVault = nvault_open("PlayerXP");

if(nVault == INVALID_HANDLE)
set_fail_state( "nVault returned invalid handle!" );
}

public plugin_precache() {

zp_register_human_class(Nume, Info, Model, Viata, Viteza, Gravitatie, Nivel)
zp_register_human_class(Nume2, Info2, Model, Viata2, Viteza2, Gravitatie2, Nivel2)
zp_register_human_class(Nume3, Info3, Model, Viata3, Viteza3, Gravitatie3, Nivel3)
zp_register_human_class(Nume4, Info4, Model, Viata4, Viteza4, Gravitatie4, Nivel4)
zp_register_human_class(Nume5, Info5, Model, Viata5, Viteza5, Gravitatie5, Nivel5)
zp_register_human_class(Nume6, Info6, Model, Viata6, Viteza6, Gravitatie6, Nivel6)
zp_register_human_class(Nume7, Info7, Model, Viata7, Viteza7, Gravitatie7, Nivel7)
zp_register_human_class(Nume8, Info8, Model, Viata8, Viteza8, Gravitatie8, Nivel8)
zp_register_human_class(Nume9, Info9, Model, Viata9, Viteza9, Gravitatie9, Nivel9)
zp_register_human_class(Nume10, Info10, Model, Viata10, Viteza10, Gravitatie10, Nivel10)
zp_register_human_class(Nume11, Info11, Model, Viata11, Viteza11, Gravitatie11, Nivel11)
zp_register_human_class(Nume12, Info12, Model, Viata12, Viteza12, Gravitatie12, Nivel12)
zp_register_human_class(Nume13, Info13, Model, Viata13, Viteza13, Gravitatie13, Nivel13)
zp_register_human_class(Nume14, Info14, Model, Viata14, Viteza14, Gravitatie14, Nivel14)
zp_register_human_class(Nume15, Info15, Model, Viata15, Viteza15, Gravitatie15, Nivel15)
zp_register_human_class(Nume16, Info16, Model, Viata16, Viteza16, Gravitatie16, Nivel16)
zp_register_human_class(Nume17, Info17, Model, Viata17, Viteza17, Gravitatie17, Nivel17)
}

public plugin_natives() {

register_native("zp_get_user_level", "native_get_user_level", 1)
register_native("zp_register_human_class", "native_register_human_class", 1)
register_native("zpxp_register_zombie_class", "native_register_zombie_class", 1)
register_native("zp_get_user_human_class", "native_get_user_human_class", 1)
register_native("zp_get_user_xp", "native_get_user_xp", 1)
register_native("zp_set_user_xp", "native_set_user_xp", 1)
}

public SaveData(id)
{
get_user_name(id, NumeJucator, 31);
format(Numee, 31, "%s", NumeJucator);
format(Date, 255, "%i", g_xp[id])
nvault_set(nVault, Numee, Date);
}

public LoadData(id)
{
get_user_name(id, NumeJucator, 31);
format(Numee, 31, "%s", NumeJucator);
format(Date, 255, "%i", g_xp[id])
nvault_get(nVault, Numee, Date, 255)

g_xp[id] = str_to_num(Date);

if(g_xp[id] == 0)
g_xp[id] = 5;
}

public Death()
{
new attacker = read_data(1)
new victim = read_data(2)
new headshot = read_data(3)

new vname[32]
get_user_name(victim, vname, 31)

static wpnName[24]
get_killer_weapon(attacker, pev(victim, pev_dmg_inflictor), wpnName, 23)

if(attacker == victim)
return PLUGIN_CONTINUE;

if (zp_armageddon_round())
{
if (zp_get_user_survivor(attacker)) // Survivor vs. Nemesis ~ Survivor Win
{
if (headshot)
{
if (equal(wpnName, "knife")) // Weapon
{
g_xp[attacker] += 6
check_level(attacker)
ColorChat(attacker, RED, "^4[Legendary System] +6 XP^3 pentru ca l-ai omorat pe ^4%s ^3cu ^4Lama ^3si cu ^4HeadShot^3.", vname) // Killed by Knife with HS
}
else
{
g_xp[attacker] += 4
check_level(attacker)
ColorChat(attacker, RED, "^4[Legendary System] +4 XP^3 pentru ca l-ai omorat pe ^4%s^3 cu ^4HeadShot^3.", vname) // Normal Kill with HS
}
}
else
{
if (equal(wpnName, "knife")) // Weapon
{
g_xp[attacker] += 4
check_level(attacker)
ColorChat(attacker, RED, "^4[Legendary System] +4 XP^3 pentru ca l-ai omorat pe ^4%s ^3cu ^4Lama^3.", vname) // Killed by Knife
}
else
{
g_xp[attacker] += 2
check_level(attacker)
ColorChat(attacker, RED, "^4[Legendary System] +2 XP^3 pentru ca l-ai omorat pe ^4%s^3.", vname) // Normal Kill
}
}
}
else
{
if (zp_get_user_nemesis(attacker))
{
if (headshot)
{
g_xp[attacker] += 4
check_level(attacker)
ColorChat(attacker, RED, "^4[Legendary System] +4 XP^3 pentru ca l-ai omorat pe ^4%s^3 cu ^4HeadShot^3.", vname) // Normal Kil with HS
}
else
{
g_xp[attacker] += 2
check_level(attacker)
ColorChat(attacker, RED, "^4[Legendary System] +2 XP^3 pentru ca l-ai omorat pe ^4%s^3.", vname) // Normal Kil
}
}
}
}
else if (zp_apocalypse_round())
{
if (zp_get_user_sniper(attacker)) // Survivor vs. Nemesis ~ Survivor Win
{
if (headshot)
{
if (equal(wpnName, "knife")) // Weapon
{
g_xp[attacker] += 6
check_level(attacker)
ColorChat(attacker, RED, "^4[Legendary System] +6 XP^3 pentru ca l-ai omorat pe ^4%s ^3cu ^4Lama ^3si cu ^4HeadShot^3.", vname) // Killed by Knife with HS
}
else
{
g_xp[attacker] += 4
check_level(attacker)
ColorChat(attacker, RED, "^4[Legendary System] +4 XP^3 pentru ca l-ai omorat pe ^4%s^3 cu ^4HeadShot^3.", vname) // Normal Kill with HS
}
}
else
{
if (equal(wpnName, "knife")) // Weapon
{
g_xp[attacker] += 4
check_level(attacker)
ColorChat(attacker, RED, "^4[Legendary System] +4 XP^3 pentru ca l-ai omorat pe ^4%s ^3cu ^4Lama^3.", vname) // Killed by Knife
}
else
{
g_xp[attacker] += 2
check_level(attacker)
ColorChat(attacker, RED, "^4[Legendary System] +2 XP^3 pentru ca l-ai omorat pe ^4%s^3.", vname) // Normal Kill
}
}
}
else
{
if (zp_get_user_assassin(attacker))
{
if (headshot)
{
g_xp[attacker] += 4
check_level(attacker)
ColorChat(attacker, RED, "^4[Legendary System] +4 XP^3 pentru ca l-ai omorat pe ^4%s^3 cu ^4HeadShot^3.", vname) // Normal Kil with HS
}
else
{
g_xp[attacker] += 2
check_level(attacker)
ColorChat(attacker, RED, "^4[Legendary System] +2 XP^3 pentru ca l-ai omorat pe ^4%s^3.", vname) // Normal Kil
}
}
}
}
else if (zp_is_swarm_round())
{
if (zp_get_user_zombie(attacker))
{
if (headshot)
{
g_xp[attacker] += 4
check_level(attacker)
ColorChat(attacker, RED, "^4[Legendary System] +4 XP^3 pentru ca l-ai omorat pe ^4%s^3 cu ^4HeadShot^3.", vname) // Normal Kil with HS
}
else
{
g_xp[attacker] += 2
check_level(attacker)
ColorChat(attacker, RED, "^4[Legendary System] +2 XP^3 pentru ca l-ai omorat pe ^4%s^3.", vname) // Normal Kil
}
}
else
{
if (headshot)
{
if (equal(wpnName, "knife")) // Weapon
{
g_xp[attacker] += 6
check_level(attacker)
ColorChat(attacker, RED, "^4[Legendary System] +6 XP^3 pentru ca l-ai omorat pe ^4%s ^3cu ^4Lama ^3si cu ^4HeadShot^3.", vname) // Killed by Knife with HS
}
else
{
g_xp[attacker] += 4
check_level(attacker)
ColorChat(attacker, RED, "^4[Legendary System] +4 XP^3 pentru ca l-ai omorat pe ^4%s^3 cu ^4HeadShot^3.", vname) // Normal Kill with HS
}
}
else
{
if (equal(wpnName, "knife")) // Weapon
{
g_xp[attacker] += 4
check_level(attacker)
ColorChat(attacker, RED, "^4[Legendary System] +4 XP^3 pentru ca l-ai omorat pe ^4%s ^3cu ^4Lama^3.", vname) // Killed by Knife
}
else
{
g_xp[attacker] += 2
check_level(attacker)
ColorChat(attacker, RED, "^4[Legendary System] +2 XP^3 pentru ca l-ai omorat pe ^4%s^3.", vname) // Normal Kill
}
}
}
}
else if (zp_is_plague_round())
{
if (zp_get_user_zombie(attacker))
{
if (headshot)
{
g_xp[attacker] += 4
check_level(attacker)
ColorChat(attacker, RED, "^4[Legendary System] +4 XP^3 pentru ca l-ai omorat pe ^4%s^3 cu ^4HeadShot^3.", vname) // Normal Kil with HS
}
else
{
g_xp[attacker] += 2
check_level(attacker)
ColorChat(attacker, RED, "^4[Legendary System] +2 XP^3 pentru ca l-ai omorat pe ^4%s^3.", vname) // Normal Kil
}
}
else if (zp_get_user_nemesis(attacker))
{
if (headshot)
{
g_xp[attacker] += 4
check_level(attacker)
ColorChat(attacker, RED, "^4[Legendary System] +4 XP^3 pentru ca l-ai omorat pe ^4%s^3 cu ^4HeadShot^3.", vname) // Normal Kil with HS
}
else
{
g_xp[attacker] += 2
check_level(attacker)
ColorChat(attacker, RED, "^4[Legendary System] +2 XP^3 pentru ca l-ai omorat pe ^4%s^3.", vname) // Normal Kil
}
}
else
{
if (headshot)
{
if (equal(wpnName, "knife")) // Weapon
{
g_xp[attacker] += 6
check_level(attacker)
ColorChat(attacker, RED, "^4[Legendary System] +6 XP^3 pentru ca l-ai omorat pe ^4%s ^3cu ^4Lama ^3si cu ^4HeadShot^3.", vname) // Killed by Knife with HS
}
else
{
g_xp[attacker] += 4
check_level(attacker)
ColorChat(attacker, RED, "^4[Legendary System] +4 XP^3 pentru ca l-ai omorat pe ^4%s^3 cu ^4HeadShot^3.", vname) // Normal Kill with HS
}
}
else
{
if (equal(wpnName, "knife")) // Weapon
{
g_xp[attacker] += 4
check_level(attacker)
ColorChat(attacker, RED, "^4[Legendary System] +4 XP^3 pentru ca l-ai omorat pe ^4%s ^3cu ^4Lama^3.", vname) // Killed by Knife
}
else
{
g_xp[attacker] += 2
check_level(attacker)
ColorChat(attacker, RED, "^4[Legendary System] +2 XP^3 pentru ca l-ai omorat pe ^4%s^3.", vname) // Normal Kill
}
}
}
}
else if (zp_is_survivor_round())
{
if (zp_get_user_survivor(attacker)) // Survivor vs. Nemesis ~ Survivor Win
{
if (headshot)
{
if (equal(wpnName, "knife")) // Weapon
{
g_xp[attacker] += 6
check_level(attacker)
ColorChat(attacker, RED, "^4[Legendary System] +6 XP^3 pentru ca l-ai omorat pe ^4%s ^3cu ^4Lama ^3si cu ^4HeadShot^3.", vname) // Killed by Knife with HS
}
else
{
g_xp[attacker] += 4
check_level(attacker)
ColorChat(attacker, RED, "^4[Legendary System] +4 XP^3 pentru ca l-ai omorat pe ^4%s^3 cu ^4HeadShot^3.", vname) // Normal Kill with HS
}
}
else
{
if (equal(wpnName, "knife")) // Weapon
{
g_xp[attacker] += 4
check_level(attacker)
ColorChat(attacker, RED, "^4[Legendary System] +4 XP^3 pentru ca l-ai omorat pe ^4%s ^3cu ^4Lama^3.", vname) // Killed by Knife
}
else
{
g_xp[attacker] += 2
check_level(attacker)
ColorChat(attacker, RED, "^4[Legendary System] +2 XP^3 pentru ca l-ai omorat pe ^4%s^3.", vname) // Normal Kill
}
}
}
else
{
if (zp_get_user_zombie(attacker))
{
if (headshot)
{
g_xp[attacker] += 4
check_level(attacker)
ColorChat(attacker, RED, "^4[Legendary System] +6 XP^3 pentru ca l-ai omorat pe ^4%s^3 cu ^4HeadShot^3.", vname) // Normal Kil with HS
}
else
{
g_xp[attacker] += 2
check_level(attacker)
ColorChat(attacker, RED, "^4[Legendary System] +4 XP^3 pentru ca l-ai omorat pe ^4%s^3.", vname) // Normal Kil
}
}
}
}
else if (zp_is_sniper_round())
{
if (zp_get_user_sniper(attacker)) // Survivor vs. Nemesis ~ Survivor Win
{
if (headshot)
{
if (equal(wpnName, "knife")) // Weapon
{
g_xp[attacker] += 6
check_level(attacker)
ColorChat(attacker, RED, "^4[Legendary System] +6 XP^3 pentru ca l-ai omorat pe ^4%s ^3cu ^4Lama ^3si cu ^4HeadShot^3.", vname) // Killed by Knife with HS
}
else
{
g_xp[attacker] += 4
check_level(attacker)
ColorChat(attacker, RED, "^4[Legendary System] +4 XP^3 pentru ca l-ai omorat pe ^4%s^3 cu ^4HeadShot^3.", vname) // Normal Kill with HS
}
}
else
{
if (equal(wpnName, "knife")) // Weapon
{
g_xp[attacker] += 4
check_level(attacker)
ColorChat(attacker, RED, "^4[Legendary System] +4 XP^3 pentru ca l-ai omorat pe ^4%s ^3cu ^4Lama^3.", vname) // Killed by Knife
}
else
{
g_xp[attacker] += 2
check_level(attacker)
ColorChat(attacker, RED, "^4[Legendary System] +2 XP^3 pentru ca l-ai omorat pe ^4%s^3.", vname) // Normal Kill
}
}
}
else
{
if (zp_get_user_zombie(attacker))
{
if (headshot)
{
g_xp[attacker] += 4
check_level(attacker)
ColorChat(attacker, RED, "^4[Legendary System] +6 XP^3 pentru ca l-ai omorat pe ^4%s^3 cu ^4HeadShot^3.", vname) // Normal Kil with HS
}
else
{
g_xp[attacker] += 2
check_level(attacker)
ColorChat(attacker, RED, "^4[Legendary System] +4 XP^3 pentru ca l-ai omorat pe ^4%s^3.", vname) // Normal Kil
}
}
}
}
else if (zp_is_assassin_round())
{
if (zp_get_user_assassin(attacker))
{
if (headshot)
{
g_xp[attacker] += 4
check_level(attacker)
ColorChat(attacker, RED, "^4[Legendary System] +4 XP^3 pentru ca l-ai omorat pe ^4%s^3 cu ^4HeadShot^3.", vname) // Normal Kil with HS
}
else
{
g_xp[attacker] += 2
check_level(attacker)
ColorChat(attacker, RED, "^4[Legendary System] +2 XP^3 pentru ca l-ai omorat pe ^4%s^3.", vname) // Normal Kil
}
}
else
{
if(zp_get_user_assassin(victim))
{
if (headshot)
{
if (equal(wpnName, "knife")) // Weapon
{
g_xp[attacker] += 6
check_level(attacker)
ColorChat(attacker, RED, "^4[Legendary System] +8 XP^3 pentru ca l-ai omorat pe ^4%s ^3cu ^4Lama ^3si cu ^4HeadShot^3.", vname) // Killed by Knife with HS
}
else
{
g_xp[attacker] += 4
check_level(attacker)
ColorChat(attacker, RED, "^4[Legendary System] +6 XP^3 pentru ca l-ai omorat pe ^4%s^3 cu ^4HeadShot^3.", vname) // Normal Kill with HS
}
}
else
{
if (equal(wpnName, "knife")) // Weapon
{
g_xp[attacker] += 4
check_level(attacker)
ColorChat(attacker, RED, "^4[Legendary System] +6 XP^3 pentru ca l-ai omorat pe ^4%s ^3cu ^4Lama^3.", vname) // Killed by Knife
}
else
{
g_xp[attacker] += 2
check_level(attacker)
ColorChat(attacker, RED, "^4[Legendary System] +4 XP^3 pentru ca l-ai omorat pe ^4%s^3.", vname) // Normal Kill
}
}
}
}
}
else if (zp_is_nemesis_round())
{
if (zp_get_user_nemesis(attacker))
{
if (headshot)
{
g_xp[attacker] += 4
check_level(attacker)
ColorChat(attacker, RED, "^4[Legendary System] +4 XP^3 pentru ca l-ai omorat pe ^4%s^3 cu ^4HeadShot^3.", vname) // Normal Kil with HS
}
else
{
g_xp[attacker] += 2
check_level(attacker)
ColorChat(attacker, RED, "^4[Legendary System] +2 XP^3 pentru ca l-ai omorat pe ^4%s^3.", vname) // Normal Kil
}
}
else
{
if(zp_get_user_nemesis(victim))
{
if (headshot)
{
if (equal(wpnName, "knife")) // Weapon
{
g_xp[attacker] += 6
check_level(attacker)
ColorChat(attacker, RED, "^4[Legendary System] +8 XP^3 pentru ca l-ai omorat pe ^4%s ^3cu ^4Lama ^3si cu ^4HeadShot^3.", vname) // Killed by Knife with HS
}
else
{
g_xp[attacker] += 4
check_level(attacker)
ColorChat(attacker, RED, "^4[Legendary System] +6 XP^3 pentru ca l-ai omorat pe ^4%s^3 cu ^4HeadShot^3.", vname) // Normal Kill with HS
}
}
else
{
if (equal(wpnName, "knife")) // Weapon
{
g_xp[attacker] += 4
check_level(attacker)
ColorChat(attacker, RED, "^4[Legendary System] +6 XP^3 pentru ca l-ai omorat pe ^4%s ^3cu ^4Lama^3.", vname) // Killed by Knife
}
else
{
g_xp[attacker] += 2
check_level(attacker)
ColorChat(attacker, RED, "^4[Legendary System] +4 XP^3 pentru ca l-ai omorat pe ^4%s^3.", vname) // Normal Kill
}
}
}
}
}
else
{
if (zp_get_user_zombie(attacker))
{
if (headshot)
{
g_xp[attacker] += 4
check_level(attacker)
ColorChat(attacker, RED, "^4[Legendary System] +4 XP^3 pentru ca l-ai omorat pe ^4%s^3 cu ^4HeadShot^3.", vname) // Normal Kil with HS
}
else
{
g_xp[attacker] += 2
check_level(attacker)
ColorChat(attacker, RED, "^4[Legendary System] +2 XP^3 pentru ca l-ai omorat pe ^4%s^3.", vname) // Normal Kil
}
}
else
{
if (headshot)
{
if (equal(wpnName, "knife")) // Weapon
{
g_xp[attacker] += 6
check_level(attacker)
ColorChat(attacker, RED, "^4[Legendary System] +6 XP^3 pentru ca l-ai omorat pe ^4%s ^3cu ^4Lama ^3si cu ^4HeadShot^3.", vname) // Killed by Knife with HS
}
else
{
g_xp[attacker] += 4
check_level(attacker)
ColorChat(attacker, RED, "^4[Legendary System] +4 XP^3 pentru ca l-ai omorat pe ^4%s^3 cu ^4HeadShot^3.", vname) // Normal Kill with HS
}
}
else
{
if (equal(wpnName, "knife")) // Weapon
{
g_xp[attacker] += 4
check_level(attacker)
ColorChat(attacker, RED, "^4[Legendary System] +4 XP^3 pentru ca l-ai omorat pe ^4%s ^3cu ^4Lama^3.", vname) // Killed by Knife
}
else
{
g_xp[attacker] += 2
check_level(attacker)
ColorChat(attacker, RED, "^4[Legendary System] +2 XP^3 pentru ca l-ai omorat pe ^4%s^3.", vname) // Normal Kill
}
}
}
}

SaveData(attacker)
return PLUGIN_CONTINUE;
}

public plugin_end() {

for(new o = 1; o < 33; o++)
{
if (!is_user_connected(o))
return;

if (is_user_bot(o))
return;

save_data(o);
}

nvault_close(nVault);
nvault_close(nvault_open(PLUGIN))
}

public handle_say(id) {

show_menu_game(id);
}

public getNeededXP(id) {

switch(userLevel[id]) {

case 1 : return 55
case 2 : return 125
case 3 : return 250
case 4 : return 375
case 5 : return 500
case 6 : return 625
case 7 : return 750
case 8 : return 875
case 9 : return 1000
case 10: return 1125
case 11: return 1250
case 12: return 1375
case 13: return 1500
case 14: return 1950
case 15: return 2375
case 16: return 2800
case 17: return 3666
}
return 100 * userLevel[id]
}

public show_menu_game(id) {

static menu[300], len;
len = 0

if(userLevel[id] < MAX_CLASSSES)
len += formatex(menu[len], charsmax(menu) - len, "\r:: \yMeniu Clase Zombie & Human \r::^n \w*\y XP:\r %d\w/\r%d \w|\y Nivel:\r %d^n^n", g_xp[id], getNeededXP(id), userLevel[id])
else
len += formatex(menu[len], charsmax(menu) - len, "\r:: \yMeniu Clase Zombie & Human \r::^n \w*\r Ai atins Nivelul Maxim.^n^n")

len += formatex(menu[len], charsmax(menu) - len, "\r1.\w Clase Human \r(%d Clase)^n", g_hclass_i)
len += formatex(menu[len], charsmax(menu) - len, "\r2.\w Clase Zombie \r(%d Clase)^n", g_zclass_i)

len += formatex(menu[len], charsmax(menu) - len, "^n^n\r0. \yIesire")

show_menu(id, KEYSMENU, menu, -1, "Game Menu")
}

public check_level(id) {

if(is_user_bot(id))
return;

if(userLevel[id] < MAX_CLASSSES)
{
new targetName[64];
get_user_name(id, targetName, 63);

if(g_xp[id] >= getNeededXP(id))
{
g_xp[id] -= getNeededXP(id);

userLevel[id] += 1
g_humanclassnext[id] = userLevel[id]-1
g_humanclass[id] = g_humanclassnext[id];
g_zombieclassnext[id] = userLevel[id]-1

setHumanParameters(id)

ColorChat(0, RED, "^4[Legendary System] ^3Jucatorul ^4%s^3 a trecut la ^4Nivelul %d^3.", targetName, userLevel[id])

//ColorChat(id, RED, "^4[Legendary System] ^3Felicitari, ai trecut la ^4Nivelul %d^3.", targetName, userLevel[id])

save_data(id)
SaveData(id)
}
}
}

public datxp(id, level, cid)
{
if (!cmd_access(id, level, cid, 2))
{
return PLUGIN_HANDLED
}

new arg[32]
read_argv(1, arg, 31)

new player = cmd_target(id, arg, CMDTARGET_ALLOW_SELF)

if (!player)
return PLUGIN_HANDLED

new spower[32], name2[32], name[32]

get_user_name(id, name, 31)
get_user_name(player, name2, 31)

read_argv(2, spower, 31)

new arg2 = str_to_num(spower)

if(arg2 < 0)
{
client_print(id, print_console, "[Legendary System] Nu poti sa trimiti Numere Negative.");
ColorChat(id, RED, "^4[Legendary System]^3 Nu poti sa trimiti ^4Numere Negative^3.")
return PLUGIN_HANDLED;
}

static XP[16];
AddCommas(arg2, XP, 15);

if(arg2 == 0)
{
if (player == id)
{
g_xp[id] = 0;
ColorChat(id, RED, "^4[Legendary System]^3 Ti-ai setat ^4XP-ul ^3pe^4 0^3.")
client_print(id, print_console, "[Legendary System] Ti-ai setat XP-ul pe 0.");

if(get_pcvar_num(cvar_logcommands))
{
log_to_file("ZombieLegendary.log", "Admin-ul %s si-a setat XP-ul pe 0.", name);
}
}
else
{
g_xp[player] = 0;
ColorChat(id, RED, "^4[Legendary System]^3 I-ai setat pe^4 0 ^3XP-ul^3 lui ^4%s^3.", name2)
ColorChat(player, RED, "^4[Legendary System]^3 Admin-ul ^4%s ^3ti-a setat ^4XP-ul ^3pe^4 0^3.", name)
client_print(id, print_console, "[Legendary System] I-ai setat pe 0 XP-ul lui %s.", name2);

if(get_pcvar_num(cvar_logcommands))
{
log_to_file("ZombieLegendary.log", "Admin-ul %s i-a setat pe 0 XP-ul lui %s.", name, name2);
}
}
}
else
{
if (player == id)
{
g_xp[id] += arg2;
ColorChat(id, RED, "^4[Legendary System]^3 Ti-ai bagat ^4%s XP^3.", XP)
client_print(id, print_console, "[Legendary System] Ti-ai bagat %s XP.", XP);

if(get_pcvar_num(cvar_logcommands))
{
log_to_file("ZombieLegendary.log", "Admin-ul %s si-a bagat %s XP.", name, XP);
}
SaveData(id)
}
else
{
g_xp[player] += arg2;
ColorChat(id, RED, "^4[Legendary System]^3 I-ai dat ^4%s XP^3 lui ^4%s^3.", XP, name2)
ColorChat(player, RED, "^4[Legendary System]^3 Adminul ^4%s ^3ti-a dat ^4%s XP^3.", name, XP)
client_print(id, print_console, "[Legendary System] I-ai dat %s XP lui %s.", XP, name2);

if(get_pcvar_num(cvar_logcommands))
{
log_to_file("ZombieLegendary.log", "Admin-ul %s i-a dat %s XP lui %s.", name, XP, name2);
}
SaveData(player)
}
}

return PLUGIN_HANDLED;
}

public luatxp(id, level, cid)
{
if (!cmd_access(id, level, cid, 2))
{
return PLUGIN_HANDLED
}

new arg[32]

read_argv(1, arg, 31)
new player = cmd_target(id, arg, CMDTARGET_ALLOW_SELF)

if (!player)
return PLUGIN_HANDLED

new spower[32], name2[32], name[32]

get_user_name(id, name, 31)
get_user_name(player, name2, 31)

read_argv(2, spower, 31)

new arg2 = str_to_num(spower)

if(g_xp[player] < arg2)
{
ColorChat(id, RED, "^4[Legendary System]^3 Suma data depaseste numarul de ^4XP ^3al ^4Jucatorului ^3(^4%d^3).", g_xp[player]);
client_print(player, print_console, "[Legendary System] Suma data depaseste numarul de XP al Jucatorului (%d).", g_xp[player]);
return PLUGIN_HANDLED;
}

if(arg2 <= 0)
{
client_print(id, print_console, "[Legendary System] Nu poti sa iei mai putin de 1 XP.");
ColorChat(id, RED, "^4[Legendary System]^3 Nu poti sa iei mai putin de^4 1 XP^3.")
return PLUGIN_HANDLED;
}

static XP[16];
AddCommas(arg2, XP, 15);

if (player == id)
{
g_xp[id] -= arg2
ColorChat(id, RED, "^4[Legendary System]^3 Ti-ai luat ^4%s XP^3.", XP)
client_print(id, print_console, "[Legendary System] Ti-ai luat %s XP.", XP);

if (get_pcvar_num(cvar_logcommands))
{
log_to_file("ZombieLegendary.log", "Admin-ul %s si-a luat %s XP.", name, XP);
}
SaveData(player)
}
else
{
g_xp[player] -= arg2
ColorChat(id, RED, "^4[Legendary System]^3 I-ai luat ^4%s XP^3 lui ^4%s^3.", XP, name2)
ColorChat(player, RED, "^4[Legendary System]^3 Adminul ^4%s ^3ti-a luat ^4%s XP^3.", name, XP)
client_print(id, print_console, "[Legendary System] I-ai luat %s XP lui %s.", XP, name2);

if (get_pcvar_num(cvar_logcommands))
{
log_to_file("ZombieLegendary.log", "Admin-ul %s i-a luat %s XP lui %s.", name, XP, name2);
}
SaveData(player)
}

return PLUGIN_HANDLED;
}

public save_data(id) {

if(is_user_bot(id))
return;

new vaultkey[40], vaultData[256];

new g_selected_zclass[sizeof g_zclass_load[]]
new g_selected_hclass[15]

formatex(g_selected_hclass, sizeof g_selected_hclass - 1, g_hclass_load[g_humanclassnext[id]]);
formatex(g_selected_zclass, sizeof g_selected_zclass -1, g_zclass_load[g_zombieclassnext[id]]);
formatex(vaultkey, sizeof vaultkey - 1, "%s_stats", userAuthID[id]);
formatex(vaultData, sizeof vaultData - 1, "0=%i;1=%s;2=%s;", userLevel[id], g_selected_hclass, g_selected_zclass);

nvault_set(nvault_open(PLUGIN), vaultkey, vaultData);
}

public load_data(id) {

if(is_user_bot(id))
return;

new vaultkey[40], vaultReturn[256];
new vaultData[4][40], vaultResults[3][40];

format(vaultkey, sizeof vaultkey - 1, "%s_stats", userAuthID[id]);
nvault_get(nvault_open(PLUGIN), vaultkey, vaultReturn, sizeof vaultReturn - 1);

new Count = ExplodeString(vaultData, sizeof vaultData - 1, sizeof vaultData[] - 1, vaultReturn, ';')

if(Count == sizeof vaultResults - 1)
{
new ivaultLevel, i_hclass_id = -1, i_zclass_id = -1;
for(new i = 0; i < sizeof vaultData - 1; i++)
{
ExplodeString(vaultResults, sizeof vaultResults - 1, sizeof vaultResults[] - 1, vaultData, '=');
switch (str_to_num(vaultResults[0]))
{
case VAULT_LEVEL:
{
ivaultLevel = str_to_num(vaultResults[1]);
if (ivaultLevel == 0)
ivaultLevel = 1;

userLevel[id] = ivaultLevel
}
case VAULT_HCLASS:
{
if(!equali(vaultResults[1], "-1"))
{
for (new i2 = 0; i2 < g_hclass_i; i2++)
{
if(equali(vaultResults[1], g_hclass_load[i2]))
{
i_hclass_id = i2;
break;
}
}
}

if (i_hclass_id == -1)
{
g_humanclassnext[id] = userLevel[id]-1;
g_humanclass[id] = g_humanclassnext[id];
}
else
{
g_humanclassnext[id] = userLevel[id]-1;
g_humanclass[id] = g_humanclassnext[id];
}
}
case VAULT_ZCLASS:
{
if(!equali(vaultResults[1], "-1"))
{
for (new i2 = 0; i2 < g_zclass_i; i2++)
{
if(equali(vaultResults[1], g_zclass_load[i2]))
{
i_zclass_id = i2;
break;
}
}
}

if (i_zclass_id == -1)
{
g_zombieclassnext[id] = userLevel[id]-1;
g_zombieclass[id] = g_zombieclassnext[id];
zp_set_user_zombie_class(id, g_zombieclassnext[id]);
}
else
{
g_zombieclassnext[id] = userLevel[id]-1;
g_zombieclass[id] = g_zombieclassnext[id];
zp_set_user_zombie_class(id, g_zombieclassnext[id]);
}
}
}
}
}
}

public client_connect(id) {

g_humanclassnext[id] = userLevel[id]-1;
g_humanclass[id] = g_humanclassnext[id];

g_zombieclassnext[id] = userLevel[id]-1;
g_zombieclass[id] = g_zombieclassnext[id];
zp_set_user_zombie_class(id, g_zombieclassnext[id]);

load_data(id)
LoadData(id)
}

public client_putinserver(id) {

if(is_user_bot(id))
return;

resetvars(id)
load_data(id)
LoadData(id)
set_task(1.0, "ShowHUD", id+TASK_SHOWHUD, _, _, "b")
}

public fw_ClientDisconnect(id) {

if(is_user_bot(id))
return;

save_data(id);
SaveData(id)
remove_task(id+TASK_SHOWHUD)

new nume[32], szIP[32];
get_user_name(id, nume, 31)
get_user_ip(id, szIP, 31, 1);

log_to_file("Deconectari.log", ">>> NUME: %s, Credite: %d, XP: %d, Nivel: %d.", nume, zp_get_user_ammo_packs(id), g_xp[id], userLevel[id])
}

public fw_PlayerSpawn_Post(id) {

if (!is_user_alive(id) || is_user_bot(id))
return FMRES_IGNORED;

g_humanclassnext[id] = userLevel[id]-1;
g_humanclass[id] = g_humanclassnext[id];

g_zombieclassnext[id] = userLevel[id]-1;
g_zombieclass[id] = g_zombieclassnext[id];
zp_set_user_zombie_class(id, g_zombieclassnext[id]);

g_human[id] = true
check_last_human()

setHumanParameters(id)
check_level(id)

return FMRES_IGNORED;
}

public event_round_start() {

static team;

for(new o = 1; o < 33; o++)
{
if (!is_user_connected(o))
continue;

check_level(o)

team = fm_get_user_team(o)

if (team == CS_TEAM_SPECTATOR || team == CS_TEAM_UNASSIGNED)
continue;

ExecuteForward(g_fwRoundStart, g_fwDummyResult, o);
}
g_freezetime = true
}

public logevent_round_start() {

static id

for (id = 1; id <= get_maxplayers(); id++)
{
if (!is_user_connected(id) || is_user_bot(id))
continue;

check_level(id)
setHumanParameters(id)
}

g_freezetime = false
}

public zp_user_infected_pre(id, infector) {

zp_set_user_zombie_class(id, userLevel[id]-1)
g_zombieclass[id] = userLevel[id]-1;
g_human[id] = false

if(id != infector && infector != 0)
check_level(infector)
}

public zp_user_infected_post(id, infector) {

zp_set_user_zombie_class(id, userLevel[id]-1)
g_zombieclass[id] = userLevel[id]-1;

if(id != infector && infector != 0)
check_level(infector)
}

public zp_user_humanized_pre(id) {

g_humanclass[id] = g_humanclassnext[id];
g_zombieclass[id] = g_zombieclassnext[id];
check_level(id)
}

public zp_user_humanized_post(id) {

if(zp_get_user_nemesis(id) || zp_get_user_assassin(id) || zp_get_user_zombie(id))
return;

else if(zp_get_user_survivor(id))
{
g_human[id] = false
fm_set_user_health(id, 6500)
}
else if(zp_get_user_sniper(id))
{
g_human[id] = false
fm_set_user_health(id, 800)
}
else
{
g_human[id] = true
setHumanParameters(id)
}

ShowHUD(id)
check_level(id)
}

public setHumanParameters(id) {

if(zp_get_user_zombie(id) || zp_get_user_survivor(id) || zp_get_user_sniper(id) || zp_get_user_assassin(id) || zp_get_user_nemesis(id))
return;

set_pev(id, pev_gravity, g_hclass_grav[g_humanclass[id]])
set_pev(id, pev_maxspeed, g_hclass_spd[g_humanclass[id]])
fm_set_user_health(id, g_hclass_hp[g_humanclass[id]])
}

public check_last_human() {

static id
for (id = 1; id <= get_maxplayers(); id++)

if(zp_get_user_last_human(id))
fm_set_user_health(id, get_user_health(id)+100)
}

public resetvars(id) {

g_zombieclassnext[id] = 0;
g_humanclassnext[id] = 0;
g_zombieclass[id] = 0;
g_humanclass[id] = 0;
userLevel[id] = 1;
get_user_name(id, userAuthID[id], 31);
zp_set_user_zombie_class(id, 0);
g_resetparams[id] = false;
}

public fw_PlayerPreThink(id) {

if (!is_user_alive(id))
return;

if(!g_human[id])
return;

if (!g_freezetime)
{
if (g_human[id])
{
set_pev(id, pev_maxspeed, float(g_hclass_spd[g_humanclass[id]]))
return;
}
}
}

public show_menu_zclass(id) {

if (!is_user_connected(id))
return;

static menu[1900], len, class;
len = 0
new curClassIcon[3];

len += formatex(menu[len], sizeof menu - 1 - len, " \r:: \yNivele Zombie \r::^n^n")

for (class = ZCLASSES_STARTID; class < min(ZCLASSES_STARTID+7, g_zclass_i); class++)
{
if (((class == g_zombieclassnext[id]) || (userLevel[id] < g_zclass_lvl[class])))
{
if (class == g_zombieclassnext[id])
curClassIcon = "* ";
else
curClassIcon = "";

len += formatex(menu[len], sizeof menu - 1 - len, "\d%s%d. %s, %s (Nivelul %d)^n", curClassIcon, class-ZCLASSES_STARTID+1, g_zclass_name[class], g_zclass_info[class], g_zclass_lvl[class])
}
else
len += formatex(menu[len], sizeof menu - 1 - len, "\r%d. \w%s, \y%s \r(Nivelul %d)^n", class-ZCLASSES_STARTID+1, g_zclass_name[class], g_zclass_info[class], g_zclass_lvl[class]);
}

len += formatex(menu[len], sizeof menu - 1 - len, "^n\r8.\w Inapoi^n\r9.\w Inainte^n^n\r0. \yAnulare")
show_menu(id, KEYSMENU, menu, -1, "Zombie Class Menu")
}

public show_menu_hclass(id) {

if (!is_user_connected(id))
return;

static menu[1500], len, class;
len = 0
new curClassIcon[3];

len += formatex(menu[len], charsmax(menu) - len, " \r:: \yNivele Human \r::^n^n")

for (class = HCLASSES_STARTID; class < min(HCLASSES_STARTID+7, g_hclass_i); class++)
{
if (((class == g_humanclassnext[id]) || (userLevel[id] < g_hclass_lvl[class])))
{
if (class == g_humanclassnext[id])
curClassIcon = "* ";
else
curClassIcon = "";

len += formatex(menu[len], charsmax(menu) - len, "\d%s%d. %s, %s (Nivelul %d)^n", curClassIcon, class-HCLASSES_STARTID+1, g_hclass_name[class], g_hclass_info[class], g_hclass_lvl[class])
}
else
len += formatex(menu[len], charsmax(menu) - len, "\r%d. \w%s, \y%s \r(Nivelul %d)^n", class-HCLASSES_STARTID+1, g_hclass_name[class], g_hclass_info[class], g_hclass_lvl[class])
}

len += formatex(menu[len], charsmax(menu) - len, "^n\r8.\w Inapoi^n\r9.\w Inainte^n^n\r0. \yAnulare")
show_menu(id, KEYSMENU, menu, -1, "Human Class Menu")
}

public menu_game(id, key) {

switch (key)
{
case 0:
{
if(g_hclass_i == 0)
{
ColorChat(id, RED, "^4[Legendary System] ^3Nu s-a incarcat nicio clasa de ^4Human^3.")
return PLUGIN_HANDLED;
}
else
show_menu_hclass(id)
}
case 1:
{
if(g_zclass_i == 0)
{
ColorChat(id, RED, "^4[Legendary System] ^3Nu s-a incarcat nicio clasa de ^4Zombie^3.")
return PLUGIN_HANDLED;
}
else
show_menu_zclass(id)
}
}
return PLUGIN_HANDLED;
}

public SetLevel(id, level, cid) {

if (!cmd_access(id, level, cid, 2))
return PLUGIN_HANDLED;

new arg[32]
read_argv(1, arg, 31)

new player = cmd_target(id, arg, CMDTARGET_ALLOW_SELF)

if (!player)
return PLUGIN_HANDLED

new spower[32], name2[32], name[32]

get_user_name(id, name, 31)
get_user_name(player, name2, 31)

read_argv(2, spower, 31)

new arg2 = str_to_num(spower)

if(arg2 <= 0)
{
client_print(id, print_console, "[Legendary System] Nu poti sa setezi mai putin de Nivelul 1.");
ColorChat(id, RED, "^4[Legendary System] ^3Nu poti sa setezi mai putin de^4 Nivelul 1^3.")
return PLUGIN_HANDLED;
}
if(arg2 > g_hclass_i)
{
client_print(id, print_console, "[Legendary System] Nu poti sa setezi un Nivel mai mare de %d.", g_hclass_i);
ColorChat(id, RED, "^4[Legendary System] ^3Nu poti sa setezi un^4 Nivel^3 mai mare de^4 %d^3.", g_hclass_i)
return PLUGIN_HANDLED;
}

if(id == player)
{
userLevel[id] = arg2;

client_print(id, print_console,"[Legendary System] Ti-ai setat Nivelul actual pe %d.", arg2);
ColorChat(id, RED, "^4[Legendary System] ^3Ti-ai setat ^4Nivelul actual ^3pe ^4%d^3.", arg2);

if (get_pcvar_num(cvar_logcommands))
log_to_file("Nivele.log", "Admin-ul %s si-a setat Nivelul %d.", name, arg2);

g_humanclassnext[id] = userLevel[id]-1;
g_humanclass[id] = g_humanclassnext[id];
g_zombieclassnext[id] = userLevel[id]-1;

setHumanParameters(id)

save_data(id)
}
else
{
userLevel[player] = arg2;

client_print(id, print_console,"[Legendary System] I-ai schimbat cu succes Nivelul lui %s.", name2);
ColorChat(id, RED, "^4[Legendary System] ^3I-ai setat ^4Nivelul %d ^3lui ^4%s^3.", arg2, name2);
ColorChat(player, RED, "^4[Legendary System] ^3Adminul ^4%s ^3ti-a setat ^4Nivelul %d^3.", name, arg2);

if (get_pcvar_num(cvar_logcommands))
log_to_file("Nivele.log", "Admin-ul %s i-a setat Nivelul %d lui %s.", name, arg2, name2)

g_humanclassnext[player] = userLevel[player]-1;
g_humanclass[player] = g_humanclassnext[player];
g_zombieclassnext[player] = userLevel[player]-1;

setHumanParameters(id)

save_data(player)
}
return PLUGIN_HANDLED;
}

public menu_zclass(id, key) {

if (key >= MENU_KEY_BACK || ZCLASSES_SELECTION >= g_zclass_i)
{
switch (key)
{
case MENU_KEY_BACK:
{
if (ZCLASSES_STARTID-7 >= 0)
ZCLASSES_STARTID -= 7
}
case MENU_KEY_NEXT:
{
if (ZCLASSES_STARTID+7 < g_zclass_i)
ZCLASSES_STARTID += 7
}
case MENU_KEY_EXIT:
return PLUGIN_HANDLED;
}
show_menu_zclass(id)

return PLUGIN_HANDLED;
}

if (ZCLASSES_SELECTION == g_zombieclassnext[id])
{
ColorChat(id, RED, "^4[Legendary System] ^3Folosesti aceasta clasa de ^4Zombie^3.")
show_menu_zclass(id)
return PLUGIN_HANDLED;
}

if (g_zclass_lvl[ZCLASSES_SELECTION] > userLevel[id])
{
ColorChat(id, RED, "^4[Legendary System] ^3Nu ai cumparat acest ^4Nivel^3.")
show_menu_zclass(id)
return PLUGIN_HANDLED;
}

if (ZCLASSES_SELECTION != g_zombieclassnext[id])
{
ColorChat(id, RED, "^4[Legendary System] ^3Poti sa folosesti doar ^4Clasa Nivelului^3 la care esti^3.")
show_menu_zclass(id)
return PLUGIN_HANDLED;
}

return PLUGIN_HANDLED;
}

public menu_hclass(id, key) {

if (key >= MENU_KEY_BACK || HCLASSES_SELECTION >= g_zclass_i)
{
switch (key)
{
case MENU_KEY_BACK:
if (HCLASSES_STARTID-7 >= 0)
HCLASSES_STARTID -= 7
case MENU_KEY_NEXT:
if (HCLASSES_STARTID+7 < g_zclass_i)
HCLASSES_STARTID += 7
case MENU_KEY_EXIT:
return PLUGIN_HANDLED;
}
show_menu_hclass(id)
return PLUGIN_HANDLED;
}

if (HCLASSES_SELECTION == g_humanclassnext[id])
{
ColorChat(id, RED, "^4[Legendary System] ^3Folosesti aceasta clasa de ^4Human^3.")
show_menu_hclass(id)
return PLUGIN_HANDLED;
}

if (g_hclass_lvl[HCLASSES_SELECTION] > userLevel[id])
{
ColorChat(id, RED, "^4[Legendary System] ^3Nu ai cumparat acest ^4Nivel^3.")
show_menu_hclass(id)
return PLUGIN_HANDLED;
}

if (ZCLASSES_SELECTION != g_humanclassnext[id])
{
ColorChat(id, RED, "^4[Legendary System] ^3Poti sa folosesti doar ^4Clasa Nivelului^3 la care esti^3.")
show_menu_zclass(id)
return PLUGIN_HANDLED;
}

return PLUGIN_HANDLED;
}

public ShowHUD(taskid) {

static id
id = ID_SHOWHUD;

if (!is_user_alive(id))
{
id = pev(id, PEV_SPEC_TARGET)

if (!is_user_alive(id))
return;
}

new nume[32];
get_user_name(id, nume, 31)

static HealthString[16], PacksString[16], XPString[16], HealthStringID[16], PacksStringID[16], XPStringID[16];

AddCommas(pev(id, pev_health), HealthString, 15);
AddCommas(zp_get_user_ammo_packs(id), PacksString, 15);
AddCommas(g_xp[id], XPString, 15);

AddCommas(pev(ID_SHOWHUD, pev_health), HealthStringID, 15);
AddCommas(zp_get_user_ammo_packs(ID_SHOWHUD), PacksStringID, 15);
AddCommas(g_xp[ID_SHOWHUD], XPStringID, 15);

if (id != ID_SHOWHUD)
{
if (zp_get_user_assassin(id))
{
set_hudmessage(255, 140, 40, HUD_SPECT_X, HUD_SPECT_Y, 0, 6.0, 1.1, 0.0, 0.0, -1)
ShowSyncHudMsg(ID_SHOWHUD, g_MsgSync, "Assassin^nXP: %s, Nivelul %d", XPString, userLevel[id])
}
else if (zp_get_user_nemesis(id))
{
set_hudmessage(255, 10, 40, HUD_SPECT_X, HUD_SPECT_Y, 0, 6.0, 1.1, 0.0, 0.0, -1)
ShowSyncHudMsg(ID_SHOWHUD, g_MsgSync, "Nemesis^nXP: %s, Nivelul %d", XPString, userLevel[id])
}
else if (zp_get_user_survivor(id))
{
set_hudmessage(10, 103, 165, HUD_SPECT_X, HUD_SPECT_Y, 0, 6.0, 1.1, 0.0, 0.0, -1)
ShowSyncHudMsg(ID_SHOWHUD, g_MsgSync, "Survivor^nXP: %s, Nivelul %d", XPString, userLevel[id])
}
else if (zp_get_user_sniper(id))
{
set_hudmessage(10, 103, 165, HUD_SPECT_X, HUD_SPECT_Y, 0, 6.0, 1.1, 0.0, 0.0, -1)
ShowSyncHudMsg(ID_SHOWHUD, g_MsgSync, "Sniper^nXP: %s, Nivelul %d", XPString, userLevel[id])
}
else if (zp_get_user_zombie(id))
{
set_hudmessage(255, 10, 40, HUD_SPECT_X, HUD_SPECT_Y, 0, 6.0, 1.1, 0.0, 0.0, -1)
ShowSyncHudMsg(ID_SHOWHUD, g_MsgSync, "%s^nXP: %s, Nivelul %d", g_zclass_name[g_zombieclass[id]], XPString, userLevel[id])
}
else
{
set_hudmessage(10, 103, 165, HUD_SPECT_X, HUD_SPECT_Y, 0, 6.0, 1.1, 0.0, 0.0, -1)
ShowSyncHudMsg(ID_SHOWHUD, g_MsgSync, "%s^nXP: %s, Nivelul %d", g_hclass_name[g_humanclass[id]], XPString, userLevel[id])
}
}
else
{
if (zp_get_user_assassin(ID_SHOWHUD))
{
set_hudmessage(255, 10, 40, HUD_STATS_X, HUD_STATS_Y, 0, 6.0, 1.1, 0.0, 0.0, -1)
ShowSyncHudMsg(ID_SHOWHUD, g_MsgSync, "Assassin^nXP: %s, Nivelul %d", XPStringID, userLevel[id])
}
else if (zp_get_user_nemesis(ID_SHOWHUD))
{
set_hudmessage(255, 10, 40, HUD_STATS_X, HUD_STATS_Y, 0, 6.0, 1.1, 0.0, 0.0, -1)
ShowSyncHudMsg(ID_SHOWHUD, g_MsgSync, "Nemesis^nXP: %s, Nivelul %d", XPStringID, userLevel[id])
}
else if (zp_get_user_zombie(ID_SHOWHUD))
{
set_hudmessage(255, 10, 40, HUD_STATS_X, HUD_STATS_Y, 0, 6.0, 1.1, 0.0, 0.0, -1)
ShowSyncHudMsg(ID_SHOWHUD, g_MsgSync, "%s^nXP: %s, Nivelul %d", g_zclass_name[g_zombieclass[id]], XPStringID, userLevel[id])
}
else if (zp_get_user_survivor(ID_SHOWHUD))
{
set_hudmessage(10, 103, 165, HUD_STATS_X, HUD_STATS_Y, 0, 6.0, 1.1, 0.0, 0.0, -1)
ShowSyncHudMsg(ID_SHOWHUD, g_MsgSync, "Survivor^n%s, Nivelul %d", XPStringID, userLevel[id])
}
else if (zp_get_user_sniper(ID_SHOWHUD))
{
set_hudmessage(10, 103, 165, HUD_STATS_X, HUD_STATS_Y, 0, 6.0, 1.1, 0.0, 0.0, -1)
ShowSyncHudMsg(ID_SHOWHUD, g_MsgSync, "Sniper^nXP: %s, Nivelul %d", XPStringID, userLevel[id])
}
else
{
set_hudmessage(10, 103, 165, HUD_STATS_X, HUD_STATS_Y, 0, 6.0, 1.1, 0.0, 0.0, -1)
show_hudmessage(ID_SHOWHUD, "%s^nXP: %s, Nivelul %d", g_hclass_name[g_humanclass[id]], XPStringID, userLevel[id])
}
}
}

public native_get_user_human_class(id) {

return g_humanclass[id];
}

public native_get_user_level(id) {

return userLevel[id];
}

public native_get_user_xp(id) {

return g_xp[id];
}

public native_set_user_xp(id, xp) {

g_xp[id] = xp;
}

public native_register_human_class(const name[], const info[], const model[], hp, speed, Float:gravity, level) {

if (g_hclass_i >= sizeof g_hclass_name)
return -1;

param_convert(1)
param_convert(2)
param_convert(3)
param_convert(4)

copy(g_hclass_name[g_hclass_i], sizeof g_hclass_name[] - 1, name)
copy(g_hclass_info[g_hclass_i], sizeof g_hclass_info[] - 1, info)
copy(g_hclass_model[g_hclass_i], sizeof g_hclass_model[] - 1, model)

g_hclass_hp[g_hclass_i] = HP
g_hclass_spd[g_hclass_i] = speed
g_hclass_grav[g_hclass_i] = gravity
g_hclass_lvl[g_hclass_i] = level

new tSave[40]
formatex(tSave, sizeof tSave - 1, "%s%s", name, info);
replace_all(tSave, sizeof tSave - 1, ";", "")
replace_all(tSave, sizeof tSave - 1, " ", "")
g_hclass_load[g_hclass_i] = tSave;

g_hclass_i++

return g_hclass_i-1;
}

public native_register_zombie_class(const name[], const info[], const model[], const clawmodel[], hp, speed, Float:gravity, Float:knockback, level) {

param_convert(1)
param_convert(2)
param_convert(3)
param_convert(4)

copy(g_zclass_name[g_zclass_i], sizeof g_zclass_name[] - 1, name)
copy(g_zclass_info[g_zclass_i], sizeof g_zclass_info[] - 1, info)
copy(g_zclass_model[g_zclass_i], sizeof g_zclass_model[] - 1, model)
copy(g_zclass_clawmodel[g_zclass_i], sizeof g_zclass_clawmodel[] - 1, clawmodel)

g_zclass_hp[g_zclass_i] = HP
g_zclass_spd[g_zclass_i] = speed
g_zclass_grav[g_zclass_i] = gravity
g_zclass_kb[g_zclass_i] = knockback
g_zclass_lvl[g_zclass_i] = level

new tSave[40]
formatex(tSave, sizeof tSave - 1, "%s%s", name, info);
replace_all(tSave, sizeof tSave - 1, ";", "")
replace_all(tSave, sizeof tSave - 1, " ", "")
g_zclass_load[g_zclass_i] = tSave;

new g_returnclass_id;
g_returnclass_id = zp_register_zombie_class(g_zclass_name[g_zclass_i], g_zclass_info[g_zclass_i], g_zclass_model[g_zclass_i], g_zclass_clawmodel[g_zclass_i], g_zclass_hp[g_zclass_i], g_zclass_spd[g_zclass_i], g_zclass_grav[g_zclass_i], g_zclass_kb[g_zclass_i]);

if(g_returnclass_id == -1)
{
server_print("Zombie Plague returneaza un identificator de clasa invalid.");
return -1
}

g_zclass_i++

return g_zclass_i-1;
}

stock ExplodeString(Output[][], Max, Size, Input[], Delimiter) {

new Idx, l = strlen(Input), Len;
do Len += (1 + copyc(Output[Idx], Size, Input[Len], Delimiter));
while((Len < l) && (++Idx < Max))
return Idx;
}

stock fm_set_user_health(id, health) {

(health > 0) ? set_pev(id, pev_health, float(health)) : dllfunc(DLLFunc_ClientKill, id);
}

stock fm_get_user_team(id) {

return get_pdata_int(id, OFFSET_CSTEAMS, OFFSET_LINUX);
}

stock fm_find_ent_by_owner(entity, const classname[], owner) {
while ((entity = engfunc(EngFunc_FindEntityByString, entity, "classname", classname)) && pev(entity, pev_owner) != owner) {}
return entity;
}

stock get_killer_weapon(killer, inflictor, retVar[], retLen)
{
static killer_weapon_name[32];
killer_weapon_name = "world";

if (pev_valid(killer) && (pev(killer, pev_flags) & FL_CLIENT))
{
if (pev_valid(inflictor))
{
if (inflictor == killer)
{
new weapon = get_user_weapon(killer);
get_weaponname(weapon, killer_weapon_name, 31);
}
else pev(inflictor, pev_classname, killer_weapon_name, 31);
}
}
else
{
if (pev_valid(killer)) pev(inflictor, pev_classname, killer_weapon_name, 31);
else if (killer == 0) killer_weapon_name = "worldspawn";
}


if (equal(killer_weapon_name, "weapon_", 7))
format(killer_weapon_name, 31, "%s", killer_weapon_name[7]);
else if (equal(killer_weapon_name, "monster_", 8))
format(killer_weapon_name, 31, "%s", killer_weapon_name[8]);
else if (equal(killer_weapon_name, "func_", 5))
format(killer_weapon_name, 31, "%s", killer_weapon_name[5]);


formatex(retVar, retLen, "%s", killer_weapon_name);
}

AddCommas(iNum , szOutput[] , iLen) {

static szTmp[15], iOutputPos, iNumPos, iNumLen;
szTmp[0]='^0', iOutputPos=iNumPos=iNumLen=0;

if(iNum < 0)
{
szOutput[iOutputPos++] = '-';
iNum = abs(iNum);
}

iNumLen = num_to_str(iNum, szTmp, charsmax(szTmp));

if(iNumLen <= 3)
iOutputPos += copy(szOutput[iOutputPos] , iLen , szTmp);
else
{
while ((iNumPos < iNumLen) && (iOutputPos < iLen))
{
szOutput[iOutputPos++] = szTmp[iNumPos++];

if((iNumLen - iNumPos) && !((iNumLen - iNumPos) % 3))
szOutput[iOutputPos++] = '.';
}
szOutput[iOutputPos] = EOS;
}
return iOutputPos;
}
Last edited by trekA on 26 Mar 2020, 11:35, edited 2 times in total.
Reason: Adaugata sursa in cod
RoyalServer
dorel123
Membru, skill 0
Membru, skill 0
Posts: 18
Joined: 12 Jun 2016, 02:52
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Contact:

29 Mar 2020, 13:46

ai zombie_plague_advance.inc ? am incercat saa ti-l compilez si asta e singura eroare pe care mi-o da
Post Reply

Return to “Probleme la servere dedicate de Counter-Strike”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 38 guests