Run time error 4: index out of bounds

Статус
В этой теме нельзя размещать новые ответы.
Сообщения
23
Реакции
3
Ошибка
L 01/25/2021 - 07:58:44: [AMXX] Run time error 4: index out of bounds
L 01/25/2021 - 07:58:44: [AMXX] [0] checkpoints.sma::fw_TouchCheckpoint (line 525)
ОС
Linux
Amx Mod X
AMX Mod X 1.10.0.5406
Билд
ReHLDS version: 3.8.0.703-dev
ReGamedll
ReGameDLL version: 5.20.0.492-dev
Версия Metamod
Metamod-r v1.3.0.128, API (5:13)
Список метамодулей
[ 1] Reunion          RUN   -    reunion_mm_i386.so          v0.1.0.137       ini  Start Never
[ 2] ReAuthCheck RUN - reauthcheck_mm_i386.so v0.1.6 ini Start Never
[ 3] Revoice RUN - revoice_mm_i386.so v0.1.0.34 ini Start Never
[ 4] SafeNameAndChat RUN - safenameandchat.so v1.1 ini ANY ANY
[ 5] AMX Mod X RUN - amxmodx_mm_i386.so v1.10.0.5406 ini Start ANY
[ 6] ReSemiclip RUN - resemiclip_mm_i386.so v2.3.9 ini Chlvl ANY
[ 7] CSX RUN - csx_amxx_i386.so v1.10.0.5406 pl5 ANY ANY
[ 8] FakeMeta RUN - fakemeta_amxx_i386.so v1.10.0.5406 pl5 ANY ANY
[ 9] MySQL RUN - mysql_amxx_i386.so v1.10.0.5406 pl5 ANY ANY
[10] CStrike RUN - cstrike_amxx_i386.so v1.10.0.5406 pl5 ANY ANY
[11] Fun RUN - fun_amxx_i386.so v1.10.0.5406 pl5 ANY ANY
[12] Ham Sandwich RUN - hamsandwich_amxx_i386.so v1.10.0.5406 pl5 ANY ANY
[13] ReAPI RUN - reapi_amxx_i386.so v5.19.0.210-dev pl5 ANY Never
[14] Engine RUN - engine_amxx_i386.so v1.10.0.5406 pl5 ANY ANY
[15] ReAimDetector RUN - reaimdetector_amxx_i386.so v0.2.2 pl5 ANY Never
Список плагинов
-
Автор плагина
Psycrow
Версия плагина
0.9
Исходный код
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fakemeta_util>
#include <hamsandwich>
#include <color_print>
#include <reapi>
#include <acp>


#define PLUGIN "Checkpoints"
#define VERSION "0.9"
#define AUTHOR "Psycrow"

#define MODEL_CHECKPOINT "models/checkpoints/checkpoints.mdl"
#define SOUND_CHECKPOINT "checkpoints/checkpoint.wav"

#define CLASSNAME_CHECKPOINT "checkpoint"

#define MAX_CHECKPOINTS 32
#define TASK_RETURN_PLAYER 100
#define TASK_SECONDS 40401

#define RETURN_PLAYER_TRY_TIMES 10

#define CHECKPOINT_RADIUS 70.0

//#define DHUD_POSITION random_num(0, 255), random_num(0, 255), random_num(0, 255), -1.0, 0.78, 1, 1.0, 1.0, 0.5, 1.0


#define CHAT_PREFIX "Чекпоинты"
#define ACCESS_FLAG ADMIN_RCON
#define COLOR_EFFECT // color transition effect in checkpoints
//#define DUELS_ENABLED // for https://dev-cs.ru/resources/136/



enum _:CvarList
{
CVAR_CHECKPOINT_REWARD, // common reward, 0 - none
CVAR_CHECKPOINT_KOEF, // common reward multiplier
CVAR_CHECKPOINT_FINISH_REWARD[3], // rewards for finish, 0 - none
CVAR_CHECKPOINT_TELEPORT, // teleport after spawn
CVAR_CHECKPOINT_LIGHT, // 0 - none, 1 - light
CVAR_CHECKPOINT_GLOW, // glow size
CVAR_CHECKPOINT_SKIP_LIMIT, // the number of checkpoints that can't be skipped
CVAR_CHECKPOINT_MAXMONEY
}

