AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved Error when compile (https://forums.alliedmods.net/showthread.php?t=337265)

OCEAN1337 04-11-2022 12:50

Error when compile
 
I get this error when i try to compile a plugin



https://media.discordapp.net/attachm...74/unknown.png

PHP Code:

#include <amxmodx>
#include <sistem_puncte>
#include <cstrike>
#include <hamsandwich>
#include <fun>
#include <amxmisc>
#include <engine>
#include <nvault>
#include <fakemeta_util>

#define REASON_LENGTH 22
#define DEFAULT_MAX_HEALTH 100
#define DEFAULT_MAX_ARMOR 100
#define ADMIN_FLAG ADMIN_KICK
#define ADD_VIP_FLAG ADMIN_PASSWORD

#pragma semicolon 1

enum 
{
    
NO_VIP 0,
    
VIP_BRONZE 1,
    
VIP_SILVER 2,
    
VIP_DIAMOND 3
}

enum _:WEAPONS
{
    
WeapName[200],
    
WeaponID[32],
    
BpAmmo
}

enum _:PLUGIN_SETTINGS
{
    
SLOT_KICK_REASON[REASON_LENGTH],
    
MAX_HP,
    
MAX_AP,
    
BRONZE_KILL_HP,
    
SILVER_KILL_HP,
    
SILVER_KILL_MONEY,
    
DIAMOND_KILL_HP,
    
DIAMOND_KILL_AP,
    
DIAMOND_KILL_MONEY,
    
FREE_VIP_ON,
    
FREE_VIP_LEVEL,
    
FREE_VIP_START_HOUR
    
FREE_VIP_END_HOUR,
    
MAX_JUMPS,
    
BD_ENABLED,
    
BD_RECEIVED
}

enum (+= 1000)
{
    
SHOW_HUD_TASK 1000,
    
GET_VIP_STATUS_TASK,
    
OPEN_VIP_MENU_TASK,
    
SWITCH_AUTO_MENU_TASK,
    
VIP_LIST_TASK
}

const 
PRIMARY_WEAPONS_BIT_SUM = (1<<CSW_SCOUT)|(1<<CSW_XM1014)|(1<<CSW_MAC10)|(1<<CSW_AUG)|(1<<CSW_UMP45)|(1<<CSW_SG550)|(1<<CSW_GALIL)|(1<<CSW_FAMAS)|(1<<CSW_AWP)|(1<<CSW_MP5NAVY)|(1<<CSW_M249)|(1<<CSW_M3)|(1<<CSW_M4A1)|(1<<CSW_TMP)|(1<<CSW_G3SG1)|(1<<CSW_SG552)|(1<<CSW_AK47)|(1<<CSW_P90);
const 
SECONDARY_WEAPONS_BIT_SUM = (1<<CSW_P228)|(1<<CSW_ELITE)|(1<<CSW_FIVESEVEN)|(1<<CSW_USP)|(1<<CSW_GLOCK18)|(1<<CSW_DEAGLE);

new const 
g_szDeagleMenu[][WEAPONS] =
{
    {
"\rDeagle\w and\r Grenades""weapon_deagle"35}
};

new const 
g_szBronzeWeapons[][WEAPONS] =
{
    {
"\yAK-47""weapon_ak47"90},
    {
"\yM4A1-S","weapon_m4a1"90}
};

new const 
g_szSilverWeapons[][WEAPONS]=
{
    {
"\rAK-47\w and\r Deagle""weapon_ak47"90},
    {
"\rM4A1-S\w and\r Deagle","weapon_m4a1"90}
};

new const 
g_szDiamondWeapons[][WEAPONS]=
{
    {
"\rAK-47\w and\r Deagle""weapon_ak47"90},
    {
"\rM4A1-S\w and\r Deagle","weapon_m4a1"90},
    {
"\rAWP\w and\r Deagle""weapon_awp"30},
    {
"\rSSG\w and\r Deagle""weapon_sg550"90},
    {
"\rG3SG1\w and\r Deagle""weapon_g3sg1"90}
};

new const     
PLUGIN[] = "Sistem VIP"
            
VERSION[] = "1.0",
            
AUTHOR[] = "lexzor";

new 
g_szTag[64];
new 
g_Cvar[PLUGIN_SETTINGS];
new 
g_iCurrentRound;
new 
bool:g_bUsedMenu[MAX_PLAYERS 1];
new 
bool:g_bIsUserFreeVIP[MAX_PLAYERS 1];
new 
bool:g_bFreeVipTime;
//new hudsync;
new const g_szConfigFileName[] ="vip_settings.cfg";
new 
jumpnum[MAX_PLAYERS 1];
new 
bool:dojump[MAX_PLAYERS 1];
new 
bool:g_bAutoMenu[MAX_PLAYERS 1];
new 
bool:g_bNoWeaponMenu;

new const 
g_szVIPMenuCommands[][] =
{
    
"/vipmenu",
    
"/vm",
    
"/vmenu"
};

new const 
g_szVIPListCommand[] = "/vips";

new const 
g_szAutoMenuCommand[] = "/automenu";
new const 
g_nVaultName[] = "sistem_vip";
new const 
g_szFileName[] = "vip_system_blocked_maps.ini";
new 
g_nVault;

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR);

    
register_logevent("LogEvent_RoundStart"2"1=Round_Start" );
    
