Jump to content
  • 0

@command to view players vote points.


x13th

Question


  • Group:  Members
  • Topic Count:  55
  • Topics Per Day:  0.01
  • Content Count:  206
  • Reputation:   13
  • Joined:  11/20/11
  • Last Seen:  

Can anyone help me out? Make a command to view your own reward points or view player reward points using gm account.

Example:

player use @rewardpoints and she will view her points.

"You currently have 100 reward points"

when a GM use #rewardpoints ragnarok, the GM will view ragnarok reward points.

"Player ragnarok have 100 reward points"

Link to comment
Share on other sites

4 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

ACMD_FUNC(rewardpoints) {
char aaa[255];
nullpo_retr(-1, sd);
sprintf( aaa, "%s currently have %d reward points", sd->status.name, pc_readglobalreg( sd, "rewardpoints" ) );
clif_displaymessage( fd, aaa );
return 0;
}

ACMD_DEF(rewardpoints),

EDITED: this code even shorter than I expected

Edited by AnnieRuru
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.00
  • Content Count:  754
  • Reputation:   186
  • Joined:  05/22/12
  • Last Seen:  

If you don't want to do src modification..

- script rewardpoints -1,{
OnInit: bindatcmd("rewardpoints","rewardpoints::OnCommand"); end;


OnCommand:
dispbottom "You currently have " +rewardpoints+ " reward points";
end;
}

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

I already tried that before I post it

-    script    kdjfksdjhf    -1,{
OnInit:
   bindatcmd "rewardpoints", strnpcinfo(0)+"::Onaa";
   bindatcmd "rewardpoints2", strnpcinfo(0)+"::Onaa2";
   end;
Onaa:
   dispbottom "You have "+ reward_points +" points";
   end;
Onaa2:
   if ( !( .@aid = getcharid( 3, .@atcmd_parameters$ ) ) ) {
       dispbottom "player not online";
       end;
   }
   .@origin = getcharid(3);
   attachrid .@aid;
   .@points = reward_points;
   attachrid .@origin;
   dispbottom rid2name( .@aid )+" have "+ .@points +" points";
   end;
}

prontera,154,178,6    script    kdjsfhkshf    100,{
   input reward_points;
   dispbottom "You have "+ reward_points +" points";
   end;
}

when I used AnnieRuru character type '#rewardpoints ennyruru',

the dispbottom display on EnnyRuru character

which is not intended to be like that

so I split out into @rewardpoints2 version ...

then I realized atcommand.c ones work correctly

atcommand.c version '#rewardpoints ennyruru' will show the message from AnnieRuru char, not on EnnyRuru

Edited by AnnieRuru
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  55
  • Topics Per Day:  0.01
  • Content Count:  206
  • Reputation:   13
  • Joined:  11/20/11
  • Last Seen:  

thank you guys for your reply, i will try it later :D

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