new
g_iCheckpointsNum,
g_iCheckpoint[MAX_CHECKPOINTS],
g_iWasChanged,
HamHook: g_fwTouch,
g_iRoundEnd,
g_iPlrCompleted[MAX_PLAYERS + 1],
g_iFinishedNum,
g_iCheckpointKey,
g_iDuelStart,
g_pCvars[CvarList]

new g_iSecond[MAX_PLAYERS + 1];

public plugin_precache()
{
precache_model(MODEL_CHECKPOINT)
precache_sound(SOUND_CHECKPOINT)
}

public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)

register_menu("Checkpoint Menu", MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_0,
"handler_checkpoint_menu")

register_concmd("say /checkpoint", "show_checkpoint_menu", ACCESS_FLAG, "-Open Checkpoint Spawn Menu")
register_concmd("checkpointsmenu", "show_checkpoint_menu", ACCESS_FLAG, "-Open Checkpoint Spawn Menu")

register_dictionary("checkpoints.txt")

g_pCvars[CVAR_CHECKPOINT_REWARD] = register_cvar("cv_checkpoint_reward", "300")
g_pCvars[CVAR_CHECKPOINT_KOEF] = register_cvar("cv_checkpoint_money_koef", "1")
g_pCvars[CVAR_CHECKPOINT_FINISH_REWARD][0] = register_cvar("cv_checkpoint_money_last_first", "5000")
g_pCvars[CVAR_CHECKPOINT_FINISH_REWARD][1] = register_cvar("cv_checkpoint_money_last_second", "3000")
g_pCvars[CVAR_CHECKPOINT_FINISH_REWARD][2] = register_cvar("cv_checkpoint_money_last_third", "1500")
g_pCvars[CVAR_CHECKPOINT_TELEPORT] = register_cvar("cv_checkpoint_teleport", "0")
g_pCvars[CVAR_CHECKPOINT_LIGHT] = register_cvar("cv_checkpoint_light_effect", "1")
g_pCvars[CVAR_CHECKPOINT_GLOW] = register_cvar("cv_checkpoint_glow_effect", "10.0")
g_pCvars[CVAR_CHECKPOINT_SKIP_LIMIT] = register_cvar("cv_checkpoint_skip_limit", "0")
g_pCvars[CVAR_CHECKPOINT_MAXMONEY] = register_cvar("cv_checkpoint_money_max", "999999")
register_clcmd("gostartduelstreettmruchecking", "duel_check");
register_event("HLTV", "startround", "a", "1=0", "2=0")

g_iCheckpointKey = engfunc(EngFunc_AllocString, CLASSNAME_CHECKPOINT)

load_checkpoints()
}

/*** Checkpoints functions ***/

load_checkpoints()
{
new szMap[48]
get_mapname(szMap, 47)
add(szMap, 47, ".ini")

new szDirCfg[128], iDir, szFile[128]
get_configsdir(szDirCfg, 127)
add(szDirCfg, 127, "/checkpoints")

iDir = open_dir(szDirCfg, szFile, 126)

if (!iDir)
{
server_print("[%s] Checkpoints were not loaded", PLUGIN)
return
}

while (next_file(iDir, szFile, 126))
{
if (szFile[0] == '.')
continue

if (equali(szMap, szFile))
{
format(szFile, 126, "%s/%s", szDirCfg, szFile)
load_spawn(szFile)
break
}
}

close_dir(iDir)
}

load_spawn(const szFile[])
{
new iFile = fopen(szFile, "rt")

if (!iFile)
{
server_print("[%s] Unable to open %s.", PLUGIN, szFile)
return
}

new szLineData[512], szOrigin[3][24], Float: fOrigin[3], szAngle[24], Float: fAngle

while (iFile && !feof(iFile))
{
fgets(iFile, szLineData, 511)

if (!szLineData[0] || szLineData[0] == ';')
continue

parse(szLineData, szOrigin[0], 23, szOrigin[1], 23, szOrigin[2], 23, szAngle, 23)

fOrigin[0] = str_to_float(szOrigin[0])
fOrigin[1] = str_to_float(szOrigin[1])
fOrigin[2] = str_to_float(szOrigin[2])
fAngle = str_to_float(szAngle)

create_checkpoint(fOrigin, fAngle)
}

fclose(iFile)

switch (g_iCheckpointsNum)
{
case 0: server_print("[%s] Checkpoints were not loaded", PLUGIN)
case 1: server_print("[%s] Loaded one checkpoint", PLUGIN)
default: server_print("[%s] Loaded %d checkpoints", PLUGIN, g_iCheckpointsNum)
}

set_finish_bodypart()
}

