Jump to content
  • 0

custom group permission - PC_PERM_INTRAVISION


Cydh

Question


  • Group:  Developer
  • Topic Count:  153
  • Topics Per Day:  0.04
  • Content Count:  2285
  • Reputation:   745
  • Joined:  06/16/12
  • Last Seen:  

Since there is no group permission which gives certain group having INTRAVISION (pc_bonus(SP_INTRAVISION,0)) 'automatically' when pc_group_pc_load loaded, I decide to make it.

 

the flow

  1. Give permission on group.conf
        permissions: {
    	        intravision: true
    	    }
  2. After player login, player who has intravision group permission, will automatically has intravision (Maya Purple Card effect)
  3. Then, if the group permission is changed then use @reloadatcommand and intravision permission is gone, player's intravision will be gone too if their group doesn't have it.

problems

  • If I place
    if(sd->permissions&PC_PERM_INTRAVISION)
        {
                pc_bonus(sd, SP_INTRAVISION,0);
        }
        else
        {
    
                sd->special_state.intravision = 0;
                clif_status_load(&sd->bl, SI_INTRAVISION, 0);
    
        }
     on pc_groups.c > pc_group_pc_load(...) after player choose the char, it will never load the map server until it's 'Rejected from server'
  • If I insert the code above (remove the code placement above) on pc.c > pc_authok(...) between
        /* load user permissions */
        pc_group_pc_load(sd);
     
        memcpy(&sd->status, st, sizeof(*st));
    . It has same problem like above.
  • If I insert the code on status.c status_calc_pc_(), it will loaded, player gets Intravision but even the group permission is changed for intravision permission, player who before having intravision still has it although the permission is gone and.

notes

  • I tried to use
    pc_has_permission(sd)
    also for replacing
    if(sd->permissions&PC_PERM_INTRAVISION)
  • I've use
    pc_bonus(sd, SP_INTRAVISION,0);
    before using
                if(sd->state.lr_flag != 2) {
                    sd->special_state.intravision = 1;
                    clif_status_load(&sd->bl, SI_INTRAVISION, 1);
                }
  • I added
    #include "status.h"
    #include "clif.h"
    if it's necessary
  • If you suggest me to use @intravision command, I know it because I made it too, but I need permission.  /no1
  • the most important is, CMIIW.  /ok
Edited by Cydh
Link to comment
Share on other sites

2 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  14
  • Topics Per Day:  0.00
  • Content Count:  407
  • Reputation:   159
  • Joined:  11/18/11
  • Last Seen:  

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  153
  • Topics Per Day:  0.04
  • Content Count:  2285
  • Reputation:   745
  • Joined:  06/16/12
  • Last Seen:  

 

Uhm, I didn't try it, never think to move pc_group_pc_load().

I'll try it. Thank's

 

-- EDIT

Perfectly works!!

actually I will make this as custom permission on Source Permission, but got this problem. LOL

hope someone can enjoy this too. :D

Edited by Cydh
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...