• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

Enforced Scripts. [ LUA ] OR [ C++]

DukeeH

Active Member
Joined
Dec 6, 2010
Messages
550
Solutions
3
Reaction score
39
Hello OTlanders.
Im here to request 3 Scripts ;x

[TFS 0.4 Trunk 3884] [8.6]

First.
Code:
 The Most Fragger Player Online Gots A Skull And If Somewone Get's more frags. The Skull Disappear From First Player And Goes To New Player

Second.
Code:
 As The First. But Broadcast The Top Fragger Like:
"PlayerName Is The Most Fragger, Let's Kill Him!"

X. Third. a little hard. { DONE. Link. }
Code:
 I Want a working 'No exp from same ip', in c++ prefered, cuz lua i think lags.
The one on c++ resources isn't working and the owner don't answer..

Help with u can.
I Will Be Thankful!
Thanks!
 
Last edited:
PHP:
local bu, bf, ru, rf, wu, wf = 10, 11, 20, 21, 30, 31 -- global storage values used to store skulls
local frags_storage = 15000 -- storage id where frags are stored

function onThink(interval, lastExecution, thinkInterval)
    local players = getPlayersOnline()
    local black_uid, black_frags = getStorage(bu), getStorage(bf)
    local red_uid, red_frags = getStorage(ru), getStorage(rf)
    local white_uid, white_frags = getStorage(wu), getStorage(wf)
    for i, uid in pairs(players) do
        local uid_frags = getCreatureStorage(uid, frags_storage)
        if(uid_frags > 0) then
            if(uid_frags > black_frags) then
                white_frags = red_frags
                white_uid = red_uid
                red_frags = black_frags
                red_uid = black_uid
                black_frags = uid_frags
                black_uid = uid
            elseif(uid_frags > red_frags) then
                white_frags = red_frags
                white_uid = red_uid
                red_frags = uid_frags
                red_uid = uid
            elseif(uid_frags > white_frags) then
                white_frags = uid_frags
                white_uid = uid
            end
        end
		if(getCreatureSkullType(uid) ~= SKULL_NONE) then
			doCreatureSetSkullType(uid, SKULL_NONE)
		end
    end
	local top3_msg = ''
    if(white_uid > 0 and getPlayerByGUID(white_uid) ~= nil) then
		top3_msg = '\n3. '.. getCreatureName(white_uid) ..' - '.. white_frags ..' frags'
        doCreatureSetSkullType(white_uid, SKULL_WHITE)
    end
    if(red_uid > 0 and getPlayerByGUID(red_uid) ~= nil) then
		top3_msg = '\n2. '.. getCreatureName(red_uid) ..' - '.. red_frags ..' frags' .. top3_msg
        doCreatureSetSkullType(red_uid, SKULL_RED)
    end
    if(black_uid > 0 and getPlayerByGUID(black_uid) ~= nil) then
		top3_msg = '\n1. '.. getCreatureName(black_uid) ..' - '.. black_frags ..' frags' .. top3_msg
        doCreatureSetSkullType(black_uid, SKULL_BLACK)
    end
    if(white_uid ~= getStorage(wu) or red_uid ~= getStorage(ru) or black_uid ~= getStorage(bu)) then
        doBroadcastMessage('Top 3 of server:' .. top3_msg)
    end
    doSetStorage(wf, white_frags)
    doSetStorage(wu, white_uid)
    doSetStorage(rf, red_frags)
    doSetStorage(ru, red_uid)
    doSetStorage(bf, black_frags)
    doSetStorage(bu, black_uid)
    return true
end
This is fixed globalevent.

Second attempt:
PHP:
local bu, bf, ru, rf, wu, wf = 10, 11, 20, 21, 30, 31 -- global storage values used to store skulls
local frags_storage = 15000 -- storage id where frags are stored

function onThink(interval, lastExecution, thinkInterval)
    local players = getPlayersOnline()
    local black_uid, black_frags = getStorage(bu), getStorage(bf)
    local red_uid, red_frags = getStorage(ru), getStorage(rf)
    local white_uid, white_frags = getStorage(wu), getStorage(wf)
    for i, uid in pairs(players) do
        local uid_frags = getCreatureStorage(uid, frags_storage)
        if(uid_frags > 0) then
            if(uid_frags > black_frags) then
                white_frags = red_frags
                white_uid = red_uid
                red_frags = black_frags
                red_uid = black_uid
                black_frags = uid_frags
                black_uid = uid
            elseif(uid_frags > red_frags) then
                white_frags = red_frags
                white_uid = red_uid
                red_frags = uid_frags
                red_uid = uid
            elseif(uid_frags > white_frags) then
                white_frags = uid_frags
                white_uid = uid
            end
        end
		if(getCreatureSkullType(uid) ~= SKULL_NONE) then
			doCreatureSetSkullType(uid, SKULL_NONE)
			doPlayerSetSkullEnd(uid, 0, SKULL_WHITE)
			doPlayerSetSkullEnd(uid, 0, SKULL_RED)
			doPlayerSetSkullEnd(uid, 0, SKULL_BLACK)
		end
    end
	local top3_msg = ''
    if(white_uid > 0 and getPlayerByGUID(white_uid) ~= nil) then
		top3_msg = '\n3. '.. getCreatureName(white_uid) ..' - '.. white_frags ..' frags'
		doCreatureSetSkullType(white_uid, SKULL_WHITE)
		doPlayerSetSkullEnd(white_uid, 9999999999999999999, SKULL_WHITE)
    end
    if(red_uid > 0 and getPlayerByGUID(red_uid) ~= nil) then
		top3_msg = '\n2. '.. getCreatureName(red_uid) ..' - '.. red_frags ..' frags' .. top3_msg
        doCreatureSetSkullType(red_uid, SKULL_RED)
		doPlayerSetSkullEnd(red_uid, 9999999999999999999, SKULL_RED)
    end
    if(black_uid > 0 and getPlayerByGUID(black_uid) ~= nil) then
		top3_msg = '\n1. '.. getCreatureName(black_uid) ..' - '.. black_frags ..' frags' .. top3_msg
        doCreatureSetSkullType(black_uid, SKULL_BLACK)
		doPlayerSetSkullEnd(black_uid, 9999999999999999999, SKULL_BLACK)
    end
    if(white_uid ~= getStorage(wu) or red_uid ~= getStorage(ru) or black_uid ~= getStorage(bu)) then
        doBroadcastMessage('Top 3 of server:' .. top3_msg)
    end
    doSetStorage(wf, white_frags)
    doSetStorage(wu, white_uid)
    doSetStorage(rf, red_frags)
    doSetStorage(ru, red_uid)
    doSetStorage(bf, black_frags)
    doSetStorage(bu, black_uid)
    return true
end
 
Last edited:
Back
Top