Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 06-24-2004, 05:16 PM
xManiamaNx xManiamaNx is offline
Supreme Dictator
xManiamaNx's Avatar
Join Date: Nov 2002
Location: 127.0.0.1
Posts: 385
xManiamaNx is on a distinguished road
Send a message via MSN to xManiamaNx Send a message via Yahoo to xManiamaNx
Smile Freebie: Jail Script using DB npc

Free Jailing NPC.
Create a DB npc named Jail.
Put the npc below in a level you want to allow people to jail from.
Idea from: Shock (goalieboy_01)
NPC Code:

//Jailing NPC
//NPC made by Maniaman
if (created) {
//Set the guilds allowed to jail
setstring this.guilds,Police,Manager,Co-Manager,Administrator,Staff,Developer;
//Set the accounts allowed to jail with no tag
setstring this.accounts,xManiamaNx,stupidplayer,leetperson,e tc;
}
if (playerchats) {
if (strcontains(#s(this.guilds),#g)||strcontains(#s(t his.accounts),#a)) {
if (startswith(/jail,#c)) {
setstring thiso.account,#e(6,-1,#c);
jail();
}
if (startswith(/unjail,#c)) {
setstring thiso.account,#e(8,-1,#c);
unjail();
}
if (startswith(/comments,#c)) {
tokenize #c;
setstring thiso.account,#t(1);
setstring thiso.comments,#t(2);
setcomments();
}
if (strequals(#c,help)){
say2 Help is sent. Press F2 to View;
sendrpgmessage Jail System Help:;
sendrpgmessage /jail <account> --- Ex: /jail Bob;
sendrpgmessage /unjail <account> --- Ex: /unjail Bob;
sendrpgmessage /comments <account> --- Ex: /comments BoB "Test Dummy";
sendrpgmessage /getcomments <account> --- Ex: /getcomments BoB;
sendrpgmessage YOU MUST BE TAGGED TO USE THESE COMMANDS!;
sendrpgmessage ---------------;
}
}
if (startswith(/getcomments,#c)) {
setstring thiso.account,#e(13,-1,#c);
getcomments();
}
}
function jail() {
//Give them jailed flag in DB NPC
with (getnpc(Jail)) { setstring this.jail.#s(thiso.account),jailed; }
with (getplayer(#s(thiso.account))) {
set clientr.jail; //Give the client a jailed flag in case the DB npc goes poof
setlevel2 jail.nw,29.5,44; //Warp them to jail level
setplayerprop #n,Jailed;
say2 You Jailed #s(thiso.account);
}
}
function unjail() {
//Remove jailed string in db npc
with (getnpc(Jail)) { setstring this.jail.#s(thiso.account),; }
with (getplayer(#s(thiso.account))) {
unset clientr.jail; //Remove Players jailed flag
setlevel2 level.nw,30,30; //Warp them out of the jail
}
}
function setcomments() {
with(getnpc(Jail)) {
if (!strequals(#s(this.jail.#s(thiso.account)),)) {
setstring this.jail.#s(thiso.account),#s(thiso.comments);
} else { setplayerprop #c,#s(thiso.account) not jailed!; }
}
}
function getcomments() {
with (getnpc(Jail)) {
if (!strequals(#s(this.jail.#s(thiso.account)),)) {
setplayerprop #c,#s(this.jail.#s(thiso.account));
} else { setplayerprop #c,#s(thiso.account) not jailed!; }
}
}

__________________
Maniaman

Play Maloria Now: [2.3] [3]
Maloria Website


Last edited by xManiamaNx; 06-24-2004 at 06:25 PM..
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 10:22 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.