|
Veteran Member
Join Date: Aug 2013
Location: Denmark
|
09-28-2016
, 10:01
Re: [CS GO] Spawn protection with fall damage
|
#14
|
Quote:
Originally Posted by Nursik
Or this:
|
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.
Quote:
Originally Posted by teo30
Thank you guys!
But.. I think you guys are misunderstanding this is my fault I didn't explain well
I want players will be get only fall damage.. and protect from shoot,fire and the others for 10? seconds
sorry guys..
|
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;
}
__________________
|
|
|
|