Tio Akima 74 Posted March 22, 2018 (edited) Hi guys, in map.c I want to create a basic function a function that returns the player ID, without parameters only with return ID from the player. If anyone knows Something like this: int map_get_id() { struct map_session_data* sd; sd = map->id2sd(?); return sd->bl.id; } EDIT: It does not have to be exactly in map.c but must be a function that returns the player ID Can someone help me? Edited March 22, 2018 by Tio Akima Quote Share this post Link to post Share on other sites
0 meko 170 Posted March 22, 2018 You can't just get the player ID (account id) out of thin air, you have to get it from somewhere. If you have a ScriptState (st) you can get it from st->rid if you have a block_list (bl) you can get it from bl->id if you have a map_session_data (sd) you can get it from sd->bl.id if you have a nickname you can get the sd with map->nick2sd(nick) and then get the id with sd->bl.id Quote Share this post Link to post Share on other sites
0 Tio Akima 74 Posted March 22, 2018 2 hours ago, meko said: You can't just get the player ID (account id) out of thin air, you have to get it from somewhere. If you have a ScriptState (st) you can get it from st->rid if you have a block_list (bl) you can get it from bl->id if you have a map_session_data (sd) you can get it from sd->bl.id if you have a nickname you can get the sd with map->nick2sd(nick) and then get the id with sd->bl.id that is, there is no solution to my problem. =/ Quote Share this post Link to post Share on other sites
0 meko 170 Posted March 23, 2018 if you explain what you are trying to accomplish I could help you find a suitable solution Quote Share this post Link to post Share on other sites
0 Tio Akima 74 Posted March 23, 2018 31 minutes ago, meko said: if you explain what you are trying to accomplish I could help you find a suitable solution In skill.c I did an area skill. This skill summon a mob. I sumono a mob and make him walk (I shoot this mob in one direction) with unit-> walktoxy (); That is, because of the unit-> walktoxy (), this mob will go through the functions: unit-> walktoxy (); unit-> walktoxy_sub (); unit-> walktoxy_timer (); right? When this mob dies (or stops walking) I want to call a skill ... skill Lord of Vermilion (WZ_VERMILION) The function that defines whether the mob has stopped walking is unit-> walktoxy_timer (); So, I need to call the skill (WZ_VERMILION) inside the function unit-> walktoxy_timer (); But for this skill to work, I need the data from the player. The information that arrives to unit-> walktoxy_timer (); are data from the MOB that walked and stopped ... The skill (WZ_VERMILION) will only work, if I call it with player data. This is a way of doing a skillshot ... Throwing the mob in one direction, and when it hits an enemy, an area skill is invoked. It sounds complicated, but it's a simple logic up to it. @meko If you can help me, I'll be very grateful. <3 Quote Share this post Link to post Share on other sites
Hi guys,
in map.c I want to create a basic function
a function that returns the player ID, without parameters
only with return ID from the player.
If anyone knows
Something like this:
int map_get_id() { struct map_session_data* sd; sd = map->id2sd(?); return sd->bl.id; }
EDIT: It does not have to be exactly in map.c
Edited by Tio Akimabut must be a function that returns the player ID
Can someone help me?
Share this post
Link to post
Share on other sites