register_event("TextMsg","Event_RoundRestart","a","2&#Game_w");
    
register_event("TextMsg","Event_RoundRestart","a","2&#Game_C");
    
RegisterHam(Ham_Spawn"player""fwHamPlayerSpawnPost"1);
    
register_event("DeathMsg""DeathMsg_event""a");

    
register_clcmd("say""sayHook");
    
register_clcmd("say_cmd""sayHook");

    
register_clcmd("set_vip_level""set_vip"ADD_VIP_FLAG"Usage: set_vip_level name level");

    
get_system_tag(g_szTagcharsmax(g_szTag));

    
register_dictionary("sistem_vip.txt");

    
g_nVault nvault_open(g_nVaultName);

    if(
g_nVault == INVALID_HANDLE)
    {
        
set_fail_state("%s Can't open nvault file ^"%s^"."g_szTagg_nVaultName);
    }

    
get_cvars();
    
check_map();
}

public 
plugin_end()
{
    
nvault_close(g_nVault);
}

public 
set_vip(idlevelcid)
{
    if(!
cmd_access(idlevelcid3))
        return 
PLUGIN_HANDLED;

    new 
szUserName[MAX_NAME_LENGTH];
    
read_argv(1szUserNamecharsmax(szUserName));
    new 
iLevel read_argv_int(2);

    if(
iLevel NO_VIP || iLevel VIP_DIAMOND)    
    {
        
client_print(idprint_console"%l""INVALID_LEVEL");
        return 
PLUGIN_HANDLED;
    }

    new 
iPlayer find_player_ex(FindPlayer_MatchNameSubstringszUserName);

    if(!
iPlayer)
    {
        
client_print(idprint_console"%l""INVALID_PLAYER");
    }
    else 
    {
        if(
is_user_connected(iPlayer))
        {
            if(
is_user_logged(iPlayer))
            {
                new 
szName[MAX_NAME_LENGTH];
                
get_user_name(iPlayerszNamecharsmax(szName));

                
set_user_vip_level(idiLevel1);
                
client_print(idprint_console"%l""PLAYER_IS_VIP_NOW"iLevelszName);
            }
            else
            {
                
client_print(idprint_console"%l""PLAYER_NOT_LOGGED_IN");
            }
        }
        else 
        {
            
client_print(idprint_console"%l""OFFLINE_PLAYER");
        }
    }

    return 
PLUGIN_HANDLED;
}

