Jump to content
  • 0

doubt command


Jamy

Question


  • Group:  Members
  • Topic Count:  23
  • Topics Per Day:  0.01
  • Content Count:  54
  • Reputation:   0
  • Joined:  02/14/12
  • Last Seen:  

Well I created a command to remove items from all players who are on the map, but this just myremoving I wanted to remove only players that are not GM's.


ACMD_FUNC(remove)
{
struct map_session_data* pl_sd;
struct s_mapiterator* iter;
int i;

nullpo_retr(-1, sd);

iter = mapit_getallusers();
for (i = 0; i < MAX_INVENTORY; i++) {
if (sd->status.inventory[i].amount) {
if(sd->status.inventory[i].equip != 0)
pc_unequipitem(sd, i, 3);

}
}
clif_displaymessage(fd, "Itens desequipados");
return 0;
}

Edited by DeMoNiAC
Link to comment
Share on other sites

4 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  78
  • Reputation:   3
  • Joined:  12/06/11
  • Last Seen:  

you could just #delitem "player name","quantity". instead of making other command.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  23
  • Topics Per Day:  0.01
  • Content Count:  54
  • Reputation:   0
  • Joined:  02/14/12
  • Last Seen:  

This command and unequip items not delete.

Edited by DeMoNiAC
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.00
  • Content Count:  243
  • Reputation:   206
  • Joined:  11/28/11
  • Last Seen:  

Hi,

I believe you want an atcommand to unequip all items from all the players in the same map that is not a GM. If this is correct, then you got the base part correct. You created a variable, iter, that holds the data of all the players in the server. Now you just have to iterate through that and check if the current data you are iterating through is (1) on the same map and (2) not a GM.

Here is a solution I quickly made using your code: atcmd_unequipmap_v1.0.patch

Hopefully that is what you wanted :);;

Regards,

~ Xantara

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  23
  • Topics Per Day:  0.01
  • Content Count:  54
  • Reputation:   0
  • Joined:  02/14/12
  • Last Seen:  

Thank xantara worked.

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