create_checkpoint(const Float: fOrigin[3], const Float: fAngle)
{
static infotarget, iEventsRegistration
if (!infotarget)
infotarget = engfunc(EngFunc_AllocString, "info_target")

if (g_iCheckpointsNum == MAX_CHECKPOINTS)
return 1

new iEnt = engfunc(EngFunc_CreateNamedEntity, infotarget)
if (pev_valid(iEnt) != 2)
return 1

engfunc(EngFunc_SetOrigin, iEnt, fOrigin)
engfunc(EngFunc_SetModel, iEnt, MODEL_CHECKPOINT)
engfunc(EngFunc_SetSize, iEnt, Float: {-CHECKPOINT_RADIUS, -CHECKPOINT_RADIUS, -CHECKPOINT_RADIUS},
Float: {CHECKPOINT_RADIUS, CHECKPOINT_RADIUS, CHECKPOINT_RADIUS})

new Float: fAngles[3]
fAngles[1] = fAngle
set_pev(iEnt, pev_angles, fAngles)

set_pev(iEnt, pev_solid, SOLID_TRIGGER)
set_pev(iEnt, pev_movetype, MOVETYPE_NOCLIP)
set_pev(iEnt, pev_classname, CLASSNAME_CHECKPOINT)
set_pev(iEnt, pev_impulse, g_iCheckpointKey)

set_pev(iEnt, pev_framerate, 1.0)
set_pev(iEnt, pev_colormap, random(256))

#if defined COLOR_EFFECT
set_pev(iEnt, pev_nextthink, get_gametime() + 0.05)
#endif

new Float: fGlow = get_pcvar_float(g_pCvars[CVAR_CHECKPOINT_GLOW])
if (fGlow > 0.0)
{
new Float: fColors[3]
fColors[0] = random(256) + 0.0
fColors[1] = random(256) + 0.0
fColors[2] = random(256) + 0.0

set_pev(iEnt, pev_renderfx, kRenderFxGlowShell)
set_pev(iEnt, pev_renderamt, fGlow)
set_pev(iEnt, pev_rendercolor, fColors)
}

if (get_pcvar_num(g_pCvars[CVAR_CHECKPOINT_LIGHT]))
set_pev(iEnt, pev_effects, EF_DIMLIGHT)

g_iCheckpoint[g_iCheckpointsNum++] = iEnt

if (!iEventsRegistration)
{
register_event("HLTV", "fw_RoundStart", "a", "1=0", "2=0")
register_event("SendAudio", "fw_RoundEnd", "a", "2&%!MRAD_rounddraw")
register_event("SendAudio", "fw_RoundEnd", "a", "2&%!MRAD_terwin")
register_event("SendAudio", "fw_RoundEnd", "a", "2&%!MRAD_ctwin")

g_fwTouch = RegisterHamFromEntity(Ham_Touch, iEnt, "fw_TouchCheckpoint")

#if defined COLOR_EFFECT
RegisterHamFromEntity(Ham_Think, iEnt, "fw_ThinkCheckpoint")
#endif

if (g_iWasChanged)
DisableHamForward(g_fwTouch)

RegisterHam(Ham_Spawn, "player", "fw_PlayerSpawn", 1)

fw_RoundStart()

iEventsRegistration = 1


}

return 0
}

set_finish_bodypart()
{
if (!g_iCheckpointsNum)
return

for (new i = 0; i < g_iCheckpointsNum - 1; i++)
{
set_pev(g_iCheckpoint[i], pev_body, 0)
set_pev(g_iCheckpoint[i], pev_skin, 0)
}

set_pev(g_iCheckpoint[g_iCheckpointsNum - 1], pev_body, 1)
set_pev(g_iCheckpoint[g_iCheckpointsNum - 1], pev_skin, 1)
}

