Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #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
  #2  
Old 06-24-2004, 05:55 PM
Thallen Thallen is offline
Banned
Thallen's Avatar
Join Date: Jun 2003
Location: Florida
Posts: 1,284
Thallen is an unknown quantity at this point
Send a message via ICQ to Thallen Send a message via AIM to Thallen Send a message via MSN to Thallen Send a message via Yahoo to Thallen
Very nice.
Reply With Quote
  #3  
Old 06-24-2004, 06:00 PM
dlang dlang is offline
Yoshi!
dlang's Avatar
Join Date: Oct 2002
Location: Houston, Texas
Posts: 406
dlang is on a distinguished road
Send a message via AIM to dlang Send a message via MSN to dlang
Why put it in a level, its easier to have it as a weapon.
__________________
Where do I take this pain of mine?
I run but it stays right by my side.
So tear me open, pour me out,
there's things inside that scream and shout.
And the pain still hates me, so hold me until it sleeps.

---------------
Reply With Quote
  #4  
Old 06-24-2004, 06:19 PM
JohnGames JohnGames is offline
Registered User
Join Date: Jun 2004
Posts: 107
JohnGames is on a distinguished road
Quote:
Originally Posted by dlang
Why put it in a level, its easier to have it as a weapon.
It will need to be rescripted. Unless it used that everywhere script.
Reply With Quote
  #5  
Old 06-24-2004, 06:21 PM
osrs osrs is offline
Graalian since 1998
osrs's Avatar
Join Date: Mar 2002
Location: Brazil
Posts: 2,724
osrs is on a distinguished road
Send a message via ICQ to osrs Send a message via AIM to osrs Send a message via MSN to osrs Send a message via Yahoo to osrs
Very nice, i made something similiar some weeks ago.
__________________
"Ability is what you are capable of doing. Motivation determines what you do. Attitude determines how well you do it."
Facebook: facebook.com/raysilvadotnet /
Reply With Quote
Reply


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:11 PM.


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