public 
get_cvars()
{
    
g_Cvar[MAX_HP] = register_cvar("vip_max_hp",  "100");
    
g_Cvar[MAX_AP] = register_cvar("vip_max_am""100");
    
g_Cvar[FREE_VIP_LEVEL] = register_cvar("vip_free_vip_level""1");
    
g_Cvar[BRONZE_KILL_HP] = register_cvar("vip_bronze_kill_hp""5");
    
g_Cvar[SILVER_KILL_HP] = register_cvar("vip_silver_kill_hp""10");
    
g_Cvar[SILVER_KILL_MONEY] = register_cvar("vip_silver_kill_money""250");
    
g_Cvar[DIAMOND_KILL_HP] = register_cvar("vip_diamond_kill_hp""15");
    
g_Cvar[DIAMOND_KILL_AP] = register_cvar("vip_diamond_kill_ap""3");
    
g_Cvar[DIAMOND_KILL_MONEY] = register_cvar("vip_diamond_kill_money""10");
    
g_Cvar[FREE_VIP_START_HOUR] = register_cvar("vip_free_start_hour""00");
    
g_Cvar[FREE_VIP_END_HOUR] = register_cvar("vip_free_end_hour""00");
    
g_Cvar[MAX_JUMPS] = register_cvar("vip_max_jumps""1");
    
g_Cvar[FREE_VIP_ON] = register_cvar("vip_free_vip""1");

    
load_cfg();
}

public 
load_cfg()
{
    new 
szFile[128], szConfigsDir[64];
    
get_configsdir(szConfigsDircharsmax(szConfigsDir));

    
formatex(szFilecharsmax(szFile), "%s/%s"szConfigsDirg_szConfigFileName);

    if(!
file_exists(szFile))
    {
        
set_fail_state("Folder ^"%s^" was not found"szFile);
    }

    
server_cmd("exec %s"szFile);

    
check_if_is_free_vip_time();
}

public 
sayHook(id)
{
    new 
szTyped[192];

    
read_args(szTypedcharsmax(szTyped));
    
remove_quotes(szTyped);
    
trim(szTyped);

    if(
szTyped[0] == EOS)
        return 
PLUGIN_HANDLED_MAIN;

    for(new 
0sizeof(g_szVIPMenuCommands); i++)
    {
        if(
equal(szTypedg_szVIPMenuCommands[i]))
        {
            
set_task(0.1"open_vip_menu"id OPEN_VIP_MENU_TASK);
            break;    
        }
    }

    if(
equal(szTypedg_szAutoMenuCommand))
    {
        
set_task(0.1"switch_auto_menu"id SWITCH_AUTO_MENU_TASK);
    }

    if(
equal(szTypedg_szVIPListCommand))
    {
        
set_task(0.1"vip_list"id VIP_LIST_TASK);
    }

    return 
PLUGIN_CONTINUE;
}

public 
switch_auto_menu(id)
{
    
id -= SWITCH_AUTO_MENU_TASK;

    switch(
g_bAutoMenu[id])
    {
        case 
trueg_bAutoMenu[id] = false;
        case 
falseg_bAutoMenu[id] = true;
    }

    
client_print_color(idprint_team_default"%s %l"g_szTag"AUTO_MENU_CHAT_MSG"g_bAutoMenu[id] == true "^4[ON]" "^4[OFF]");
}

public 
vip_list(id)
{
    
id -= VIP_LIST_TASK;
    new 
iPlayers[MAX_PLAYERS], iPlayeriNumiVips;
    new 
szMessage[191], iLenszName[MAX_NAME_LENGTH];
    
get_players_ex(iPlayersiNumGetPlayers_ExcludeBots|GetPlayers_ExcludeHLTV);
    
    for(new 
iiNumi++)
    {
        
iPlayer iPlayers[i];

        if(!
is_user_connected(iPlayer))
            continue;
    
        
get_user_name(iPlayerszNamecharsmax(szName));

        if(
is_user_vip(iPlayer))
        {
            
iLen += formatex(szMessage[iLen], charsmax(szMessage), "%s^1,^3 "szName);
             
iVips++;
        }
    }

    if(
iVips != 0)
    {
        
trim(szMessage);
        
szMessage[strlen(szMessage) - 2] = '.';
        
client_print_color(idprint_team_default"%s Online VIPS:^3 %s"g_szTagszMessage);
    }
    else 
    {
        
client_print_color(idprint_team_default"%s No vips online!"g_szTag);
    }
}

public 
client_authorized(id)
{
    if(
is_user_bot(id) || is_user_hltv(id))
        return 
PLUGIN_HANDLED;

    
set_task(1.0"set_vip_status"id GET_VIP_STATUS_TASK);
    
jumpnum[id] = 0;
    
dojump[id] = false;
    
g_bAutoMenu[id] = true;
    
get_data(id);

    return 
PLUGIN_CONTINUE;
}

