Sprawdź
#include <amxmodx>
#include <cstrike>
#include <fun>
#define PLUGIN "Various Weapon Speeds"
#define AUTHOR "v3x"
#define VERSION "1.03"
// R G B A
new iColorT[4] = { 0, 0, 0, 0 } // Alpha = Visibility (255 = Visible, 0 = Invisible)
new iColorCT[4] = { 0, 0, 0, 0 } // Alpha at 100 = Less than Half Visible
new bool:speed = false
public plugin_init()
{
register_plugin(PLUGIN,VERSION,AUTHOR)
register_event("CurWeapon","check_speed","be")
register_cvar("knife_speed","390")
register_cvar("c4_speed","230")
register_cvar("awp_speed","230")
register_cvar("speed_glow","1")
register_logevent("new_round",2,"1=Round_Start")
set_cvar_num("mp_freezetime",0)
}
public new_round()
{
speed = false
new ft = get_cvar_num("mp_freezetime")
set_task(float(ft),"allow_speed",0)
return PLUGIN_CONTINUE
}
public allow_speed()
{
speed = true
return PLUGIN_HANDLED
}
public check_speed(id)
{
// If the speed var is false..
if(!speed) {
// Stop the function
return PLUGIN_HANDLED
}
// Get the users weapon
new clip, ammo
new weapon = get_user_weapon(id,clip,ammo)
// Get the users team
new CsTeams:team = cs_get_user_team(id)
switch(weapon)
{
case CSW_KNIFE:
{
// Set the speed for the knife
set_user_maxspeed(id,float(get_cvar_num("knife_speed")))
// If the glow cvar is set
if(get_cvar_num("speed_glow"))
{
// Switch the teams
switch(team)
{
// Seperate the 2 teams and give them different glows
case CS_TEAM_T: set_user_rendering(id,kRenderFxGlowShell,iColorT[0],iColorT[1],iColorT[2],kRenderTransAlpha,iColorT[3])
case CS_TEAM_CT: set_user_rendering(id,kRenderFxGlowShell,iColorCT[0],iColorCT[1],iColorCT[2],kRenderTransAlpha,iColorCT[3])
}
}
}
case CSW_C4: {
// Set the speed for the C4
set_user_maxspeed(id,float(get_cvar_num("c4_speed")))
}
case CSW_AWP: {
// Set the speed for the AWP
set_user_maxspeed(id,float(get_cvar_num("awp_speed")))
}
default:
{
// If nothing, set normal rendering
set_user_rendering(id,kRenderFxNone,255,255,255,kRenderNormal,255)
}
}
return PLUGIN_CONTINUE
}