|
Junior Member
|
09-28-2016
, 10:36
Re: [CS GO] Spawn protection with fall damage
|
#16
|
Quote:
Originally Posted by xines
Just dont.
What was the reason for this rewrite of my posted fix? You mixed new syntax with old syntax, then expanded the same GetClientOfUserId/GetClientUserId method.
Here then try this:
Spoiler
PHP Code:
#pragma semicolon 1
#include <sourcemod>
ConVar g_protecttime;
public void OnPluginStart()
{
g_protecttime = CreateConVar("respawn_protection_time", "3.0", "How much seconds to protect from fall damage");
HookEvent("player_spawn", OnPlayerSpawn);
}
public Action OnPlayerSpawn(Event event, const char[] name, bool dontBroadcast)
{
int client = GetClientOfUserId(event.GetInt("userid"));
if(IsClientInGame(client) && IsPlayerAlive(client))
{
CreateTimer(g_protecttime.FloatValue, Timer_StopTakingNoDamage, GetClientUserId(client));
SetEntProp(client, Prop_Data, "m_takedamage", 0, 1);
}
return Plugin_Continue;
}
public Action Timer_StopTakingNoDamage(Handle timer, any userid)
{
int client = GetClientOfUserId(userid);
if (client != 0 && IsClientInGame(client))
{
SetEntProp(client, Prop_Data, "m_takedamage", 2, 1);
}
return Plugin_Continue;
}
|
really thank you but this plug-in still enabled protect from fall damage
|
|
|
|