get_data(id)
{
    new 
iTsszAuthid[MAX_AUTHID_LENGTH], szData[10];
    
get_user_authid(idszAuthidcharsmax(szAuthid));
    
    if(
nvault_lookup(g_nVaultszAuthidszDatacharsmax(szData), iTs))
    {
        
g_bAutoMenu[id] = str_to_num(szData) == true false;
    }
}

public 
client_disconnected(id)
{
    if(
is_user_bot(id) || is_user_hltv(id))
        return 
PLUGIN_HANDLED;

    
g_bIsUserFreeVIP[id] = false;
    
set_user_vip_level(idNO_VIP0);
    
jumpnum[id] = 0;
    
dojump[id] = false;
    
remove_task(id SHOW_HUD_TASK);
    
save_data(id);

    return 
PLUGIN_CONTINUE;
}

save_data(id)
{
    new 
szData[10], szAuthid[MAX_NAME_LENGTH];
    
get_user_authid(idszAuthidcharsmax(szAuthid));
    
formatex(szDatacharsmax(szData), "%i"g_bAutoMenu[id] == true 0);
    
nvault_set(g_nVaultszAuthidszData);
}

public 
set_vip_status(id)
{
    if(
g_bFreeVipTime == true)
    {
        if(
get_user_vip_level(id) == NO_VIP)
            
set_user_vip_level(idVIP_BRONZE0);
    }
}

public 
open_vip_menu(id)
{
    if(
id MAX_PLAYERS 1)
        
id -= OPEN_VIP_MENU_TASK;

    if(
g_bNoWeaponMenu == true)
    {
        
client_print_color(idprint_team_default"%s %l"g_szTag"NO_WEAPON_MENU");
        return 
PLUGIN_HANDLED;
    }

    if(
g_bFreeVipTime == false)
    {
        if(!
is_user_logged(id))
        {
            
client_print_color(idprint_team_default"%s %l"g_szTag"MUST_BE_LOGGED_IN_MENU");
            return 
PLUGIN_HANDLED;
        }
        
        if(
get_user_vip_level(id) == NO_VIP)
        {
            
client_print_color(idprint_team_default"%s %l"g_szTag"MUST_BE_VIP");
            return 
PLUGIN_HANDLED;
        }
    }

    if(!
is_user_alive(id))
    {
        
client_print_color(idprint_team_default"%s %l"g_szTag"MUST_BE_ALIVE");
        return 
PLUGIN_HANDLED;
    }

    new 
szText[64];
    
formatex(szTextcharsmax(szText), "%l""MAIN_MENU_TITLE");
    new 
iMenu menu_create(szText"open_vip_menu_handler");

    switch(
get_user_vip_level(id))
    {
        case 
VIP_BRONZE:
        {
            if(
g_iCurrentRound >= 3)
            {
                for(new 
isizeof(g_szBronzeWeapons); i++)
                    
menu_additem(iMenug_szBronzeWeapons[i][WeapName]);
            }
        }

        case 
VIP_SILVER:
        {
            if(
g_iCurrentRound >= 3)
            {
                for(new 
isizeof(g_szSilverWeapons); i++)
                    
menu_additem(iMenug_szSilverWeapons[i][WeapName]);
            }
            else
            {
                for(new 
isizeof(g_szDeagleMenu); i++)
                    
menu_additem(iMenug_szDeagleMenu[i][WeapName]);
            }
        }

        case 
VIP_DIAMOND:
        {
            if(
g_iCurrentRound >= 3)
            {
                for(new 
isizeof(g_szDiamondWeapons); i++)
                    
menu_additem(iMenug_szDiamondWeapons[i][WeapName]);
            }
            else
            {
                for(new 
isizeof(g_szDeagleMenu); i++)
                    
menu_additem(iMenug_szDeagleMenu[i][WeapName]);
            }
        }
    }
    
    
menu_addblank2(iMenu);

    
formatex(szTextcharsmax(szText), "%l""VIP_MENU_TEXT"g_szAutoMenuCommandg_bAutoMenu[id] == true "disable" "enable");
    
menu_addtext2(iMenuszText);

    
menu_setprop(iMenuMPROP_EXITMEXIT_ALL);
    
menu_display(idiMenu0, -1);

    return 
PLUGIN_CONTINUE;
}

