If player joins as engineer, opens engineer menu, switches to different class & then he/she can still build things.
I'm not a programmer, but I managed to use existing code to do extra check if class is engineer before building prop.
on line 1161
change:
if (client > 0 && g_ConstructRemainingTime[client] <= 0 && IsPlayerAlive(client) && !IsClientTimingOut(client) && ((StrContains(sWeapon, "weapon_knife") > -1) || (StrContains(sWeapon, "weapon_wrench") > -1)))
If player joins as engineer, opens engineer menu, switches to different class & then he/she can still build things. I'm not a programmer, but I managed to use existing code to do extra check if class is engineer before building prop.
on line 1161 change:
if (client > 0 && g_ConstructRemainingTime[client] <= 0 && IsPlayerAlive(client) && !IsClientTimingOut(client) && ((StrContains(sWeapon, "weapon_knife") > -1) || (StrContains(sWeapon, "weapon_wrench") > -1)))
to:
if (client > 0 && g_ConstructRemainingTime[client] <= 0 && IsPlayerAlive(client) && !IsClientTimingOut(client) && (StrContains(g_client_last_classstring[client], "engineer") > -1) && ((StrContains(sWeapon, "weapon_knife") > -1) || (StrContains(sWeapon, "weapon_wrench") > -1)))