SnRolls
Sergeant at Arms
I want each player to have his own stats and items from the database(mysql).
So right now each time player joins the server, it loads his items and puts them in trp_player_(playerid) troop inventory and sets the troop id.
Problem is with the stats, such as Athletics, Agility... etc.
Each time a player joins server, i send a url request and it goes to game_receive_url_response with his stats. then, on game_receive_url_response i send a network message to the player using
multiplayer_send_3_int_to_player with an event i made to raise the troop stat (Agility,strength,athletics...).
Problem is the actual player doesnt really have those stats event tho i sent the data...
I dont understand whats wrong here? i used troop_raise_attribute and troop_raise_skill
Please help ive tried to solve this problem for a few days now :/
My client events:
The game_receive_url_response:
As you can see ive tried couple ways to make that work... tried with sending player slots to the client and then setting it, tried with directly sending a client message with the stats... idk what to do
So right now each time player joins the server, it loads his items and puts them in trp_player_(playerid) troop inventory and sets the troop id.
Problem is with the stats, such as Athletics, Agility... etc.
Each time a player joins server, i send a url request and it goes to game_receive_url_response with his stats. then, on game_receive_url_response i send a network message to the player using
multiplayer_send_3_int_to_player with an event i made to raise the troop stat (Agility,strength,athletics...).
Problem is the actual player doesnt really have those stats event tho i sent the data...
I dont understand whats wrong here? i used troop_raise_attribute and troop_raise_skill
Please help ive tried to solve this problem for a few days now :/
My client events:
Code:
(else_try),
(eq, ":event_type", multiplayer_event_send_updated_troop_attribute),
(try_begin),
(store_script_param, ":troop_id", 3),
(store_script_param, ":att_id", 4),
(store_script_param, ":level", 5),
(val_sub, ":level", 3),
(troop_raise_attribute, ":troop_id", ":att_id", ":level"),
(try_end),
(else_try),
(eq, ":event_type", multiplayer_event_send_updated_troop_prof),
(try_begin),
(store_script_param, ":troop_id", 3),
(store_script_param, ":prof_no", 4),
(store_script_param, ":value", 5),
(troop_raise_proficiency_linear, ":troop_id", ":prof_no", ":value"),
(try_end),
(else_try),
(eq, ":event_type", multiplayer_event_send_updated_troop_skill),
(try_begin),
(display_message, "@PASS!"),
(store_script_param, ":troop_id", 3),
(store_script_param, ":skill_id", 4),
(store_script_param, ":value", 5),
(troop_raise_skill, ":troop_id", ":skill_id", ":value"),
(try_end),
The game_receive_url_response:
Code:
(eq, ":event", 7), #get attributes, skills, proficiencies and load them
(try_begin),
(assign, ":str", reg3),
(assign, ":agi", reg4),
(assign, ":powerstrike", reg5),
(assign, ":powerdraw", reg6),
(assign, ":powerthrow", reg7),
(assign, ":athletics", reg8),
(assign, ":ironflesh", reg9),
(assign, ":onehanded", reg10),
(assign, ":twohanded", reg11),
(assign, ":polearm", reg12),
(assign, ":archery", reg13),
(assign, ":crossbow", reg14),
(assign, ":throwing", reg15),
(display_message, "@Athletics recieved: {reg8}"),
(multiplayer_send_3_int_to_player, ":local_id", multiplayer_event_send_updated_player_slot, slot_player_str, ":str", ":local_id"),
(multiplayer_send_3_int_to_player, ":local_id", multiplayer_event_send_updated_player_slot, slot_player_agi, ":agi", ":local_id"),
(multiplayer_send_3_int_to_player, ":local_id", multiplayer_event_send_updated_player_slot, slot_player_powerstrike, ":powerstrike", ":local_id"),
(multiplayer_send_3_int_to_player, ":local_id", multiplayer_event_send_updated_player_slot, slot_player_ironflesh, ":ironflesh", ":local_id"),
(multiplayer_send_3_int_to_player, ":local_id", multiplayer_event_send_updated_player_slot, slot_player_powerdraw, ":powerdraw", ":local_id"),
(multiplayer_send_3_int_to_player, ":local_id", multiplayer_event_send_updated_player_slot, slot_player_powerthrow, ":powerthrow", ":local_id"),
(multiplayer_send_3_int_to_player, ":local_id", multiplayer_event_send_updated_player_slot, slot_player_athletics, ":athletics", ":local_id"),
(multiplayer_send_3_int_to_player, ":local_id", multiplayer_event_send_updated_player_slot, slot_player_onehanded, ":onehanded", ":local_id"),
(multiplayer_send_3_int_to_player, ":local_id", multiplayer_event_send_updated_player_slot, slot_player_twohanded, ":twohanded", ":local_id"),
(multiplayer_send_3_int_to_player, ":local_id", multiplayer_event_send_updated_player_slot, slot_player_polearm, ":polearm", ":local_id"),
(multiplayer_send_3_int_to_player, ":local_id", multiplayer_event_send_updated_player_slot, slot_player_archery, ":archery", ":local_id"),
(multiplayer_send_3_int_to_player, ":local_id", multiplayer_event_send_updated_player_slot, slot_player_crossbow, ":crossbow", ":local_id"),
(multiplayer_send_3_int_to_player, ":local_id", multiplayer_event_send_updated_player_slot, slot_player_throwing, ":throwing", ":local_id"),
(val_sub, ":str", 3),
(val_sub, ":agi", 3),
(store_add, ":troop_id", "trp_player_0", ":local_id"),
(troop_raise_attribute, ":troop_id", ca_strength, ":str"),
(troop_raise_attribute, ":troop_id", ca_agility, ":agi"),
(multiplayer_send_3_int_to_player, ":local_id", multiplayer_event_send_updated_troop_attribute, ":troop_id", ca_strength, ":str"),
(multiplayer_send_3_int_to_player, ":local_id", multiplayer_event_send_updated_troop_attribute, ":troop_id", ca_agility, ":agi"),
(troop_raise_skill, ":troop_id", skl_athletics, ":athletics"),
(multiplayer_send_3_int_to_player, ":local_id", multiplayer_event_send_updated_troop_skill, ":troop_id", skl_athletics, ":athletics"),
As you can see ive tried couple ways to make that work... tried with sending player slots to the client and then setting it, tried with directly sending a client message with the stats... idk what to do