Добрый день парни может кто нить будь поглядит код ,а то в логах идет ошибка а плагин работает , суть плагина на csdm каждые 30 сек давать админа и випам разный денежный бонус.
Иногда говорят не приходят деньги
Код:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <colorchat>
#define PLUGIN "name"
#define VERSION "0.2"
#define AUTHOR "author"
#define BONUS_MONEY 555
#define MAX_MONEY 32000
new g_MaxPlayers
public plugin_init()
{
register_plugin( PLUGIN, VERSION, AUTHOR )
g_MaxPlayers = get_maxplayers()
set_task( 30.0, "give_bonus", _, _, _, "b" )
}
public give_bonus()
{
for( new j = 1; j <= g_MaxPlayers; j ++ )
{
if( is_user_connected( j ) )
{
if( get_user_flags( j ) & ADMIN_BAN )
{
new money = cs_get_user_money( j )
if( money < MAX_MONEY )
{
cs_set_user_money( j, money + BONUS_MONEY )
ColorChat( j, NORMAL, "^3Вы получили свой бонус:^4 +%d$", BONUS_MONEY )
}
if( money > MAX_MONEY )
{
cs_set_user_money( j, MAX_MONEY )
}
}
}
{
if( get_user_flags( j ) & ADMIN_LEVEL_H )
{
new money = cs_get_user_money( j )
if( money < MAX_MONEY )
{
cs_set_user_money( j, money + 400 )
ColorChat( j, NORMAL, "^3Вы получили свой бонус:^4 +%d$", 400 )
}
if( money > MAX_MONEY )
{
cs_set_user_money( j, MAX_MONEY )
}
}
}
}
}
Код:
L 03/31/2016 - 12:02:18: [AMXX] Displaying debug trace (plugin "csdm_bonus.amxx")
L 03/31/2016 - 12:02:18: [AMXX] Run time error 10: native error (native "cs_get_user_money")
L 03/31/2016 - 12:02:18: [AMXX] [0] csdm_bonus.sma::give_bonus (line 62)
Отредактировал: meloman, - 31.3.2016, 10:25
Причина: Выдано предупреждение!