public 
open_vip_menu_handler(idmenuitem)
{
    if(
item == MENU_EXIT)
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }

    if(
g_bUsedMenu[id] == true)
    {
        
client_print_color(idprint_team_default"%s %l"g_szTag"USED_MENU");
        return 
PLUGIN_HANDLED;
    }

    if(!
is_user_alive(id) || !is_user_connected(id))
        return 
PLUGIN_HANDLED;

    if(
g_iCurrentRound >= 3)
        
drop_weapons(id1);
    
    
drop_weapons(id2);

    switch(
get_user_vip_level(id))
    {
        case 
VIP_BRONZE:
        {
            
give_item(idg_szBronzeWeapons[item][WeaponID]);
            
cs_set_user_bpammo(idget_weaponid(g_szBronzeWeapons[item][WeaponID]), g_szBronzeWeapons[item][BpAmmo]);
            
give_default_pistol(idget_user_team(id));
        }

        case 
VIP_SILVER:
        {
            if(
g_iCurrentRound >= 3)
            {
                
give_item(idg_szSilverWeapons[item][WeaponID]);
                
cs_set_user_bpammo(idget_weaponid(g_szSilverWeapons[item][WeaponID]), g_szSilverWeapons[item][BpAmmo]);
                
give_deagle(id);
            }
            else
            {
                
give_deagle(id);
            }

            
give_nades(id);
        }

        case 
VIP_DIAMOND:
        {
            if(
g_iCurrentRound >= 3)
            {
                
give_item(idg_szDiamondWeapons[item][WeaponID]);
                
cs_set_user_bpammo(idget_weaponid(g_szDiamondWeapons[item][WeaponID]), g_szDiamondWeapons[item][BpAmmo]);
                
give_deagle(id);
            }
            else
            {
                
give_deagle(id);
            }

            
give_nades(id);
            
give_item(id"weapon_smokegrenade");
        }
    }

    if(
get_user_team(id) == 2)
        
give_item(id"item_thighpack");

    
g_bUsedMenu[id] = true;

    return 
PLUGIN_CONTINUE;
}

public 
LogEvent_RoundStart()
{
    
g_iCurrentRound++;

    
check_if_is_free_vip_time();
}

public 
check_if_is_free_vip_time()
{
    if(
get_pcvar_num(g_Cvar[FREE_VIP_ON]) == 0)
        return 
PLUGIN_HANDLED;

    if(
IsVipHour(get_pcvar_num(g_Cvar[FREE_VIP_START_HOUR]), get_pcvar_num(g_Cvar[FREE_VIP_END_HOUR])))
    {
        
free_vip_status(1);

        if(
g_bFreeVipTime == false)
            
client_print_color(0print_team_default"%s %l"g_szTag"FREE_VIP_START");

        
g_bFreeVipTime true;
    }
    else if(!
IsVipHour(get_pcvar_num(g_Cvar[FREE_VIP_START_HOUR]), get_pcvar_num(g_Cvar[FREE_VIP_END_HOUR])))
    {
        
free_vip_status(0);

        if(
g_bFreeVipTime == true)
            
client_print_color(0print_team_default"%s %l"g_szTag"FREE_VIP_END");
    
        
g_bFreeVipTime false;
    }

    return 
PLUGIN_CONTINUE;
}

free_vip_status(type)
{

    new 
iPlayers[MAX_PLAYERS], iPlayeriNum;
    
get_players(iPlayersiNum"ch");

    for(new 
0iNumi++)
    {
        
iPlayer iPlayers[i];

        if(!
is_user_connected(iPlayer) || get_user_vip_level(iPlayer) != NO_VIP)
            continue;

        switch(
type)
        {
            case 
1:
            {
                if(
get_user_vip_level(iPlayer) == NO_VIP && g_bIsUserFreeVIP[iPlayer] == false)
                {
                    
set_user_vip_level(iPlayerVIP_BRONZE0);
                    
g_bIsUserFreeVIP[iPlayer] = true;
                }    
            }

            case 
0:
            {
                if(
get_user_vip_level(iPlayer) == VIP_BRONZE && g_bIsUserFreeVIP[iPlayer] == true)
                {
                    
set_user_vip_level(iPlayerNO_VIP0);
                    
g_bIsUserFreeVIP[iPlayer] = false;
                }
            }
        }
    }

}

