Jamy Posted February 24, 2012 Posted February 24, 2012 (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 February 25, 2012 by DeMoNiAC Quote
Prez Posted February 25, 2012 Posted February 25, 2012 you could just #delitem "player name","quantity". instead of making other command. Quote
Jamy Posted February 25, 2012 Author Posted February 25, 2012 (edited) This command and unequip items not delete. Edited February 25, 2012 by DeMoNiAC Quote
Xantara Posted February 25, 2012 Posted February 25, 2012 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 Quote
Question
Jamy
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.
Edited by DeMoNiAC4 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.