#include <amxmodx>
#include <cstrike>
#include <fun>
#include <csx>
#define PLUGIN "knives_speed"
#define VERSION "1.0.1"
#define AUTHOR "autor"
new g_lastwpn[33];
new bool:g_imobile[33];
new gCurrentFOV[33];
new bool:freezetime;
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("CurWeapon", "Event_CurWeapon", "be", "1=1");
}
new Float:gCSWeaponSpeed[32] =
{
0.0,
250.0, // CSW_P228
0.0,
260.0, // CSW_SCOUT
250.0, // CSW_HEGRENADE
240.0, // CSW_XM1014
250.0, // CSW_C4
250.0, // CSW_MAC10
240.0, // CSW_AUG
250.0, // CSW_SMOKEGRENADE
250.0, // CSW_ELITE
250.0, // CSW_FIVESEVEN
250.0, // CSW_UMP45
210.0, // CSW_SG550
240.0, // CSW_GALI
240.0, // CSW_FAMAS
250.0, // CSW_USP
250.0, // CSW_GLOCK18
210.0, // CSW_AWP
250.0, // CSW_MP5NAVY
220.0, // CSW_M249
230.0, // CSW_M3
230.0, // CSW_M4A1
250.0, // CSW_TMP
210.0, // CSW_G3SG1
250.0, // CSW_FLASHBANG
250.0, // CSW_DEAGLE
235.0, // CSW_SG552
221.0, // CSW_AK47
250.0, // CSW_KNIFE
245.0 // CSW_P90
};
public client_putinserver(id)
{
g_imobile[id] = false;
}
public Event_CurWeapon(id){
if ( !is_user_alive(id) )
return;
new weapon_id = read_data(2);
if(is_user_alive(id)){
if(weapon_id == CSW_KNIFE){
if ( g_lastwpn[id] != weapon_id )
{
//set_task(0.1, "set_speed", id);
zmien_predkosc(id);
}
}
else{
new Float:g_speed;
g_speed = gCSWeaponSpeed[weapon_id] ;
set_user_maxspeed(id, g_speed) ;
}
g_lastwpn[id] = weapon_id;
}
}
public zmien_predkosc(id){
if ( !is_user_alive(id) || freezetime ){
return;
}
new Float:speed;
if ( g_imobile[id] ){
speed = 100.0;
}
else{
if ( cs_get_user_vip(id) ){
speed = 227.0;
}
else{
new weapon = get_user_weapon(id);
speed = gCSWeaponSpeed[weapon];
if ( gCurrentFOV[id] <= 45 ){
switch(weapon){
case CSW_SCOUT: speed = 220.0;
case CSW_SG550, CSW_AWP, CSW_G3SG1: speed = 150.0;
}
}
}
speed += (get_user_maxspeed(id) + 25);
}
if ( speed != get_user_maxspeed(id) )
{
set_user_maxspeed(id, speed);
}
}
uap, działa na 100 %