save_checkpoints()
{
new szDirCfg[128], szFile[128]
get_configsdir(szDirCfg, 127)
add(szDirCfg, 127, "/checkpoints")

get_mapname(szFile, 127)
format(szFile, 127, "%s/%s.ini", szDirCfg, szFile)

if (!dir_exists(szDirCfg))
mkdir(szDirCfg)

delete_file(szFile)

if (!g_iCheckpointsNum)
return 0

for (new i = 0; i < g_iCheckpointsNum; i++)
{
new szText[128], Float: fOrigin[3], Float: fAngles[3]
pev(g_iCheckpoint[i], pev_origin, fOrigin)
pev(g_iCheckpoint[i], pev_angles, fAngles)
format(szText, 127, "^"%f^" ^"%f^" ^"%f^" ^"%f^"",
fOrigin[0], fOrigin[1], fOrigin[2], fAngles[2])
write_file(szFile, szText, -1)
}

return 0
}

/*** Menu handlers ***/

public show_checkpoint_menu(id, level, cid)
{
if (cmd_access(id, level, cid, 1))
display_checkpoint_menu(id)

return PLUGIN_HANDLED
}

display_checkpoint_menu(const id)
{
new szMenu[512], iLen, iKeys = MENU_KEY_0

iLen = formatex(szMenu, 511, "\r%L \y[\w%i/%i\y]^n^n",
LANG_PLAYER, "MENU_HEADER", g_iCheckpointsNum, MAX_CHECKPOINTS)

if (g_iCheckpointsNum != MAX_CHECKPOINTS)
{
iLen += formatex(szMenu[iLen], 511 - iLen, "\r1. \w%L^n", id, "MENU_SPAWN")
iKeys |= MENU_KEY_1
}

if (g_iCheckpointsNum)
{
iLen += formatex(szMenu[iLen], 511 - iLen, "\r2. \w%L^n", id, "MENU_REMOVE")
iLen += formatex(szMenu[iLen], 511 - iLen, "\r3. \w%L^n", id, "MENU_REMOVE_ALL")
iKeys |= MENU_KEY_2 | MENU_KEY_3
}

if (g_iWasChanged)
{
iLen += formatex(szMenu[iLen], 511 - iLen, "^n\r4. \w%L^n", id, "MENU_SAVE")
iKeys |= MENU_KEY_4
}

iLen += formatex(szMenu[iLen], 511 - iLen, "^n\r0. \w%L", id, "MENU_EXIT")

show_menu(id, iKeys, szMenu, -1, "Checkpoint Menu")
}

public handler_checkpoint_menu(id, key)
{
if (key == 9)
return PLUGIN_CONTINUE

switch (key + 1)
{
case 1:
{
new Float: fOrigin[3], Float: fAngles[3]
fm_get_aim_origin(id, fOrigin)
fOrigin[2] += CHECKPOINT_RADIUS
pev(id, pev_v_angle, fAngles)

if (!create_checkpoint(fOrigin, fAngles[1]))
{
set_finish_bodypart()
g_iWasChanged = 1
DisableHamForward(g_fwTouch)

if (check_stuck(fOrigin, id))
color_print(id, "!y[!g%s!y]!y %L", CHAT_PREFIX, LANG_PLAYER, "CP_CAN_STUCK")

}
}
case 2:
{
engfunc(EngFunc_RemoveEntity, g_iCheckpoint[--g_iCheckpointsNum])
if (g_iCheckpointsNum)
set_finish_bodypart()

g_iWasChanged = 1
DisableHamForward(g_fwTouch)
}
case 3:
{
for (new i = 0; i < g_iCheckpointsNum; i++)
engfunc(EngFunc_RemoveEntity, g_iCheckpoint[i])

g_iCheckpointsNum = 0
g_iWasChanged = 1
DisableHamForward(g_fwTouch)
}
case 4:
{
if (!save_checkpoints())
{
color_print(id, "!y[!g%s!y]!y %L", CHAT_PREFIX, LANG_PLAYER, "CP_SAVED")
g_iWasChanged = 0

if (g_iCheckpointsNum)
EnableHamForward(g_fwTouch)

arrayset(g_iPlrCompleted, -1, 33)
g_iFinishedNum = 0
}
}
}

display_checkpoint_menu(id)
return PLUGIN_CONTINUE
}

