How to Add attached Player to Array

astralprojection

New member
Messages
334
Points
0
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 
biggrin.png


 
now its better to use queue iterator for this kind of system

Code:
-	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;}
 
Last edited by a moderator:
Back
Top