Ошибка native "user_has_weapon"

Сообщения
16
Реакции
0
Ошибка
L 04/28/2022 - 22:13:33: Invalid player id 0
L 04/28/2022 - 22:13:33: [AMXX] Run time error 10 (plugin "c4_taker.amxx") (native "user_has_weapon") - debug not enabled!
L 04/28/2022 - 22:13:33: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
ОС
Linux
Amx Mod X
AMX Mod X 1.9.0-dev+5210
Билд
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
ReHLDS version: 3.11.0.773-dev
Build date: 13:43:28 Feb 22 2022 (2873)
ReGamedll
ReGameDLL version: 5.20.0.492-dev
Build date: 15:26:35 Jan 4 2021
Версия Metamod
Metamod v1.21p37  2013/05/30 (5:13)
Список метамодулей
description      stat pend  file              vers      src   load  unlod
[ 1] Reunion RUN - reunion_mm_i386. v0.1.92d ini Start Never
[ 2] VoiceTranscoder RUN - VoiceTranscoder. v2017RC5 ini ANY ANY
[ 3] AMX Mod X RUN - amxmodx_mm_i386. v1.9.0-d ini Start ANY
[ 4] Rechecker RUN - rechecker_mm_i38 v2.7 ini Chlvl ANY
[ 5] ReSRDetector RUN - resrdetector_mm_ v0.1.0 ini Chlvl ANY
[ 6] ReSemiclip RUN - resemiclip_mm_i3 v2.3.9 ini Chlvl ANY
[ 7] WHBlocker RUN - whblocker_mm_i38 v1.5.697 ini Chlvl ANY
[ 8] Hide Cvars RUN - hidecvars_amxx_i v1.0 pl3 ANY ANY
[ 9] ReAimDetector RUN - reaimdetector_am v0.2.2 pl3 ANY Never
[10] IPHub Client RUN - iphubclient_amxx v1.0.1 pl3 ANY Never
[11] FakeMeta RUN - fakemeta_amxx_i3 v1.9.0.5 pl3 ANY ANY
[12] MySQL RUN - mysql_amxx_i386. v1.9.0.5 pl3 ANY ANY
[13] Engine RUN - engine_amxx_i386 v1.9.0.5 pl3 ANY ANY
[14] Ham Sandwich RUN - hamsandwich_amxx v1.9.0.5 pl3 ANY ANY
[15] VTC AMXX API RUN - VtcApi_amxx_i386 v2017 RC pl3 ANY ANY
[16] CStrike RUN - cstrike_amxx_i38 v1.9.0.5 pl3 ANY ANY
[17] CSX RUN - csx_amxx_i386.so v1.9.0.5 pl3 ANY ANY
[18] GeoIP RUN - geoip_amxx_i386. v1.9.0.5 pl3 ANY ANY
[19] ReAPI RUN - reapi_amxx_i386. v5.19.0. pl3 ANY Never
[20] Fun RUN - fun_amxx_i386.so v1.9.0.5 pl3 ANY ANY
20 plugins, 20 running
Список плагинов
[  1] FreshBans               1.4.6b      kanagava          fresh_bans_146-  running  
[ 2] ReAimDetector API 0.2.2 ReHLDS Team reaimdetector.a running
[ 3] Menus Front-End 20.06.06 SKAJIbnEJIb & AM amxmodmenu_rbs. running
[ 4] Player Votes 1.0 neugomon player_votes.am running
[ 5] [190] High Ping Kicker 20.06.06 SKAJIbnEJIb hpk_rbs.amxx running
[ 6] GameCMS_API 5.3.5 zhorzh78 gamecms_api_5.3 running
[ 7] Voice Manager 1.6 Stimul 5sek.amxx running
[ 8] [VTC][183] Ultimate Ga 17.08.28 SKAJIbnEJIb ultimate_gag_vt running
[ 9] [190] Ultimate Gag 21.01.02BE SKAJIbnEJIb ultimate_gag.am running
[ 10] Night Mode 1.2.3 Radius night_mode.amxx running
[ 11] Map Manager: Core 3.1.4 Mistrick map_manager_cor running
[ 12] Map Manager: Scheduler 0.1.9 Mistrick map_manager_sch running
[ 13] Admin Mapmenu 0.5.3 d3m37r4 admin_mapmenu.a running
[ 14] Map Manager: Rtv 0.1.1 Mistrick map_manager_rtv running
[ 15] Map Manager: Nominatio 0.2.0 Mistrick map_manager_nom running
[ 16] Map Manager: BlockList 0.0.4 Mistrick map_manager_blo running
[ 17] Map Manager: Online so 0.0.4 Mistrick map_manager_onl running
[ 18] Map Manager: Effects 0.1.0 Mistrick map_manager_eff running
[ 19] Map Manager: Informer 0.0.5 Mistrick map_manager_inf running
[ 20] Map Manager: Advanced 0.1.0 Mistrick map_manager_adv running
[ 21] GameCMS BonusSystem 1.1 +- DUKKHAZ0R gamecms_bonus.a running
[ 22] CMSGive_RegFlags 1.0 ApXuTekToR CMSGive_RegFlag running
[ 23] [190] Ultimate Models 21.03.23 SKAJIbnEJIb ultimate_models running
[ 24] [190] Map Spawns Edito 20.06.06 SKAJIbnEJIb & iG MapSpawnsEditor running
[ 25] [190] Chat Controller 20.06.06 SKAJIbnEJIb chat_controller running
[ 26] [190] AdminChat RBS 20.06.06 SKAJIbnEJIb adminchat_rbs.a running
[ 27] [182] RestMenu RBS 17.09.14 SKAJIbnEJIb & AM restmenu_rbs.am running
[ 28] [190] CsStats MySQL 20.06.06 SKAJIbnEJIb csstats_mysql.a running
[ 29] [190] StatsX RBS 21.03.23 SKAJIbnEJIb & AM statsx_rbs.amxx running
[ 30] [190] Stats Configurat 20.06.06 SKAJIbnEJIb & AM statscfg_rbs.am running
[ 31] Server Controller 1.2 MakapoH. server_controll stopped
[ 32] New Kick Menu 1.3.2 Radius newkickmenu.amx running
[ 33] [190] Army Ranks Ultim 20.06.06 SKAJIbnEJIb army_ranks_ulti running
[ 34] [190] BonusMenu RBS 20.06.06 SKAJIbnEJIb bonusmenu_rbs.a running
[ 35] [182] BuyMenu RBS 21.03.23 SKAJIbnEJIb buymenu_rbs.amx running
[ 36] [190] C4 Destroyer 21.03.23 SKAJIbnEJIb c4_destroyer.am running
[ 37] [190] Maps Helper 20.06.06 SKAJIbnEJIb maps_helper.amx running
[ 38] [190] Ultimate Informe 21.03.23 SKAJIbnEJIb ultimate_inform running
[ 39] [190] Skill ELO 20.06.06 SKAJIbnEJIb skill_elo.amxx running
[ 40] [190] Chat RBS 20.06.06 SKAJIbnEJIb chat_rbs.amxx running
[ 41] [190] Chat Addons 20.06.06 SKAJIbnEJIb chat_addons.amx running
[ 42] [190] Analizator 20.06.06 SKAJIbnEJIb analizator.amxx running
[ 43] [190] BonusTime RBS 20.08.08 SKAJIbnEJIb bonustime_rbs.a running
[ 44] [190] Snipers RBS 20.06.06 SKAJIbnEJIb snipers_rbs.amx running
[ 45] Revive Players 1.0.0 Emma Jule acrevive_teamma running
[ 46] [ReAPI] Healthnade 0.1.7 F@nt0M + mx?! reapi_healthnad running
[ 47] [ReAPI] TopRoundDamage 1.0.6 Dager* *.* -G- damage_round.am running
[ 48] Color Flash Screen 1.4.3 Radius (Stimul i color_flash_scr running
[ 49] [182] AdminCmd RBS 20.06.06 SKAJIbnEJIb & AM admincmd_rbs.am running
[ 50] [190] Blind RBS 20.06.06 SKAJIbnEJIb blind_rbs.amxx running
[ 51] [182] Ultimate Weapons 21.03.23 SKAJIbnEJIb ultimate_weapon running
[ 52] [182] VIP RBS 20.07.20 SKAJIbnEJIb vip_rbs.amxx running
[ 53] [182] Cvar on Map 18.03.24 SKAJIbnEJIb cvar_on_map.amx running
[ 54] Random Weapons WarmUP 1.6 neugomon random_weapons_ running
[ 55] [190] Damager RBS 20.06.06 SKAJIbnEJIb damager_rbs.amx running
[ 56] [190] Screen Player 20.06.06 SKAJIbnEJIb screen_player.a running
[ 57] C4 Timer on roundtime 0.3.3a neygomon c4timer.amxx running
[ 58] [190] CmdMenu RBS 20.06.06 SKAJIbnEJIb & AM cmdmenu_rbs.amx running
[ 59] Pause Plugins 1.8.2 AMXX Dev Team pausecfg.amxx running
[ 60] Reset Score 1.0 M1 TEAM ResetScore.amxx running
[ 61] GameName Changer 1.0 neugomon GameNameChanger running
[ 62] [ReAPI] Parachute 3.0 Leo_[BH] parachute.amxx running
[ 63] [190] ESP RBS 20.06.06 SKAJIbnEJIb & Ko esp_rbs.amxx running
[ 64] [190] WallHack Viewer 20.06.06 SKAJIbnEJIb wallhack_viewer running
[ 65] Auto RR 0.1 Sokrat auto_rest.amxx running
[ 66] [190] Ad From Server 20.06.06 SKAJIbnEJIb ad_from_server. running
[ 67] [190] DemoRecorder RBS 20.06.06 SKAJIbnEJIb demorecorder_rb running
[ 68] Auto Team Balance Adva 1.5.1 Radius auto_team_balan running
[ 69] [190] AfkKicker RBS 20.08.02 SKAJIbnEJIb afkkicker_rbs.a running
[ 70] [190] Anti Kill Hostag 20.06.06 SKAJIbnEJIb & .F anti_kill_hosta stopped
[ 71] [190] Bets RBS 20.06.06 SKAJIbnEJIb bets_rbs.amxx running
[ 72] Money 1.1 M1 TEAM money.amxx running
[ 73] Weapon Icon 1.0 M1 TEAM weapon_icon.amx running
[ 74] HS Sound 1.0 M1 TEAM headshot.amxx running
[ 75] Kills Counter CS-RAIN 1.0 Leo_[BH] kills_counter.a running
[ 76] Nice Killer 1.6 Got Milk? / HoHo nice_killer.amx running
[ 77] TOP VIP 1.0a Leo_[BH] top_vip.amxx running
[ 78] Block grande info 1.0 neygomon BlockGrenadeInf running
[ 79] Fake Ping 1.1 MeRcyLeZZ/gyxoBk FakePing.amxx running
[ 80] Weapon Rest On Map 1.0 MakapoH. weapon_rest_on_ stopped
[ 81] [ReAPI] KiLL Assist poka_4to_b PRoSToTeM@ Kill_assist_rea running
[ 82] [190] Ultimate Flags 20.06.06 SKAJIbnEJIb ultimate_flags. running
[ 83] Replace Info Message 2.3 M1 TEAM replace_info_ms running
[ 84] [190] SlayLosers RBS 20.06.06 SKAJIbnEJIb & d3 slaylosers_rbs. running
[ 85] [ReAPI] No Team Flash 1.0 ReHLDS Team noteamflash.amx running
[ 86] Top Bomber 0.1.1 Albertio top_bomber.amxx running
[ 87] Walls Creator 1.1 d3m37r4 walls_creator.a running
[ 88] Invisible Spectator 1.0 ReHLDS Team invisible_spect running
[ 89] [ReAPI] Silly C4 2.0 F@ntoM & Cheap_S reapi_sillyc4.a running
[ 90] NameChangeTime 0.0.1 Vaqtincha block_change_ni running
[ 91] Stop the Bastards 1.7.0 F@nt0M stop_the_bastar running
[ 92] [190] Block Reconnect 20.06.06 ShaTalKiN Block_Reconnect running
[ 93] Weapon Kill No Suicide 1.2 Slove. & AcE no_suicide_weap running
[ 94] C4 Taker 1.05 joaquimandrade a c4_taker.amxx running
[ 95] [190] Bind RBS 20.06.06 SKAJIbnEJIb bind_rbs.amxx running
[ 96] recoil_manager 1.0.0 fl0wer recoil_manager. running
[ 97] unknown unknown unknown spam_block_1.am running
[ 98] unknown unknown unknown spam_block_2.am running
[ 99] Mode 2x2 2.5re s1lent mode.amxx running
[100] Defuser Icon New Color 1.0.1 Leo_[BH] defuser_color.a running
[101] BuyZone Icon New Color 1.0.1 Leo_[BH] bz_color.amxx running
[102] C4 Icon New Color 1.0.1 Leo_[BH] c4_color.amxx running
102 plugins, 99 running
Автор плагина
hellmonja & HamletEagle
Версия плагина
1.10
Исходный код
//////////////////////////////////////////////
// C4 TAKER (For lack of a better name) //
// ======================================== //
// //
// Enables the ADMIN to take the C4 from a //
// teammate by aiming at him/her and //
// pressing the USE key. (default 'E') //
// //
// SPECIAL THANKS To: joaquimandrade, //
// ConnorMcLeod, wickked, JusTGo, VEN //
// & HamletEagle //
//////////////////////////////////////////////

#include <amxmodx>
#include <amxmisc>
#include <fakemeta_util>
#include <hamsandwich>

new const plugin[] = "C4 Taker"
new const author[] = "hellmonja & HamletEagle"
new const version[] = "1.10"

new const WpnPickUpSnd[] = "items/gunpickup2.wav"
new num[33], admin_only, take_from_humans, max_dist, hud_limiter;

public plugin_init()
{
register_plugin(plugin, version, author);
register_logevent("Bomb_Carrier_Spawned", 3, "2=Spawned_With_The_Bomb");
register_event("StatusValue", "EventStatusValue_PlayerID", "b", "1=2", "2>0");
register_event("StatusValue", "Event_StatusValue_Hide", "be", "1=1", "2=0");
RegisterHam(Ham_ObjectCaps, "player", "Use_Button");

//CVARS
admin_only = register_cvar("c4t_admin_only", "1"); //by default, only the ADMIN can take C4 from teammates. Set to '0' so everyone can take C4 from their teammates
take_from_humans = register_cvar("c4t_take_from_humans", "0"); //set to '1' to enable to take C4 from human players
max_dist = register_cvar("c4t_max_distance", "120"); //max distance for the take
hud_limiter = register_cvar("c4t_hud", "5"); //number of instances the HUD Message appears. Set to '0' to disable. Can be set to '9999...'.
}

public plugin_precache()
engfunc(EngFunc_PrecacheSound, WpnPickUpSnd)

public Bomb_Carrier_Spawned()
{
new carrier = get_loguser_index();
if(is_user_admin(carrier))
return

if(get_pcvar_num(admin_only) == 2)
{
new i, players[32], pnum;
get_players(players, pnum, "ae", "TERRORIST");

do
{
i = random_num(0, pnum - 1);
}
while(!is_user_admin(players[i]));

fm_transfer_user_gun(carrier, players[i], CSW_C4);
}
}

public EventStatusValue_PlayerID(id) //Event that triggers when you aim at a player
{
if(!is_user_alive(id))
return

new idAim, body, dist = get_pcvar_num(max_dist), limiter = get_pcvar_num(hud_limiter);
get_user_aiming(id, idAim, body, dist);

if(!is_user_alive(idAim))
return

if(!is_user_admin(id) && get_pcvar_num(admin_only) >= 1)
return

if(get_pcvar_num(take_from_humans) == 0 && !is_user_bot(idAim))
return //HUD Message will refuse to appear if player is not ADMIN and 'admin_only' is enabled

if(get_user_team(id) == get_user_team(idAim) && user_has_weapon(idAim, CSW_C4) && num[id] <= limiter)
{
set_hudmessage(255, 255, 255, -1.0, 0.40, 0, 3.0, 2.0, 0.5, 1.0, 4); // Setting up the HUD Message
show_hudmessage(id, "(E)TAKE BOMB"); //Actual message itself
num[id]++; // The limiter. If it gets to a certain amount the HUD Messag is disabled.
}
}

public Event_StatusValue_Hide(id) //Turns off HUD Message when you've stopped looking at bomb carrier
{
set_hudmessage(0, 0, 0, -1.0, 0.40, 0, 3.0, 0.1, 0.1, 0.1, 4);
show_hudmessage(id, " ");
}

Take_C4(id) //Function for taking the C4
{
new idAim, body, dist = get_pcvar_num(max_dist);
get_user_aiming(id, idAim, body, dist);

if(!is_user_alive(idAim))
return

if(!is_user_admin(id) && get_pcvar_num(admin_only) >= 1)
return //Take_C4 will refuse to work if player is not ADMIN and 'admin_only' is enabled

if(get_pcvar_num(take_from_humans) == 0 && !is_user_bot(idAim))
return //If player you're aiming at is human but 'take_from_humans' is set to 0, you cannot take the C4

if((get_user_team(id) == get_user_team(idAim)) && user_has_weapon(idAim, CSW_C4))
{
fm_transfer_user_gun(idAim, id, CSW_C4); //Actual code that takes the C4.
client_cmd(id,"spk %s", WpnPickUpSnd);
new playername[32];
get_user_name(id, playername, charsmax(playername));
set_hudmessage(255, 255, 255, -1.0, 0.40, 0, 3.0, 2.0, 0.5, 1.0, 4);
show_hudmessage(idAim, "%s HAS TAKEN THE BOMB.", playername); //Notifying player that a teammate has taken the C4 from him/her
}
}

public Use_Button(id) //Function when you press 'E' or the USE key
{
if(is_user_alive(id))
if(pev(id,pev_button) & IN_USE) //Checks if you pressed the USE key
Take_C4(id); //Calls function to take C4
}

public client_disconnect(id)
num[id] = 0; //Resets 'num' to 0 when a player disconnects

stock get_loguser_index()
{
new loguser[80], name[32];
read_logargv(0, loguser, charsmax(loguser));
parse_loguser(loguser, name, charsmax(name));

return get_user_index(name);
}
Хлопцы, помогите,в чём может быть проблема?
 
В этой теме было размещено решение! Перейти к решению.
Сообщения
16
Реакции
0
DEVV,

L 04/29/2022 - 23:32:01: Invalid player id 0
L 04/29/2022 - 23:32:01: [AMXX] Displaying debug trace (plugin "c4_taker.amxx", version "1.05")
L 04/29/2022 - 23:32:01: [AMXX] Run time error 10: native error (native "user_has_weapon")
L 04/29/2022 - 23:32:01: [AMXX] [0] c4_taker.sma::EventStatusValue_PlayerID (line 69)
 
Сообщения
3,593
Реакции
1,576
Помог
141 раз(а)

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

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