Серый™
CS:S Server
- Сообщения
- 2,925
- Реакции
- 1,376
В килбонусе есть ошибка
Не знаю почему индекс выходит за границы массива.
Можете посмотреть офлайн бан на ошибки.
Правильно написана функция поменять местами команды?
L 08/28/2013 - 14:46:20: [SM] Plugin encountered error 15: Array index is out of bounds
L 08/28/2013 - 14:46:20: [SM] Displaying call stack trace for plugin "killbonus.smx":
L 08/28/2013 - 14:46:20: [SM] [0] Line 260, E:\server\Server_tdm-dd2\cstrike\addons\sourcemod\scripting\killbonus.s p::ResetClient()
L 08/28/2013 - 14:46:20: [SM] [1] Line 253, E:\server\Server_tdm-dd2\cstrike\addons\sourcemod\scripting\killbonus.s p::ResetAll()
L 08/28/2013 - 14:46:20: [SM] [2] Line 271, E:\server\Server_tdm-dd2\cstrike\addons\sourcemod\scripting\killbonus.s p::Event_RoundStart()
Можете посмотреть офлайн бан на ошибки.
Правильно написана функция поменять местами команды?
PHP:
public Handle_ModeTeam(Handle:topmenu, TopMenuAction:action, TopMenuObject:object_id, param, String:buffer[], maxlength)
{
if (action == TopMenuAction_DisplayOption)
{
Format(buffer, maxlength, "%t", "changed the team");
}
else if(action == TopMenuAction_SelectOption)
{
SelectionMenu(param);
}
}
SelectionMenu(client)
{
for(new i = 1; i <= GetMaxClients(); i++)
{
if(IsClientInGame(i) && (GetClientTeam(i) == TEAM_2 || GetClientTeam(i) == TEAM_1))
{
PerformSwitch_d(i);
}
}
ShowActivity(client, "%t", "changed the team places");
LogAction(client, -1, "\"%L\" changed the team places", client, client);
}
void:PerformSwitch_d(client, bool:toSpec = false)
{
new cTeam = GetClientTeam(client),
toTeam = (toSpec ? TEAM_SPEC : TEAM_1 + TEAM_2 - cTeam);
if (cstrikeExtAvail && !toSpec)
{
CreateTimer(0.1, Timer_TeamSwitch2, client);
CS_SwitchTeam(client, toTeam);
if (cTeam == TEAM_2)
{
SetEntityModel(client, "models/player/t_leet.mdl");
}
else
{
SetEntityModel(client, "models/player/ct_sas.mdl");
}
if (GetPlayerWeaponSlot(client, CS_SLOT_C4) != -1)
{
new ent;
if ((ent = GetPlayerWeaponSlot(client, CS_SLOT_C4)) != -1)
SDKHooks_DropWeapon(client, ent);
}
}
else
{
ForcePlayerSuicide(client);
ChangeClientTeam(client, toTeam);
}
}
public Action:Timer_TeamSwitch2(Handle:timer, any:client)
{
if (IsClientInGame(client))
CS_RespawnPlayer(client);
return Plugin_Stop;
}