Slowly getting through getting this thing to work for me but I am having dificulty assigning a gold value to a player who joins using the fetched data from my db.
game_receive_url_response
*fetch / receive script
My web server is receiving the information and exporting the correct values, warband recognises the values being received but I am unable to assign the values to players. It seems game_receive_url is only reaching PASSED 1 then stopping.
https://dl.dropboxusercontent.com/u/5493561/dicks%20script.png
Any suggestions would be great
game_receive_url_response
Code:
("game_receive_url_response", # called by the game when a response is received from a web server, if used
[
(store_script_param, ":integer_count", 1),
(store_script_param, ":string_count", 2),
(display_message, "@PASSED 1 | {reg0} {reg1} {s1}"),
# gold|unique_id|player_id|
(try_begin),
(eq, ":integer_count", 2),
(eq, ":string_count", 1),
(assign, ":gold", reg0),
(assign, ":unique_id", reg1),
(assign, ":player_id", s0),
dbg.vars_display(":player_id", ":gold"),
(display_message, "@PASSED 2 | {reg0} {reg1} {s1} "),
# check if player is still online
(player_is_active, ":player_id"),
# unique id checksum
(player_get_unique_id, ":player_unique_id", ":player_id"),
(eq, ":player_unique_id", ":unique_id"),
(call_script, "script_player_adjust_gold", ":player_id", ":gold"),
dbg.vars_display(":player_id", ":gold"),
(display_message, "@PASSED 3 | {reg0} {reg1} {s1} "),
(try_end),
]),
*fetch / receive script
Code:
("test_script", # grab player's database values
[(store_script_param, ":player_id", 1), # must be valid
(player_get_unique_id, ":unique_id", ":player_id"),
(str_store_string, s0, "@WELCOME TO GGS_PW (EXPORTED INFORMATION) "),
(multiplayer_send_string_to_player, ":player_id", server_event_local_chat, s0),
(assign, reg1, ":unique_id"),
(str_store_player_username, s1, ":player_id"),
# gold|unique_id|player_id|
(send_message_to_url, "@http://127.0.0.1/dicks/index.php?player_id={s1}&unique_id={reg1}"),
(display_message, "@SENDING URL"),
]),
My web server is receiving the information and exporting the correct values, warband recognises the values being received but I am unable to assign the values to players. It seems game_receive_url is only reaching PASSED 1 then stopping.
https://dl.dropboxusercontent.com/u/5493561/dicks%20script.png
Any suggestions would be great