Raised This Month: $51 Target: $400
 12% 

Adding the bonus limit for a given round


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
szogun
Senior Member
Join Date: Apr 2016
Old 03-31-2018 , 07:39   Adding the bonus limit for a given round
Reply With Quote #1

PHP Code:
#pragma semicolon 1

#define DEBUG

#define PLUGIN_AUTHOR "xFlane"
#define PLUGIN_VERSION "1.00"

#define NICKNAME_PART "OneFrag.pl"

#define PREFIX "[BONUS]"

#include <sourcemod>
#include <sdktools>

#define CHANCE_TO_RECEIVE_MONEY 33
#define CHANCE_TO_WEAPON CHANCE_TO_RECEIVE_MONEY + 33
#define CHANCE_TO_KEVLAR CHANCE_TO_WEAPON + 33
#define CHANCE_TO_ARMOR CHANCE_TO_WEAPON + 33

const int LIMIT_BONUS 15// ogranicza dana runde
int g_iRoundCount 0// zeruje rundy 
int moneyGifts[] = 
{
    
100,
    
200,
    
300,
    
400,
    
500
};

char itemGifts[][] = 
{
    
"weapon_decoy",
    
"weapon_flashbang",
    
"weapon_hegrenade",
    
"weapon_incgrenade",
    
"weapon_molotov",
    
"weapon_smokegrenade",
    
"weapon_taser",
    
"weapon_tagrenade"
};

#pragma newdecls required

EngineVersion g_Game;

public 
Plugin myinfo 
{
    
name "[SM] Nickname random gifts.",
    
author PLUGIN_AUTHOR,
    
description "",
    
version PLUGIN_VERSION,
    
url "http://steamcommunity.com/id/xflane/"
};

public 
void OnPluginStart()
{
    
g_Game GetEngineVersion();
    if(
g_Game != Engine_CSGO && g_Game != Engine_CSS)
    {
        
SetFailState("This plugin is for CSGO/CSS only.");    
    }
    
    
HookEvent("player_spawn"Event_Spawn);
    
HookEvent("round_start"Event_OnRoundStart);
}

public 
void OnMapStart() {
  
g_iRoundCount 0;
}
 
public 
Action Event_OnRoundStart(Event hEvent, const char[] szBroadcastbool bBroadcast) {
  if (
GameRules_GetProp("m_bWarmupPeriod") == 0) { // nie liczymy rozgrzewki
    
g_iRoundCount += 1;
  }
}

public 
Action Event_Spawn(Event event, const char[] namebool dontBroadcast)
{
    
int client GetClientOfUserId(event.GetInt("userid"));
    
    
char clientName[32];
    
GetClientName(clientclientName32);
    
    if(
StrContains(clientNameNICKNAME_PART) > -1)
    {
        
int num GetRandomInt(0100);
        if(
num <= CHANCE_TO_RECEIVE_MONEY)
        {
            else if (
GetTeamScore(CS_TEAM_CT) + GetTeamScore(CS_TEAM_T) != && !IsBonusDisabled())
            
int money moneyGifts[GetRandomInt(0sizeof(moneyGifts) - 1)];
            
PrintToChat(client"%s Otrzymales \x04%i$\x01, bonusowe \x04%s\x01 za dopisek w nicku."PREFIXmoneyNICKNAME_PART);
            
money += GetEntProp(clientProp_Send"m_iAccount");
            
SetEntProp(clientProp_Send"m_iAccount"money 16000 16000 money);
        }
        else if(
num <= CHANCE_TO_WEAPON)
        {
            
char weapon[32];
            
strcopy(weapon32itemGifts[GetRandomInt(0sizeof(itemGifts) - 1)]);
            
GivePlayerItem(clientweapon);
            
ReplaceString(weapon32"weapon_""");
            
PrintToChat(client"%s Otrzymales \x04%s\x01, jako bonus \x04%s\x01 za dopisek w nicku."PREFIXweaponNICKNAME_PART);
        }
        else if(
num <= CHANCE_TO_KEVLAR)
        {
            
SetEntProp(clientProp_Send"m_bHasHelmet"1);
            
PrintToChat(client"%s Otrzymales \x04Kevlar\x01, jako bonus \x04%s\x01 za dopisek w nicku."PREFIXNICKNAME_PART);
        }
        else if(
num <= CHANCE_TO_ARMOR)
        {
            
SetEntProp(clientProp_Send"m_ArmorValue"100);
            
PrintToChat(client"%s Otrzymales \x0Kamizelke\x01, jako bonus \x04%s\x01 za dopisek w nicku."PREFIXNICKNAME_PART);
        }
    }
}

