Jump to content
  • 0

how to count players online on a party


Question

Posted

is there any possibility that an npc count the player online on a party

because when i used the $@partymembercount thing it involves the other

player that not around or offline,

is this possible or not

another question : is this a source modification or a script commands can someone give me a tricks,tips or example with this can of script thank you so much in advance....

5 answers to this question

Recommended Posts

Posted (edited)

Yes, it's possible.

http://pastebin.com/TfCsDcNR

/*
getPartyOnlinePlayers(party_id);
*/
function script getPartyOnlinePlayers {

set @counter, 0;
getpartymember(getarg(0));
for(set @i, 0; @i <= $@partymembercount; set @i, @i+1)
{
if(isloggedin(getcharid(3,$@partymembername$[@i]), getcharid(0,$@partymembername$[@i]))) set @counter, @counter + 1;
} return @counter;
}

Example:

set @onlinememberscount, callfunc("getPartyOnlinePlayers", getcharid(1));

# Sorry for the error, fixed :P

Edited by Mooka
Posted

i got error:

parse_simpleexpr: unmatch ')'

288 :

289 : set @counter, 0;

290 : getpartymember(getarg(0));

291 : for(set @i, 0; @i <= $@partymembercount; set @i, @i+1)

292 : {

* 293 : if(isloggedin(getcharid(3,$@partymembername$[@i]), getcharid(0,$@partymembername$[@i])) 's'et @counter,@counter + 1;

294 : } return @counter;

295 : }

i should i do

bumb please help me /sob

Posted (edited)

it still the same the npc tell that the other one of the party is still online but not look at this picture

post-631-0-53150400-1339148404_thumb.jpg

prontera,155,151,5    script    Testing Online Player    954,{
set @onlinememberscount, callfunc("getPartyOnlinePlayers", getcharid(1));
   mes ""+@onlinememberscount+"";
   close;
}

is this correct when it use to npc?

Edited by hakuren
Posted (edited)

Yes, but there is a better way:

prontera,155,151,5	  script  Testing Online Player   954,{

	mes "Party Online Players: "+callfunc("getPartyOnlinePlayers", getcharid(1));
	close;
}

-- Sorry for miss ')' :P

Edited by Mooka

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...