Need a help with code.

Users who are viewing this thread

Hello!

This is my code:

Code:
script_player_joined_common

(store_script_param, ":player_no", 1),

(player_get_unique_id, ":player_unique_id", ":player_no"),

(eq, ":player_unique_id", 123456),
(str_store_string, s4, "str_ownerjoined"),
(call_script, "script_multiplayer_broadcast_message"),

I am trying to extend this script to check more than one player and do welcome messages on the my server. But it gives error on the compiling moment or compiling without errors but not working in game.

 
Bu comparision with  this working script you should discover whats wrong.

Code:
("spawn_zombie",[
	
	(init_position, pos15),
	(position_set_x, pos15, "$spawn_x"),
	(position_set_y, pos15, "$spawn_y"),
	(position_set_z_to_ground_level, pos15),
	
	(position_move_x, pos15, "$spawn_modifer"),
	
	(set_spawn_position, pos15),
	
	
]),
 
EmielRegis said:
Bu comparision with  this working script you should discover whats wrong.

Ah... Got it.

Well, when I am trying to extend it:


Code:
(Player_Joined_Common,

(store_script_param, ":player_no", 1),

(player_get_unique_id, ":player_unique_id", ":player_no"),

     (try_begin),
(eq, ":player_unique_id", 123456),
(str_store_string, s4, "str_firstjoined"),
(call_script, "script_multiplayer_broadcast_message"),
  (try_end),
       (else_try),
(eq, ":player_unique_id", 213456),
(str_store_string, s4, "str_secondjoined"),
(call_script, "script_multiplayer_broadcast_message"),
 (try_end),
  (else_try),
(try_end),

It compiling if I am putting cf_ at the scrip begin, but not working In-Game.
 
Code:
 #script_multiplayer_server_player_joined_common
  # INPUT: arg1 = player_no
  # OUTPUT: none
  ("multiplayer_server_player_joined_common",
   [
     (store_script_param_1, ":player_no"),
     (player_get_unique_id, ":player_unique_id", ":player_no"),
     (try_begin),
       (this_or_next|player_is_active, ":player_no"),
       (eq, ":player_no", 0),
       (call_script, "script_multiplayer_init_player_slots", ":player_no"),
       (store_mission_timer_a, ":player_join_time"),
       (player_set_slot, ":player_no", slot_player_join_time, ":player_join_time"),
       (player_set_slot, ":player_no", slot_player_first_spawn, 1),
       (try_begin),
         (multiplayer_is_server),
        
         (call_script, "script_multiplayer_send_initial_information", ":player_no"),
       (try_end),
       

##################My code###############################
	(str_store_player_username, s2, ":player_no"),

(try_begin),
(eq, ":player_unique_id", 123456),
(str_store_string, s4, "str_1joined"),
(call_script, "script_multiplayer_broadcast_message"),
  (try_end),
       (else_try),
(eq, ":player_unique_id", 234567),
(str_store_string, s4, "str_2joined"),
(call_script, "script_multiplayer_broadcast_message"),
  (try_end),
  (else_try),
(try_end),
###########################################################

       (call_script, "script_multiplayer_server_protect_admin_password", ":player_no"),
     (try_end),

]),
 
Back
Top Bottom