Raised This Month: $ Target: $400
 0% 

RoundStart Money Edit


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
@LeX
Junior Member
Join Date: Nov 2018
Old 11-10-2023 , 21:09   Re: RoundStart Money Edit
Reply With Quote #1

Quote:
Originally Posted by Shzzzzz View Post
So, there is few problems and idk if warmup is the cause of them. People get 16k while in warmup and after sv_restart they get no money from plugin.
P.S. i will try to use 1 of them again later
that's why i said it depends on how you use it
so i understand that you have a warmup system/plugin that lasts one round, then after the restart there is another round where you want pistols to be played, then after that round offer them $16k

we can reset the count when the round is restarted

I'm going to make everything simple, I'm going to add a boolean variable that detects whether or not a restart has been made in the round

Try This:
PHP Code:

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <engine>

new MONEY;
new 
szRoundCount;
new 
bool:IsRestarting

public plugin_init()
{
    
register_plugin("round_money","0.7","SweatyBanana")
    
    
MONEY register_cvar("round_money","16000")
    
    
register_dictionary("rmlang.txt")
    
    
register_logevent("new_round"2"1=Round_Start")
    
register_event("TextMsg""Event_TextMsg_Restart""a""2&#Game_C""2&#Game_w")
}

public 
Event_TextMsg_Restart()
{
    
IsRestarting true;
}

public 
new_round()
{
    if( 
IsRestarting )
    {
        
IsRestarting false;
        
szRoundCount 0;
    }

    if(
szRoundCount 2)
        return 
0;

    
szRoundCount++;

    if(
szRoundCount == 2)
    {
        new 
players[32], playerCountiplayerpMoney;
        
pMoney get_pcvar_num(MONEY)
        
        
get_players(players,playerCount);
        
        for(
i=0;i<playerCount;i++)
        {
            
player players[i];
            if(
cs_get_user_money(player) < pMoney)
            {
                
cs_set_user_money(playerpMoney);
                
client_print(player,print_chat,"%L",LANG_PLAYER,"MONEY_AMOUNT",pMoney)
            }
        } 
    }
    return 
0;

@LeX is offline
Shzzzzz
Junior Member
Join Date: Nov 2023
Old 11-11-2023 , 11:52   Re: RoundStart Money Edit
Reply With Quote #2

Thank you again! I will try it later this night when players are gone!
Shzzzzz is offline
Reply


Thread Tools
Display Modes

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 20:22.


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