Zirius 1 Posted October 21, 2014 (edited) hello! warp party requires party_id , I am just wondering if there's a way to get the party_id given the party name? *warpparty "<to_mapname>",<x>,<y>,<party_id> I am coding a script that warps 2 parties into 2 different location using whisper system recall#"party name 1"#"party name 2" it that way, I can put all members of "party name 1" and "party name 2" on 2 different location simultaneously. Hope somebody can help. Thanks! Edited October 21, 2014 by Zirius Quote Share this post Link to post Share on other sites
0 Mumbles 193 Posted October 21, 2014 Place this at the top of your script (below the header) and you'll be able to use getpartyid() to determine the party ID of the input party name. Alternatively, you could do something with getcharid(1), but it may require more writing than you'd like. // getpartyid("Party Name")function getpartyid { // Determine party ID query_sql "SELECT `party_id` FROM `party` WHERE `name` ='"+ getarg(0) +"'", .@party_id; // Return false (0) if party not found if (!.@party_id) { return false; // Return party ID if found } else { return .@party_id; }} Example: // Determine party ID of party "Party Name".@party_id = getpartyid("Party Name"); 1 Zirius reacted to this Quote Share this post Link to post Share on other sites
0 Angelmelody 221 Posted October 21, 2014 why not use @partyrecall ? atcommand "@partyrecall "+party name 1; atcommand "@partyrecall "+party name 2; Quote Share this post Link to post Share on other sites
0 Zirius 1 Posted October 21, 2014 why not use @partyrecall ? atcommand "@partyrecall "+party name 1; atcommand "@partyrecall "+party name 2; Because the one who should issue the command must stay at a single far spot. Oh, typo at my original post, each party will be warped at far away from each other. Quote Share this post Link to post Share on other sites
0 Yommy 265 Posted October 22, 2014 you should also be careful if you are thinking to accept user input.mes "Enter the party name!" they can enter something bad like hax'; UPDATE `login` SET `group_id` = 99 WHERE `user_id` = 'Yommy 2 Mumbles and Zirius reacted to this Quote Share this post Link to post Share on other sites
0 Dastgir 1246 Posted October 22, 2014 you should also be careful if you are thinking to accept user input. mes "Enter the party name!" they can enter something bad like hax'; UPDATE `login` SET `group_id` = 99 WHERE `user_id` = 'Yommy To avoid this kind of thing, one should use escape_sql ScriptCommand 2 Mumbles and Zirius reacted to this Quote Share this post Link to post Share on other sites
0 Zirius 1 Posted October 22, 2014 wow, thank you very much~! that could had been exploit. Quote Share this post Link to post Share on other sites
0 Mumbles 193 Posted October 23, 2014 Right, in which case just change line 4: query_sql "SELECT `party_id` FROM `party` WHERE `name` ='"+ getarg(0) +"'", .@party_id; to this: query_sql "SELECT `party_id` FROM `party` WHERE `name` ='"+ escape_sql(getarg(0)) +"'", .@party_id; 1 Zirius reacted to this Quote Share this post Link to post Share on other sites
hello! warp party requires party_id , I am just wondering if there's a way to get the party_id given the party name?
I am coding a script that warps 2 parties into 2 different location using whisper system
it that way, I can put all members of "party name 1" and "party name 2" on 2 different location simultaneously. Hope somebody can help.
Thanks!
Edited by ZiriusShare this post
Link to post
Share on other sites