Jump to content
  • 0

how can i disable gm accounts to drop item


Brynner

Question


  • Group:  Members
  • Topic Count:  118
  • Topics Per Day:  0.03
  • Content Count:  1942
  • Reputation:   197
  • Joined:  01/08/12
  • Last Seen:  

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 Brynner
Link to comment
Share on other sites

13 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  209
  • Topics Per Day:  0.05
  • Content Count:  892
  • Reputation:   27
  • Joined:  12/09/11
  • Last Seen:  

clif_displaymessage(sd->fd, "Your Message");
 

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  209
  • Topics Per Day:  0.05
  • Content Count:  892
  • Reputation:   27
  • Joined:  12/09/11
  • Last Seen:  

try this goto src/map/pc.c

find 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 by TrojanWorm
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  118
  • Topics Per Day:  0.03
  • Content Count:  1942
  • Reputation:   197
  • Joined:  01/08/12
  • Last Seen:  

thanks it works. but the normal player cannot drop item? and also the admin account.

Edited by Brynner
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  209
  • Topics Per Day:  0.05
  • Content Count:  892
  • Reputation:   27
  • Joined:  12/09/11
  • Last Seen:  

ah only with group id 50 can't drop

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  118
  • Topics Per Day:  0.03
  • Content Count:  1942
  • Reputation:   197
  • Joined:  01/08/12
  • Last Seen:  

group_id must be 1-2 but when i put 1 or 2. all level are become affected

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

/*==========================================
 * 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

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  118
  • Topics Per Day:  0.03
  • Content Count:  1942
  • Reputation:   197
  • Joined:  01/08/12
  • Last Seen:  

/*==========================================
 * 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.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  209
  • Topics Per Day:  0.05
  • Content Count:  892
  • Reputation:   27
  • Joined:  12/09/11
  • Last Seen:  

oh ahaha sorry ahah

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  118
  • Topics Per Day:  0.03
  • Content Count:  1942
  • Reputation:   197
  • Joined:  01/08/12
  • Last Seen:  

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 items
return 0;
if ( sd->group_id > 0 && sd->group_id < 99 ){ // your group you want to disable
clif_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?

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  


if ( pc_get_group_level(sd) >= 1 && pc_get_group_level(sd) < 99 ){

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  118
  • Topics Per Day:  0.03
  • Content Count:  1942
  • Reputation:   197
  • Joined:  01/08/12
  • Last Seen:  

 if ( pc_get_group_level(sd) >= 1 && pc_get_group_level(sd) < 99 ){

thanks :)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  118
  • Topics Per Day:  0.03
  • Content Count:  1942
  • Reputation:   197
  • Joined:  01/08/12
  • Last Seen:  

how can i change the display message? i just want to make it GM accounts are not allowed to drop any kind of items.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  118
  • Topics Per Day:  0.03
  • Content Count:  1942
  • Reputation:   197
  • Joined:  01/08/12
  • Last Seen:  

tha

 

clif_displaymessage(sd->fd, "Your Message");
 

thanks

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