astralprojection 35 Posted December 8, 2015 I would like to ask help on achieving this: 1. Player whisper to NPC 2. NPC save names and location of players. ( example "player1","prontera",110,40,"player2","izlude",120,111,etc...) Thanks Quote Share this post Link to post Share on other sites
0 AnnieRuru 957 Posted December 8, 2015 (edited) now its better to use queue iterator for this kind of system - script sfhkjsdfhsk FAKE_NPC,{OnInit: if ( QUEUEOPT_LOGOUT != 1 ) end; // if your server is outdated, error will be thrown on this line bindatcmd "whisper", strnpcinfo(0)+"::Onjoin", 0, 100; bindatcmd "debug", strnpcinfo(0)+"::Ondebug", 99, 100; // GM99 debug .q = queue(); end;Onjoin: if ( queueadd( .q, getcharid(3) ) ) dispbottom "join success"; else dispbottom "you already joined"; end;Ondebug: .@it = queueiterator(.q); for ( .@aid = qiget(.@it); qicheck(.@it); .@aid = qiget(.@it) ) { .@name$ = rid2name(.@aid); getmapxy .@map$, .@x, .@y, 0, .@name$; dispbottom ( ++.@i )+". "+ .@name$ +" at "+ .@map$ +","+ .@x +","+ .@y; } if ( !.@i ) { dispbottom "nobody join yet"; } qiclear .@it; end;} Edited December 8, 2015 by AnnieRuru Quote Share this post Link to post Share on other sites
0 astralprojection 35 Posted December 8, 2015 damn brilliant AnnieRuru. i will try this Quote Share this post Link to post Share on other sites
I would like to ask help on achieving this:
1. Player whisper to NPC
2. NPC save names and location of players. ( example "player1","prontera",110,40,"player2","izlude",120,111,etc...)
Thanks
Share this post
Link to post
Share on other sites