stock bool IsBonusDisabled() {
  return 
g_iRoundCount >= LIMIT_BONUS// ta funkcja też musi być zawarta


Quote:
//// RandomNickGifts.sp
//
// RandomNickGifts.sp(93) : error 017: undefined symbol "CS_TEAM_CT"
// RandomNickGifts.sp(99) : error 017: undefined symbol "CS_TEAM_CT"
//
// 2 Errors.

Last edited by szogun; 03-31-2018 at 12:17.
szogun is offline
xFlane
AlliedModders Donor
Join Date: Nov 2017
Location: Israel
Old 03-31-2018 , 07:52   Re: CS_TEAM_CT
Reply With Quote #2

what do you wish to check by that

PHP Code:
 else if (GetTeamScore(CS_TEAM_CT) + GetTeamScore(CS_TEAM_T) != && !IsBonusDisabled()) 
also, change the precentage of getting each option so you can get each of the options. (( 33 * 4 ) is bigger than 100)

PHP Code:

#define CHANCE_TO_RECEIVE_MONEY 25
#define CHANCE_TO_WEAPON CHANCE_TO_RECEIVE_MONEY + 25
#define CHANCE_TO_KEVLAR CHANCE_TO_WEAPON + 25
#define CHANCE_TO_ARMOR CHANCE_TO_WEAPON + 25 
__________________
Taking private requests.

Last edited by xFlane; 03-31-2018 at 07:53.
xFlane is offline
91346706501435897134
Member
Join Date: Oct 2017
Old 03-31-2018 , 07:53   Re: CS_TEAM_CT
Reply With Quote #3

Code:
#include <cstrike>
91346706501435897134 is offline
szogun
Senior Member
Join Date: Apr 2016
Old 03-31-2018 , 09:23   Re: CS_TEAM_CT
Reply With Quote #4

Quote:
Originally Posted by xFlane View Post
what do you wish to check by that

PHP Code:
 else if (GetTeamScore(CS_TEAM_CT) + GetTeamScore(CS_TEAM_T) != && !IsBonusDisabled()) 
He wants to limit the receipt of bonuses in the first round and 15 round

Last edited by szogun; 03-31-2018 at 09:27.
szogun is offline
szogun
Senior Member
Join Date: Apr 2016
Old 03-31-2018 , 11:05   Re: CS_TEAM_CT
Reply With Quote #5

PHP Code:
#pragma semicolon 1

#define DEBUG

#define PLUGIN_AUTHOR "xFlane"
#define PLUGIN_VERSION "1.00"

#define NICKNAME_PART "OneFrag.pl"
#define PREFIX "[BONUS]"
#define MAX_ROUNDS "48"

#include <sourcemod>
#include <sdktools>

#define CHANCE_TO_RECEIVE_MONEY 25
#define CHANCE_TO_WEAPON CHANCE_TO_RECEIVE_MONEY + 25
#define CHANCE_TO_KEVLAR CHANCE_TO_WEAPON + 25
#define CHANCE_TO_ARMOR CHANCE_TO_WEAPON + 25

const int LIMIT_BONUS 1// runda w której ograniczyć bonus
const int LIMIT_BONUS 15// runda w której ograniczyć bonus
int g_iRoundCount 0// resetuje rundy
int moneyGifts[] = 
{
    
100,
    
200,
    
300,
    
400,
    
500
};

char itemGifts[][] = 
{
    
"weapon_decoy",
    
"weapon_flashbang",
    
"weapon_hegrenade",
    
"weapon_incgrenade",
    
"weapon_molotov",
    
"weapon_smokegrenade",
    
"weapon_taser",
    
"weapon_tagrenade"
};

#pragma newdecls required

EngineVersion g_Game;

public 
Plugin myinfo 
{
    
name "[SM] Nickname random gifts.",
    
author PLUGIN_AUTHOR,
    
description "",
    
version PLUGIN_VERSION,
    
url "http://steamcommunity.com/id/xflane/"
};

public 
void OnPluginStart()
{
    
g_Game GetEngineVersion();
    if(
g_Game != Engine_CSGO && g_Game != Engine_CSS)
    {
        
SetFailState("This plugin is for CSGO/CSS only.");    
    }
    
    
HookEvent("player_spawn"Event_Spawn);
    
HookEvent("round_start"Event_OnRoundStart);
}

public 
void OnMapStart() {
  
g_iRoundCount 0;
}
 
public 
Action Event_OnRoundStart(Event hEvent, const char[] szBroadcastbool bBroadcast) {
  if (
GameRules_GetProp("m_bWarmupPeriod") == 0) { // nie liczymy rozgrzewki
    
g_iRoundCount += 1;
  }
}

public 
Action Event_Spawn(Event event, const char[] namebool dontBroadcast)
{
    
int client GetClientOfUserId(event.GetInt("userid"));
    
    
char clientName[32];
    
GetClientName(clientclientName32);
    
    if(
StrContains(clientNameNICKNAME_PART) > -1)
    {
        
int num GetRandomInt(0100);
        if(
num <= CHANCE_TO_RECEIVE_MONEY)
        {
            (!
IsBonusDisabled());  // warunek ograniczajacy bonus
            
int money moneyGifts[GetRandomInt(0sizeof(moneyGifts) - 1)];
            
PrintToChat(client"%s Otrzymales \x04%i$\x01, bonusowe \x04%s\x01 za dopisek w nicku."PREFIXmoneyNICKNAME_PART);
            
money += GetEntProp(clientProp_Send"m_iAccount");
            
SetEntProp(clientProp_Send"m_iAccount"money 16000 16000 money);
        }
        else if(
num <= CHANCE_TO_WEAPON)
        {
            
char weapon[32];
            
strcopy(weapon32itemGifts[GetRandomInt(0sizeof(itemGifts) - 1)]);
            
GivePlayerItem(clientweapon);
            
ReplaceString(weapon32"weapon_""");
            
PrintToChat(client"%s Otrzymales \x04%s\x01, jako bonus \x04%s\x01 za dopisek w nicku."PREFIXweaponNICKNAME_PART);
        }
        else if(
num <= CHANCE_TO_KEVLAR)
        {
            
SetEntProp(clientProp_Send"m_bHasHelmet"1);
            
PrintToChat(client"%s Otrzymales \x04Kevlar\x01, jako bonus \x04%s\x01 za dopisek w nicku."PREFIXNICKNAME_PART);
        }
        else if(
num <= CHANCE_TO_ARMOR)
        {
            
SetEntProp(clientProp_Send"m_ArmorValue"100);
            
PrintToChat(client"%s Otrzymales \x0Kamizelke\x01, jako bonus \x04%s\x01 za dopisek w nicku."PREFIXNICKNAME_PART);
        }
    }
}

stock bool IsBonusDisabled() {
  return 
g_iRoundCount >= LIMIT_BONUS// funkcja ograniczająca bonusy

Quote:
//// RandomNickGifts.sp
//
// RandomNickGifts.sp(21) : warning 201: redefinition of constant/macro (symbol
"LIMIT_BONUS")
// Code size: 4464 bytes
// Data size: 3068 bytes
// Stack/heap size: 16384 bytes
// Total requirements: 23916 bytes
//
// 1 Warning.
//
// Compilation Time: 0,2 sec

Last edited by szogun; 03-31-2018 at 11:06.
szogun is offline
Kellan123
AlliedModders Donor
Join Date: Aug 2012
Old 03-31-2018 , 11:32   Re: CS_TEAM_CT
Reply With Quote #6

const int LIMIT_BONUS = 1; // runda w której ograniczyć bonus
const int LIMIT_BONUS = 15; // runda w której ograniczyć bonus

to

const int LIMIT_BONUS = 15; // runda w której ograniczyć bonus

PS: You are using two same names.

Last edited by Kellan123; 03-31-2018 at 11:32.
Kellan123 is offline
xFlane
AlliedModders Donor
Join Date: Nov 2017
Location: Israel
Old 03-31-2018 , 11:42   Re: CS_TEAM_CT
Reply With Quote #7

Quote:
Originally Posted by szogun View Post
He wants to limit the receipt of bonuses in the first round and 15 round
try that:

PHP Code:

#pragma semicolon 1

#define DEBUG

#define PLUGIN_AUTHOR "xFlane"
#define PLUGIN_VERSION "1.00"

#define NICKNAME_PART "OneFrag.pl" 

#define PREFIX "[BONUS]"

#include <sourcemod>
#include <cstrike>
#include <sdktools>

#define CHANCE_TO_RECEIVE_MONEY 25
#define CHANCE_TO_WEAPON CHANCE_TO_RECEIVE_MONEY + 25
#define CHANCE_TO_KEVLAR CHANCE_TO_WEAPON + 25
#define CHANCE_TO_ARMOR CHANCE_TO_WEAPON + 25

#pragma newdecls required

const int LIMIT_BONUS 15// ogranicza dana runde
int g_iRoundCount 0// zeruje rundy 

int moneyGifts[] = 
{
    
100
    
200
    
300
    
400
    
500
};

char itemGifts[][] = 
{
    
"weapon_decoy"
    
"weapon_flashbang"
    
"weapon_hegrenade"
    
"weapon_incgrenade"
    
"weapon_molotov"
    
"weapon_smokegrenade"
    
"weapon_taser"
    
"weapon_tagrenade"
};

EngineVersion g_Game;

public 
Plugin myinfo 
{
    
name "[SM] Nickname random gifts."
    
author PLUGIN_AUTHOR
    
description ""
    
version PLUGIN_VERSION
    
url "http://steamcommunity.com/id/xflane/"
};

public 
void OnPluginStart()
{
    
g_Game GetEngineVersion();
    if (
g_Game != Engine_CSGO && g_Game != Engine_CSS)
    {
        
SetFailState("This plugin is for CSGO/CSS only.");
    }
    
    
HookEvent("player_spawn"Event_Spawn);
    
HookEvent("round_start"Event_OnRoundStart);
}

public 
void OnMapStart() {
    
g_iRoundCount 0;
}

public 
Action Event_OnRoundStart(Event hEvent, const char[] szBroadcastbool bBroadcast) {
    if (
GameRules_GetProp("m_bWarmupPeriod") == 0) {  // nie liczymy rozgrzewki
        
g_iRoundCount += 1;
    }
}

public 
Action Event_Spawn(Event event, const char[] namebool dontBroadcast)
{
    if (
GetTeamScore(CS_TEAM_CT) + GetTeamScore(CS_TEAM_T) == || IsBonusDisabled())
        return 
Plugin_Continue;
    
    
int client GetClientOfUserId(event.GetInt("userid"));
    
    
char clientName[32];
    
GetClientName(clientclientName32);
    
    if (
StrContains(clientNameNICKNAME_PART) > -1)
    {
        
int num GetRandomInt(0100);
        if (
num <= CHANCE_TO_RECEIVE_MONEY)
        {
            
int money moneyGifts[GetRandomInt(0sizeof(moneyGifts) - 1)];
            
PrintToChat(client"%s Otrzymales \x04%i$\x01, bonusowe \x04%s\x01 za dopisek w nicku."PREFIXmoneyNICKNAME_PART);
            
money += GetEntProp(clientProp_Send"m_iAccount");
            
SetEntProp(clientProp_Send"m_iAccount"money 16000 16000 money);
        }
        else if (
num <= CHANCE_TO_WEAPON)
        {
            
char weapon[32];
            
strcopy(weapon32itemGifts[GetRandomInt(0sizeof(itemGifts) - 1)]);
            
GivePlayerItem(clientweapon);
            
ReplaceString(weapon32"weapon_""");
            
PrintToChat(client"%s Otrzymales \x04%s\x01, jako bonus \x04%s\x01 za dopisek w nicku."PREFIXweaponNICKNAME_PART);
        }
        else if (
num <= CHANCE_TO_KEVLAR)
        {
            
SetEntProp(clientProp_Send"m_bHasHelmet"1);
            
PrintToChat(client"%s Otrzymales \x04Kevlar\x01, jako bonus \x04%s\x01 za dopisek w nicku."PREFIXNICKNAME_PART);
        }
        else if (
num <= CHANCE_TO_ARMOR)
        {
            
SetEntProp(clientProp_Send"m_ArmorValue"100);
            
PrintToChat(client"%s Otrzymales \x0Kamizelke\x01, jako bonus \x04%s\x01 za dopisek w nicku."PREFIXNICKNAME_PART);
        }
        
    }
    
    return 
Plugin_Continue;
}

stock bool IsBonusDisabled() {
    return 
g_iRoundCount >= LIMIT_BONUS// ta funkcja też musi być zawarta

__________________
Taking private requests.

Last edited by xFlane; 03-31-2018 at 11:43.
xFlane is offline
szogun
Senior Member
Join Date: Apr 2016
Old 03-31-2018 , 12:06   Re: CS_TEAM_CT
Reply With Quote #8

Quote:
Originally Posted by Kellan123 View Post
const int LIMIT_BONUS = 1; // runda w której ograniczyć bonus
const int LIMIT_BONUS = 15; // runda w której ograniczyć bonus

to

const int LIMIT_BONUS = 15; // runda w której ograniczyć bonus

PS: You are using two same names.
Okay, tell me now how to add new rounds. because if you can not define one variable twice

Quote:
Originally Posted by xFlane View Post
try that:

PHP Code:

#pragma semicolon 1

#define DEBUG

#define PLUGIN_AUTHOR "xFlane"
#define PLUGIN_VERSION "1.00"

#define NICKNAME_PART "OneFrag.pl" 

#define PREFIX "[BONUS]"

#include <sourcemod>
#include <cstrike>
#include <sdktools>

#define CHANCE_TO_RECEIVE_MONEY 25
#define CHANCE_TO_WEAPON CHANCE_TO_RECEIVE_MONEY + 25
#define CHANCE_TO_KEVLAR CHANCE_TO_WEAPON + 25
#define CHANCE_TO_ARMOR CHANCE_TO_WEAPON + 25

#pragma newdecls required

const int LIMIT_BONUS 15// ogranicza dana runde
int g_iRoundCount 0// zeruje rundy 

int moneyGifts[] = 
{
    
100
    
200
    
300
    
400
    
500
};

char itemGifts[][] = 
{
    
"weapon_decoy"
    
"weapon_flashbang"
    
"weapon_hegrenade"
    
"weapon_incgrenade"
    
"weapon_molotov"
    
"weapon_smokegrenade"
    
"weapon_taser"
    
"weapon_tagrenade"
};

EngineVersion g_Game;

public 
Plugin myinfo 
{
    
name "[SM] Nickname random gifts."
    
author PLUGIN_AUTHOR
    
description ""
    
version PLUGIN_VERSION
    
url "http://steamcommunity.com/id/xflane/"
};

public 
void OnPluginStart()
{
    
g_Game GetEngineVersion();
    if (
g_Game != Engine_CSGO && g_Game != Engine_CSS)
    {
        
SetFailState("This plugin is for CSGO/CSS only.");
    }
    
    
HookEvent("player_spawn"Event_Spawn);
    
HookEvent("round_start"Event_OnRoundStart);
}

public 
void OnMapStart() {
    
g_iRoundCount 0;
}

public 
Action Event_OnRoundStart(Event hEvent, const char[] szBroadcastbool bBroadcast) {
    if (
GameRules_GetProp("m_bWarmupPeriod") == 0) {  // nie liczymy rozgrzewki
        
g_iRoundCount += 1;
    }
}

public 
Action Event_Spawn(Event event, const char[] namebool dontBroadcast)
{
    if (
GetTeamScore(CS_TEAM_CT) + GetTeamScore(CS_TEAM_T) == || IsBonusDisabled())
        return 
Plugin_Continue;
    
    
int client GetClientOfUserId(event.GetInt("userid"));
    
    
char clientName[32];
    
GetClientName(clientclientName32);
    
    if (
StrContains(clientNameNICKNAME_PART) > -1)
    {
        
int num GetRandomInt(0100);
        if (
num <= CHANCE_TO_RECEIVE_MONEY)
        {
            
int money moneyGifts[GetRandomInt(0sizeof(moneyGifts) - 1)];
            
PrintToChat(client"%s Otrzymales \x04%i$\x01, bonusowe \x04%s\x01 za dopisek w nicku."PREFIXmoneyNICKNAME_PART);
            
money += GetEntProp(clientProp_Send"m_iAccount");
            
SetEntProp(clientProp_Send"m_iAccount"money 16000 16000 money);
        }
        else if (
num <= CHANCE_TO_WEAPON)
        {
            
char weapon[32];
            
strcopy(weapon32itemGifts[GetRandomInt(0sizeof(itemGifts) - 1)]);
            
GivePlayerItem(clientweapon);
            
ReplaceString(weapon32"weapon_""");
            
PrintToChat(client"%s Otrzymales \x04%s\x01, jako bonus \x04%s\x01 za dopisek w nicku."PREFIXweaponNICKNAME_PART);
        }
        else if (
num <= CHANCE_TO_KEVLAR)
        {
            
SetEntProp(clientProp_Send"m_bHasHelmet"1);
            
PrintToChat(client"%s Otrzymales \x04Kevlar\x01, jako bonus \x04%s\x01 za dopisek w nicku."PREFIXNICKNAME_PART);
        }
        else if (
num <= CHANCE_TO_ARMOR)
        {
            
SetEntProp(clientProp_Send"m_ArmorValue"100);
            
PrintToChat(client"%s Otrzymales \x0Kamizelke\x01, jako bonus \x04%s\x01 za dopisek w nicku."PREFIXNICKNAME_PART);
        }
        
    }
    
    return 
Plugin_Continue;
}

stock bool IsBonusDisabled() {
    return 
g_iRoundCount >= LIMIT_BONUS// ta funkcja też musi być zawarta

Hmm ... more I want to limit the same bonus which adds extra $$ and here I think that it will block all

Last edited by szogun; 03-31-2018 at 12:14.
szogun is offline
xFlane
AlliedModders Donor
Join Date: Nov 2017
Location: Israel
Old 03-31-2018 , 12:48   Re: CS_TEAM_CT
Reply With Quote #9

Quote:
Originally Posted by szogun View Post
Okay, tell me now how to add new rounds. because if you can not define one variable twice



Hmm ... more I want to limit the same bonus which adds extra $$ and here I think that it will block all
PHP Code:


#pragma semicolon 1

#define DEBUG

#define PLUGIN_AUTHOR "xFlane"
#define PLUGIN_VERSION "1.00"

#define NICKNAME_PART "OneFrag.pl" 

#define PREFIX "[BONUS]"

#include <sourcemod>
#include <cstrike>
#include <sdktools>

#define CHANCE_TO_RECEIVE_MONEY 25
#define CHANCE_TO_WEAPON CHANCE_TO_RECEIVE_MONEY + 25
#define CHANCE_TO_KEVLAR CHANCE_TO_WEAPON + 25
#define CHANCE_TO_ARMOR CHANCE_TO_KEVLAR + 25

#pragma newdecls required

const int LIMIT_BONUS 15// ogranicza dana runde
int g_iRoundCount 0// zeruje rundy 

int moneyGifts[] = 
{
    
100
    
200
    
300
    
400
    
500
};

char itemGifts[][] = 
{
    
"weapon_decoy"
    
"weapon_flashbang"
    
"weapon_hegrenade"
    
"weapon_incgrenade"
    
"weapon_molotov"
    
"weapon_smokegrenade"
    
"weapon_taser"
    
"weapon_tagrenade"
};

EngineVersion g_Game;

public 
Plugin myinfo 
{
    
name "[SM] Nickname random gifts."
    
author PLUGIN_AUTHOR
    
description ""
    
version PLUGIN_VERSION
    
url "http://steamcommunity.com/id/xflane/"
};

public 
void OnPluginStart()
{
    
g_Game GetEngineVersion();
    if (
g_Game != Engine_CSGO && g_Game != Engine_CSS)
    {
        
SetFailState("This plugin is for CSGO/CSS only.");
    }
    
    
HookEvent("player_spawn"Event_Spawn);
    
HookEvent("round_start"Event_OnRoundStart);
}

public 
void OnMapStart() {
    
g_iRoundCount 0;
}

public 
Action Event_OnRoundStart(Event hEvent, const char[] szBroadcastbool bBroadcast) {
    if (
GameRules_GetProp("m_bWarmupPeriod") == 0) {  // nie liczymy rozgrzewki
        
g_iRoundCount += 1;
    }
}

public 
Action Event_Spawn(Event event, const char[] namebool dontBroadcast)
{
    
int client GetClientOfUserId(event.GetInt("userid"));
    
    
char clientName[32];
    
GetClientName(clientclientName32);
    
    if (
StrContains(clientNameNICKNAME_PART) > -1)
    {
        
int num 0;
        
        if (
GetTeamScore(CS_TEAM_CT) + GetTeamScore(CS_TEAM_T) == || IsBonusDisabled())
            
num GetRandomInt(CHANCE_TO_RECEIVE_MONEY+1100);
        else
            
num GetRandomInt(0100);

        if (
num <= CHANCE_TO_RECEIVE_MONEY)
        {
            
int money moneyGifts[GetRandomInt(0sizeof(moneyGifts) - 1)];
            
PrintToChat(client"%s Otrzymales \x04%i$\x01, bonusowe \x04%s\x01 za dopisek w nicku."PREFIXmoneyNICKNAME_PART);
            
money += GetEntProp(clientProp_Send"m_iAccount");
            
SetEntProp(clientProp_Send"m_iAccount"money 16000 16000 money);
        }
        else if (
num <= CHANCE_TO_WEAPON)
        {
            
char weapon[32];
            
strcopy(weapon32itemGifts[GetRandomInt(0sizeof(itemGifts) - 1)]);
            
GivePlayerItem(clientweapon);
            
ReplaceString(weapon32"weapon_""");
            
PrintToChat(client"%s Otrzymales \x04%s\x01, jako bonus \x04%s\x01 za dopisek w nicku."PREFIXweaponNICKNAME_PART);
        }
        else if (
num <= CHANCE_TO_KEVLAR)
        {
            
SetEntProp(clientProp_Send"m_bHasHelmet"1);
            
PrintToChat(client"%s Otrzymales \x04Kevlar\x01, jako bonus \x04%s\x01 za dopisek w nicku."PREFIXNICKNAME_PART);
        }
        else if (
num <= CHANCE_TO_ARMOR)
        {
            
SetEntProp(clientProp_Send"m_ArmorValue"100);
            
PrintToChat(client"%s Otrzymales \x0Kamizelke\x01, jako bonus \x04%s\x01 za dopisek w nicku."PREFIXNICKNAME_PART);
        }
        
    }
    
    return 
Plugin_Continue;
}

stock bool IsBonusDisabled() {
    return 
g_iRoundCount >= LIMIT_BONUS// ta funkcja też musi być zawarta

__________________
Taking private requests.

Last edited by xFlane; 03-31-2018 at 12:49.
xFlane is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:10.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode