Ако не може да се редактира то да се направи .
Код за потвърждение: Избери целия код
#include <sourcemod>
#include <sdktools>
#define VERSION "0.0.1"
#define MAX_PLAYERS 256
public Plugin:myinfo = {
name = "AWP Time LIMIT",
author = "AchTuNG",
description = "AWP timelimit per map.",
version = VERSION,
url = "http://www.soucemod.net"
};
new Handle:AWPTimer[MAX_PLAYERS+1]
new Handle:RestrictedWeapon;
new String:Weapon[20];
public OnPluginStart(){
RestrictedWeapon = CreateConVar("timer_weapon","a","Sets The Weapons To Punish For",FCVAR_NOTIFY);
HookEvent("weapon_fire", IsAWP);
PrintToServer("[AWP Timelimit] by AchTuNG! loaded succesfully");
}
public Action:IsAWP(Handle:event, const String:name[], bool:dontBroadcast){
new clientID = GetEventInt(event,"userid");
new client = GetClientOfUserId(clientID);
new String:Weps[20];
GetConVarString(RestrictedWeapon,Weps,20);
GetClientWeapon(client,Weapon,19)
if(StrEqual("weapon_awp",Weapon)== true && StrContains(Weps,"a")!= -1) //flag a AWP
{
PrintToChat(client,"You have AWP! Timer Started!");
PrintToConsole(client, "You have AWP! Timer Started!")
AWPTimer[client] = CreateTimer(15.0, AWPRemove, client)
}
}
public OnClientDisconnect(client)
{
if (AWPTimer[client] != INVALID_HANDLE)
{
KillTimer(AWPTimer[client])
AWPTimer[client] = INVALID_HANDLE
}
}
public Action:AWPRemove(Handle:timer, any:client)
{
PrintToChat(client,"While using the AWP has expired!");
PrintToConsole(client, "While using the AWP has expired!");
RemoveAWP(client);
AWPTimer[client] = INVALID_HANDLE
}
RemoveAWP(client)
{
new wepIdx;
for (new x = 0; x <= 3; x++)
{
if (x != 2 && (wepIdx = GetPlayerWeaponSlot(client, x)) != -1)
{
RemovePlayerItem(client, wepIdx);
RemoveEdict(wepIdx);
PrintToChat(client,"AWP Remowed!");
}
}
}