youtube Posted July 25, 2013 Posted July 25, 2013 - script restricted_manner -1,{ OnInit: setarray .@bad_word$, "tangina", "t@ngin@", "t@ng1ng@", "tanga", "t@ng@" , "t@nga", "bobo" , "bob0"; .@size_b = getarraysize( .@bad_word$ ); for( ; .@i < .@size_b; .@i++ ) defpattern 1, "([^:]+):.*\\s"+ .@bad_word$[.@i] +".$", "warning"; activatepset 1; end; warning: @warning++; if ( @warning == 3 ) { @warning = 0; deltimer strnpcinfo(0) +"::OnDelay"; atcommand "@mute 5 "+ strcharinfo(0); } else { deltimer strnpcinfo(0) +"::OnDelay"; addtimer 300000, strnpcinfo(0) +"::OnDelay"; message strcharinfo(0), "Be careful with your language... Warning "+ @warning +"/3"; } end; OnDelay: @warning = 3; end; } need help Quote
Patskie Posted July 25, 2013 Posted July 25, 2013 try this : - script restricted_manner -1,{ OnInit: setarray .@bad_word$, "tangina", "t@ngin@", "t@ng1ng@", "tanga", "t@ng@" , "t@nga", "bobo" , "bob0"; set .@size_b, getarraysize( .@bad_word$ ); for( set .@i, 0; .@i < .@size_b; set .@i, .@i + 1 ) defpattern 1, "([^:]+):.*\\s"+ .@bad_word$[.@i] +".$", "warning"; activatepset 1; end; warning: set @warning, @warning + 1; if ( @warning == 3 ) { set @warning, 0; deltimer strnpcinfo(0) +"::OnDelay"; atcommand "@mute 5 "+ strcharinfo(0); } else { deltimer strnpcinfo(0) +"::OnDelay"; addtimer 300000, strnpcinfo(0) +"::OnDelay"; message strcharinfo(0), "Be careful with your language... Warning "+ @warning +"/3"; } end; OnDelay: set @warning, 3; end; } Quote
youtube Posted July 25, 2013 Author Posted July 25, 2013 when i say bobo there are no action about script. if i say bobo automatic jail Quote
Patskie Posted July 25, 2013 Posted July 25, 2013 Is there any error in the console? If so, post error. If none, then you might not have PCRE? Quote
Emistry Posted July 27, 2013 Posted July 27, 2013 i dont think this kind of script can simply done using npc script .... suppose done through src mod .. when you using defpattern in a npc ... a player must be near to the NPC so that the defpattern can trigger the events given.. using a floating npc..it wont work..because it has no location...mean..the player cant be near to the npc ... Quote
Patskie Posted July 27, 2013 Posted July 27, 2013 Instead of creating either script or source why not put your array content in your data/manner.txt? Quote
Xynvaroth Posted August 3, 2013 Posted August 3, 2013 then?Please post a clear and complete question. I do not think people will understand what you actually mean with this. 2 Quote
youtube Posted August 4, 2013 Author Posted August 4, 2013 i mean the player say the bad words automatic mute for 15mins or 30mins i use Eathena . this script not working to Ea i think . i need someone help me to fix that script master Quote
Emistry Posted August 4, 2013 Posted August 4, 2013 i mean the player say the bad words automatic mute for 15mins or 30mins i use Eathena . this script not working to Ea i think . i need someone help me to fix that script master if you want to create a npc that work like this...you need OnPCChatEvent .... whenever they chat...when compare the chat contents with your bad words list...and apply mute if matches.... Quote
Question
youtube
- script restricted_manner -1,{
OnInit:
setarray .@bad_word$, "tangina", "t@ngin@", "t@ng1ng@", "tanga", "t@ng@" , "t@nga", "bobo" , "bob0";
.@size_b = getarraysize( .@bad_word$ );
for( ; .@i < .@size_b; .@i++ )
defpattern 1, "([^:]+):.*\\s"+ .@bad_word$[.@i] +".$", "warning";
activatepset 1;
end;
warning:
@warning++;
if ( @warning == 3 ) {
@warning = 0;
deltimer strnpcinfo(0) +"::OnDelay";
atcommand "@mute 5 "+ strcharinfo(0);
}
else {
deltimer strnpcinfo(0) +"::OnDelay";
addtimer 300000, strnpcinfo(0) +"::OnDelay";
message strcharinfo(0), "Be careful with your language... Warning "+ @warning +"/3";
}
end;
OnDelay:
@warning = 3;
end;
}
need help
13 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.