AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Fix this script guys pls (https://forums.alliedmods.net/showthread.php?t=331914)

SHIFT0 04-12-2021 18:00

Fix this script guys pls
 
Pls help me on this
maybe need more includes

PHP Code:

#include <zombie_escape>
#include <cstrike>
#include <amxmodx>
#include <fun>


// Definitions
#define ADMIN_ACCESS    ADMIN_LEVEL_H
 
// Resource
new const g_szModelM249[] = "models/vipitems/v_m249.mdl"
new const g_szModelHe[] = "models/vipitems/v_hebomb.mdl"
new const g_szModelFb[] = "models/vipitems/v_flashbomb.mdl"
 
// Forward called after server activation
public plugin_init()
{
    
// Load plugin
    
register_plugin("Features VIP""1.0""Null")
   
    
// Events
    
register_event("CurWeapon""CurrentWeapon""be""1=1")
}
 
// Forward allows precaching files
public plugin_precache()
{
    
// Precache models
    
precache_model(g_szModelM249)
    
precache_model(g_szModelHe)
    
precache_model(g_szModelFb)
}
 
// Forward called when user humanized
public ze_user_humanized(id)
{
    
// Not Admin? Exit the function...
    
if (!(get_user_flags(id) & ADMIN_ACCESS))
        return
   
    
// Give VIP features
    
Give_Features(id)
}
 
public 
Give_Features(id)
{
    
// Give M249
    
static iWeapon
    iWeapon 
rg_give_item(id"weapon_m249")
    
rg_set_user_bpammo(idWeaponIdType:iWeapon200)
   
    
// Give x2 Fire Nades
    
iWeapon rg_give_item(id"weapon_hegrenade")
    
rg_set_user_bpammo(idWeaponIdType:iWeapon2)
   
    
// Give x2 Frost Nades
    
iWeapon rg_give_item(id"weapon_flashbang")
    
rg_set_user_bpammo(idWeaponIdType:iWeapon2)
}
 
// Forward called when current weapon
public CurrentWeapon(id)
{
    
// It's not a alive or It's not a VIP or It's not a connected.
    
if (!is_user_connected(id) || !is_user_alive(id) || !(get_user_flags(id) & ADMIN_ACCESS))
        return
       
    
// Set weapon's model
    
if (get_user_weapon(id) == CSW_M249)
    {
        
set_pev(idpev_viewmodel2g_szModelM249)
    }
    else if (
get_user_weapon(id) == CSW_HEGRENADE)
    {
        
set_pev(idpev_viewmodel2g_szModelHe)
    }
    else if (
get_user_weapon(id) == CSW_FLASHBANG)
    {
        
set_pev(idpev_viewmodel2g_szModelFb)
    }



redivcram 04-12-2021 18:28

Re: Fix this script guys pls
 
And what's your problem? Do you have zombie_escape.inc?

Celena Luna 04-12-2021 22:24

Re: Fix this script guys pls
 
zombie_escapse and reapi include is missing

mlibre 04-14-2021 20:41

Re: Fix this script guys pls
 
try this one that does not use reapi "optional"

PHP Code:

#include <amxmodx>
#include <engine>
#include <fun>
#include <cstrike>
#include <zombie_escape>

// Definitions
#define ADMIN_ACCESS    ADMIN_LEVEL_H

static is_player_alive[33]

// Resource
new const g_szModelM249[] = "models/vipitems/v_m249.mdl"
new const g_szModelHe[] = "models/vipitems/v_hebomb.mdl"
new const g_szModelFb[] = "models/vipitems/v_flashbomb.mdl"

public plugin_precache()
{
    
register_plugin("Features VIP""1.0""Null")
    
    
file_exists_pre(g_szModelM249)
    
file_exists_pre(g_szModelHe)
    
file_exists_pre(g_szModelFb)
    
    
RegisterHam(Ham_Item_Deploy"weapon_m249""fw_Item_Deploy_Post"1)
    
RegisterHam(Ham_Spawn"player""fw_PlayerSpawn"1)
    
RegisterHam(Ham_Killed"player""fw_PlayerKilled")
}
 
// Forward called when user humanized
public ze_user_humanized(id)
{
    
// Not Admin? Exit the function...
    
if (!(get_user_flags(id) & ADMIN_ACCESS))
        return
   
    
// Give VIP features
    
Give_Features(id)
}
 
public 
Give_Features(id)
{
    
// Give M249
    
static iwiw give_item(id"weapon_m249")
    
    if(
iw 0
    {
        
engclient_cmd(id"weapon_m249")
        
        
cs_set_user_bpammo (idCSW_M249200
    }
    
    
// Give x2 Fire Nades
    
iw give_item(id"weapon_hegrenade")
        
    if(
iw 0
    { 
        
cs_set_user_bpammo (idCSW_HEGRENADE2
    }
    
    
// Give x2 Frost Nades
    
iw give_item(id"weapon_flashbang")
        
    if(
iw 0
    { 
        
cs_set_user_bpammo (idCSW_FLASHBANG2
    }
}

public 
client_putinserver(id
{
    
is_player_alive[id] = 0
}

public 
fw_PlayerSpawn(const id
{
    if( !
is_user_alive(id) || !is_user_connected(id) ) 
        return 
HAM_IGNORED
        
    is_player_alive
[id] = 1
    
    
return HAM_IGNORED
}

public 
fw_PlayerKilled(id
{
    
is_player_alive[id] = 0
}

public 
fw_Item_Deploy_Post(x
{
    static 
idid get_pdata_cbase(x414)
    
    if( !
is_valid_ent(id) || !is_player_alive[id
    || !
is_user_connected(id) || !(get_user_flags(id) & ADMIN_ACCESS) )
        return 
HAM_IGNORED
        
    
static wpwp cs_get_weapon_id(x)
    
    switch(
wp
    {
        case 
CSW_M249entity_set_string(idEV_SZ_viewmodelg_szModelM249)
        case 
CSW_HEGRENADEentity_set_string(idEV_SZ_viewmodelg_szModelHe)
        case 
CSW_FLASHBANGentity_set_string(idEV_SZ_viewmodelg_szModelFb)
    }
    
    return 
HAM_IGNORED
}

stock file_exists_pre(const file[])
{
    if(
file_exists(file))
    {
        
precache_model(file)
    }
    else {
        
set_fail_state(file)
    }



nG_getwreck 04-15-2021 00:02

Re: Fix this script guys pls
 
Quote:

Originally Posted by SHIFT0 (Post 2743933)
Pls help me on this
maybe need more includes

You didn't state the problem, you should say it. How we can find solution or help you, if there's no problem stated.

Btw
Quote:

Originally Posted by OciXCrom (Post 2740463)
This is not the "do it for me" section. If you're not willing to collaborate, don't bother posting here.


nG_getwreck 04-15-2021 00:03

Re: Fix this script guys pls
 
Quote:

Originally Posted by mlibre (Post 2744095)
try this one that does not use reapi "optional"

PHP Code:

#include <amxmodx>
#include <engine>
#include <fun>
#include <cstrike>
#include <hamsandwich>
#include <zombie_escape>

// Definitions
#define ADMIN_ACCESS    ADMIN_LEVEL_H

static is_player_alive[33]

// Resource
new const g_szModelM249[] = "models/vipitems/v_m249.mdl"
new const g_szModelHe[] = "models/vipitems/v_hebomb.mdl"
new const g_szModelFb[] = "models/vipitems/v_flashbomb.mdl"

public plugin_precache()
{
    
register_plugin("Features VIP""1.0""Null")
    
    
file_exists_pre(g_szModelM249)
    
file_exists_pre(g_szModelHe)
    
file_exists_pre(g_szModelFb)
    
    
RegisterHam(Ham_Item_Deploy"weapon_m249""fw_Item_Deploy_Post"1)
    
RegisterHam(Ham_Spawn"player""fw_PlayerSpawn"1)
    
RegisterHam(Ham_Killed"player""fw_PlayerKilled")
}
 
// Forward called when user humanized
public ze_user_humanized(id)
{
    
// Not Admin? Exit the function...
    
if (!(get_user_flags(id) & ADMIN_ACCESS))
        return
   
    
// Give VIP features
    
Give_Features(id)
}
 
public 
Give_Features(id)
{
    
// Give M249
    
static iwiw give_item(id"weapon_m249")
    
    if(
iw 0
    {
        
engclient_cmd(id"weapon_m249")
        
        
cs_set_user_bpammo (idCSW_M249200
    }
    
    
// Give x2 Fire Nades
    
iw give_item(id"weapon_hegrenade")
        
    if(
iw 0
    { 
        
cs_set_user_bpammo (idCSW_HEGRENADE2
    }
    
    
// Give x2 Frost Nades
    
iw give_item(id"weapon_flashbang")
        
    if(
iw 0
    { 
        
cs_set_user_bpammo (idCSW_FLASHBANG2
    }
}

public 
client_putinserver(id
{
    
is_player_alive[id] = 0
}

public 
fw_PlayerSpawn(const id
{
    if( !
is_user_alive(id) || !is_user_connected(id) ) 
        return 
HAM_IGNORED
        
    is_player_alive
[id] = 1
    
    
return HAM_IGNORED
}

public 
fw_PlayerKilled(id
{
    
is_player_alive[id] = 0
}

public 
fw_Item_Deploy_Post(x
{
    static 
idid get_pdata_cbase(x414)
    
    if( !
is_valid_ent(id) || !is_player_alive[id
    || !
is_user_connected(id) || !(get_user_flags(id) & ADMIN_ACCESS) )
        return 
HAM_IGNORED
        
    
static wpwp cs_get_weapon_id(x)
    
    switch(
wp
    {
        case 
CSW_M249entity_set_string(idEV_SZ_viewmodelg_szModelM249)
        case 
CSW_HEGRENADEentity_set_string(idEV_SZ_viewmodelg_szModelHe)
        case 
CSW_FLASHBANGentity_set_string(idEV_SZ_viewmodelg_szModelFb)
    }
    
    return 
HAM_IGNORED
}

stock file_exists_pre(const file[])
{
    if(
file_exists(file))
    {
        
precache_model(file)
    }
    else {
        
set_fail_state(file)
    }



Those includes are already included in zombie_escape.inc file.

SHIFT0 04-15-2021 07:38

Re: Fix this script guys pls
 
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

D:\Games\Counter-Strike\cstrike\addons\amxmodx\scripting\inclu de\amxconst.inc(50) : error 056: arrays, local variables and function arguments cannot be public (variable "NULL_STRING")
D:\Games\Counter-Strike\cstrike\addons\amxmodx\scripting\inclu de\amxconst.inc(55) : error 056: arrays, local variables and function arguments cannot be public (variable "NULL_VECTOR")
D:\Games\Counter-Strike\cstrike\addons\amxmodx\scripting\inclu de\string_stocks.inc(91) : warning 207: unknown #pragma
D:\Games\Counter-Strike\cstrike\addons\amxmodx\scripting\inclu de\string_stocks.inc(91) : error 038: extra characters on line
D:\Games\Counter-Strike\cstrike\addons\amxmodx\scripting\inclu de\amxmodx.inc(178) : warning 207: unknown #pragma
D:\Games\Counter-Strike\cstrike\addons\amxmodx\scripting\inclu de\amxmodx.inc(178) : error 038: extra characters on line
D:\Games\Counter-Strike\cstrike\addons\amxmodx\scripting\inclu de\amxmodx.inc(2555) : warning 207: unknown #pragma
D:\Games\Counter-Strike\cstrike\addons\amxmodx\scripting\inclu de\amxmodx.inc(2555) : error 038: extra characters on line
D:\Games\Counter-Strike\cstrike\addons\amxmodx\scripting\inclu de\amxmodx.inc(2567) : warning 207: unknown #pragma
D:\Games\Counter-Strike\cstrike\addons\amxmodx\scripting\inclu de\amxmodx.inc(2567) : error 038: extra characters on line
D:\Games\Counter-Strike\cstrike\addons\amxmodx\scripting\inclu de\amxmodx.inc(2615) : warning 207: unknown #pragma
D:\Games\Counter-Strike\cstrike\addons\amxmodx\scripting\inclu de\amxmodx.inc(2615) : error 038: extra characters on line
D:\Games\Counter-Strike\cstrike\addons\amxmodx\scripting\inclu de\amxmodx.inc(2626) : warning 207: unknown #pragma
D:\Games\Counter-Strike\cstrike\addons\amxmodx\scripting\inclu de\amxmodx.inc(2626) : error 038: extra characters on line
D:\Games\Counter-Strike\cstrike\addons\amxmodx\scripting\inclu de\amxmodx.inc(2638) : warning 207: unknown #pragma
D:\Games\Counter-Strike\cstrike\addons\amxmodx\scripting\inclu de\amxmodx.inc(2638) : error 038: extra characters on line
D:\Games\Counter-Strike\cstrike\addons\amxmodx\scripting\inclu de\engine.inc(1022) : error 008: must be a constant expression; assumed zero
D:\Games\Counter-Strike\cstrike\addons\amxmodx\scripting\inclu de\ham_const.inc(1917) : warning 200: symbol "Ham_DOD_Weapon_PlayerIsWaterSni" is truncated to 31 characters
D:\Games\Counter-Strike\cstrike\addons\amxmodx\scripting\inclu de\ham_const.inc(2686) : warning 200: symbol "Ham_ESF_Weapon_HolsterWhenMelee" is truncated to 31 characters
D:\Games\Counter-Strike\cstrike\addons\amxmodx\scripting\inclu de\ham_const.inc(2755) : warning 200: symbol "Ham_NS_EffectivePlayerClassChan" is truncated to 31 characters
D:\Games\Counter-Strike\cstrike\addons\amxmodx\scripting\inclu de\ham_const.inc(2860) : warning 200: symbol "Ham_NS_Weapon_GetWeaponPrimeTim" is truncated to 31 characters
D:\Games\Counter-Strike\cstrike\addons\amxmodx\scripting\inclu de\ham_const.inc(2884) : warning 200: symbol "Ham_NS_Weapon_GetIsWeaponPrimin" is truncated to 31 characters
D:\Games\Counter-Strike\cstrike\addons\amxmodx\scripting\inclu de\ham_const.inc(3332) : warning 200: symbol "Ham_SC_CheckAndApplyGenericAtta" is truncated to 31 characters
D:\Games\Counter-Strike\cstrike\addons\amxmodx\scripting\inclu de\ham_const.inc(3381) : warning 200: symbol "Ham_SC_Player_MenuInputPerforme" is truncated to 31 characters
D:\Games\Counter-Strike\cstrike\addons\amxmodx\scripting\inclu de\ham_const.inc(3477) : warning 200: symbol "Ham_SC_Player_TimeToStartNextVo" is truncated to 31 characters
D:\Games\Counter-Strike\cstrike\addons\amxmodx\scripting\inclu de\ham_const.inc(3509) : warning 200: symbol "Ham_SC_Player_DisableCollisionW" is truncated to 31 characters
D:\Games\Counter-Strike\cstrike\addons\amxmodx\scripting\inclu de\ham_const.inc(3517) : warning 200: symbol "Ham_SC_Player_EnableCollisionWi" is truncated to 31 characters
D:\Games\Counter-Strike\cstrike\addons\amxmodx\scripting\inclu de\ham_const.inc(3591) : warning 200: symbol "Ham_SC_Weapon_PrecacheCustomMod" is truncated to 31 characters
D:\Games\Counter-Strike\cstrike\addons\amxmodx\scripting\inclu de\ham_const.inc(3692) : warning 200: symbol "Ham_TFC_Weapon_GetNextAttackDel" is truncated to 31 characters
D:\Games\Counter-Strike\cstrike\addons\amxmodx\scripting\inclu de\ham_const.inc(3760) : warning 200: symbol "Ham_OPF_MySquadTalkMonsterPoint" is truncated to 31 characters
D:\Games\Counter-Strike\cstrike\addons\amxmodx\scripting\inclu de\ham_const.inc(4158) : warning 200: symbol "Ham_SC_Item_InactiveItemPreFram" is truncated to 31 characters
D:\Games\Counter-Strike\cstrike\addons\amxmodx\scripting\inclu de\ham_const.inc(4166) : warning 200: symbol "Ham_SC_Item_InactiveItemPostFra" is truncated to 31 characters
D:\Games\Counter-Strike\cstrike\addons\amxmodx\scripting\inclu de\ham_const.inc(4211) : warning 200: symbol "Ham_SC_Weapon_ExtractAmmoFromIt" is truncated to 31 characters
D:\Games\Counter-Strike\cstrike\addons\amxmodx\scripting\inclu de\cssdk_const.inc(1050) : warning 200: symbol "ROUND_ESCAPING_TERRORISTS_NEUTR" is truncated to 31 characters
D:\Games\Counter-Strike\cstrike\addons\amxmodx\scripting\inclu de\cssdk_const.inc(1230) : warning 200: symbol "RR_ESCAPING_TERRORISTS_NEUTRALI" is truncated to 31 characters
D:\Games\Counter-Strike\cstrike\addons\amxmodx\scripting\inclu de\reapi_gamedll_const.inc(409) : warning 200: symbol "RG_CBaseAnimating_ResetSequence" is truncated to 31 characters
D:\Games\Counter-Strike\cstrike\addons\amxmodx\scripting\inclu de\reapi_gamedll_const.inc(613) : warning 200: symbol "RG_CBasePlayer_SetClientUserInf" is truncated to 31 characters
D:\Games\Counter-Strike\cstrike\addons\amxmodx\scripting\inclu de\reapi_gamedll_const.inc(619) : warning 200: symbol "RG_CBasePlayer_SetClientUserInf" is truncated to 31 characters
D:\Games\Counter-Strike\cstrike\addons\amxmodx\scripting\inclu de\reapi_gamedll_const.inc(625) : warning 200: symbol "RG_CBasePlayer_Observer_IsValid" is truncated to 31 characters
D:\Games\Counter-Strike\cstrike\addons\amxmodx\scripting\inclu de\reapi_gamedll_const.inc(755) : warning 200: symbol "RG_CBasePlayer_SetSpawnProtecti" is truncated to 31 characters
D:\Games\Counter-Strike\cstrike\addons\amxmodx\scripting\inclu de\reapi_gamedll_const.inc(762) : warning 200: symbol "RG_CBasePlayer_RemoveSpawnProte" is truncated to 31 characters
D:\Games\Counter-Strike\cstrike\addons\amxmodx\scripting\inclu de\reapi_gamedll_const.inc(803) : warning 200: symbol "RG_CBasePlayerWeapon_DefaultDep" is truncated to 31 characters
D:\Games\Counter-Strike\cstrike\addons\amxmodx\scripting\inclu de\reapi_gamedll_const.inc(810) : warning 200: symbol "RG_CBasePlayerWeapon_DefaultRel" is truncated to 31 characters
D:\Games\Counter-Strike\cstrike\addons\amxmodx\scripting\inclu de\reapi_gamedll_const.inc(817) : warning 200: symbol "RG_CBasePlayerWeapon_DefaultSho" is truncated to 31 characters
D:\Games\Counter-Strike\cstrike\addons\amxmodx\scripting\inclu de\reapi_gamedll_const.inc(854) : warning 200: symbol "RG_CSGameRules_FShouldSwitchWea" is truncated to 31 characters
D:\Games\Counter-Strike\cstrike\addons\amxmodx\scripting\inclu de\reapi_gamedll_const.inc(861) : warning 200: symbol "RG_CSGameRules_GetNextBestWeapo" is truncated to 31 characters
D:\Games\Counter-Strike\cstrike\addons\amxmodx\scripting\inclu de\reapi_gamedll_const.inc(868) : warning 200: symbol "RG_CSGameRules_FlPlayerFallDama" is truncated to 31 characters
D:\Games\Counter-Strike\cstrike\addons\amxmodx\scripting\inclu de\reapi_gamedll_const.inc(875) : warning 200: symbol "RG_CSGameRules_FPlayerCanTakeDa" is truncated to 31 characters
D:\Games\Counter-Strike\cstrike\addons\amxmodx\scripting\inclu de\reapi_gamedll_const.inc(888) : warning 200: symbol "RG_CSGameRules_FPlayerCanRespaw" is truncated to 31 characters
D:\Games\Counter-Strike\cstrike\addons\amxmodx\scripting\inclu de\reapi_gamedll_const.inc(895) : warning 200: symbol "RG_CSGameRules_GetPlayerSpawnSp" is truncated to 31 characters
D:\Games\Counter-Strike\cstrike\addons\amxmodx\scripting\inclu de\reapi_gamedll_const.inc(901) : warning 200: symbol "RG_CSGameRules_ClientUserInfoCh" is truncated to 31 characters
D:\Games\Counter-Strike\cstrike\addons\amxmodx\scripting\inclu de\reapi_gamedll_const.inc(920) : warning 200: symbol "RG_CSGameRules_CanHavePlayerIte" is truncated to 31 characters
D:\Games\Counter-Strike\cstrike\addons\amxmodx\scripting\inclu de\reapi_gamedll_const.inc(927) : warning 200: symbol "RG_CSGameRules_DeadPlayerWeapon" is truncated to 31 characters
D:\Games\Counter-Strike\cstrike\addons\amxmodx\scripting\inclu de\reapi_gamedll_const.inc(939) : warning 200: symbol "RG_CSGameRules_CheckMapConditio" is truncated to 31 characters
D:\Games\Counter-Strike\cstrike\addons\amxmodx\scripting\inclu de\reapi_gamedll_const.inc(959) : warning 200: symbol "RG_CSGameRules_CheckWinConditio" is truncated to 31 characters
D:\Games\Counter-Strike\cstrike\addons\amxmodx\scripting\inclu de\reapi_gamedll_const.inc(1002) : warning 200: symbol "RG_CSGameRules_CanPlayerHearPla" is truncated to 31 characters
D:\Games\Counter-Strike\cstrike\addons\amxmodx\scripting\inclu de\reapi_gamedll_const.inc(5929) : warning 200: symbol "m_Shield_hEntToIgnoreTouchesFro" is truncated to 31 characters
D:\Games\Counter-Strike\cstrike\addons\amxmodx\scripting\inclu de\amxmisc.inc(635) : warning 207: unknown #pragma
D:\Games\Counter-Strike\cstrike\addons\amxmodx\scripting\inclu de\amxmisc.inc(635) : error 038: extra characters on line

11 Errors.
Could not locate output file D:\Program Files (x86)\AMX Mod X\amxxstudio\Untitled.amx (compile failed).

SHIFT0 04-15-2021 07:41

Re: Fix this script guys pls
 
Quote:

Originally Posted by redivcram (Post 2743935)
And what's your problem? Do you have zombie_escape.inc?

Yup

mlibre 04-15-2021 08:49

Re: Fix this script guys pls
 
Quote:

Originally Posted by nG_getwreck (Post 2744103)
Those includes are already included in zombie_escape.inc file.

True I had not noticed, apparently it requires using reapi this works only in version 1.8.3 or higher

Quote:

Originally Posted by SHIFT0 (Post 2744132)
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team
11 Errors.
Could not locate output file D:\Program Files (x86)\AMX Mod X\amxxstudio\Untitled.amx (compile failed).

update your amxx here

https://www.amxmodx.org/downloads-new.php

SHIFT0 04-15-2021 11:27

Re: Fix this script guys pls
 
Done ty <3


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

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