Подскажите пожалуйста, как сделать проверку на определенное кол-во игроков. Допустим если в командах 6 человек в сумме (спектора не учитываются), то выполняется код
int k = 0;
for(int i = 1; i <= MaxClients; i++) if(IsClientInGame(i) && !IsFakeClient(i) && GetClientTeam(i) > 1) k++;
if(k > 6)
{
// Игроков больше 6, делаем что-то
}
else if(k < 6)
{
// Игроков меньше 6, делаем что-то
}
else
{
// Игроков 6, делаем что-то
}
заметил, что после перезахода все равно она снова включается самаСкачай - автор обновил плагин! Round Start Music v1.3.1 - Форум
Сообщите о проблеме автору на форуме. Я не использую данный плагин.заметил, что после перезахода все равно она снова включается сама
Подскажите пожалуйста, как выполнить опр действие при пиканьи бомбы (Бомба уже установленна и надо при каждом пиканье этой бомбы выполнить действие)
Спасибо большое, как раз там смотрел события, но почему-то проморгал именно это)Counter-Strike: Source Events - AlliedModders Wiki
wiki.alliedmods.net
48| PerformBeacon(iClient); ----> if(0 < iClient <= MaxClients ) PerformBeacon(iClient);Спасибо большое, как раз там смотрел события, но почему-то проморгал именно это)
Сообщения автоматически склеены:
Помогите пожалуйста исправить ошибку :
L 02/08/2023 - 08:06:24: [SM] Exception reported: Client index 0 is invalid
L 02/08/2023 - 08:06:24: [SM] Blaming: Bomp_PlantEffect.smx
L 02/08/2023 - 08:06:24: [SM] Call stack trace:
L 02/08/2023 - 08:06:24: [SM] [0] GetClientAbsOrigin
L 02/08/2023 - 08:06:24: [SM] [1] Line 24, D:\Desktop\1.11 scripting\Bomp_PlantEffect.sp::PerformBeacon
L 02/08/2023 - 08:06:24: [SM] [2] Line 46, D:\Desktop\1.11 scripting\Bomp_PlantEffect.sp::bomb_beep
Ошибка ушла, но не создается эффект вокруг бомбы, подскажите пожалуйста почему48| PerformBeacon(iClient); ----> if(0 < iClient <= MaxClients ) PerformBeacon(iClient);
#pragma semicolon 1
#pragma newdecls required
#include <cstrike>
#include <sdktools_functions>
public Action CS_OnBuyCommand(int client, const char[] weapon)
{
static int val;
if(!client || (val = GetClientTeam(client)) < 2 || !IsPlayerAlive(client))
return Plugin_Continue;
if(val == 2)
{
if(strcmp(weapon, "ak47", false))
return Plugin_Continue;
if((val = GetEntProp(client, Prop_Send, "m_iAccount") - CS_GetWeaponPrice(client, CSWeapon_M4A1)) >= 0)
{
SetEntProp(client, Prop_Send, "m_iAccount", val);
GivePlayerItem(client, "weapon_m4a1");
}
}
else
{
if(strcmp(weapon, "m4a1", false))
return Plugin_Continue;
if((val = GetEntProp(client, Prop_Send, "m_iAccount") - CS_GetWeaponPrice(client, CSWeapon_AK47)) >= 0)
{
SetEntProp(client, Prop_Send, "m_iAccount", val);
GivePlayerItem(client, "weapon_ak47");
}
}
return Plugin_Handled;
}
C:\Users\Desktop\test.sp(20) : error 017: undefined symbol "GivePlayerItem"@-=|УЧЕНИК|=-, попробуй такое:C-подобный:#pragma semicolon 1 #pragma newdecls required #include <cstrike> public Action CS_OnBuyCommand(int client, const char[] weapon) { static int val; if(!client || (val = GetClientTeam(client)) < 2 || !IsPlayerAlive(client)) return Plugin_Continue; if(val == 2) { if(strcmp(weapon, "ak47", false)) return Plugin_Continue; if((val = GetEntProp(client, Prop_Send, "m_iAccount") - CS_GetWeaponPrice(client, CSWeapon_M4A1)) >= 0) { SetEntProp(client, Prop_Send, "m_iAccount", val); GivePlayerItem("weapon_m4a1"); } } else { if(strcmp(weapon, "m4a1", false)) return Plugin_Continue; if((val = GetEntProp(client, Prop_Send, "m_iAccount") - CS_GetWeaponPrice(client, CSWeapon_AK47)) >= 0) { SetEntProp(client, Prop_Send, "m_iAccount", val); GivePlayerItem("weapon_ak47"); } } return Plugin_Handled; }
sdktools_functions