Jump to content
  • 0

how to count players online on a party


hakuren

Question


  • Group:  Members
  • Topic Count:  120
  • Topics Per Day:  0.03
  • Content Count:  295
  • Reputation:   6
  • Joined:  12/02/11
  • Last Seen:  

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....

Link to comment
Share on other sites

5 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  21
  • Reputation:   8
  • Joined:  11/15/11
  • Last Seen:  

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


  • Group:  Members
  • Topic Count:  120
  • Topics Per Day:  0.03
  • Content Count:  295
  • Reputation:   6
  • Joined:  12/02/11
  • Last Seen:  

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

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  120
  • Topics Per Day:  0.03
  • Content Count:  295
  • Reputation:   6
  • Joined:  12/02/11
  • Last Seen:  

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


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  21
  • Reputation:   8
  • Joined:  11/15/11
  • Last Seen:  

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...