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

Group Money


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
alphaearth
Senior Member
Join Date: Feb 2018
Location: Turkey
Old 04-11-2019 , 13:06   Group Money
Reply With Quote #1

I tried to do something like this by getting help.
Is there a place I need to fix?

PHP Code:
#include <sourcemod>
#include <cstrike>
#include <sdktools>
#include <SteamWorks>
#include <SWGM>

#pragma semicolon 1
#pragma newdecls required

#define MESSAGE_PREFIX " \x02[Narkotik]"

Handle RoundStartMoney;

int iRoundStartMoney;

public 
Plugin myinfo 
{
    
name "Round start and per kill money",
    
author "B3none, LazHoroni",
    
description "",
    
version "1.0.0",
    
url ""
};

public 
void OnPluginStart()
{
    
HookEvent("round_start"OnRoundStart);
    
    
RoundStartMoney CreateConVar("sm_roundstartmoney""1000""Round start money");
}

public 
void OnMapStart()
{
    
iRoundStartMoney GetConVarInt(RoundStartMoney);
}

public 
Action OnRoundStart(Handle hEvent, const char[] Namebool dontbroadcast)
{
    if (
IsWarmup())
    {
        return;
    }
    
    if (
IsRoundBlah(GetCurrentRound()))
    {
        for (
int iClient 1iClient <= MaxClientsiClient++)
        {
            if(
IsClientInGame(iClient))
            {
                if(
SWGM_IsPlayerValidated(iClient) && !SWGM_InGroup(iClient))
                {
                    
PrintToChat(iClient"%s \x04Her round \x07+$%i \x04kazanmak için gruba katılınız."MESSAGE_PREFIXiRoundStartMoney);
                    
PrintToChat(iClient"%s \x04Skor tablosundaki \x07SUNUCU İNTERNET SİTESİ\x04'ne tıklayarak gruba katılabilirsin."MESSAGE_PREFIX);
                    
SetEntProp(iClientProp_Send"m_bHasHelmet"100);
                    
SetEntProp(iClientProp_Send"m_ArmorValue"100);
                }
                else
                {
                    
PrintToChat(iClient"%s \x07+$%i \x04kazandınız. Gruba katıldığınız için teşekkürler."MESSAGE_PREFIXiRoundStartMoney);
                    
int money GetEntProp(iClientProp_Send"m_iAccount");
                    
SetEntProp(iClientProp_Send"m_iAccount"money iRoundStartMoney);
                    
SetEntProp(iClientProp_Send"m_bHasHelmet"100);
                    
SetEntProp(iClientProp_Send"m_ArmorValue"100);
                }
            }
        }
    }
    
    if (
IsRoundBlahYasak(GetCurrentRound()))
    {
        for (
int iClient 1iClient <= MaxClientsiClient++)
        {
            if(
IsClientInGame(iClient))
            {
                if(
SWGM_IsPlayerValidated(iClient) && !SWGM_InGroup(iClient))
                {
                    
PrintToChat(iClient"%s \x04Her round \x07+$%i \x04kazanmak için gruba katılınız."MESSAGE_PREFIXiRoundStartMoney);
                    
PrintToChat(iClient"%s \x04Skor tablosundaki \x07SUNUCU İNTERNET SİTESİ\x04'ne tıklayarak gruba katılabilirsin."MESSAGE_PREFIX);
                }
                else
                {
                    
PrintToChat(iClient"%s \x04İlk 3 round \x07+$%i \x04ödülü devre dışıdır."MESSAGE_PREFIXiRoundStartMoney);
                }
            }
        }
    }
    
    if (
IsRoundWeaponYasak(GetCurrentRound()))
    {
        
ServerCommand("sm plugins unload weapons");
        for (
int iClient 1iClient <= MaxClientsiClient++)
        {
            if(
IsClientInGame(iClient))
            {
                if(
SWGM_IsPlayerValidated(iClient) && !SWGM_InGroup(iClient))
                {
                    
PrintToChat(iClient"%s \x04Her round \x07+$%i \x04kazanmak için gruba katılınız."MESSAGE_PREFIXiRoundStartMoney);
                    
PrintToChat(iClient"%s \x04Skor tablosundaki \x07SUNUCU İNTERNET SİTESİ\x04'ne tıklayarak gruba katılabilirsin."MESSAGE_PREFIX);
                }
                else
                {
                    
PrintToChat(iClient"%s \x04İlk 3 round \x07+$%i \x04ödülü devre dışıdır."MESSAGE_PREFIXiRoundStartMoney);
                }
            }
        }
    }
    
    if (
IsRoundWeaponSerbest(GetCurrentRound()))
    {
        
ServerCommand("sm plugins load weapons");
        for (
int iClient 1iClient <= MaxClientsiClient++)
        {
            if(
IsClientInGame(iClient))
            {
                if(
SWGM_IsPlayerValidated(iClient) && !SWGM_InGroup(iClient))
                {
                    
PrintToChat(iClient"%s \x04Her round \x07+$%i \x04kazanmak için gruba katılınız."MESSAGE_PREFIXiRoundStartMoney);
                    
PrintToChat(iClient"%s \x04Skor tablosundaki \x07SUNUCU İNTERNET SİTESİ\x04'ne tıklayarak gruba katılabilirsin."MESSAGE_PREFIX);
                    
SetEntProp(iClientProp_Send"m_bHasHelmet"100);
                    
SetEntProp(iClientProp_Send"m_ArmorValue"100);
                }
                else
                {
                    
PrintToChat(iClient"%s \x07+$%i \x04kazandınız. Gruba katıldığınız için teşekkürler."MESSAGE_PREFIXiRoundStartMoney);
                    
int money GetEntProp(iClientProp_Send"m_iAccount");
                    
SetEntProp(iClientProp_Send"m_iAccount"money iRoundStartMoney);
                    
SetEntProp(iClientProp_Send"m_bHasHelmet"100);
                    
SetEntProp(iClientProp_Send"m_ArmorValue"100);
                }
            }
        }
    }

}