/*** Global events ***/
public startround()
{
g_iDuelStart = 0

for (new i = 1; i <= MaxClients; i++)
{
if (!is_user_connected(i))
continue;

g_iSecond[i] = 0;
remove_task(i + TASK_SECONDS);
}
}


public fw_RoundStart()
{
g_iRoundEnd = 0

arrayset(g_iPlrCompleted, -1, 33)
g_iFinishedNum = 0
}

public fw_RoundEnd()
{
g_iRoundEnd = 1
}

/*** Player events ***/

public client_putinserver(id)
{
g_iPlrCompleted[id] = -1
}

public client_disconnected(id)
{
g_iSecond[id] = 0;
remove_task(id + TASK_SECONDS);
g_iPlrCompleted[id] = -1;
}

public fw_PlayerSpawn(const iPlayer)
{
remove_task(iPlayer + TASK_RETURN_PLAYER)
if (get_pcvar_num(g_pCvars[CVAR_CHECKPOINT_TELEPORT]) && g_iPlrCompleted[iPlayer] > -1)
{
if (return_player(iPlayer, g_iPlrCompleted[iPlayer]))
set_task(0.5, "task_teleport_player", iPlayer + TASK_RETURN_PLAYER,
.flags = "a", .repeat = RETURN_PLAYER_TRY_TIMES)
}
if (get_member(iPlayer, m_iTeam) == TEAM_CT)
set_task(1.0, "Task_Seconds", iPlayer + TASK_SECONDS, _, _, "b");
}
public Task_Seconds(id)
{
id -= TASK_SECONDS;

if (!is_user_connected(id) || !is_user_alive(id) || get_member(id, m_iTeam) != TEAM_CT)
{
remove_task(id + TASK_SECONDS);
return;
}
g_iSecond[id]++;
}

public task_return_player(id)
{
new iPlayer = id - TASK_RETURN_PLAYER

if (g_iPlrCompleted[iPlayer] >= g_iCheckpointsNum)
g_iPlrCompleted[iPlayer] = -1

if (!is_user_alive(iPlayer))
remove_task(id)

if (!return_player(iPlayer, g_iPlrCompleted[iPlayer]))
{
print_skip_ad(iPlayer)
remove_task(id)
}
}

public task_teleport_player(id)
{
new iPlayer = id - TASK_RETURN_PLAYER

if (!is_user_alive(iPlayer))
remove_task(id)

if (g_iPlrCompleted[iPlayer] >= g_iCheckpointsNum || !return_player(iPlayer, g_iPlrCompleted[iPlayer]))
{
remove_task(id)
return
}
}

/*** Checkpoint's actions ***/

