Jump to content
  • 0

script error


caspa

Question


  • Group:  Members
  • Topic Count:  194
  • Topics Per Day:  0.04
  • Content Count:  499
  • Reputation:   3
  • Joined:  03/11/12
  • Last Seen:  

....

Edited by caspa
Link to comment
Share on other sites

1 answer to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  130
  • Reputation:   43
  • Joined:  12/11/11
  • Last Seen:  

First of, the variables are a bit messed up.

1) You can't use the same variable for both iterating and holding the array data like this.

Use the variables actually set by *getpartymember()

2) You use $@members as a static var? The party could have everything from 1 to 12 members.

*getpartymember sets $@partymembercount, use that.

You use *getpartymember(... , 1) but you don't use the cid in *isloggedin(aid, cid). So technically the player can have 2 characters from the same account and be offline on one of them and still register as online.

You can rewrite the for loop to reduce the code:

for(set .@i, 0; .@i < $@partymembercount && isloggedin($@partymemberaid[.@i], $@partymembercid[.@i]); set .@i, .@i+1){ }
if(.@i < $@partymembercount){
 mes "not enough members";
 close;
}

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