Jump to content

try to make anti MOJRM-511 nickname


Recommended Posts

^_^ anti MOJRM-511 name

hey agine

i try to make this script since 1 month

alot of people in my server take my nickname MOJRM-511

and i try to make anti MOJRM-511 nickname

first check player name if player name was MOJRM-511

check serial if serial was 039873CEAE41542F1B058AFCDAC5A943 <--my serial

then

output message (MOJRM-511 enter the server)

if not same my serial give him banned automatic banned

but i dont know how i make that working

see my code

  
function loginPlayer() 
  
   local name = getPlayerName(source) 
   if   playername = 'MOJRM-511' ..name then 
     outputChatBox ( "#00ff00 name was checked", getRootElement(), 255, 0, 0, true ) 
   local serial = getPlayerSerial(source) 
            elseif playerserial = '039873CEAE41542F1B058AFCDAC5A943'..serial 
      if ( name = playerserial ) then 
       
       
       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 ( ipToBan, nil, nil, source, "bye bye you not MOJRM-511 ^_^" )  
    end 
     end 
end 
addEventHandler("onPlayerJoin", root, loginPlayer) 
  
  

Link to comment

try this:

function check(oldNick,newNick) 
    if(newNick)then 
        name = newNick 
    else 
        local name = getPlayerName(source) -- get player name 
    end 
    if(string.find(name,"MOJRM-511"))then --check if "MOJRM-511" is in the player name 
        outputChatBox ( "#00ff00 name was checked",source, 255, 0, 0, true ) --tell the player that their name was checked 
        local serial = getPlayerSerial(source) 
        if (serial == '039873CEAE41542F1B058AFCDAC5A943')then --check if their serial is the real MOJRM-511 
            outputChatBox ( " #00ff00  MOJRM-511 entered the server", getRootElement(), 255, 0, 0, true ) --output to everyone that MOJRM has entered the server 
        else   
            outputChatBox ( name.." is not MOJRM-511", getRootElement(), 255, 0, 0, true ) -- if it's not MOJRM then tell everyone that the player is not MOJRM 
            addBan ( serial, source, "bye bye you not MOJRM-511 ^_^" ) --Ban him by serial 
        end 
    end 
end 
addEventHandler("onPlayerJoin", root,check) 
addEventHandler("onPlayerChangeNick",root,check) 

I've added comments so you know what's happening step by step

Edited by Guest
Link to comment
what is the error?

Type in /debugscript 3 and see if it says anything

nothing happend

i type debugscript 3

nothing happend no errors

see this code

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

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

Link to comment
if (name == string.find("MOJRM-511"))then --Added quotes 

This wont work: http://lua-users.org/wiki/StringLibraryTutorial

string.find(THE_STRING,WHAT_TO_LOOK_FOR)

then it returns for some reason the number where it start and the end of the character.

When you start the resource, do you want everyone with the nametag to be checked or are you just going into the server and seeing if the output works?

yes i test ur code and no outputbox work

you can enter my server now and you will see

enter my server and put ur name MOJRM-511

not working :(

Link to comment

Try this:

function loginPlayer ( ) 
    local name = getPlayerName ( source ) 
    local serial = getPlayerSerial ( source ) 
    if ( 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
Try this:
function loginPlayer ( ) 
    local name = getPlayerName ( source ) 
    local serial = getPlayerSerial ( source ) 
    if ( 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 ) 

not working :(

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