Quote:
Originally Posted by Shzzzzz
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], playerCount, i, player, pMoney;
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(player, pMoney);
client_print(player,print_chat,"%L",LANG_PLAYER,"MONEY_AMOUNT",pMoney)
}
}
}
return 0;
}