Bo2

rui vieira

Veteran
Messages
14
Points
558
can some one help me with this script getting bad syntax

devgui_award_challenge( n_index )
{
while( n_index == 4 )
{
s_team_stats = level._challenges.s_team;
s_team_stats.n_completed = 1;
s_team_stats.n_medals_held = 1;
a_keys = getarraykeys( level._challenges.s_team.a_stats );
s_stat = level._challenges.s_team.a_stats[ a_keys[ 0]];
s_stat.b_medal_awarded = 1;
s_stat.b_reward_claimed = 0;
a_players = get_players();
foreach( player in a_players )
{
s_stat.a_b_player_rewarded[player.characterindex] = 0;
player setclientfieldtoplayer( s_stat.s_parent.cf_complete, 1 );
}
foreach( m_board in level.a_m_challenge_boards )
{
m_board showpart( s_stat.str_glow_tag );
}
}
a_keys = getarraykeys( level._challenges.a_players[ 0].a_stats );
a_players = get_players();
foreach( player in a_players )
{
s_player_data = level._challenges.a_players[ player.characterindex];
s_player_data.n_completed++;
s_player_data.n_medals_held++;//Testing bad syntax
s_stat = s_player_data.a_stats[ a_keys[ n_index - 1]];
s_stat.b_medal_awarded = 1;
s_stat.b_reward_claimed = 0;
player setclientfieldtoplayer( s_stat.s_parent.cf_complete, 1 );
foreach( m_board in level.a_m_challenge_boards )
{
m_board showpart( s_stat.str_glow_tag );
}
}

}
 

CF4_99

Veteran
Messages
118
Points
663
C++:
devgui_award_challenge( n_index )
{
    while( n_index == 4 )
    {
        s_team_stats = level._challenges.s_team;
        s_team_stats.n_completed = 1;
        s_team_stats.n_medals_held = 1;
        a_keys = getarraykeys( level._challenges.s_team.a_stats );
        s_stat = level._challenges.s_team.a_stats[ a_keys[ 0]];
        s_stat.b_medal_awarded = 1;
        s_stat.b_reward_claimed = 0;
        a_players = get_players();
        foreach( player in a_players )
        {
            s_stat.a_b_player_rewarded[player.characterindex] = 0;
            player setclientfieldtoplayer( s_stat.s_parent.cf_complete, 1 );
        }
        foreach( m_board in level.a_m_challenge_boards )
        {
            m_board showpart( s_stat.str_glow_tag );
        }
    }
    a_keys = getarraykeys( level._challenges.a_players[ 0].a_stats );
    a_players = get_players();
    foreach( player in a_players )
    {
        s_player_data = level._challenges.a_players[ player.characterindex];
        s_player_data.n_completed++;
        s_player_data.n_medals_held++;//Testing bad syntax
        s_stat = s_player_data.a_stats[ a_keys[ n_index - 1] ];
        s_stat.b_medal_awarded = 1;
        s_stat.b_reward_claimed = 0;
        player setclientfieldtoplayer( s_stat.s_parent.cf_complete, 1 );
        foreach( m_board in level.a_m_challenge_boards )
        {
            m_board showpart( s_stat.str_glow_tag );
        }
    }
}


Code:
 s_stat = s_player_data.a_stats[ a_keys[ n_index - 1] ];
this part was your problem. You needed a separation between the brackets.

Bad Syntax: "]]"
Good Syntax: "] ]"
 

Similar threads


Top