forked from lazhoroni/Plugins-for-CSGO-Servers
-
Notifications
You must be signed in to change notification settings - Fork 1
/
bunnyYavaslat.sp
96 lines (82 loc) · 2.11 KB
/
bunnyYavaslat.sp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#pragma semicolon 1
#include <sourcemod>
#include <sdkhooks>
#include <sdktools>
#include <cstrike>
public Plugin:myinfo =
{
name = "Hasar Alınca Bunny Hızı Düşürme",
author = "ImPossibLe`",
description = "DrK # GaminG",
version = "1.0",
};
// When plugin starts
public OnPluginStart()
{
HookEvent("player_jump", Event_Jumper);
}
// When a Player Jumps
public Action:Event_Jumper(Handle:event, const String:name[], bool:dontBroadcast)
{
// Remind Player that Bunnyhopping isnt allowed, and alter Gravity
// temporarily to affect Bunnyhopping, but not normal crouch jumps.
new client = GetClientOfUserId(GetEventInt(event, "userid"));
SetEntityGravity(client, 1.5);
// Starts the 0.3 second timer.
CreateTimer( 0.3, Timer_Bunnyhop_Detect, GetClientOfUserId(GetEventInt(event, "userid")), TIMER_REPEAT );
}
public Action:Timer_Bunnyhop_Detect(Handle:timer, any:client)
{
// Resets the users gravity.
SetEntityGravity(client, 1.0);
return Plugin_Stop;
}
public OnPluginEnd()
{
// When plugin is unloaded, unhook the jump event, and spawn event.
UnhookEvent("player_jump", Event_Jumper);
}
/*
bool damageAldi[MAXPLAYERS+1];
bool teleportYap[MAXPLAYERS+1];
public OnClientPostAdminCheck(iClient)
{
SDKHook(iClient, SDKHook_OnTakeDamage, OnTakeDamage);
}
public Action:OnTakeDamage(victim, &attacker, &inflictor, &Float:damage, &damagetype)
{
if(damage >= 1)
{
damageAldi[victim] = true;
teleportYap[victim] = true;
CreateTimer(2.0, HasarSifirla, victim);
}
}
public Action HasarSifirla(Handle timer, int victim)
{
damageAldi[victim] = false;
teleportYap[victim] = false;
}
public OnPluginStart()
{
//RegConsoleCmd("sm_test", test);
}
public Action:OnPlayerRunCmd(client, &buttons, &impulse, Float:vel[3], Float:angles[3], &weapon)
{
if(buttons & IN_JUMP)
{
if(damageAldi[client])
{
if(teleportYap[client])
{
new Float:PlayerOrigin[3];
GetClientAbsOrigin(client, PlayerOrigin);
PlayerOrigin[2] += 10;
TeleportEntity(client, PlayerOrigin, NULL_VECTOR, NULL_VECTOR);
teleportYap[client]. = false;
}
return Plugin_Handled;
}
}
return Plugin_Continue;
}*/