Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ```Lua
- CTF.Register = function(Player)
- local PID = GetRoleID(Player)
- local IP = GetAccountIP(Player)
- local MAC = GetAccountMac(Player)
- local OsTime = os.time()
- local Attempt = CTF.LeaveTime[PID]
- if GetChaAttr(Player, ATTR_JOB) < 8 then
- BickerNotice(Player, "Only characters that have done 2nd class advancement can participate!")
- return
- end
- if CTF.OpenDay() == 0 then
- BickerNotice(Player, "Registering for "..CTF.Conf.MapName.." is unavailable today, please come back again tommorow.")
- return
- end
- -- Checking if player mac same from registered character and playerid different from registered.
- if CTF.EnterLobby[IP].MAC == MAC and CTF.EnterLobby[IP].PlayerID ~= PID then
- BickerNotice(Player, "Alts are not allowed to enter!")
- return
- end
- -- Not registered and battle arealdy started.
- if CTF.EnterLobby[IP] == nil and CTF.MapOpened == true then
- BickerNotice(Player, "You can't participate, the battle arealdy started!")
- return
- end
- -- Registered, battle started and didn't DC on map.
- if CTF.EnterLobby[IP].PlayerID == PID and CTF.MapOpened == true and Attempt == nil then
- StartPlayerCTF(Player)
- return
- end
- -- Registered, battle started and disconnect attempt time didn't gone.
- if CTF.EnterLobby[IP].PlayerID == PID and CTF.MapOpened == true and Attempt ~= nil and OsTime < Attempt then
- StartPlayerCTF(Player)
- return
- end
- -- Registered, battle started and disconnect attempt time gone.
- if CTF.EnterLobby[IP].PlayerID == PID and CTF.MapOpened == true and Attempt ~= nil and OsTime >= Attempt then
- BickerNotice(Player, "You can't participate anymore, your attempt time has gone!")
- return
- end
- if CTF.OpenHour() == 0 then
- BickerNotice(Player, "Registering for "..CTF.Conf.MapName.." is unavailable at this hour, please come back later.")
- return
- end
- if IsInTeam(Player) == 1 then
- BickerNotice(Player, "You're inside a party. Cannot register!")
- return
- end
- if CTF.Conf.MinLv > GetChaAttr(Player, ATTR_LV) or (CTF.Conf.MaxLv ~= 0 and CTF.Conf.MaxLv < GetChaAttr(Player, ATTR_LV)) then
- BickerNotice(Player, "You can't participate, only players between levels "..CTF.Conf.MinLv.." through "..CTF.Conf.MaxLv.." can participate.")
- return
- end
- CTF.EnterLobby[IP] = {}
- CTF.EnterLobby[IP].PlayerID = PID
- CTF.EnterLobby[IP].MAC = MAC
- MoveCity(Player, "Arena Island")
- end
- ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement