Jump to content
  • 0

NPC Gift : Character Name as controller


Chaos92

Question


  • Group:  Members
  • Topic Count:  49
  • Topics Per Day:  0.01
  • Content Count:  1554
  • Reputation:   239
  • Joined:  08/03/12
  • Last Seen:  

If theres any script that can gift rewards to any selected character names by the script for example if "Admin01","Admin02"  talk to the npc, they can redeem the gift, but if other character talk to the npc, they didnt receive anything.

Any scripts like that ?

Link to comment
Share on other sites

2 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

Easy way is to just compare strings:

set .@name$, strcharinfo(0);
if (.@name$ == "Admin01" || .@name$ == "Admin02" || ... ) {
	//if (getgmlevel() < 1) end; //If this is GM only, block normal players too.
	getitem 501,1;
	end;
}
If you have a lot of names (100+, probably), you might want to use an SQL table or an array and search algorithm.
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  49
  • Topics Per Day:  0.01
  • Content Count:  1554
  • Reputation:   239
  • Joined:  08/03/12
  • Last Seen:  

allright im gonna try this :)

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...