Участник
Пользователь
- Сообщения
- 2,143
- Реакции
- 1,225
- Помог
- 44 раз(а)
EnemyDown,
Код:
#include <amxmodx>
#include <reapi>
new cvarMoney;
new cvarMoneyNoVip;
new round_number;
#define FLAG_ACCESS ADMIN_LEVEL_H // default flag "t"
#define ROUND 3
public plugin_init() {
register_plugin("Spawn Money", "1.2b", "Don.C");
RegisterHookChain(RG_RoundEnd, "RoundEnd_Post", .post = true);
RegisterHookChain(RG_CSGameRules_RestartRound, "NewRound_Post", .post = true);
RegisterHookChain(RG_CBasePlayer_Spawn, "PlayerSpawn_Post", .post = true);
cvarMoney = register_cvar("vip_spawn_money_amount", "16000");
cvarMoneyNoVip = register_cvar("novip_money_amount", "7777");
}
public RoundEnd_Post(WinStatus:status, ScenarioEventEndRound:event, Float:tmDelay) {
if(event == ROUND_GAME_COMMENCE || event == ROUND_GAME_RESTART) round_number = 0;
}
public NewRound_Post() round_number++;
public PlayerSpawn_Post(id) {
if(round_number < ROUND) return;
if(!is_user_alive(id)) return;
rg_add_account(id, isVIP(id) ? get_pcvar_num(cvarMoney) : get_pcvar_num(cvarMoneyNoVip), AS_SET);
}
public isVIP(id) {
return get_user_flags(id) & FLAG_ACCESS;
}