Jump to content
  • 0

Request #killable NPC


mofo

Question


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  69
  • Reputation:   4
  • Joined:  07/02/12
  • Last Seen:  

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
Link to comment
Share on other sites

3 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:  

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
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  69
  • Reputation:   4
  • Joined:  07/02/12
  • Last Seen:  

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
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  224
  • Reputation:   22
  • Joined:  03/23/12
  • Last Seen:  

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

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