Jump to content
  • 0

doubt command


Question

Posted (edited)

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

4 answers to this question

Recommended Posts

Posted

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

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...