CamerDisco
06-18-2016, 18:55
Hi, I'm looking for plugin for hide other players, I tried take it from cksurf, but It's not working
public OnPluginStart()
{
RegConsoleCmd("sm_hide", Client_Hide, " on/off - hides other players");
}
public void OnClientPutInServer(int client)
{
SDKHook(client, SDKHook_SetTransmit, Hook_SetTransmit);
}
public void OnClientDisconnect(int client)
{
SDKUnhook(client, SDKHook_SetTransmit, Hook_SetTransmit);
}
but Hook_SetTransmit is very connected with cksurf plugin and idk how to edit this to normal plugin (it's using bools from cksurf)
public Action Hook_SetTransmit(int entity, int client)
{
if (client != entity && (0 < entity <= MaxClients) && IsValidClient(client))
{
if (g_bChallenge[client] && !g_bHide[client])
{
if (!StrEqual(g_szSteamID[entity], g_szChallenge_OpponentID[client], false))
return Plugin_Handled;
}
else
if (g_bHide[client] && entity != g_SpecTarget[client])
return Plugin_Handled;
else
if (entity == g_InfoBot && entity != g_SpecTarget[client])
return Plugin_Handled;
}
return Plugin_Continue;
}
public OnPluginStart()
{
RegConsoleCmd("sm_hide", Client_Hide, " on/off - hides other players");
}
public void OnClientPutInServer(int client)
{
SDKHook(client, SDKHook_SetTransmit, Hook_SetTransmit);
}
public void OnClientDisconnect(int client)
{
SDKUnhook(client, SDKHook_SetTransmit, Hook_SetTransmit);
}
but Hook_SetTransmit is very connected with cksurf plugin and idk how to edit this to normal plugin (it's using bools from cksurf)
public Action Hook_SetTransmit(int entity, int client)
{
if (client != entity && (0 < entity <= MaxClients) && IsValidClient(client))
{
if (g_bChallenge[client] && !g_bHide[client])
{
if (!StrEqual(g_szSteamID[entity], g_szChallenge_OpponentID[client], false))
return Plugin_Handled;
}
else
if (g_bHide[client] && entity != g_SpecTarget[client])
return Plugin_Handled;
else
if (entity == g_InfoBot && entity != g_SpecTarget[client])
return Plugin_Handled;
}
return Plugin_Continue;
}