Jump to content
  • 0

@command to view players vote points.


Question

Posted

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"

4 answers to this question

Recommended Posts

Posted (edited)

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
Posted

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;
}

Posted (edited)

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

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...