View Single Post
xSaG
Junior Member
Join Date: Sep 2018
Location: Romānia
Old 11-12-2019 , 14:18   Re: I'm trying to make a AWP restriction.. help
Reply With Quote #3

Not tested
PHP Code:
#define PLUGIN_NAME           "Restricție AWP"
#define PLUGIN_AUTHOR         "xSaG.exe"
#define PLUGIN_DESCRIPTION    "Restricție la awp īn funcție de jucători."
#define PLUGIN_VERSION        "1.0"
#define PLUGIN_URL            "https://steamcommunity.com/id/xsag69"

#include <sourcemod>
#include <sdktools>

int iAWP;

public 
Plugin:myinfo =
{
    
name PLUGIN_NAME,
    
author PLUGIN_AUTHOR,
    
description PLUGIN_DESCRIPTION,
    
version PLUGIN_VERSION,
    
url PLUGIN_URL
};

public 
OnPluginStart()
{
    
HookEvent("player_spawn"Event_PlayerSpawn);
}

public 
Action Event_PlayerSpawn(Event event, const char[] namebool dontBroadcast)
{
    
iAWP 0;
}

public 
Action CS_OnBuyCommand(int client, const char[] weapon)
{
    
int CheckTeam GetClientTeam(client);
    if(
strcmp(weapon,"awp"false) == && (CheckTeam == || CheckTeam == 3))
    {
        
float RatieAwpT float((33 100) * GetTeamClientCount(2));
        
float RatieAwpCT float((33 100) * GetTeamClientCount(3));
        if(
RatieAwpT iAWP || RatieAwpCT iAWP)
        {
            
PrintToChat(client"Echipa ta are prea multe awp-uri!");
            return 
Plugin_Handled;
        }
        
iAWP++;
    }
    return 
Plugin_Continue;

Best Regard!

Last edited by xSaG; 11-12-2019 at 14:28.
xSaG is offline