Raised This Month: $32 Target: $400
 8% 

[CS GO] Spawn protection with fall damage


Post New Thread Reply   
 
Thread Tools Display Modes
xines
Veteran Member
Join Date: Aug 2013
Location: Denmark
Old 09-28-2016 , 06:25   Re: [CS GO] Spawn protection with fall damage
Reply With Quote #11

Quote:
Originally Posted by teo30 View Post
I tried but I can't compile sp file to smx
http://imgur.com/a/Tnvh2
What did I do wrong?
Here, try this...
Spoiler
__________________
xines is offline
Nursik
Senior Member
Join Date: Jul 2016
Location: In TF2
Old 09-28-2016 , 07:48   Re: [CS GO] Spawn protection with fall damage
Reply With Quote #12

Quote:
Originally Posted by xines View Post
Here, try this...
Or this:

PHP Code:
#pragma semicolon 1
#include sourcemod
#include sdkhooks

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[] namebool dontBroadcast)
{
    new 
userid GetClientOfUserId(event.GetInt("userid"));
    new 
client GetClientUserId(userid);
    if(
IsClientInGame(client) && IsPlayerAlive(client))
    {
        
CreateTimer(g_protecttime.FloatValueTimer_StopTakingNoDamageclient);
        
SDKHook(clientSDKHook_OnTakeDamageOnTakeDamage);
    }
    return 
Plugin_Continue;
}

public 
Action OnTakeDamage(int victimint &attackerint &inflictorfloat &damageint &damagetypeint &weaponfloat damageForce[3], float damagePosition[3])
{
    if (
IsClientInGame(victim) && IsPlayerAlive(victim))
    {
        if (
damagetype DMG_FALL)
        {
            return 
Plugin_Handled;
        }
    }
    return 
Plugin_Continue;
}

public 
Action Timer_StopTakingNoDamage(Handle timerany userid)
{
    new 
client GetClientOfUserId(userid);
    if (
client != && IsClientInGame(client))
    {
        
SDKUnhook(clientSDKHook_OnTakeDamageOnTakeDamage);
    }
    return 
Plugin_Continue;


Last edited by Nursik; 09-28-2016 at 07:55.
Nursik is offline
teo30
Junior Member
Join Date: Sep 2016
Old 09-28-2016 , 09:12   Re: [CS GO] Spawn protection with fall damage
Reply With Quote #13

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..
teo30 is offline
xines
Veteran Member
Join Date: Aug 2013
Location: Denmark
Old 09-28-2016 , 10:01   Re: [CS GO] Spawn protection with fall damage
Reply With Quote #14

Quote:
Originally Posted by Nursik View Post
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 View Post
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
__________________
xines is offline
Nursik
Senior Member
Join Date: Jul 2016
Location: In TF2
Old 09-28-2016 , 10:04   Re: [CS GO] Spawn protection with fall damage
Reply With Quote #15

Quote:
Originally Posted by xines View Post
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
I am sorry. xD I just don't like the new syntax.
Nursik is offline
teo30
Junior Member
Join Date: Sep 2016
Old 09-28-2016 , 10:36   Re: [CS GO] Spawn protection with fall damage
Reply With Quote #16

Quote:
Originally Posted by xines View Post
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
really thank you but this plug-in still enabled protect from fall damage
teo30 is offline
xines
Veteran Member
Join Date: Aug 2013
Location: Denmark
Old 09-28-2016 , 11:29   Re: [CS GO] Spawn protection with fall damage
Reply With Quote #17

Quote:
Originally Posted by teo30 View Post
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..
Quote:
Originally Posted by teo30 View Post
really thank you but this plug-in still enabled protect from fall damage
I thought you wanted both, so this is only to block damage from players, but allow fall damage?

If so, here:

Spoiler
__________________
xines is offline
teo30
Junior Member
Join Date: Sep 2016
Old 09-29-2016 , 10:27   Re: [CS GO] Spawn protection with fall damage
Reply With Quote #18

Quote:
Originally Posted by xines View Post
I thought you wanted both, so this is only to block damage from players, but allow fall damage?

If so, here:

Spoiler
perfect, thank you so much!
teo30 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 21:49.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode