Jump to content

Recommended Posts

  • Premium

I wanna put one timer in send whisper. But this dont work... Why?

 

 

def SendWhisper(self):

        Time = {"LAST":0}
        text = self.chatLine.GetText()
        textLength = len(text)
        stringy = ""
        x1 = 0
        if textLength > 0:
            if net.IsInsultIn(text):
                chat.AppendChat(chat.CHAT_TYPE_INFO, locale.CHAT_INSULT_STRING)
                return
            if self.targetName.find("Grupo:") != -1:
                for y in constInfo.groups[self.targetName]:
                    if x1 == 0:
                        stringy = stringy + y
                        x1 = 1
                    else:
                        stringy = stringy + "," + y
                        
                for x in constInfo.groups[self.targetName]:
                    net.SendWhisperPacket(x, "_pn_groupx1888329||" + str(stringy) + "||" + self.targetName + "||" + player.GetName() + " : " + text)
                constInfo.group_chat_enable = 1
                self.chatLine.SetText("")

                chat.AppendWhisper(chat.WHISPER_TYPE_CHAT, self.targetName, player.GetName() + " : " + text)
                constInfo.chat_string =  player.GetName() + " : " + text
                
            else:
                if app.GetGlobalTimeStamp()>=self.Time["LAST"]:
                    constInfo.group_chat_enable = 0
                    net.SendWhisperPacket(self.targetName, text)
                    self.chatLine.SetText("")
                    self.Time["LAST"] = app.GetGlobalTimeStamp()+1

                    chat.AppendWhisper(chat.WHISPER_TYPE_CHAT, self.targetName, player.GetName() + " : " + text)
                    constInfo.chat_string =  player.GetName() + " : " + text
                else:
                    chat.AppendChat(chat.CHAT_TYPE_INFO,"Antispam: You can only write 1 time per second.")

 

Edited by EnKor
if pc.get_sex() == true and npc.get_sex() == false then
	npc.purge()
end

 

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.