Jump to content

try to make anti MOJRM-511 nickname


Recommended Posts

function loginPlayer ( ) 
    local name = getPlayerName ( source ) 
    local serial = getPlayerSerial ( source ) 
    if ( name == "MOJRM-511" or name:find ( "MOJRM-511" ) ) then 
        if ( serial == "039873CEAE41542F1B058AFCDAC5A943" ) then 
            outputChatBox ( "#00ff00 name was checked", getRootElement(), 255, 0, 0, true ) 
            outputChatBox ( "#00ff00 MOJRM-511 entered the server", getRootElement(), 255, 0, 0, true ) 
        else 
            outputChatBox ( "he is not MOJRM-511", getRootElement(), 255, 0, 0, true ) 
            addBan ( nil, nil, serial, source, "bye bye you not MOJRM-511 ^_^" ) 
        end 
    end 
end 
addEventHandler ( "onPlayerJoin", root, loginPlayer ) 

Link to comment
Guest Guest4401

string.find wasn't working because the string has to be plain...

string.find(s, pattern [, init [, plain]]) 

string.find ( "MOJRM-511", "MOJRM-511" ) 
-- nothing happens 

string.find ( "MOJRM-511", "MOJRM-511", 1, true ) 
-- works, result : 1 - 9 

Link to comment
function loginPlayer ( ) 
    local name = getPlayerName ( source ) 
    local serial = getPlayerSerial ( source ) 
    if ( name == "MOJRM-511" or name:find ( "MOJRM-511" ) ) then 
        if ( serial == "039873CEAE41542F1B058AFCDAC5A943" ) then 
            outputChatBox ( "#00ff00 name was checked", getRootElement(), 255, 0, 0, true ) 
            outputChatBox ( "#00ff00 MOJRM-511 entered the server", getRootElement(), 255, 0, 0, true ) 
        else 
            outputChatBox ( "he is not MOJRM-511", getRootElement(), 255, 0, 0, true ) 
            addBan ( nil, nil, serial, source, "bye bye you not MOJRM-511 ^_^" ) 
        end 
    end 
end 
addEventHandler ( "onPlayerJoin", root, loginPlayer ) 

worked worked wow wow

thanks you solid snake and thanks for all for replay

Link to comment

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...