public 
Event_RoundRestart()
{
    
g_iCurrentRound 0;
}

public 
DeathMsg_event()
{
    new 
iKiller read_data(1);

    if(!
is_user_alive(iKiller))
        return 
PLUGIN_HANDLED;

    new 
iHP get_user_health(iKiller);
    new 
iAP get_user_armor(iKiller);
    new 
iMaxHP get_pcvar_num(g_Cvar[MAX_HP]);
    new 
iMaxAP get_pcvar_num(g_Cvar[MAX_AP]);
    new 
iAddHP;
    new 
iCvarHP;

    switch(
get_user_vip_level(iKiller))
    {
        case 
VIP_BRONZE:
        {
            
iCvarHP get_pcvar_num(g_Cvar[BRONZE_KILL_HP]);
            
iAddHP iHP iCvarHP;

            if(
iHP iMaxHP && ((iHP iAddHP) <= iMaxHP))
            {
                
set_user_health(iKilleriHP get_pcvar_num(g_Cvar[BRONZE_KILL_HP]));
            }
            else 
            {
                
set_user_health(iKilleriMaxHP);
            }

            
client_print_color(iKillerprint_team_default"%s %l"g_szTag"GOT_HP_CHAT_MSG"iCvarHP);
        }

        case 
VIP_SILVER:
        {
            
iCvarHP get_pcvar_num(g_Cvar[SILVER_KILL_HP]);
            
iAddHP iHP iCvarHP;

            if(
iHP iMaxHP && ((iHP iAddHP) <= iMaxHP))
            {
                
set_user_health(iKilleriHP get_pcvar_num(g_Cvar[SILVER_KILL_HP]));
            }
            else 
            {
                
set_user_health(iKilleriMaxHP);
            }

            
client_print_color(iKillerprint_team_default"%s %l"g_szTag"GOT_HP_CHAT_MSG"iCvarHP);

            
cs_set_user_money(iKillercs_get_user_money(iKiller) + get_pcvar_num(g_Cvar[SILVER_KILL_MONEY]));
        }

        case 
VIP_DIAMOND:
        {
            
iCvarHP get_pcvar_num(g_Cvar[DIAMOND_KILL_HP]);
            
iAddHP iHP iCvarHP;

            new 
iCvarAP get_pcvar_num(g_Cvar[DIAMOND_KILL_AP]);
            new 
iAddAP iAP iCvarAP;

            if(
iHP iMaxHP && ((iHP iAddHP) <= iMaxHP))
            {
                
set_user_health(iKilleriHP iAddHP);
            }
            else 
            {
                
set_user_health(iKilleriMaxHP);
            }

            if(
iAP iMaxAP && ((iAP iAddAP) <= iMaxAP))
            {
                
set_user_armor(iKilleriAP iAddHP);
            }
            else 
            {
                
set_user_armor(iKilleriMaxAP);
            }

            
client_print_color(iKillerprint_team_default"%s %l"g_szTag"GOT_HP_AND_AM_CHAT_MSG"iCvarHPiCvarAP);
        
            
cs_set_user_money(iKillercs_get_user_money(iKiller) + get_pcvar_num(g_Cvar[DIAMOND_KILL_MONEY]));
        }
    }

    return 
PLUGIN_CONTINUE;
}

public 
fwHamPlayerSpawnPost(id)
{
    if(
is_user_alive(id) && is_user_connected(id) && get_user_vip_level(id) != NO_VIP)
    {
        
g_bUsedMenu[id] = false;

        if(
g_bAutoMenu[id] == true)
            
set_task(0.5"open_vip_menu"id OPEN_VIP_MENU_TASK);
        
        new 
iMaxHP get_pcvar_num(g_Cvar[MAX_HP]);
        new 
iMaxAP get_pcvar_num(g_Cvar[MAX_AP]);

        if(
iMaxHP != DEFAULT_MAX_HEALTH)
            
set_user_health(idiMaxHP);

        switch(
get_user_vip_level(id))
        {

            case 
VIP_SILVER:
            {
                
cs_set_user_armor(idiMaxAPCS_ARMOR_VESTHELM);
            }

            case 
VIP_DIAMOND:
            {
                
cs_set_user_armor(idiMaxAPCS_ARMOR_VESTHELM);
            }
        }
    }
}

