Jump to content

|REL| Anti insult System With Money v1.0.1


Micro

Recommended Posts

Hello

Now Available v1.0.1

----------------------------------

*Fixed small bugs

*Add words

--------------------------------

Anti insult Money

By Micro

Version 1.0.0

---------------------------------------------

9539.png

----------------------------------------------

Description : |EN|

If Any One insult In Chat We Will Lose Money -5000

You Can edit a money and insult word from server.lua

Description : |AR|

من خلال المود اي شخص يقوم بشتم يخسر 5000 من المال

ويقوم بحدف الكلمة ويمكنك تعدل الكلمات و المال من

ملف server.lua

شكرا لكم

Download : https://community.multitheftauto.com/ind ... ls&id=6100

Edited by Guest
Link to comment

^

Not wanting to make you give up of that but I don't know who could use this with such code.

This is a mess.

1. You forgot to use local variables; Well, that ain't gonna make the script not work, but local variables should be used.

2. You should use global variables for variables like "take" in your script.

3. "k" table ain't needed.

3. There's no 3rd argument in onPlayerChat's function.

Corrected code:

local MONEY_AMOUNT = 5000; 
local WORDS_BLOCK =  
{  
    ["fuck"] = true,  
    ["bitch"] = true,  
    ["sex"] = true,  
    ["gay"] = true,  
    ["ass"] = true,  
    ["dick"] = true,  
    ["shutup"] = true; 
} 
  
addEventHandler( "onPlayerChat", root, 
    function( szMSG, szTYPE ) 
        for str in pairs( WORDS_BLOCK ) do 
            if ( string.find( szMSG, str ) or string.find( szMSG, string.upper( str ) ) ) then 
                cancelEvent(); 
                 
                outputChatBox( getPlayerName( source ) .. " lost $5000 for insulting/writing a forbidden word!", root, 0, 255, 255, true ); 
                takePlayerMoney( source, MONEY_AMOUNT ); 
  
                break; 
            end 
        end 
    end 
) 

Wasn't tested but should work.

Link to comment
  • 2 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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