x13th Posted November 5, 2012 Posted November 5, 2012 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" Quote
AnnieRuru Posted November 6, 2012 Posted November 6, 2012 (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 November 6, 2012 by AnnieRuru 1 Quote
clydelion Posted November 6, 2012 Posted November 6, 2012 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; } Quote
AnnieRuru Posted November 6, 2012 Posted November 6, 2012 (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 November 6, 2012 by AnnieRuru Quote
x13th Posted November 9, 2012 Author Posted November 9, 2012 thank you guys for your reply, i will try it later Quote
Question
x13th
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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.