Jump to content
  • 0

validate a userid


exchisu

Question


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  60
  • Reputation:   1
  • Joined:  12/12/13
  • Last Seen:  

Hi, well im doing a script who gave u a designet hat. But is only one. and is going to design by me.

 

more explain, ill put all the userid on the script and when the people talk with the npc with the user id what i put on the script ill receive the hat. if the userid isnt in the script dont give nothing.

 

Well i dont know that part.. how to validate the userid... like if(@userid =="theuserIDwhatiput")... but i need to put so much userids.. no just one..

 

that, anybody can help me to how to validate that ?

Link to comment
Share on other sites

1 answer to this question

Recommended Posts


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

you can try something like this

function	aid_in_array	{
	.@aid = getcharid(3);
	.@argcount = getargcount();
	
	while( .@i < .@argcount ) {
		if ( getarg(.@i) == .@aid )
			return 1;
	}
	
	return 0;
}

sample usage :

	if ( aid_in_array( <aid1>,<aid2>,...,<aid_n> ) ) {
		mes "Your AID are found.";
	}
	else {
		mes "AID not found.";
	}
	close;
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...