Jump to content
  • 0
hakuren

how to count players online on a party

Question

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

because when i used the [email protected] 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....

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

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 <= [email protected]; set @i, @i+1)
{
if(isloggedin(getcharid(3,[email protected]$[@i]), getcharid(0,[email protected]$[@i]))) set @counter, @counter + 1;
} return @counter;
}

Example:

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

# Sorry for the error, fixed :P

Edited by Mooka
Link to comment
Share on other sites

i got error:

parse_simpleexpr: unmatch ')'

288 :

289 : set @counter, 0;

290 : getpartymember(getarg(0));

291 : for(set @i, 0; @i <= [email protected]; set @i, @i+1)

292 : {

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

294 : } return @counter;

295 : }

i should i do

bumb please help me /sob

Link to comment
Share on other sites

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 ""[email protected]+"";
   close;
}

is this correct when it use to npc?

Edited by hakuren
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.