Raised This Month: $ Target: $400
 0% 

how to upgrade say_bs?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
FIYA
Member
Join Date: Sep 2007
Location: Cracow, Poland
Old 09-11-2007 , 15:21   how to upgrade say_bs?
Reply With Quote #1

Hi!
First of all, I'm newb if it comes to scripting and I don't have any idea how it works so please be understanding.
I've recently come across this plugin "say_bs" by f117bomb which I noticed is really basic and everyone knows it.

Code:
/* AMXMOD script.
   *
   * (c) Copyright 2000-2002, f117bomb
   * This file is provided as is (no warranties).
   *
   */
   #include <amxmod>
   new phrase[4][] = { "bs", "bullshit", "bullsh*t", "hack"}
   public say_event(id)
   {
       new sid[10]
       num_to_str(id,sid,10)
       new said[192]
       read_args(said,191)

       for(new i = 0 ;i < 4; i += 1)
           if(containi(said,phrase[i]) != -1)
               set_task(1.0,"client",0,sid,10)
   }
   public client(sid[])
   {
       new id = str_to_num(sid)
       engclient_cmd(id,"say", "But then agian, I am a noob...")
   }
   public plugin_init()
   {
       register_plugin("Say BS","0.3","f117bomb")
       register_clcmd("say","say_event")
       return PLUGIN_CONTINUE
   }
Without any knowledge of scripting or whatsoever I've put some slight changes with the key words triggering this plugin and the response to those words to adapt it to my language so it would work fine on my server.
Now, the situation is that some of these really short words are parts of other words in my language that are not offensive so I wouldn't want them to trigger the afterward response, but that's the way it works in this form. As I tried to logically solve this problem I noticed the "containi" part that might be the problem but only based on my english language knowledge. I looked at some other plugins and found the possible alternative which is "equali". I tried some different combinations but either the plugin works as it was at the beginning, triggers on every word written or it doesn't work at all. All I want to know is how to set it up so it would work only on the words given the way they are exactly written, not being parts of any other words. Oh, and not case sensitive as I came across that issue too. So please, help me if you can
FIYA is offline
 


Thread Tools
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 -4. The time now is 16:11.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode