Jump to content

Bantime


Recommended Posts

Posted

Sziasztok van egy scriptem ami a ban-t mutatja hogy ha beírom /ban [Játékos nevét] Akkor örökje bannolja

[ban]:Játékos név Ki lett bannolva Admin által 

[ban] indok: Nem ölöd meg az admin-t!!

nos azt szeretném hogy ha beírom hogy /ban Chris 4(idő) Indok

így kellene mutatnia

[ban]:Játékos Ki lett bannolva Admin által (x órára)

[ban]:Indok: Nem ölöd meg az admint

és úgy kellene lennie hogy ha 1-et írok akkor 1 óra

ha 2,3,4,5,6,7,8,9 akkor annyi óra amennyit beírok. ne mp. vagy perc hanem óra

pl 2589 akkor 2589 órára ::  ja és ha az írom hogy 0 akkor óra helyett azt írja hogy (Véglegesen)

[NEM SAN,EXTERNAL,FREEDOM SZERVERRE KELL, A SAJÁT SCRIPTES SZERORA AMI MÉG NEM INDULT EL!!]

Quote

function banPlayerCommand ( theClient, commandName, bannedName, ... ) 
    if hasObjectPermissionTo ( theClient, "function.kickPlayer" ) then 
        if not ... then 
            return outputChatBox ("#7cc576[Használat]:#ffffff /ban [Név] [óra] [indok]", theClient, 255, 255, 255, true ) 
        end 
        local reason = table.concat({...}," ") 
        local bannerName = getPlayerName(theClient):gsub("#%x%x%x%x%x%x","") 
        local bannedPlayer = getPlayerFromName(bannedName) 
        if not isElement(bannedPlayer) then 
            outputChatBox ("#7cc576Sikertelen ban mivel hibás játékos nevet adtál meg, vagy a játékos lecsatlakozott!", theClient, 255, 255, 255, true ) 
        end 
        outputChatBox("#d75959[Ban]:#7cc576"..getPlayerName(bannedPlayer):gsub("#%x%x%x%x%x%x","").." #ffffffKi lett bannolva#7cc576 ".. bannerName .." által (IDE KELLENE AZ IDŐT) #32b3ef", root, 255, 0, 0, true ) 
        outputChatBox("#d75959[Ban]:#7cc576Indok:#ffffff"..reason, root, 255, 0, 0, true )   
        banPlayer ( bannedPlayer, theClient, reason ) 
    else 
        outputChatBox ("#7cc576[Használat]:#ffffff Nem vagy Admin! ", theClient, 255, 255, 255, true ) 
    end 
end 
addCommandHandler ( "ban", banPlayerCommand )  

 

Posted

Ez legyen a kód:

function banPlayerCommand ( theClient, commandName, bannedName, ora, ... )
  	ora = tonumber(ora)*60*60
    if hasObjectPermissionTo ( theClient, "function.kickPlayer" ) then 
        if not ... then 
            return outputChatBox ("#7cc576[Használat]:#ffffff /ban [Név] [óra] [indok]", theClient, 255, 255, 255, true ) 
        end 
        local reason = table.concat({...}," ") 
        local bannerName = getPlayerName(theClient):gsub("#%x%x%x%x%x%x","") 
        local bannedPlayer = getPlayerFromName(bannedName) 
        if not isElement(bannedPlayer) then 
            outputChatBox ("#7cc576Sikertelen ban mivel hibás játékos nevet adtál meg, vagy a játékos lecsatlakozott!", theClient, 255, 255, 255, true ) 
        end 
        outputChatBox("#d75959[Ban]:#7cc576"..getPlayerName(bannedPlayer):gsub("#%x%x%x%x%x%x","").." #ffffffKi lett bannolva#7cc576 ".. bannerName .." által (IDE KELLENE AZ IDŐT) #32b3ef", root, 255, 0, 0, true ) 
        outputChatBox("#d75959[Ban]:#7cc576Indok:#ffffff"..reason, root, 255, 0, 0, true )   
		banPlayer(bannedName, true, false, false, reason, ora)
    else 
        outputChatBox ("#7cc576[Használat]:#ffffff Nem vagy Admin! ", theClient, 255, 255, 255, true ) 
    end 
end 
addCommandHandler ( "ban", banPlayerCommand )  

Ez alapján ez a parancs:

/ban Chris 123 Csak mert bannolva lettél és kész!

Elvileg működik, nem teszteltem.

Use Thanks reaction on my reply please!

Posted (edited)

Az csak azért lehet, mert nem adtál meg időt.

EDIT:

A parancs ez:

"/ban [Név] [Óra] [Indok]

"/ban Chris 123 BannHammer!"

Edited by TyFun

Use Thanks reaction on my reply please!

Posted

Igen... meg is van a probléma csak elnéztem egy argumentumot a 15. Sor legyen ez:

banPlayer(bannedPlayer, true, false, false, nil, reason, ido)

Ha megint nem írtam el semmit.

Ha igen írj aztán megint ránézek.

Use Thanks reaction on my reply please!

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