Filir Опубликовано 28 марта, 2014 Жалоба Поделиться Опубликовано 28 марта, 2014 Какая команда проверяет наличие онлайна и человек в пати, требуется чтобы проверка была на людей >2 и чтобы они были онлайн. Как такое создать? Ссылка на комментарий Поделиться на другие сайты Поделиться
Кеник Опубликовано 28 марта, 2014 Жалоба Поделиться Опубликовано 28 марта, 2014 *attachrid(<Account ID>)*isloggedin(<account id>)*getpartymember <party id>; Ссылка на комментарий Поделиться на другие сайты Поделиться
Filir Опубликовано 29 марта, 2014 Автор Жалоба Поделиться Опубликовано 29 марта, 2014 *attachrid(<Account ID>)*getpartymember <party id>;Не могли бы вы показать на примере? Я не очень понимаю. Ссылка на комментарий Поделиться на другие сайты Поделиться
Кеник Опубликовано 29 марта, 2014 Жалоба Поделиться Опубликовано 29 марта, 2014 В документации есть и примеры и описание работы функций..*getpartymember <party id>;Thank you to HappyDenn for all this information.This command will find all members of a specified party and returns their namesinto an array of temporary global variables. There's actually quite a fewcommands like this which will fill a special variable with data upon executionand not do anything else.Upon executing this,$@partymembername$[] is a global temporary stringarray which contains all the names of these party members.$@partymembercount is the number of party members that were found.The party members will (apparently) be found regardless of whether they areonline or offline. Note that the names come in no particular order.Be sure to use $@partymembercount to go through this array, and not'getarraysize', because it is not cleared between runs of 'getpartymember'. Ifsomeone with 7 party members invokes this script, the array would have 7elements. But if another person calls up the NPC, and he has a party of 5, theserver will not clear the array for you, overwriting the values instead. So inaddition to returning the 5 member names, the 6th and 7th elements from the lastcall remain, and you will get 5+2 members, of which the last 2 don't belong tothe new guy's party. $@partymembercount will always contain the correct number,(5) unlike 'getarraysise()' which will return 7 in this case.Example: // get the character's party ID getpartymember(getcharid(1)); // immediately copy $@partymembercount value to a new variable, since // you don't know when 'getpartymember' will get called again for someone // else's party, overwriting your global array. set @partymembercount,$@partymembercount; // copy $@partymembername array to a new array copyarray @partymembername$[0],$@partymembername$[0],@partymembercount; //list the party members in NPC dialog set @count,0; L_DisplayMember: if(@count == @partymembercount) goto L_DisplayMemberEnd; mes (@count + 1) + ". ^0000FF" + @partymembername$[@count] + "^000000"; set @count,@count+1; goto L_DisplayMember; L_DisplayMemberEnd: close;*isloggedin(<account id>)This function returns 1 if the specified character is logged in and 0 if theyaren't. Ссылка на комментарий Поделиться на другие сайты Поделиться
Filir Опубликовано 29 марта, 2014 Автор Жалоба Поделиться Опубликовано 29 марта, 2014 Понял только, что attachrid input @NAME$;if(isloggedin(getcharid(3,@NAME$))==0) goto L_Notlogged;.........L_Notlogged:mes "That person is not logged in";close;Но как сделать, чтобы проверялись со партийцы на онлайн. Там такого не описано.Спасибо за getpartymember все получилось. Ссылка на комментарий Поделиться на другие сайты Поделиться
Кеник Опубликовано 29 марта, 2014 Жалоба Поделиться Опубликовано 29 марта, 2014 В массиве у тебя хранятся имена персонажей в пати. Через них получаешь айди аккаунтов этих персонажей и проверяешь их наличие. Ссылка на комментарий Поделиться на другие сайты Поделиться
Рекомендуемые сообщения