Simple string send to player

Users who are viewing this thread

Kosolov325

Recruit
I'm thinking about to create a simply chat command /info just to sent to player who had wrote the command informations of the server, i'm thinking about to use the WSE but i read some threads and i see how is complicated. I need the game to go to a web server, like php for example etc... but its possible to do this just by a simply script? I'm new in modding so i need this help.

Python:
("server_commands",[
    #i dont know... how to check if the player send /info i just know how to send a message to play
(multiplayer_send_string_to_player,":player_id", server_event_script_message_announce, "@This server was made by Kosolov325. Have nice play : )"),   
]),
 
Solution
Okay, so.

You don't need webserver of any kind.
You have to use WSE.
Only WSE provides scripts to fetch the hardcoded ingame chats and operations to process string data.
~Sebastian
Secondly, Warband doesn't provide a way to compare strings.

Personally, I never used WSE but i'll try to help as much as I can.

Use wse_chat_message_received script from WSE.

Python:
#script_wse_chat_message_received
# Called each time a chat message is received (both for servers and clients)
# INPUT
# script param 1 = sender player no
# script param 2 = chat type (0 = global, 1 = team)
# s0 = message
# OUTPUT
# trigger result = anything non-zero suppresses default chat behavior. Server will not even broadcast messages to clients.
# result string =...
Thank you, Sorry for bold i think is cool, i Will try to do by webserver but i'm using an Ubuntu OS... so i guess Will by more dificult
 
Upvote 0
Okay, so.

You don't need webserver of any kind.
You have to use WSE.
Only WSE provides scripts to fetch the hardcoded ingame chats and operations to process string data.
~Sebastian
Secondly, Warband doesn't provide a way to compare strings.

Personally, I never used WSE but i'll try to help as much as I can.

Use wse_chat_message_received script from WSE.

Python:
#script_wse_chat_message_received
# Called each time a chat message is received (both for servers and clients)
# INPUT
# script param 1 = sender player no
# script param 2 = chat type (0 = global, 1 = team)
# s0 = message
# OUTPUT
# trigger result = anything non-zero suppresses default chat behavior. Server will not even broadcast messages to clients.
# result string = changes message text for default chat behavior (if not suppressed).
("wse_chat_message_received", [
    (store_script_param, ":player_no", 1),
    (store_script_param, ":chat_type", 2),

### do something like this (keep in mind that this script might contain errors)
(try_begin),
#(str_equals, <string_1>, <string_2>, [<case_insensitive>]), #Fails if <string_1> is not equal to <string_2>
(str_equals, s0, "/help", 0),

   (multiplayer_send_string_to_player, ":player_no", multiplayer_event_show_server_message, "YOUR HELP COMMAND RESPONSE"),

(try_end),
]),
 
Upvote 0
Solution
Back
Top Bottom