Code
if (get_user_flags(id) & ADMIN_LEVEL_A) {
new money = cs_get_user_money(id);
if(money < 16000)
{
cs_set_user_money(id, 16000);
}}
И по работай с условиями.
Можно разбить на 2 файла.(один для 5000 другой для 2000)
Code
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#define get_bit(%1,%2) (%1 & (1 << (%2 & 31)))
#define set_bit(%1,%2) %1 |= (1 << (%2 & 31))
#define reset_bit(%1,%2) %1 &= ~(1 << (%2 & 31))
#define MAX_ACCESS 32
new ARRAY_saved_access[MAX_ACCESS][32]
new BITSUM_access
new INT_total_access
public plugin_precache()
{
register_srvcmd("add_access", "SRVCMD__add_access")
new cfgdir[32]
get_configsdir(cfgdir, 31)
server_cmd("exec %s/access.cfg", cfgdir)
server_exec()
}
public SRVCMD__add_access()
{
if (INT_total_access >= MAX_ACCESS) return
new name[32]
read_argv(1, name, 31)
remove_quotes(name)
formatex(ARRAY_saved_access[INT_total_access], 31, name)
INT_total_access++
}
public plugin_init()
{
register_plugin("Jzona.ru", "1.0", "Contra")
}
public client_putinserver(id)
{
reset_bit(BITSUM_access, id)
new name[32]
get_user_name(id, name, 31)
for (new i = 0; i < INT_total_access; i++)
if (equal(name, ARRAY_saved_access[i]))
{
set_bit(BITSUM_access, id)
break
}
}