adrianoswatt

MensagemToGuild onLogin

Feb 2nd, 2017
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.20 KB | None | 0 0
  1.  
  2.  
  3. -- [[ Tag: login.lua ]] --
  4. registerCreatureEvent(cid, "msg2guild")
  5. -- [[ Tag: login.lua ]] --
  6.  
  7. -- [[ Tag: creaturescripts.xml ]] --
  8. <event type="login" name="msg2guild" event="script" value="msg2guild.lua"/>
  9. -- [[ Tag: creaturescripts.xml ]] --
  10.  
  11. -- [[ Script msg2guild.lua ]] --
  12. local msgType = MESSAGE_STATUS_CONSOLE_BLUE
  13.  
  14. function onLogin(cid)
  15.     if isPlayer(cid) then
  16.         getMyGuild = getPlayerGuildId(cid)
  17.         if getMyGuild ~= 0 then
  18.             for i = 1, #getPlayersOnline() do
  19.                 tid = getPlayersOnline()[i]
  20.                 getHerGuild = getPlayerGuildId(tid)
  21.                 if getMyGuild == getHerGuild then
  22.                     if cid ~= tid then
  23.                         doPlayerSendTextMessage(tid, msgType, ""..getPlayerGuildRank(cid):upper()..": "..getCreatureName(cid)..", "..getPlayerVocationName(cid)..", level "..getPlayerLevel(cid).." and from "..getPlayerGuildName(cid).." Guild is Online now.")
  24.                     end
  25.                     doPlayerSendChannelMessage(tid, getCreatureName(cid), ""..getPlayerGuildRank(cid):upper()..": Vocation "..getPlayerVocationName(cid)..", level "..getPlayerLevel(cid).." and from "..getPlayerGuildName(cid).." Guild is Online now.", TALKTYPE_CHANNEL_W, CHANNEL_GUILD)
  26.                 end
  27.             end
  28.         end    
  29.     end
  30. return true
  31. end
  32. -- [[ Script msg2guild.lua ]] --
Advertisement
Add Comment
Please, Sign In to add comment