public fw_TouchCheckpoint(const iEnt, const iPlayer)
{
static i, iPos

if (g_iRoundEnd || pev(iEnt, pev_impulse) != g_iCheckpointKey)
return HAM_IGNORED

if (g_iDuelStart)
return HAM_IGNORED

for (i = 0; i < g_iCheckpointsNum; i++)
{
if (g_iCheckpoint[i] == iEnt)
{
iPos = i
break
}
}

if (g_iPlrCompleted[iPlayer] >= iPos || !is_user_alive(iPlayer))
return HAM_IGNORED

new iSkipLimit = get_pcvar_num(g_pCvars[CVAR_CHECKPOINT_SKIP_LIMIT])
if (iSkipLimit && iPos - g_iPlrCompleted[iPlayer] > iSkipLimit)
{
if (!return_player(iPlayer, g_iPlrCompleted[iPlayer]))
print_skip_ad(iPlayer)
else if (!task_exists(iPlayer + TASK_RETURN_PLAYER))
set_task(0.5, "task_return_player", iPlayer + TASK_RETURN_PLAYER,
.flags = "a", .repeat = RETURN_PLAYER_TRY_TIMES)

return HAM_IGNORED
}

client_cmd(iPlayer, "spk %s", SOUND_CHECKPOINT)

new iReward

//set_dhudmessage(DHUD_POSITION)

if (iPos == g_iCheckpointsNum - 1)
{
new endings[30]
get_ending(g_iSecond[iPlayer], "секунду", "секунды", "секунд", endings, charsmax(endings))
set_dhudmessage(random_num(0, 255), random_num(0, 255), random_num(0, 255), -1.0, 0.78, 1, 1.0, 2.5, 0.5, 1.0)
show_dhudmessage(iPlayer, "%L", LANG_PLAYER, "CP_FINISH", ++g_iFinishedNum, g_iSecond[iPlayer], endings);

new szPlayerName[24]
get_user_name(iPlayer, szPlayerName, 23)

if (szPlayerName[22] != 0)
szPlayerName[22] = szPlayerName[21] = szPlayerName[20] = '.'

color_print(0, "!y[!g%s!y]!y %L", CHAT_PREFIX, LANG_PLAYER, "FINISH_AD",prefix(iPlayer), szPlayerName, g_iFinishedNum, g_iSecond[iPlayer], endings);

if (g_iFinishedNum > 3)
{
iReward = get_pcvar_num(g_pCvars[CVAR_CHECKPOINT_REWARD])
if (get_pcvar_num(g_pCvars[CVAR_CHECKPOINT_KOEF]))
iReward *= iPos + 1
}
else
iReward = get_pcvar_num(g_pCvars[CVAR_CHECKPOINT_FINISH_REWARD][g_iFinishedNum - 1])
}
else
{

iReward = get_pcvar_num(g_pCvars[CVAR_CHECKPOINT_REWARD])
if (get_pcvar_num(g_pCvars[CVAR_CHECKPOINT_KOEF]))
iReward *= iPos + 1
set_dhudmessage(random_num(0, 255), random_num(0, 255), random_num(0, 255), -1.0, 0.78, 1, 1.0, 1.0, 0.5, 1.0)
show_dhudmessage(iPlayer, "%L", LANG_PLAYER, "CP_COMPLETE", iPos + 1, iReward);
}

if (iReward)
{
new iCurMoney = cs_get_user_money(iPlayer),
iMaxMoney = get_pcvar_num(g_pCvars[CVAR_CHECKPOINT_MAXMONEY])

if (iCurMoney + iReward > iMaxMoney)
iReward = iMaxMoney - iCurMoney
cs_set_user_money(iPlayer, iCurMoney + iReward)
if ((iPos == g_iCheckpointsNum - 1) && !(g_iFinishedNum > 3))
{
set_dhudmessage(random_num(0, 255), random_num(0, 255), random_num(0, 255), -1.0, 0.81, 1, 1.0, 2.5, 0.5, 1.0)
show_dhudmessage(iPlayer, "%L", LANG_PLAYER, "BONUS_F", iReward);
}
//color_print(iPlayer, "!y[!g%s!y]!y %L", CHAT_PREFIX, LANG_PLAYER, "CP_REWARD", iReward)
}

g_iPlrCompleted[iPlayer] = iPos

return HAM_IGNORED
}

public fw_ThinkCheckpoint(const iEnt)
{
static iTopColor

if (pev(iEnt, pev_impulse) != g_iCheckpointKey)
return HAM_IGNORED

iTopColor = pev(iEnt, pev_colormap)
iTopColor = iTopColor == 255 ? 0 : iTopColor + 1

set_pev(iEnt, pev_colormap, iTopColor)
set_pev(iEnt, pev_nextthink, get_gametime() + 0.05)

return HAM_IGNORED
}

/*** Other stuff ***/

return_player(const iPlayer, const iPos)
{
new Float: fOrigin[3], Float: fAngles[3]

if (iPos == -1)
{
new iSpawnEnts[32], iSpawnNum, iSpawn = -1

while ((iSpawn = engfunc(EngFunc_FindEntityByString, iSpawn, "classname", "info_player_start")))
iSpawnEnts[iSpawnNum++] = iSpawn

pev(iSpawnEnts[random(iSpawnNum)], pev_origin, fOrigin)
}
else
{
pev(g_iCheckpoint[iPos], pev_origin, fOrigin)
pev(g_iCheckpoint[iPos], pev_angles, fAngles)
}

if (check_stuck(fOrigin, iPlayer))
return 1

engfunc(EngFunc_SetOrigin, iPlayer, fOrigin)
set_pev(iPlayer, pev_angles, fAngles)
set_pev(iPlayer, pev_fixangle, 1)
set_pev(iPlayer, pev_velocity, Float: {0.0, 0.0, 0.0})

return 0
}

