Перейти к содержанию

Проверка на пати


Рекомендуемые сообщения

Какая команда проверяет наличие онлайна и человек в пати, требуется чтобы проверка была на людей >2 и чтобы они были онлайн. Как такое создать?

Ссылка на комментарий
Поделиться на другие сайты

В документации есть и примеры и описание работы функций..

*getpartymember <party id>;

Thank you to HappyDenn for all this information.

This command will find all members of a specified party and returns their names

into an array of temporary global variables. There's actually quite a few

commands like this which will fill a special variable with data upon execution

and 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 are

online 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'. If

someone with 7 party members invokes this script, the array would have 7

elements. But if another person calls up the NPC, and he has a party of 5, the

server will not clear the array for you, overwriting the values instead. So in

addition to returning the 5 member names, the 6th and 7th elements from the last

call remain, and you will get 5+2 members, of which the last 2 don't belong to

the 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 they

aren't.

Ссылка на комментарий
Поделиться на другие сайты

Понял только, что attachrid

input @NAME$;

if(isloggedin(getcharid(3,@NAME$))==0) goto L_Notlogged;

.........

L_Notlogged:

mes "That person is not logged in";

close;

Но как сделать, чтобы проверялись со партийцы на онлайн. Там такого не описано.

Спасибо за getpartymember все получилось.

Ссылка на комментарий
Поделиться на другие сайты

В массиве у тебя хранятся имена персонажей в пати. Через них получаешь айди аккаунтов этих персонажей и проверяешь их наличие.

Ссылка на комментарий
Поделиться на другие сайты

×
×
  • Создать...
Яндекс.Метрика