Seiro Posted November 28, 2012 Group: Members Topic Count: 20 Topics Per Day: 0.00 Content Count: 42 Reputation: 0 Joined: 10/24/12 Last Seen: August 11, 2014 Share Posted November 28, 2012 What's the command to give everyone item again? Quote Link to comment Share on other sites More sharing options...
QQfoolsorellina Posted November 28, 2012 Group: Members Topic Count: 40 Topics Per Day: 0.01 Content Count: 587 Reputation: 105 Joined: 11/19/11 Last Seen: July 7, 2019 Share Posted November 28, 2012 http://www.eathena.ws/board/index.php?showtopic=276326 Quote Link to comment Share on other sites More sharing options...
hendra814 Posted November 28, 2012 Group: Members Topic Count: 59 Topics Per Day: 0.01 Content Count: 1281 Reputation: 170 Joined: 06/12/12 Last Seen: 5 hours ago Share Posted November 28, 2012 @item player_name[space]item[space]quantity Quote Link to comment Share on other sites More sharing options...
Seiro Posted November 29, 2012 Group: Members Topic Count: 20 Topics Per Day: 0.00 Content Count: 42 Reputation: 0 Joined: 10/24/12 Last Seen: August 11, 2014 Author Share Posted November 29, 2012 @QQ thank you @hendra thanks, but the #itemall is the one I'm looking for. heh Quote Link to comment Share on other sites More sharing options...
Emistry Posted November 29, 2012 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: 2 hours ago Share Posted November 29, 2012 if you want... you can try this... http://pastebin.com/raw.php?i=SR3ucpeN Quote Link to comment Share on other sites More sharing options...
Dastgir Posted November 29, 2012 Group: Members Topic Count: 26 Topics Per Day: 0.01 Content Count: 331 Reputation: 63 Joined: 11/29/11 Last Seen: 14 hours ago Share Posted November 29, 2012 (edited) @Emistry Script I think can be exploited. bindatcmd("itemall",strnpcinfo(0)+"::OnAtCommand"); Change it to bindatcmd("itemall",strnpcinfo(0)+"::OnAtCommand",.GMLevel,.GMLevel); Or bindatcmd("itemall",strnpcinfo(0)+"::OnAtCommand",90,90); Edited November 29, 2012 by Dastgir Pojee Quote Link to comment Share on other sites More sharing options...
KeyWorld Posted November 29, 2012 Group: Members Topic Count: 9 Topics Per Day: 0.00 Content Count: 379 Reputation: 304 Joined: 11/10/11 Last Seen: December 2, 2014 Share Posted November 29, 2012 @Emistry It's not a stable script. When log in you are setting some variables to the player to find it easily. @ArrayIndex = .@array; @Slot = .@size; Whe log out, you removed his index in the array: deletearray getd(".PlayerArray"+@ArrayIndex+"$["+@Slot+"]"),1; Scenario: - 3 players are online, give an array of : [ A, B, C ] with local variable for index: (A:0, B:1, C:2). - Player A log out, result online players: [b, C], with local variable: (B:1, C:2) - Player B log out, result online players: . You need to update each @ArrayIndex value when someone log out. You need also to update .array_size to avoid useless loop sometimes. Quote Link to comment Share on other sites More sharing options...
Dastgir Posted November 29, 2012 Group: Members Topic Count: 26 Topics Per Day: 0.01 Content Count: 331 Reputation: 63 Joined: 11/29/11 Last Seen: 14 hours ago Share Posted November 29, 2012 Don't know if this works or not, but try it, havent' tested it itemall.txt Quote Link to comment Share on other sites More sharing options...
Emistry Posted November 29, 2012 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: 2 hours ago Share Posted November 29, 2012 @Keyworld.. Owh..thank for pointing that... somehow i have forgotten / didnt think about this scenario... @Dastgir oh..no worry on this... because i got this.. OnAtCommand: if( getgmlevel() >= .GMLevel ){; but yeah..your method would be better ...i forgotten the bindatcmd have Account Level Parameter..xD and...there is 1 thing i forgot....there is SQL to do this also... hahaha ~ damn..been busy with god damn assignment for the past few day ...just manage to finished it in time..and now i still so blur with some stuff... hahaha~ guess i gonna take some time to rest awhile after my assignment.... >.< Quote Link to comment Share on other sites More sharing options...
clydelion Posted November 29, 2012 Group: Members Topic Count: 17 Topics Per Day: 0.00 Content Count: 754 Reputation: 186 Joined: 05/22/12 Last Seen: October 15, 2022 Share Posted November 29, 2012 Here.. atcommand.c add after the last command /*========================================== * @itemall command (usage: @itemall <name/id_of_item> <quantity>) * Ported to a global command by clydelion *------------------------------------------*/ ACMD_FUNC(itemall) { struct map_session_data *pl_sd = NULL; struct s_mapiterator* iter; char item_name[100]; int number = 0, item_id; struct item item_tmp; struct item_data *item_data; int get_count, i, j = 0; nullpo_retr(-1, sd); memset(item_name, '\0', sizeof(item_name)); if (!message || !*message || ( sscanf(message, "\"%99[^\"]\" %d", item_name, &number) < 1 && sscanf(message, "%99s %d", item_name, &number) < 1 )) { clif_displaymessage(fd, msg_txt(983)); // Please enter an item name or ID (usage: @item <item name/ID> <quantity>). return -1; } if (number <= 0) number = 1; if ((item_data = itemdb_searchname(item_name)) == NULL && (item_data = itemdb_exists(atoi(item_name))) == NULL) { clif_displaymessage(fd, msg_txt(19)); // Invalid item ID or name. return -1; } item_id = item_data->nameid; get_count = number; //Check if it's stackable. if (!itemdb_isstackable2(item_data)) get_count = 1; iter = mapit_getallusers(); for( pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter) ){ int flag = 0; if( pc_get_group_level(pl_sd) > pc_get_group_level(sd) ) continue; if( pl_sd == sd ) continue; for ( i = 0; i < number; i += get_count ) { // if not pet egg if (!pet_create_egg(pl_sd, item_id)) { memset(&item_tmp, 0, sizeof(item_tmp)); item_tmp.nameid = item_id; item_tmp.identify = 1; if ((flag = pc_additem(pl_sd, &item_tmp, get_count, LOG_TYPE_COMMAND))) clif_additem(pl_sd, 0, 0, flag); } } if (flag == 0){ sprintf(atcmd_output,"You have received %d %s %s from %s.",i,i>1?"pcs.":"pc.",item_data->name, sd->status.name); clif_displaymessage(pl_sd->fd,atcmd_output); j++; } } sprintf(atcmd_output,"You have given %d %s %s to %d %s.",i,i>1?"pcs.":"pc.",item_data->name,j,j>1?"players":"player"); clif_displaymessage(fd,atcmd_output); return 0; } declare it in the command reference list.. AtCommandInfo atcommand_base[] = { + ACMD_DEF(itemall), ACMD_DEF2("warp", mapmove), I've attached a diff. itemall_atcommand.diff Quote Link to comment Share on other sites More sharing options...
Question
Seiro
What's the command to give everyone item again?
Link to comment
Share on other sites
9 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.