Graal Forums  

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

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 06-14-2003, 03:11 AM
ASouthernMan ASouthernMan is offline
Banned
Join Date: Jun 2003
Location: Alabama
Posts: 72
ASouthernMan is on a distinguished road
Send a message via ICQ to ASouthernMan Send a message via AIM to ASouthernMan Send a message via Yahoo to ASouthernMan
No Cursing Script

NPC Code:

if (actionserverside) {
if (strequals(#p(0),addstrings)) {
setstring clientr.nocurse_r1,pls,plz,brb,;
setstring clientr.nocurse_r2,please,please,"Be right back",;
setstring clientr.nocurse_p1,PUT,YOUR,CURSE,WORDS,HERE;
}
}
//#CLIENTSIDE
if (created) {
triggeraction 0,0,serverside,-Anticurse,addstrings;
}
if (playerchats) {
repeatcheck();
profanitycheck();
function repeatcheck() {
for (i=0; i<sarraylen(clientr.nocurse_r1); i++) {
this.i_r1 = indexof(#I(clientr.nocurse_r1,i),#c);
if (this.i_r1 > -1) {
setstring client.nocurse_ts,#e(0,strtofloat(#v(this.i_r1)),# c)#I(clientr.nocurse_r2,i)#e(strtofloat(#v(this.i_ r1))+strlen(#I(clientr.nocurse_r2,i))-3,-1,#c);
setplayerprop #c,#s(client.nocurse_ts);
}
}
if (this.i_rl < strlen(#c)) repeatcheck();
}
function profanitycheck() {
for (u=0; u<sarraylen(clientr.nocurse_p1); u++) {
this.i_p1 = indexof(#I(clientr.nocurse_p1,u),#c);
if (this.i_p1 > -1) {
setstring client.nocurse_st,;
for (o=0; o<strlen(#I(clientr.nocurse_p1,u)); o++) setstring client.nocurse_st,#s(client.nocurse_st)*;
setstring client.nocurse_ts,#e(0,strtofloat(#v(this.i_p1)),# c)#s(client.nocurse_st)#e(strtofloat(#v(this.i_p1) )+strlen(#s(client.nocurse_st)),-1,#c);
setplayerprop #c,#s(client.nocurse_ts);
}
}
if (this.i_p1 < strlen(#c)) profanitycheck();
}



client.nocurse_r1 and r2 are replacement strings

The "tokens" correspond to each other
Reply With Quote
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 02:53 PM.


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