GlobalEvent Effect for tutors!

Discussion in 'GlobalEvents, Spells & CreatureEvents' started by ghettobird, Aug 21, 2013.

  1. Jikoe II

    Jikoe II New Member

    Joined:
    Feb 7, 2009
    Messages:
    174
    Likes Received:
    9
    Best Answers:
    0
    yeppppppp
     
  2. WORGEN

    WORGEN Mind Freak Premium User

    Joined:
    Jul 17, 2012
    Messages:
    162
    Likes Received:
    5
    Best Answers:
    0
    yeye Ineed it Too IF u can Make it for The highest Guild in the Frags It will be Cool :D
    (For just the FIrst Guild!)
     
  3. Yusuf El-Shora

    Yusuf El-Shora Herizona-Ots

    Joined:
    Jul 19, 2015
    Messages:
    169
    Likes Received:
    6
    Best Answers:
    0
    If i want the effect for an admin, i use group 6?
     
  4. Tarek1337

    Tarek1337 Well-Known Member

    Joined:
    Jun 9, 2012
    Messages:
    3,523
    Likes Received:
    1,076
    Best Answers:
    3
    if getPlayerGroupId(cid) ==3 then
    If you mean this^ yes
     
  5. Yusuf El-Shora

    Yusuf El-Shora Herizona-Ots

    Joined:
    Jul 19, 2015
    Messages:
    169
    Likes Received:
    6
    Best Answers:
    0
    Yea i mean this xD
    Thanks bro
     
  6. kito2

    kito2 mtibia-global.com Just a noob

    Joined:
    Mar 9, 2009
    Messages:
    3,360
    Likes Received:
    90
    Best Answers:
    1
    This uses a lot of resources, good idea btw, but I would change to events/scripts/player.lua in order to iterate, without getting the list of online players.
     
  7. haji h ali

    haji h ali Member

    Joined:
    Sep 10, 2013
    Messages:
    37
    Likes Received:
    2
    Best Answers:
    0
    And what should I wrote down in Globalevents note?, I copied this Code to Lua note and how to make it worked?
     
  8. Hashirama479

    Hashirama479 World of Ninja

    Joined:
    Dec 19, 2016
    Messages:
    494
    Likes Received:
    68
    Best Answers:
    5
    Code (Text):
    1. <globalevent name="TutorEffect" interval="1" event="script" value="FILENAME.lua"/>
     
    haji h ali likes this.
  9. haji h ali

    haji h ali Member

    Joined:
    Sep 10, 2013
    Messages:
    37
    Likes Received:
    2
    Best Answers:
    0
    Thank you Hashirama479!
     
    Hashirama479 likes this.
  10. haji h ali

    haji h ali Member

    Joined:
    Sep 10, 2013
    Messages:
    37
    Likes Received:
    2
    Best Answers:
    0
    Sorry i made a mistake, thank you it's working fine!
     
    Hashirama479 likes this.
  11. CipsoftStinks

    CipsoftStinks Old Tibia Player

    Joined:
    Oct 1, 2016
    Messages:
    516
    Likes Received:
    51
    Best Answers:
    2
    [​IMG]

    its a very funny scripts thanks for release guys !
     
  12. Itutorial

    Itutorial Well-Known Member

    Joined:
    Dec 23, 2014
    Messages:
    1,001
    Likes Received:
    163
    Best Answers:
    12
    for TFS 1.x

    Code (Lua):
    1.  
    2. function onThink(interval)
    3.     players = Game.getPlayers()
    4.         for i, v in ipairs(players) do
    5.             player = Player(players[i])
    6.                 if player:getAccess() >= 3 then
    7.                     player:say("Staff", TALKTYPE_MONSTER_SAY, 0, 1, player:getPosition())
    8.                     player:getPosition():sendMagicEffect(10)
    9.                 end
    10.         end
    11. return true
    12. end
    13.  
     
  13. Static_

    Static_ Well-Known Member

    Joined:
    Feb 14, 2015
    Messages:
    3,136
    Likes Received:
    1,356
    Best Answers:
    188
    Code (Lua):
    1. local cfg = {
    2.     [1] = {"Tutor", CONST_ME_MAGIC_RED},
    3.     [2] = {"Gamemaster", CONST_ME_MAGIC_BLUE},
    4.     [3] = {"Admin", CONST_ME_MAGIC_GREEN}
    5. }
    6.  
    7. function onThink(interval)
    8.     local players = Game.getPlayers()
    9.     for _, player in ipairs(players) do
    10.         local effect = cfg[player:getGroup():getAccess()]
    11.         if effect then
    12.             player:say(effect[1], TALKTYPE_MONSTER_SAY)
    13.             player:getPosition():sendMagicEffect(effect[2])
    14.         end
    15.     end
    16.     return true
    17. end
     
    StreamSide likes this.
  14. Itutorial

    Itutorial Well-Known Member

    Joined:
    Dec 23, 2014
    Messages:
    1,001
    Likes Received:
    163
    Best Answers:
    12
    Code (Lua):
    1.  
    2. local fag = {
    3. [1] = {name = "Static_", age = 10, life_status = "Bitch Boy"}
    4. }
    5.  
    Jk, I haven't done any coding in a long time didn't think of the most efficient way to do it. Thanks for correcting it.
     
  15. Static_

    Static_ Well-Known Member

    Joined:
    Feb 14, 2015
    Messages:
    3,136
    Likes Received:
    1,356
    Best Answers:
    188
    ok
     
  16. Imfreezing

    Imfreezing Krossa Kapitalismen

    Joined:
    Jun 7, 2012
    Messages:
    990
    Likes Received:
    78
    Best Answers:
    0
    So nobody is gonna add in the |Disabled in /ghost| function?
     
  17. Itutorial

    Itutorial Well-Known Member

    Joined:
    Dec 23, 2014
    Messages:
    1,001
    Likes Received:
    163
    Best Answers:
    12
    Code (Lua):
    1.  
    2. function onThink(interval, lastExecution)
    3.     for k, v in pairs(getPlayersOnline()) do
    4.         if getPlayerGroupId(v) == 3 and not isPlayerGhost(v) then
    5.             if getPlayerStorageValue(v, 15612) == 1 then
    6.                 doSendMagicEffect(getPlayerPosition(v), CONST_ME_GIFT_WRAPS)
    7.                 doSendAnimatedText(getPlayerPosition(v), "Tutor", TEXTCOLOR_RED)
    8.             end
    9.         end
    10.     end
    11.     return true
    12. end
    13.  
    Code (Lua):
    1.  
    2. function onSay(cid, words, param, channel)
    3.     if getPlayerAccess(cid) > 3 then
    4.         if getPlayerStorageValue(cid, 15612) == 1 then
    5.             setPlayerStorageValue(cid, 15612, 0)
    6.             doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Automatic Message: OFF")
    7.         else
    8.             setPlayerStorageValue(cid, 15612, 1)
    9.             doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Automatic Message: ON")
    10.         end
    11.     end
    12. return true
    13. end
    14.  
     
  18. Itutorial

    Itutorial Well-Known Member

    Joined:
    Dec 23, 2014
    Messages:
    1,001
    Likes Received:
    163
    Best Answers:
    12
    Also made it so you can make a talkaction to turn it on and off.
     

Share This Page

Loading...