Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Autokick Invalid CD Keys
- -- by H® Shaft for Halo PC/CE for SAPP
- -- This will validate all joining players CD Keys and kick them -IF- their CD Key is NOT VALID.
- -- Note: CD Key validation only happens on public servers.
- -- Message to invalidated player before they are kicked:
- Kick_Messages = {
- "YOUR CD-KEY IS INVALID! A VALID CD-KEY REQUIRED TO PLAY HERE!",
- "SU CLAVE DE CD NO ES VALIDA!",
- "DEBE TENER UNA CLAVE DE CD VALIDA PARA JUGAR AQUI!"
- }
- -- don't edit below --
- api_version = "1.10.0.0"
- ce = 0x0
- function OnScriptLoad()
- register_callback(cb['EVENT_JOIN'], "OnPlayerJoin")
- end
- function OnPlayerJoin(PlayerIndex)
- timer(3000, "Validate_CD", PlayerIndex)
- end
- function Validate_CD(PlayerIndex)
- local Reason = "INVALID CD-KEY"
- local Name = get_var(PlayerIndex,"$name")
- local valid_cd = get_var(PlayerIndex,"$valid")
- local id = get_var(PlayerIndex, "$n")
- if player_present(PlayerIndex) then
- if (valid_cd == "0") then
- for l,message in pairs(Kick_Messages) do
- say(PlayerIndex,string.gsub(message,"$PLAYER",get_var(PlayerIndex,"$name")))
- end
- SayExcept(Name .. " is being auto-kicked for using an Invalid CD-Key.", PlayerIndex)
- timer(3000, "Auto_Kick", PlayerIndex)
- end
- end
- end
- function Auto_Kick(PlayerIndex)
- local Reason = "INVALID CD-KEY"
- execute_command("sv_kick " .. PlayerIndex)
- return false
- end
- function SayExcept(Message, Except)
- for i=1,16 do
- if i ~= tonumber(Except) then
- say(i, Message)
- end
- end
- end
- function OnScriptUnload() end
- function OnError(Message)
- print(debug.traceback())
- end
- -- Created by H® Shaft
- -- Visit http://halorace.org/forum/index.php
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement