Reapi_dead_pistols

Статус
В этой теме нельзя размещать новые ответы.
Сообщения
160
Реакции
170
Помог
1 раз(а)
Ошибка
reapi_dead_pistols.sma(47) : error 088: number of arguments does not match definition
Компилятор
Локальный
Amx Mod X
1.10.0
Исходный код
// Copyright © 2016 Vaqtincha

/*******************************************************
* Support forum:
* http://goldsrc.ru
*
* Credits:
*
* - ConnorMcLeod for plugin "Drop All Weapons On Death"
*
********************************************************/

// #define DEBUG

#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>
#include <reapi>


#define SET_MODEL(%1,%2) engfunc(EngFunc_SetModel, %1, %2)
#define cs_get_user_has_prim(%1) (get_member(%1, m_rgpPlayerItems, PRIMARY_WEAPON_SLOT) > 0)
#define cs_get_user_has_shield(%1) get_member(%1, m_bOwnsShield)

const MAX_AMMO_TYPES = 15

new const g_szAmmoTypes[MAX_AMMO_TYPES][] = {
"", "338Magnum", "762Nato", "556NatoBox", "556Nato", "buckshot", "45acp", "57mm",
"50AE", "357SIG", "9mm", "Flashbang", "HEGrenade", "SmokeGrenade", "C4"
}

new mp_drop_pistols


public plugin_init()
{
register_plugin("Drop Pistols on Death", "0.0.2", "Vaqtincha")

RegisterHookChain(RG_CSGameRules_DeadPlayerWeapons, "CSGameRules_DeadPlayerWeapons", .post = true)

mp_drop_pistols = register_cvar("mp_drop_pistols", "1")
}


public CSGameRules_DeadPlayerWeapons(id)
{
new iRet = GetHookChainReturn()

if(!get_pcvar_num(mp_drop_pistols) || iRet == GR_PLR_DROP_GUN_NO)
return HC_CONTINUE

if(!cs_get_user_has_prim(id) && !cs_get_user_has_shield(id))
return HC_CONTINUE

new iWeapon = get_member(id, m_rgpPlayerItems, PISTOL_SLOT)

while(iWeapon > 0 && !is_nullent(iWeapon))
{
PackPlayerItem(id, iWeapon, bool:(iRet != GR_PLR_DROP_AMMO_NO))

iWeapon = get_member(iWeapon, m_pNext)
}

return HC_CONTINUE
}

PackPlayerItem(id, iWeapon, bool:bPackAmmo)
{
new Float:flOrigin[3], Float:flAngles[3], szModel[26], szWeapon[20]
new iWeaponBox, iAmmoId

get_entvar(id, var_origin, flOrigin)
get_entvar(id, var_angles, flAngles)

if((iWeaponBox = WeaponBox_Spawn(flOrigin, flAngles)) != NULLENT)
{
// set_entvar(iWeaponBox, var_owner, id) // ?

if(!WeaponBox_PackWeapon(iWeaponBox, iWeapon, id))
{
set_entvar(iWeaponBox, var_flags, FL_KILLME)
}
else
{
if(bPackAmmo)
{
iAmmoId = ExecuteHam(Ham_Item_PrimaryAmmoIndex, iWeapon)
WeaponBox_PackAmmo(iWeaponBox, iAmmoId, get_member(id, m_rgAmmo, iAmmoId))
}

get_entvar(iWeapon, var_classname, szWeapon, charsmax(szWeapon))
formatex(szModel, charsmax(szModel), "models/w_%s.mdl", szWeapon[7])

if(szModel[0])
{
SET_MODEL(iWeaponBox, szModel)
#if defined DEBUG
server_print("WeaponName: %s | WeaponID: %d | WeaponClip: %d^nWeaponModel: %s", szWeapon, get_member(iWeapon, m_iId), get_member(iWeapon, m_Weapon_iClip), szModel)
server_print("=================================^n")
#endif
}
}
}
}


stock WeaponBox_Spawn(Float:flOrigin[3], Float:flAngles[3])
{
new iWeaponBox = rg_create_entity("weaponbox", .useHashTable = true)
if(is_nullent(iWeaponBox))
{
#if defined DEBUG
server_print("Failed to create WeaponBox!")
#endif
return NULLENT
}

set_entvar(iWeaponBox, var_movetype, MOVETYPE_TOSS)
set_entvar(iWeaponBox, var_solid, SOLID_TRIGGER)

/** not necessary */
// engfunc(EngFunc_SetSize, iWeaponBox, Float:{-1.0, -1.0, -1.0} , Float:{1.0, 1.0, 1.0})
// engfunc(EngFunc_SetModel, iWeaponBox, "models/w_weaponbox.mdl")

engfunc(EngFunc_SetOrigin, iWeaponBox, flOrigin)

// don't let weaponbox tilt.
flAngles[0] = 0.0
flAngles[2] = 0.0

set_entvar(iWeaponBox, var_angles, flAngles)

new Float:flVelocity[3]
flVelocity[0] = random_float(-75.0, 75.0)
flVelocity[1] = random_float(-75.0, 75.0)
set_entvar(iWeaponBox, var_velocity, flVelocity)

ExecuteHamB(Ham_Spawn, iWeaponBox)

return iWeaponBox
}

/// from weapons.cpp
stock bool:WeaponBox_PackWeapon(iWeaponBox, iWeapon, id)
{
if(!ExecuteHam(Ham_RemovePlayerItem, id, iWeapon))
{
#if defined DEBUG
server_print("Failed to unhook the weapon from the player!")
#endif
return false
}

set_member(iWeaponBox, m_WeaponBox_rgpPlayerItems, iWeapon, ExecuteHamB(Ham_Item_ItemSlot, iWeapon))
set_member(iWeapon, m_pNext, NULLENT)

// never respawn
set_entvar(iWeapon, var_spawnflags, get_entvar(iWeapon, var_spawnflags) | SF_NORESPAWN)
set_entvar(iWeapon, var_movetype, MOVETYPE_NONE)
set_entvar(iWeapon, var_solid, SOLID_NOT)
set_entvar(iWeapon, var_effects, EF_NODRAW)
set_entvar(iWeapon, var_modelindex, 0)
set_entvar(iWeapon, var_model, 0)
set_entvar(iWeapon, var_owner, iWeaponBox)
set_member(iWeapon, m_pPlayer, NULLENT)

return true
}

stock WeaponBox_PackAmmo(iWeaponBox, iAmmoId, iCount)
{
if(!(1 <= iAmmoId <= MAX_AMMO_TYPES))
return

set_member(iWeaponBox, m_WeaponBox_rgiszAmmo, g_szAmmoTypes[iAmmoId], 0)
set_member(iWeaponBox, m_WeaponBox_rgAmmo, (iCount < 0) ? 0 : iCount, 0)

#if defined DEBUG
new szAmmoName[16]
get_member(iWeaponBox, m_WeaponBox_rgiszAmmo, szAmmoName, charsmax(szAmmoName))
server_print("^n=========== Drop Pistols Info ===========")
server_print("AmmoName: %s | AmmoID: %d | AmmoPacked: %d", szAmmoName, iAmmoId, iCount)
#endif
}
Exe version 1.0.0.3/Stdio (czero)
ReHLDS version: 3.4.0.643-dev
Build date: 09:50:09 Apr 28 2018 (1477)

Metamod-r v1.3.0.122, API (5:13)
Metamod-r build: 23:43:27 Apr 23 2018


AMX Mod X 1.8.3-Re (http://www.amxmodx.org)
Authors (ReHLDS Team):
"Adidasman", "s1lent"
Compiled: Dec 24 2016 15:59:38
Build ID: 7

В принципе я понимаю что означает данная ошибка,но я не скриптер.
Кому не трудно подправьте пожалуйста или подскажите как исправить.
 
В этой теме было размещено решение! Перейти к решению.
Сообщения
2,751
Реакции
3,017
Помог
61 раз(а)
На 47 строке поправь так:
Код:
public CSGameRules_DeadPlayerWeapons(id)
{
-    new iRet = GetHookChainReturn()
+    new iRet = GetHookChainReturn(ATYPE_INTEGER)
...
 
Статус
В этой теме нельзя размещать новые ответы.

Пользователи, просматривающие эту тему

Сейчас на форуме нет ни одного пользователя.
Сверху Снизу