#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <engine>
#include <hamsandwich>
#define PLUGIN "Fast Swim Detector"
#define VERSION "1.0"
#define AUTHOR "DPCS*"
const Float:jumplimit = 2.5 // space basili tutma max sure
new Float:jumpstarttime[33]
const Float:speedlimit = 250.0 // suda max hiz (space ile)
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_forward(FM_PlayerPostThink, "Player_PostThink");
RegisterHam(Ham_Killed, "player", "Player_Spawn",1);
for (new i = 1; i < 33; i++)
jumpstarttime[i] = -1.0
}
public Player_Spawn(const id) {
jumpstarttime[id] = -1.0
return HAM_IGNORED;
}
public client_disconnect(id) {
jumpstarttime[id] = -1.0
}
public Player_PostThink(const id) {
static inwater; inwater = entity_get_int(id, EV_INT_waterlevel)
static Buttons;Buttons = pev(id, pev_button);
static Float:veloc[3];get_user_velocity(id, veloc)
static Float:hveloc; hveloc = vector_length(veloc)
if(inwater == 2 && Buttons & IN_JUMP && jumpstarttime[id] < 0.0) {
jumpstarttime[id] = get_gametime()
}
else if(!(Buttons & IN_JUMP) && jumpstarttime[id] > 0.0) {
jumpstarttime[id] = -1.0
}
if(inwater == 2 && jumpstarttime[id] >= 0.0 && get_gametime() - jumpstarttime[id] > jumplimit && hveloc > speedlimit) {
client_print_color(0, 0, "^3[^1ZE^3] ^4( ^1%n ^4) ^3Adli oyuncuda ^1Hizli yuzme ^3tespit Edildi!", id);
user_slap(id,1);
jumpstarttime[id] = -1.0
}
}