[HELP] Error Complete 2
Hello guys i dont understand what is Error in this cod but is not complete :/
Code:
PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <cstrike>
#include <nvault>
/* ZP Includes */
#include <zp50_core>
#include <zp50_class_nemesis>
#include <zp50_class_survivor>
/* Plugin API */
#include <zp50simplexp>
/* Classes */
enum _:CLASSES
{
None,
CLASS_HUMAN,
CLASS_ZOMBIE
}
/* Xp Data */
enum _:XPData
{
Class,
Level,
XP[CLASSES]
}
/* Level XP */
new const g_iLevelXP[LEVELS][2] =
{
{0, 49}, {50, 99}, {100, 149}, {150, 299}, {200, 249}, {250, 299}, {300, 349}, {350, 399}, {400, 449}, {450, 499},
{500, 549}, {550, 599}, {600, 649}, {650, 599}, {700, 749}, {750, 799}, {800, 849}, {850, 899}, {900, 949},{950, 999},
{1000, 1049}, {1050, 1099}, {1100, 1149}, {1150, 1199}, {1200, 1249}, {1250, 1299}, {1300, 1349}, {1350, 1399}, {1400, 1449}, {1450, 1499},
{1500, 1549}, {1550, 1599}, {1600, 1649}, {1650, 1699}, {1700, 1749}, {1750, 1799}, {1800, 1849}, {1850, 1899}, {1900, 1949}, {1950, 1999},
{2000, 2049}, {2050, 2099}, {2100, 2149}, {2150, 2199}, {2200, 2249}, {2250, 2299}, {2300, 2349}, {2350, 2399}, {2400, 2449}, {2450, 2499},
{2500, 2549}, {2550, 2599}, {2600, 2649}, {2650, 2699}, {2700, 2749}, {2750, 2799}, {2800, 2849}, {2850, 2899}, {2900, 2949}, {2950, 2999},
{3000, 3049}, {3050, 3099}, {3100, 3149}, {3150, 3199}, {3200, 3249}, {3250, 3299}, {3300, 3349}, {3350, 3399}, {3400, 3449}, {3450, 3499},
{3500, 3549}, {3550, 3599}, {3600, 3649}, {3650, 3699}, {3700, 3749}, {3750, 3799}, {3800, 3849}, {3850, 3899}, {3900, 3949}, {3950, 3999},
{4000, 4049}, {4050, 4099}, {4100, 4149}, {4150, 4199}, {4200, 4249}, {4250, 4299}, {4300, 4349}, {4350, 4399}, {4400, 4449}, {4450, 4499},
{4500, 4549}, {4550, 4599}, {4600, 4649}, {4650, 4699}, {4700, 4749}, {4750, 4799}, {4800, 4849}, {4850, 4899}, {4900, 4949}, {4950, 5000}
}
/* Level Names */
new const g_szLevelDesc[LEVELS][] =
{
"Rookie", "Member", "Madness", "Blackness", "darckness", "slayer", "Killer", "Jumper", "Master", "Level 10",
"Level 11", "Level 12", "Level 13", "Level 14", "Level 15", "Level 16", "Level 17", "Level 18", "Level 19", "Level 20",
"Level 21", "Level 22", "Level 23", "Level 24", "Level 25", "Level 26", "Level 27", "Level 28", "Level 29", "Level 30",
"Level 31", "Level 32", "Level 33", "Level 34", "Level 35", "Level 36", "Level 37", "Level 38", "Level 39", "Level 40",
"Level 41", "Level 42", "Level 43", "Level 44", "Level 45", "Level 46", "Level 47", "Level 48", "Level 49", "Level 50",
"Level 51", "Level 52", "Level 53", "Level 54", "Level 55", "Level 56", "Level 57", "Level 58", "Level 59", "Level 60",
"Level 61", "Level 62", "Level 63", "Level 64", "Level 65", "Level 66", "Level 67", "Level 68", "Level 69", "Level 70",
"Level 71", "Level 72", "Level 73", "Level 74", "Level 75", "Level 76", "Level 77", "Level 78", "Level 79", "Level 80",
"Level 81", "Level 82", "Level 83", "Level 84", "Level 85", "Level 86", "Level 87", "Level 88", "Level 89", "Level 90",
"Level 91", "Level 92", "Level 93", "Level 94", "Level 95", "Level 96", "Level 97", "Level 98", "Level 99", "Max Level"
}
new const g_szClassDesc[CLASSES][] =
{
"None", "Human", "Zombie"
}
/* Plugin Constants */
const MAXPLAYERS = 32;
const TASK_SHOWINFO = 55271;
/* Hud Sync Object */
new g_SyncHudObj;
/* Player Variables */
new g_XP[MAXPLAYERS+1][XPData];
new g_szAuthID[MAXPLAYERS+1][32];
/* Vault Variable */
new g_iVault;
/* Plugin ConVars */
new g_Cvar_Base_XP, g_Cvar_Nem_XP, g_Cvar_Surv_XP;
new g_Cvar_HUD_Red, g_Cvar_HUD_Green, g_Cvar_HUD_Blue, g_Cvar_HUD_Xpos, g_Cvar_HUD_Ypos;
public plugin_init()
{
/* Register the Plugin with AMX ModX */
register_plugin("[ZP50] Addon: Simple XP System", "0.0.2", "Cata + Sav");
/* Register Player Death Event */
RegisterHam(Ham_Spawn, "player", "fwd_PlayerSpawn");
RegisterHam(Ham_Killed, "player", "fwd_PlayerKilled");
/* Create Hud Sync Object */
g_SyncHudObj = CreateHudSyncObj();
/* Create the Plugins ConVars */
g_Cvar_Base_XP = register_cvar("zp_base_xp", "1"); /* Base Experience gained per kill */
g_Cvar_Nem_XP = register_cvar("zp_nem_xp", "2"); /* Bonus XP for killing Nem */
g_Cvar_Surv_XP = register_cvar("zp_surv_xp", "2"); /* Bonus XP for killing a Survivor */
/* HUD Setting ConVars */
g_Cvar_HUD_Red = register_cvar("zp_hud_red", "255");
g_Cvar_HUD_Green = register_cvar("zp_hud_green", "0");
g_Cvar_HUD_Blue = register_cvar("zp_hud_blue", "0");
g_Cvar_HUD_Xpos = register_cvar("zp_hud_xpos", "0.02"); //Horizontal positioning from left to right.
g_Cvar_HUD_Ypos = register_cvar("zp_hud_ypos", "0.65"); //Vertical positioning from top to bottom.
/* Open the Vault File */
g_iVault = nvault_open("zp_simple_xp_sys");
/* Check if the Vault File is Open Fail if Not */
if(g_iVault == INVALID_HANDLE)
{
set_fail_state("Failed to open/create vault file");
}
}
public plugin_end()
{
/* Close the Vault file */
nvault_close(g_iVault);
}
/*
public plugin_natives()
{
register_library("zp50simplexp");
register_native("zp_get_player_level", "native_get_player_level");
register_native("zp_set_player_level", "native_set_player_level");
register_native("zp_get_player_hoh_level", "native_get_player_hoh_level");
register_native("zp_set_player_hoh_level", "native_set_player_hoh_level");
}
*/
public client_authorized(id)
{
/* Get and Store a players Auth ID */
get_user_authid(id, g_szAuthID[id], charsmax(g_szAuthID[]));
LoadData(id);
}
public client_disconnect(id)
{
ClearData(id);
remove_task(id+TASK_SHOWINFO);
}
public fwd_PlayerSpawn(id)
{
if(zp_core_is_zombie(id))
g_XP[id][Class] = CLASS_ZOMBIE;
else
g_XP[id][Class] = CLASS_HUMAN;
}
public fwd_PlayerKilled(iVictim, iAttacker, iShouldGib)
{
new iTempXP;
/* Self kill or Team Kill Protection */
if(iAttacker == iVictim || cs_get_user_team(iVictim) == cs_get_user_team(iAttacker) || g_XP[iAttacker][XP][g_XP[iAttacker][Class]] == g_szLevelDesc[LEVEL_MAX][1])
return HAM_IGNORED;
iTempXP += get_pcvar_num(g_Cvar_Base_XP);
if(zp_class_nemesis_get(iVictim))
iTempXP += get_pcvar_num(g_Cvar_Nem_XP);
if(zp_class_survivor_get(iVictim))
iTempXP += get_pcvar_num(g_Cvar_Surv_XP);
/* Apply Updated XP */
g_XP[iAttacker][XP][g_XP[iAttacker][Class]] += iTempXP;
/* Check if more than MAX xp SET to MAX xp if so */
if(g_XP[iAttacker][XP][g_XP[iAttacker][Class]] > g_szLevelDesc[LEVEL_MAX][1])
g_XP[iAttacker][XP][g_XP[iAttacker][Class]] = g_szLevelDesc[LEVEL_MAX][1];
/* Check if player leveled up */
ChecklLevel(iAttacker);
/* Clear TempXP var */
iTempXP = 0;
return HAM_IGNORED;
}
public SaveData(id)
{
/* Save to Nvault */
new szVaultData[256];
format(szVaultData, charsmax(szVaultData), "%d %d", g_XP[id][XP][CLASS_ZOMBIE], g_XP[id][XP][CLASS_HUMAN]);
nvault_set(g_iVault, g_szAuthID[id], szVaultData);
}
public LoadData(id)
{
/* Load from Nvault */
new szVaultData[256], szVaultDataSplit[2][256];
nvault_get(g_iVault, g_szAuthID[id], szVaultData, charsmax(szVaultData));
/* Parse the vault string for the different classes */
parse(szVaultData, szVaultDataSplit[0], charsmax(szVaultDataSplit[]), szVaultDataSplit[1], charsmax(szVaultDataSplit[]));
g_XP[id][XP][CLASS_ZOMBIE] = str_to_num(szVaultDataSplit[0]);
g_XP[id][XP][CLASS_HUMAN] = str_to_num(szVaultDataSplit[1]);
/* Display Hud Info */
set_task(0.01, "ShowInfo", id+TASK_SHOWINFO, _, _, "b");
}
public ClearData(id)
{
/* Clear XP Info for new player */
g_XP[id] = g_XP[0];
}
public ChecklLevel(id)
{
new szPlayerName[32];
get_user_name(id, szPlayerName, charsmax(szPlayerName));
for(new i=0; i<sizeof(g_iLevelXP); i++)
{
if(g_iLevelXP[i][0] <= g_XP[id][XP][g_XP[id][Class]] <= g_iLevelXP[i][1])
{
if(g_XP[id][Level] != i)
{
if(g_XP[id][Level] < i)
{
client_print(id, print_chat, "%s has been promoted", szPlayerName);
g_XP[id][Level] = i;
break;
}
}
}
}
SaveData(id);
}
public ShowInfo(id)
{
/* Show Hud Info for current Human/Zombie classes */
if(!is_user_alive(id))
return;
set_hudmessage(get_pcvar_num(g_Cvar_HUD_Red), get_pcvar_num(g_Cvar_HUD_Green), get_pcvar_num(g_Cvar_HUD_Blue), get_pcvar_float(g_Cvar_HUD_Xpos), get_pcvar_float(g_Cvar_HUD_Ypos), 0, 0.0, 1.0,_ ,_, -1);
ShowSyncHudMsg(id, g_SyncHudObj, "[Class: %s] \n [XP: %d/%d] \n [Level: %s (%d/%d)]", g_szClassDesc[g_XP[id][Class]], g_XP[id][XP][g_XP[id][Class]], (g_XP[id][Level] + 1) == LEVELS ? g_iLevelXP[g_XP[id][Level]][1]:g_iLevelXP[g_XP[id][Level]][0], g_szLevelDesc[g_XP[id][Level]], g_XP[id][Level], LEVELS);
}
Error Massage:
Code:
Error: Cannot read from file: "zp50simplexp" on line 12
Compilation aborted.
1 Error.
Could not locate output file C:\Users\abood\Desktop\zoz_ammopacks_levels.amx (compile failed).
|