Jump to content
  • 0

Request #killable NPC


Question

Posted

I'd like to request for an NPC that will use the #killable command on a player upon login. A gm can input a character name (or char ID) that will render said character killable everytime he logs in. When normal players click the NPC, it will show them a list of names who are killable. I figured, instead of banning abusers, just let other players have fun with them. Thanks in advance

  • Upvote 1

3 answers to this question

Recommended Posts

Posted

Interesting request... xD

<header> {
   mes "[List of Killable Players]";
   if (!getarraysize($killable$)) mes "(none)";
   else for(set .@i,0; .@i<getarraysize($killable$); set .@i,.@i+1)
    mes " ~ "+$killable$[.@i];
   if (getgmlevel() < 80) close;    // Set GM level here
   next;
   switch(select("Add to list:Delete from list:Close")) {
    case 1:
	    input .@n$;
	    query_sql("SELECT `char_id` FROM `char` WHERE `name` = '"+.@n$+"'",.@charid);
	    if (!.@charid) { mes "The name is invalid."; close; }
	    mes "Player ^FF0000"+.@n$+"^000000 added.";
	    set $killable$[getarraysize($killable$)], .@n$;
	    close;
    case 2:
	    set .@i, select(implode($killable$,":"))-1;
	    mes "Player ^FF0000"+$killable$[.@i]+"^000000 deleted.";
	    deletearray $killable$[.@i],1;
    case 3:
	    close;
   }
OnPCLoginEvent:
   for(set .@i,0; .@i<getarraysize($killable$); set .@i,.@i+1)
    if ($killable$[.@i] == strcharinfo(0)) { atcommand "@killable"; break; }
   end;
}

That's untested, so there might be minor errors.

  • Upvote 1
Posted (edited)

yey, thanks so much. i will test it later. this script is concise so it should be easy to diagnose errors (if there are any). thank you again =)

edit: it works!

Edited by mofo
Posted

Interesting request... xD

<header> {
mes "[List of Killable Players]";
if (!getarraysize($killable$)) mes "(none)";
else for(set .@i,0; .@i<getarraysize($killable$); set .@i,.@i+1)
	mes " ~ "+$killable$[.@i];
if (getgmlevel() < 80) close;	// Set GM level here
next;
switch(select("Add to list:Delete from list:Close")) {
	case 1:
		input .@n$;
		query_sql("SELECT `char_id` FROM `char` WHERE `name` = '"+.@n$+"'",.@charid);
		if (!.@charid) { mes "The name is invalid."; close; }
		mes "Player ^FF0000"+.@n$+"^000000 added.";
		set $killable$[getarraysize($killable$)], .@n$;
		close;
	case 2:
		set .@i, select(implode($killable$,":"))-1;
		mes "Player ^FF0000"+$killable$[.@i]+"^000000 deleted.";
		deletearray $killable$[.@i],1;
	case 3:
		close;
}
OnPCLoginEvent:
for(set .@i,0; .@i<getarraysize($killable$); set .@i,.@i+1)
	if ($killable$[.@i] == strcharinfo(0)) { atcommand "@killable"; break; }
end;
}

That's untested, so there might be minor errors.

Lol that's quite an epic way to deal with awkward players <.<

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