Jump to content
  • 0

Convert account id in charid?


kilow

Question


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.01
  • Content Count:  41
  • Reputation:   0
  • Joined:  05/18/20
  • Last Seen:  

Hello,
Can someone tell me why this script don't return char id?
 

Quote

    bg_get_data(.red, 1);
    for ( .@i = 0; .@i < $@arenamemberscount; ++.@i ) {
        .teamcid[.@i] = convertpcinfo($@arenamembers[.@i],CPC_CHAR);
    }
    party_create("teamredred",.teamcid[1]);
    .partyid = $@party_create_id;
    for ( .@i = 1; .@i < getarraysize(.teamcid)-1; ++.@i ) {
        party_addmember(.partyid,teamcid[.@i]);
    }

i also tried this :

Quote

    bg_get_data(.red, 1);
    for ( .@i = 0; .@i < $@arenamemberscount; ++.@i ) {
        .teamname[.@i] = rid2name($@arenamembers[.@i]);
    }
  
    for ( .@i = 0; .@i < getarraysize(.teamname)-1; ++.@i ) {
        .teamcid[.@i] = getcharid(0,.teamname[.@i]);
    }

    party_create("teamredred",.teamcid[0]);
    .partyid = $@party_create_id;
    for ( .@i = 1; .@i < getarraysize(.teamcid)-1; ++.@i ) {
        party_addmember(.partyid,teamcid[.@i]);
    }

Thank you

 

Edited by kilow
Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  283
  • Reputation:   76
  • Joined:  06/13/13
  • Last Seen:  

try debuging the output of  .teamname and  .teamcid with debugmes, you can see where it gone wrong. 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.01
  • Content Count:  41
  • Reputation:   0
  • Joined:  05/18/20
  • Last Seen:  

Finally, i made a npc that the first player who has a party and click on the npc, his team is registered and other can join by clicking. Not usual but it works.
Thank you for your answer

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