Brynner Posted March 22, 2013 Posted March 22, 2013 (edited) how can i disable gm accounts to drop item. but they can still trade on the player?only the dropping item will be disabled from them. Edited March 22, 2013 by Brynner Quote
PewN Posted March 22, 2013 Posted March 22, 2013 (edited) try this goto src/map/pc.cfind this /*========================================== * Check if player can drop an item *------------------------------------------*/ int pc_candrop(struct map_session_data *sd, struct item *item) { ..... then replace with this source /*========================================== * Check if player can drop an item *------------------------------------------*/ int pc_candrop(struct map_session_data *sd, struct item *item) { if( item && item->expire_time ) return 0; if( !pc_can_give_items(sd) ) //check if this GM level can drop items return 0; if ( pc_get_group_level(sd) == 50 ) // your group you want to disable clif_displaymessage (sd->fd, msg_txt(426)); return 0; return (itemdb_isdropable(item, pc_get_group_level(sd))); } Edited March 22, 2013 by TrojanWorm Quote
Brynner Posted March 22, 2013 Author Posted March 22, 2013 (edited) thanks it works. but the normal player cannot drop item? and also the admin account. Edited March 22, 2013 by Brynner Quote
Brynner Posted March 23, 2013 Author Posted March 23, 2013 group_id must be 1-2 but when i put 1 or 2. all level are become affected Quote
Emistry Posted March 23, 2013 Posted March 23, 2013 /*========================================== * Check if player can drop an item *------------------------------------------*/ int pc_candrop(struct map_session_data *sd, struct item *item) { if( item && item->expire_time ) return 0; if( !pc_can_give_items(sd) ) //check if this GM level can drop items return 0; if ( pc_get_group_level(sd) == 50 ){ // your group you want to disable clif_displaymessage (sd->fd, msg_txt(426)); return 0; } return (itemdb_isdropable(item, pc_get_group_level(sd))); } you have to put the curley bracket if the contents inside the IF-ELSE statement has more than 1 lines 1 Quote
Brynner Posted March 23, 2013 Author Posted March 23, 2013 /*========================================== * Check if player can drop an item *------------------------------------------*/ int pc_candrop(struct map_session_data *sd, struct item *item) { if( item && item->expire_time ) return 0; if( !pc_can_give_items(sd) ) //check if this GM level can drop items return 0; if ( pc_get_group_level(sd) == 50 ){ // your group you want to disable clif_displaymessage (sd->fd, msg_txt(426)); return 0; } return (itemdb_isdropable(item, pc_get_group_level(sd))); } you have to put the curley bracket if the contents inside the IF-ELSE statement has more than 1 lines wow thanks. that's why all group level is become affected. Quote
Brynner Posted March 23, 2013 Author Posted March 23, 2013 is this possible? /*==========================================* Check if player can drop an item*------------------------------------------*/int pc_candrop(struct map_session_data *sd, struct item *item){if( item && item->expire_time )return 0;if( !pc_can_give_items(sd) ) //check if this GM level can drop itemsreturn 0;if ( sd->group_id > 0 && sd->group_id < 99 ){ // your group you want to disableclif_displaymessage (sd->fd, msg_txt(426));return 0;}return (itemdb_isdropable(item, pc_get_group_level(sd)));} below group id 99 and higher than 0 level are allowed to drop? Quote
Emistry Posted March 23, 2013 Posted March 23, 2013 if ( pc_get_group_level(sd) >= 1 && pc_get_group_level(sd) < 99 ){ Quote
Brynner Posted March 23, 2013 Author Posted March 23, 2013 if ( pc_get_group_level(sd) >= 1 && pc_get_group_level(sd) < 99 ){ thanks Quote
Brynner Posted March 23, 2013 Author Posted March 23, 2013 how can i change the display message? i just want to make it GM accounts are not allowed to drop any kind of items. Quote
Brynner Posted March 23, 2013 Author Posted March 23, 2013 tha clif_displaymessage(sd->fd, "Your Message"); thanks Quote
Question
Brynner
how can i disable gm accounts to drop item. but they can still trade on the player?only the dropping item will be disabled from them.
Edited by Brynner13 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.