I need to know if this works properly without any mistakes !
I'm trying to get the round number and if the round is 1 or 16 it
will block the buy of the specific weapons. The block buy code
works. But when im tryin to get the round number sometimes it
works sometimes not. EDIT : this code i didnt tried so i wanna
make sure it works properly.
CODE :
public Action CS_OnBuyCommand(int iClient, const char[] chWeapon)
{
if (GameRules_GetProp("m_totalRoundsPlayed") == 0 || GameRules_GetProp("m_totalRoundsPlayed") == 15)
{
char blocked_weapons[][] = { "ump45", "p90", "mp9", "mp7", "mp5sd", "mac10", "bizon", "ssg08", "sg556", "scar20", "m4a1_silencer", "m4a1", "galilar", "g3sg1", "famas", "awp", "aug", "ak47", "xm1014", "sawedoff", "nova", "negev", "mag7", "m249" };
for (int i = 0; i < sizeof(blocked_weapons); i++)
{
if (StrEqual(chWeapon, blocked_weapons[i]))
{
PrintToChat(iClient, "'You're rich BUT I FORBID YOU TO BUY' - shadowbringer.");
return Plugin_Handled;
}
}
}
return Plugin_Continue; // Continue as normal.
}
im using GameRules_GetProp("m_totalRoundsPlayed") == 0 set to 0 because i think to get the first round it means that totalroundplayed needs to be 0. IF IM WRONG CORRECT ME.
Last edited by shadow10; 01-30-2023 at 10:03.
|