 |
|
Veteran Member
Join Date: Oct 2010
Location: Spain (Madrid)
|

11-14-2015
, 05:33
Re: Transparent player models when approaching them.
|
#9
|
Quote:
Originally Posted by Bad Cold Man
I've made a small change, because sm_hide already in use in another plugin.
PHP Code:
#include <sourcemod> #include <sdktools> #include <sdkhooks> #include <zombiereloaded>
#define PLUGIN_VERSION "1.0"
new bool:g_bHider[MAXPLAYERS+1][MAXPLAYERS+1]; new bool:g_hider[MAXPLAYERS+1];
public Plugin:myinfo = { name = "SM Hider Teammates For Proximity", author = "Franc1sco franug", description = "", version = PLUGIN_VERSION, url = "www.steamcommunity.com/id/franug/" }
public OnPluginStart() { CreateTimer(0.5, Pasar, _, TIMER_REPEAT); HookEvent("player_death", Event_OnPlayerDeath, EventHookMode_Pre); RegConsoleCmd("sm_hider", Comando); }
public Action:Comando(client, args) { g_hider[client] = !g_hider[client]; PrintToChat(client, "Hider feature %s" ,g_hider[client]?"Activated":"Desactivated");
return Plugin_Handled; }
public Action:Event_OnPlayerDeath(Handle:event, const String:name[], bool:dontBroadcast) { new client = GetClientOfUserId(GetEventInt(event, "userid")); for(new i = 1; i <= MaxClients; i++) g_bHider[client][i] = false; }
public ZR_OnClientInfected(client, attacker, bool:motherInfect, bool:respawnOverride, bool:respawn) { for(new i = 1; i <= MaxClients; i++) g_bHider[client][i] = false; }
public Action:Pasar(Handle:timer) { for(new i = 1; i <= MaxClients; i++) if(IsClientInGame(i) && IsPlayerAlive(i) && ZR_IsClientHuman(i)) CheckClientOrg(i);
}
CheckClientOrg(Client) { decl Float:MedicOrigin[3],Float:TargetOrigin[3], Float:Distance; GetClientAbsOrigin(Client, MedicOrigin); for (new X = 1; X <= MaxClients; X++) { if(X != Client && IsClientInGame(X) && IsPlayerAlive(X) && ZR_IsClientHuman(X)) { GetClientAbsOrigin(X, TargetOrigin); Distance = GetVectorDistance(TargetOrigin,MedicOrigin); if(Distance <= 100.0) g_bHider[Client][X] = true; else g_bHider[Client][X] = false; } } }
public OnClientPutInServer(client) { g_hider[client] = true; for(new i = 1; i <= MaxClients; i++) g_bHider[client][i] = false; SDKHook(client, SDKHook_SetTransmit, Hook_SetTransmit); }
public Action:Hook_SetTransmit(client1, client2) { if (client1 != client2 && g_hider[client2] && g_bHider[client1][client2]) return Plugin_Handled; return Plugin_Continue; }
|
So you use my plugin now?
As I said, I can make that change only transparency of players (dynamic transparencies) instead of dissapear him completly (without use settransmit that also will be more optimized ). You can help me with the testing in steam if you want a better version of this plugin.
__________________
Last edited by Franc1sco; 11-14-2015 at 05:35.
|
|
|
|