Warband door owner system

Users who are viewing this thread

Kosolov325

Recruit
There are a way to do a door owner system by gold and by gold assuming a "database" for save the player ID's and using only server side scripts(WSE) for not force client side download? I need a "north" for this system, can someone help me?

*I was thinking to use the base of DOORS system created by the admin team tools team
 
Solution
Use send_message_to_url operation.

Python:
(send_message_to_url, <string_id>, <encode_url>), #result will be returned to script_game_receive_url_response

In your url, include params with player unique id and do things on your backend.

Python:
(player_get_unique_id, <destination>, <player_id>), #can only bew used on server side

Response will be returned in script_game_receive_url_response script.

Python:
  #script_game_receive_url_response
  #response format should be like this:
  #  [a number or a string]|[another number or a string]|[yet another number or a string] ...
  # here is an example response:
  # 12|Player|100|another string|142|323542|34454|yet another string
  # INPUT: arg1 = num_integers, arg2 = num_strings
  # reg0, reg1...
Please do not be help vampire. Make questions instead of asking if someone can help you.
Sorry for it, In reality, i was thinking if there are a way to check if player used a bind/keyboard button infront of prop (in reality the door) i could not found an operator like it.


Code:
(BEGIN_TRY)
#if u already played DARKRP u get the point : )
check if player clicked F2 (or another bind) infront of the door or another prop??
#i can do the rest of this i guess

#Send string to player use /buy door_id
#If owner send string to player use /sell door_id
^^^^CHECK IF THE DOOR ARE REGISTRED IN THE DB'S DOOR
^^^^IF THE DOOR IS REGISTRED AND PLAYER PRESS (F)TO OPEN
CHECK IF HE HAS PERMISSION TO OPEN THE DOOR OR ARE THE OWNER
(END_TRY)
 
Upvote 0


Thanks, but the admin tools checks only if he are admin or not. I'm trying to do a system to buy or sell the door in reality a very simple system like a "gambiarra" LOL (i can do that by using a mongo db, i'm hosting a PK SERVER) i just want to know how to check if player used a key in the door (Like F2 or another bind)
 
Upvote 0
Use send_message_to_url operation.

Python:
(send_message_to_url, <string_id>, <encode_url>), #result will be returned to script_game_receive_url_response

In your url, include params with player unique id and do things on your backend.

Python:
(player_get_unique_id, <destination>, <player_id>), #can only bew used on server side

Response will be returned in script_game_receive_url_response script.

Python:
  #script_game_receive_url_response
  #response format should be like this:
  #  [a number or a string]|[another number or a string]|[yet another number or a string] ...
  # here is an example response:
  # 12|Player|100|another string|142|323542|34454|yet another string
  # INPUT: arg1 = num_integers, arg2 = num_strings
  # reg0, reg1, reg2, ... up to 128 registers contain the integer values
  # s0, s1, s2, ... up to 128 strings contain the string values


I am sure you are able to implement that, but you have to think how to do that by yourself :smile:

make sure you test things on dedicated server to make sure everything works right.

If you gonna encounter any problems with it, @mention me.
These operations are tricky, not many people uses them.

Good Luck!
 
Upvote 0
Solution
Thanks bro, it is very useful.

I had problem with to check if player are in front of door and check if he clicked F2 in that door, because the backend server will only be used to save the doors id and the name of the owners, it might be easy (i guess).

I dont know how to do this : /
Code:
Check if player clicked f2 infront of door
If yes = get_prop_valnum1 (i dont know the operation to do that but i will try search about it) and save in var ValN, send string to player etc = "The DOOR ID are " + ValN

Use send_message_to_url operation.

Python:
(send_message_to_url, <string_id>, <encode_url>), #result will be returned to script_game_receive_url_response

In your url, include params with player unique id and do things on your backend.

Python:
(player_get_unique_id, <destination>, <player_id>), #can only bew used on server side

Response will be returned in script_game_receive_url_response script.

Python:
  #script_game_receive_url_response
  #response format should be like this:
  #  [a number or a string]|[another number or a string]|[yet another number or a string] ...
  # here is an example response:
  # 12|Player|100|another string|142|323542|34454|yet another string
  # INPUT: arg1 = num_integers, arg2 = num_strings
  # reg0, reg1, reg2, ... up to 128 registers contain the integer values
  # s0, s1, s2, ... up to 128 strings contain the string values


I am sure you are able to implement that, but you have to think how to do that by yourself :smile:

make sure you test things on dedicated server to make sure everything works right.

If you gonna encounter any problems with it, @mention me.
These operations are tricky, not many people uses them.

Good Luck!
 
Upvote 0
I never did something similar to this so i don't know.

You might try to investigate these parts of code

module_scene_props

Python:
check_sally_door_use_trigger = (ti_on_scene_prop_use,
    [
      (store_trigger_param_1, ":agent_id"),
      (store_trigger_param_2, ":instance_id"),

      (agent_get_position, pos1, ":agent_id"),
      (prop_instance_get_starting_position, pos2, ":instance_id"),
      
      (scene_prop_get_slot, ":opened_or_closed", ":instance_id", scene_prop_open_or_close_slot),

      (try_begin),
        #out doors like castle sally door can be opened only from inside, if door coordinate is behind your coordinate. Also it can be closed from both sides.
        (this_or_next|position_is_behind_position, pos1, pos2),
        (eq, ":opened_or_closed", 1),
      
        (try_begin),
          #for only server itself-----------------------------------------------------------------------------------------------
          (call_script, "script_use_item", ":instance_id", ":agent_id"),
          #for only server itself-----------------------------------------------------------------------------------------------
          (get_max_players, ":num_players"),                               
          (try_for_range, ":player_no", 1, ":num_players"), #0 is server so starting from 1
            (player_is_active, ":player_no"),
            (multiplayer_send_2_int_to_player, ":player_no", multiplayer_event_use_item, ":instance_id", ":agent_id"),
          (try_end),
        (try_end),
      (try_end),
    ])


and script_use_item.

Maybe there you can check if doors are owned by x player.

Do not use username in your database, use unique id.
 
Upvote 0
Back
Top Bottom