public 
client_PreThink(id)
{
    if(!
is_user_alive(id) || get_user_vip_level(id) == VIP_BRONZE || !is_user_logged(id)) 
        return 
PLUGIN_HANDLED;

    new 
Float:fallspeed 70.0 * -1.0;

    new 
nbut get_user_button(id);
    new 
obut get_user_oldbutton(id);

    if(
nbut IN_USE
    {
        new 
Float:velocity[3];
        
entity_get_vector(idEV_VEC_velocityvelocity);
        if (
velocity[2] < 0.0
        {
            
entity_set_int(idEV_INT_sequence3);
            
entity_set_int(idEV_INT_gaitsequence1);
            
entity_set_float(idEV_FL_frame1.0);
            
entity_set_float(idEV_FL_framerate1.0);

            
velocity[2] = (velocity[2] + 40.0 fallspeed) ? velocity[2] + 40.0 fallspeed;
            
entity_set_vector(idEV_VEC_velocityvelocity);
        }
    }

    if((
nbut IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(obut IN_JUMP))
    {
        if(
jumpnum[id] < get_pcvar_num(g_Cvar[MAX_JUMPS]))
        {
            
dojump[id] = true;
            
jumpnum[id]++;
            return 
PLUGIN_HANDLED;
        }
    }
    if((
nbut IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))
    {
        
jumpnum[id] = 0;
        return 
PLUGIN_HANDLED;
    }

    return 
PLUGIN_CONTINUE;


public 
client_PostThink(id)
{
    if(!
is_user_alive(id) || get_user_vip_level(id) != VIP_DIAMOND || !is_user_logged(id))
        return 
PLUGIN_CONTINUE;
    
    if(
dojump[id] == true)
    {
        new 
Float:velocity[3];
        
entity_get_vector(id,EV_VEC_velocity,velocity);
        
velocity[2] = random_float(265.0,285.0);
        
entity_set_vector(id,EV_VEC_velocity,velocity);
        
dojump[id] = false;
        return 
PLUGIN_CONTINUE;
    }

    return 
PLUGIN_CONTINUE;
}    

give_deagle(id)
{
    
give_item(id"weapon_deagle");
    
cs_set_user_bpammo(idCSW_DEAGLE35);        
}

give_nades(id)
{
    
give_item(id"weapon_hegrenade");
    
give_item(id"weapon_flashbang");
    
cs_set_user_bpammo(idCSW_FLASHBANG2);
}

give_default_pistol(idteam)
{
    switch(
team)
    {
        case 
1:
        {
            
give_item(id"weapon_glock18");
            
cs_set_user_bpammo(idget_weaponid("weapon_glock18"), 120);
        }

        case 
2:
        {
            
give_item(id"weapon_usp");
            
cs_set_user_bpammo(idget_weaponid("weapon_usp"), 100);
        }
    }
}

bool:IsVipHour(iStartiEnd)
{
    new 
iHourtime(iHour);
    return 
bool:(iStart iEnd ? (iStart <= iHour iEnd) : (iStart <= iHour || iHour iEnd));
}

check_map()
{
    new 
iFilePointerszConfigsDir[64], szFile[128];
    
get_configsdir(szConfigsDircharsmax(szConfigsDir));
    
formatex(szFilecharsmax(szFile), "%s/%s"szConfigsDirg_szFileName);

    if(!
file_exists(szFile))
    {
        
iFilePointer fopen(szFile"w");
        
fputs(iFilePointer"#Lista cu hartile unde este oprit meniul de arme.^n#Hartile trebuie trecute unele sub altele.");
        
fclose(iFilePointer);
        
set_fail_state("File ^"%s^" has been created."g_szFileName);
    }
    else 
    {
        
iFilePointer fopen(szFile"r");

        new 
szData[600], szMapName[64];
        
get_mapname(szMapNamecharsmax(szMapName));
        
        while(!
feof(iFilePointer))
        {
            
fgets(iFilePointerszDatacharsmax(szData));
            
trim(szData);

            if(
szData[0] == '#' || szData[0] == ';' || szData[0] == EOS)
                continue;

            if(
equal(szDataszMapName))
            {
                
g_bNoWeaponMenu true;
                break;
            }
        }

        
fclose(iFilePointer);
    }
}

stock drop_weapons(iddropwhat)
{
    new 
weapons[32], num_weaponsindexweaponid;
    
get_user_weapons(idweaponsnum_weapons);
    
    for (
index 0index num_weaponsindex++)
    {
        
weaponid weapons[index];
        
        if ((
dropwhat == && ((1<<weaponid) & PRIMARY_WEAPONS_BIT_SUM)) 
        || (
dropwhat == && ((1<<weaponid) & SECONDARY_WEAPONS_BIT_SUM))
        || (
dropwhat == 3) && (((1<<weaponid) & PRIMARY_WEAPONS_BIT_SUM) || ((1<<weaponid) & SECONDARY_WEAPONS_BIT_SUM)))
        {
            new 
wname[32];
            
get_weaponname(weaponidwnamecharsmax(wname));
            

            
engclient_cmd(id"drop"wname);
        }
    }



OciXCrom 04-11-2022 14:07

Re: Error when compile
 
The error is very clear. You're not using the correct amount of arguments with the function on the lines displayed in the error.

And "is_user_vip" does not exist.

zXCaptainXz 04-12-2022 17:12

Re: Error when compile
 
Please show us addons/amxmodx/scripting/sistem_puncte.inc

OCEAN1337 04-14-2022 15:36

Re: Error when compile
 
2 Attachment(s)
Quote:

Originally Posted by zXCaptainXz (Post 2776621)
Please show us addons/amxmodx/scripting/sistem_puncte.inc


Craxor 04-15-2022 00:12

Re: Error when compile
 
I would also recommen you to use give user weapon() stock insteand of the method youre using .

fysiks 04-15-2022 00:17

Re: Error when compile
 
For the argument mismatch (all but one of the errors), look at the line on which the error occurs (the line is the number in paretheses after the file name; e.g. the first error occurs on line 188). If you don't have an editor that shows the line numbers, you should find one that does (Notepad++ or Visual Studio Code are good options; the latter has a plugin that can help find errors in your code). Then, find the definition of that function in the include files to see how many arguments and of which type it requires.

For example, line 188 has the function set_user_vip_level(). Now, find this function in the include files (this one happens to be in sistem_puncte.inc). There you will find how many arguments it requires. Then do the same for all others with the same type of error.

For the undefined symbol is_user_vip(), says that the compiler can't find this function anywhere. However, it is actually in sistem_puncte.inc which means you were probably not properly using that same include file when you were compiling it. Make sure that this exact include file is in your include folder.

OCEAN1337 04-15-2022 00:27

Re: Error when compile
 
This plugins where made custom for me…but the guy that did it does not gives me support no more…i do not know amxx or whatever is this language…They are too complicated for me…i will post everything for free and who knows how to repair it will use it. Is just sistem_vip that doies not compile

Craxor 04-15-2022 13:22

Re: Error when compile
 
If you aren't able or interested in learning and supporting your own code you should have posted in Request Section .

OCEAN1337 04-15-2022 13:56

Re: Error when compile
 
Quote:

Originally Posted by Craxor (Post 2776899)
If you aren't able or interested in learning and supporting your own code you should have posted in Request Section .

It is not that i’m not able or interested to do it, but how can i do it with 0 knowledge ?

Here is the full scripts, https://mega.nz/file/LRNmHIxT#jD_2mk...9nI5mE7cO8yvrU

Craxor 04-15-2022 14:16

Re: Error when compile
 
Ocean, thats what im saying , if you aren't able to support your code you should have maded your thread in request section not in Scripting Help section, you get it?

Wich is here: https://forums.alliedmods.net/forumdisplay.php?f=12


All times are GMT -4. The time now is 10:33.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.