Jump to content
  • 0

(Request)defpattern/pcre in global npc?


Question

Posted

Hallo Masters of Source, after i discussed about PCRE and whisper_sys with Emistry in this topic

i wish, this function can be reality if anyone can help me how to create source about deffpatern with global npc (like whisper_sys do)..

for example:

-	script	HealMeEverywhere	-1,{

end;

OnHealPlayer:

percentheal 100, 100;

specialeffect2 EF_HEAL;

end;

OnInit:

(for example)defpatternglobal 1, "([^:]+):.*\\sheal plz(\\s.*)?", "OnHealPlayer";

activatepset 1;

}

so when i use normal chat "heal plz" global npc automatic heal me, in everywhere and everytime i need..

anyone can help my wishing for? i think it's possible to make great thing like this. ^^

thank you ^^

2 answers to this question

Recommended Posts

Posted

thank's Emistry, but.. i can't modify source, its to hard for me hahaha >_<

oh i can see annie's modification in here.. adding source onPcChatEvent?

- script asdfadsfasdfa -1,{
OnPCChatEvent:
for ( set .@i, 0; .@i < .size; set .@i, .@i +1 ) {
if ( compare( @pc_chattext$, .foul$[.@i] ) ) {
announce strcharinfo(0) +", stop speaking rude ! detect '"+ .foul$[.@i] +"'", 0;
end;
}
}
end;
OnInit:
setarray .foul$, "tanga", "shit", "fuck", "asshole";
set .size, getarraysize(.foul$);
}


still could use it in last git?

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...