Hello everyone ! I have a problem with my plugin...
If I want to take everyone from a team from the server is not taking everyone... Sometimes random... Also no errors in console
Here is the code:
PHP Code:
for (int i = 1; i<=MaxClients; i++)
{
new uID1 = GetClientUserId(i);
ServerCommand("sm_blind #%d 220", uID1);
if(IsClientInGame(i) && GetClientTeam(i) == 2) // Sets the T Team model
{
g_bCommandUsedDayZom[i] = true;
SetEntityMoveType(i, MOVETYPE_NONE);
SDKHook(i, SDKHook_WeaponEquip, OnWeaponEquip);
SetEntityModel(i, "models/player/kuristaja/zombies/gozombie/gozombie.mdl");
SetEntityHealth(i, 4000);
new uID = GetClientUserId(i);
ServerCommand("sm_blind #%d 250", uID);
}
}
Also if you want to see the SDKHook :
PHP Code:
public Action:OnWeaponEquip(client, weapon)
{
decl String:sWeapon[32];
GetEdictClassname(weapon, sWeapon, sizeof(sWeapon));
if( !StrEqual(sWeapon, "weapon_knife") )
{
if( GetClientTeam(client) == CS_TEAM_T)
{
return Plugin_Handled;
}
if( GetClientTeam(client) == CS_TEAM_CT && g_bCommandUsedDayHNS[client])
{
return Plugin_Handled;
}
}
return Plugin_Continue;
}