Jump to content
  • 0
Sign in to follow this  
exchisu

How validate a userid ?

Question

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 ?

Share this post


Link to post
Share on other sites

7 answers to this question

Recommended Posts

  • 0

First of all, each character has 2 IDs actually: accID ( getcharid(3) ) and charID( getcharid(0) ), since there are usually less accounts than characters, you may check with comparing accID instead of charIDs. Are there any criterias at which you decide if to give or not to give? If so you can run a query, and get all the IDs into an array, and then compare with it. Or if you're using consecutive IDs you may check for intervals. Otherwise setting an array manually is probably the only way?

Share this post


Link to post
Share on other sites
  • 0

First of all, each character has 2 IDs actually: accID ( getcharid(3) ) and charID( getcharid(0) ), since there are usually less accounts than characters, you may check with comparing accID instead of charIDs. Are there any criterias at which you decide if to give or not to give? If so you can run a query, and get all the IDs into an array, and then compare with it. Or if you're using consecutive IDs you may check for intervals. Otherwise setting an array manually is probably the only way?

 

actually 

 

NgRL7sY.png

 

i can use the account_id or userid 

 

but i dont know how to check that, thats why i need help...

 

if i put an if for user account_id or userid ill put manualy in the script, like if( user id = 20000) give the item only one time.  then the user with acc id(20000) is going to speak with the npc, the npc give the item, and that's all. 

 

and the same for all the ids what ill put in the script.

Share this post


Link to post
Share on other sites
  • 0

Ooh. You mean the name of the account O_O I wouldn't use that, use the accID, and I mentioned the way you can get it before:

getcharid(3)

from script ingame will net you attached character's account id. And you can make a for() that runs through an array and checks if player accID matches the ones ou input.

//Setting arraysetarray .@accIDs[0],2000000,2000005,2000010,2000012,3000001;//Checking if char has accID of any of those arraysfor (.@i = 0; .@i < getarraysize(.@accIDs); .@i++) {	if( getcharid(3) == .@accIDs[.@i] && !givenitem) {		//Your code		givenitem = 1 //To prevent giving away 2 items to same character on account		// Can make it account-wide variable if you want to grant it once per acc.	}}

Share this post


Link to post
Share on other sites
  • 0

uhmm.. when i put your script, in the Case 1:

 

and end the script with } appear 

 

 Missing 1 right curlys at file xxx  line '28'.

 
and.. if i put the curly appear: unexpected end of script
 
 * 28 : }
 
 
wtf ?

Share this post


Link to post
Share on other sites
  • 0

Umm... because that's only part of script? You need to input it into NPC yourself >.>

Not to mention input the item giving or some messages inside :P

Share this post


Link to post
Share on other sites
  • 0

Umm... because that's only part of script? You need to input it into NPC yourself >.>

Not to mention input the item giving or some messages inside :P

 

didnt understand, can you explain a little better ?

Edited by exchisu

Share this post


Link to post
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.   Restore formatting

  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.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.