print_skip_ad(const iPlayer)
{
new szPlayerName[18]
get_user_name(iPlayer, szPlayerName, 17)

if (szPlayerName[16] != 0)
szPlayerName[16] = szPlayerName[15] = szPlayerName[14] = '.'

color_print(0, "!y[!g%s!y]!y %L", CHAT_PREFIX, LANG_PLAYER, "CP_RETURN", szPlayerName)
}

bool: check_stuck(const Float: fOrigin[3], const iPlayer)
{
static tr
engfunc(EngFunc_TraceHull, fOrigin, fOrigin, 0, HULL_HUMAN, iPlayer, tr)

if (!get_tr2(tr, TR_StartSolid) || !get_tr2(tr, TR_AllSolid))
return false
return true
}

/*** Duel forwards ***/


public duel_check()
{
g_iDuelStart = 1
for(new i = 1; i <= get_maxplayers(); i++)
{
if(is_user_alive(i))
{
remove_task(i + TASK_RETURN_PLAYER)
}
}
}
stock get_ending ( num, const a[], const b[], const c[], output[], output_len )
{
new iNum100 = num%100, iNum10 = num%10
if ( iNum100 >= 5 && iNum100 <= 20 || iNum10 == 0 || iNum10 >= 5 && iNum10 <= 9 ) format ( output, output_len, "%s", c )
else if ( iNum10 == 1 ) format ( output, output_len, "%s", a )
else if ( iNum10 >= 2 && iNum10 <= 4 ) format ( output, output_len, "%s", b )
}
Доброго времени суток, флудит в лог ошибкой, проблема именно в строке
Код:
g_iPlrCompleted[iPlayer] >= iPos
но никак не получается исправить, подскажите пожалуйста, на что обратить внимание.
 
В этой теме было размещено решение! Перейти к решению.

RockTheStreet

Саппорт года
Сообщения
1,743
Реакции
344
Помог
40 раз(а)
Обратите внимание, если вы хотите заключить сделку с этим пользователем, он заблокирован
Собственно, откуда версия 0.9? Что на гит'е у автора, что на сайте next21, что на нашем форуме, везде версия 0.8
 

RockTheStreet

Саппорт года
Сообщения
1,743
Реакции
344
Помог
40 раз(а)
Обратите внимание, если вы хотите заключить сделку с этим пользователем, он заблокирован
DanyaBokov, С версией от оригинального автора проблемы были? Нет? Ну тогда её и ставьте.
А так, там проверочка потерялась.
 
Сообщения
23
Реакции
3
RockTheStreet, то, что потерялась проверка я понял, только никак не могу найти какая, подскажите пожалуйста :scratch_one-s_head:
 

RockTheStreet

Саппорт года
Сообщения
1,743
Реакции
344
Помог
40 раз(а)
Обратите внимание, если вы хотите заключить сделку с этим пользователем, он заблокирован
DanyaBokov, Раз уж сам начал искать, то просто предложу способ быстрого поиска.
diffchecker.com
 

RockTheStreet

Саппорт года
Сообщения
1,743
Реакции
344
Помог
40 раз(а)
Обратите внимание, если вы хотите заключить сделку с этим пользователем, он заблокирован
?
1611660804495.png
 
Сообщения
23
Реакции
3
RockTheStreet, разве это не одно и тоже?
Код:
    if (g_iPlrCompleted[iPlayer] >= iPos || !is_user_alive(iPlayer))
        return HAM_IGNORED
        
    if (!is_user_alive(iPlayer) || g_iPlrCompleted[iPlayer] >= iPos)
        return HAM_IGNORED
 
Сообщения
2,288
Реакции
1,739
Помог
31 раз(а)
RockTheStreet,
Он тебя на понт взял, а ты повелся и сам в дифф нашел за него))))
 

Ayk

Сообщения
763
Реакции
478
Помог
19 раз(а)
Попросили пояснить, вот:
убедившись, что iPlayer это живой игрок, мы исключаем выход за пределы массива во второй проверке.
 
Статус
В этой теме нельзя размещать новые ответы.

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

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