bool IsRoundBlah(int iRound)
{
    return 
iRound == && iRound == && iRound == && iRound == && iRound == && iRound == && iRound == 10 && iRound == 11 && iRound == 12 && iRound == 13 && iRound == 14 && iRound == 19 && iRound == 20 && iRound == 21 && iRound == 22 && iRound == 23 && iRound == 24 && iRound == 25 && iRound == 26 && iRound == 27 && iRound == 28 && iRound == 29;
}

bool IsRoundBlahYasak(int iRound)
{
    return 
iRound == && iRound == && iRound == 16 && iRound == 17;
}

bool IsRoundWeaponYasak(int iRound)
{
    return 
iRound == && iRound == 15;
}

bool IsRoundWeaponSerbest(int iRound)
{
    return 
iRound == && iRound == 18;
}

bool IsWarmup()
{
    return 
GameRules_GetProp("m_bWarmupPeriod") != 0;
}

int GetCurrentRound()
{
    return 
CS_GetTeamScore(CS_TEAM_T) + CS_GetTeamScore(CS_TEAM_CT);

__________________
alphaearth is offline
impossible_cc
Senior Member
Join Date: Sep 2018
Location: Ukraine
Old 04-12-2019 , 16:47   Re: Group Money
Reply With Quote #2

Quote:
Originally Posted by alphaearth View Post
I tried to do something like this by getting help.
Is there a place I need to fix?

PHP Code:
bool IsRoundBlah(int iRound

    return 
iRound == && iRound == && iRound == && iRound == && iRound == && iRound == && iRound == 10 && iRound == 11 && iRound == 12 && iRound == 13 && iRound == 14 && iRound == 19 && iRound == 20 && iRound == 21 && iRound == 22 && iRound == 23 && iRound == 24 && iRound == 25 && iRound == 26 && iRound == 27 && iRound == 28 && iRound == 29


bool IsRoundBlahYasak(int iRound

    return 
iRound == && iRound == && iRound == 16 && iRound == 17


bool IsRoundWeaponYasak(int iRound

    return 
iRound == && iRound == 15


bool IsRoundWeaponSerbest(int iRound

    return 
iRound == && iRound == 18

It is not possible.
Variable cannot be equals to 1, equals to 2, equals to 16 and equals to 17 in the same time.
I think that you need this:
PHP Code:
bool IsRoundBlah(int iRound

    return 
iRound == || iRound == || iRound == || iRound == || iRound == || iRound == || iRound == 10 || iRound == 11 || iRound == 12 || iRound == 13 || iRound == 14 || iRound == 19 || iRound == 20 || iRound == 21 || iRound == 22 || iRound == 23 || iRound == 24 || iRound == 25 || iRound == 26 || iRound == 27 || iRound == 28 || iRound == 29


bool IsRoundBlahYasak(int iRound

    return 
iRound == || iRound == || iRound == 16 || iRound == 17


bool IsRoundWeaponYasak(int iRound

    return 
iRound == || iRound == 15


bool IsRoundWeaponSerbest(int iRound

    return 
iRound == || iRound == 18

__________________
impossible_cc 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 16:46.


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