can you help me
is everything right?
Code:
#include <sourcemod>
#include <sdkhooks>
#pragma semicolon 1
#pragma newdecls required
int g_iWeapon;
public void OnMapStart()
{
g_iWeapon = 0;
CreateTimer(300.0, TimerChangeWeapon, _, TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
}
public void OnClientPutInServer(int client)
{
if (IsValidClient(client))
{
SDKHook(client, SDKHook_WeaponCanUse, OnWeaponUse);
}
}
public Action TimerChangeWeapon(Handle timer)
{
g_iWeapon++;
}
public Action OnWeaponUse(int client, int weapon)
{
if (IsValidClient(client))
{
char sWeapon[32];
GetEdictClassname(weapon, sWeapon, sizeof(sWeapon));
switch (g_iWeapon)
{
case 1: // USP-S
{
if (StrContains(sWeapon, "usp_silencer", false) != -1)
{
return Plugin_Handled;
}
}
case 2: // DEAGLE
{
if (StrContains(sWeapon, "deagle", false) != -1)
{
return Plugin_Handled;
}
}
case 3: // AK47
{
if (StrContains(sWeapon, "ak47", false) != -1)
{
return Plugin_Handled;
}
}
case 4: // M4A1
{
if (StrContains(sWeapon, "m4a1", false) != -1)
{
return Plugin_Handled;
}
}
case 5: // SSG
{
if (StrContains(sWeapon, "ssg08", false) != -1)
{
return Plugin_Handled;
}
}
case 6: // AWP
{
if (StrContains(sWeapon, "awp", false) != -1)
{
return Plugin_Handled;
}
}
}
}
return Plugin_Continue;
}
stock bool IsValidClient(int client)
{
return (client > 0 && client <= MaxClients && IsClientInGame(client) && !IsClientInKickQueue(client) && IsPlayerAlive(client) && !IsFakeClient(client));
}