Jump to content
  • 0

NPC Gift : Character Name as controller


Question

Posted

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 ?

2 answers to this question

Recommended Posts

Posted

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.

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...