Trying to make plugin that
checks on round end if(is the user is dead && is on the losing team && money is less than 800)
{
sets users money to 800
}
but it is giving a tag mismatch error during compiling on these two lines
Code:
if ((fm_get_user_team(i) == CS_TEAM_CT) && !is_user_alive(i) && (cs_get_user_money(i) < 800))
and I have no idea if I'm doing anything else wrong with this code.
PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fakemeta>
#define TIMETOWAIT 4.7
#define fm_get_user_team(%1) get_pdata_int(%1, 114)
new g_iMaxPlayers
public plugin_init()
{
register_logevent("LogEvent_CTs_Win", 6, "0=Team", "1=CT", "3=CTs_Win")
register_logevent("LogEvent_Ts_Win", 3, "0=Team", "1=CT", "3=CTs_Win")
g_iMaxPlayers = get_maxplayers()
}
public LogEvent_CTs_win()
{
set_task(TIMETOWAIT, "GiveTmoney")
}
public LogEvent_Ts_win()
{
set_task(TIMETOWAIT, "GiveCTmoney")
}
public GiveTmoney()
{
for (new i = 1; i <= g_iMaxPlayers; i++)
{
if(!is_user_connected(i))
continue;
if ((fm_get_user_team(i) == CS_TEAM_T) && !is_user_alive(i) && (cs_get_user_money(i) < 800))
cs_set_user_money(i, 800)
}
}
public GiveCTmoney()
{
for (new i = 1; i <= g_iMaxPlayers; i++)
{
if(!is_user_connected(i))
continue;
if ((fm_get_user_team(i) == CS_TEAM_CT) && !is_user_alive(i) && (cs_get_user_money(i) < 800))
cs_set_user_money(i, 800)
}
}