error in code

Users who are viewing this thread

EmielRegis

Sergeant Knight at Arms
Hello all. I have problem with my code. It should get max players number and send to all detected players message but its not working at all and i dont know why. pls help


Code:
(else_try),
        (eq, ":event_type", multiplayer_event_big_chat_server),
        (try_begin),
         (str_store_string, s4, s0),
		 (server_add_message_to_log, s4),
		 (get_max_players, ":num_players"),
          (try_for_range, ":cur_player", 0, ":num_players"),
            (multiplayer_send_string_to_player, ":cur_player", multiplayer_event_big_chat_client, s4), 
        (try_end),
		
		
		(try_end),
 
You must use the player_is_active operation inside the loop to ensure the ":cur_payer" value is currently used by a connected player.

Also, indent your code consistently.
 
Vornne said:
Also, indent your code consistently.

EmielRegis said:
Code:
(else_try),
     (eq, ":event_type", multiplayer_event_big_chat_server),
     (try_begin),
          (str_store_string, s4, s0),
          (server_add_message_to_log, s4),
          (get_max_players, ":num_players"),
          (try_for_range, ":cur_player", 0, ":num_players"),
               (player_is_active, ":cur_player"),
               (multiplayer_send_string_to_player, ":cur_player", multiplayer_event_big_chat_client, s4), 
          (try_end),
     (try_end),
 
Back
Top Bottom