• 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!

Solved Top Guild Effect

kafo

Well-known Member
Joined
Oct 14, 2011
Messages
209
Reaction score
17
Location
Egypt
Hello OTlanders,,,

i need help plz guys i searched for a script that make an effect to top guild players i found this

Code:
[code=lua]
local highscorefrags = getHighscoreString(Frags)
function onThink(interval, lastExecution)
    if getPlayerGuildFrags(cid) == highscorefrags then
              doSendMagicEffect(getPlayerPosition(cid), 27)
                  doSendAnimatedText(getPlayerPosition(cid), "TOP FRAGS", TEXTCOLOR_RED)
              end
       
        return true
end
[/CODE]

but i cant make the method getPlayerGuildFrags(cid) could any1 help me plz :D
 
im not sure what TFS are you using but perhaps its possible that:
getPlayerGuildFrags(cid) == number(value)
highscorefrags == string(value)
 
well show us what does getPlayerGuildFrags(cid) do then.
If you get no errors but script is running, we would like to know what does that function return.
 
it returns the top guild frags
well i don't see the script then how can i be sure?
whatever do this:
test = getPlayerGuildFrags(cid)
print(type(test).." "..tostring(test))
print(type(highscorefrags).." "..tostring(highscorefrags))
and tell me what prints you get to your console.
 
well i don't see the script then how can i be sure?
whatever do this:
test = getPlayerGuildFrags(cid)
print(type(test).." "..tostring(test))
print(type(highscorefrags).." "..tostring(highscorefrags))
and tell me what prints you get to your console.

man this function "getPlayerGuildFrags(cid)" dosn't exist i need make it understand me ??
 
btw that's what u ask
Untitled.png
 
man this function "getPlayerGuildFrags(cid)" dosn't exist i need make it understand me ??
now i do.. i asked before what does it return and you answered me:
it returns the top guild frags
but apparently you don't have this function.
Well i don't know how does TFS 0.4 work, but now someone else who does know it, also understands your issue.
 
now i do.. i asked before what does it return and you answered me:

but apparently you don't have this function.
Well i don't know how does TFS 0.4 work, but now someone else who does know it, also understands your issue.
i ment by the return that what function can do :P thats not mean its exist btw thx for help
 
2. Double Post:
- You have to wait 24 hours to post after your own post in a thread.

10. Tagging Users:
- Please refrain from tagging specific users in your posts just because you are desperately in need of help. They will eventually see your post or thread, and help you out.
 
I made this script, works properly but make freez.
Code:
function onThink(interval, lastExecution)
                    local text = {"1ST GUILD", "2ND GUILD", "3RD GUILD", "4TH GUILD"}
                    local info = db.getResult('SELECT `g`.`name` AS `name`, COUNT(`g`.`name`) as `frags` FROM `killers` k LEFT JOIN `player_killers` pk ON `k`.`id` = `pk`.`kill_id` LEFT JOIN `players` p ON `pk`.`player_id` = `p`.`id` LEFT JOIN `guild_ranks` gr ON `p`.`rank_id` = `gr`.`id` LEFT JOIN `guilds` g ON `gr`.`guild_id` = `g`.`id` WHERE `k`.`unjustified` = 1 AND `k`.`final_hit` = 1 GROUP BY `name` ORDER BY `frags` DESC, `name` ASC LIMIT 0, 4;')
                    if(info:getID() == -1) then
                        return true
                    end
                    local guilds, frags = {}, {}
                    while(info:next()) do
                        table.insert(guilds, info:getDataString("name"))
                        table.insert(frags, info:getDataString("frags"))
                    end
                    info:free()
                    if(#guilds < 1 and #frags < 1) then
                        return true
                    end
                    for _, pid in ipairs(getPlayersOnline()) do
                        for i = 1, 4 do
                            if(#guilds >= i) then
                                if(getPlayerGuildName(pid) == guilds[i]) then
                                    doSendAnimatedText(getCreaturePosition(pid), text[i], TEXTCOLOR_RED)
                                end
                            end
                        end
                    end
                    doBroadcastMessage("Best guild on server is ".. guilds[1] .." with ".. frags[1] .." kills!")
                    return true
                end
 
Back
Top