Functions and Timers | Strings being lost
#1

I am using a delay in IRC Messages so they go in order but something odd here...

Код:
format(string, sizeof(string), "Register Country: %s", country);
IRC_DelayedMessage(channel,IRC_LIST_COLOR,string,150);
format(string, sizeof(string), "Rank: %s", ServerRankNames[rank]);
IRC_DelayedMessage(channel,IRC_LIST_COLOR,string,200);
format(string, sizeof(string), "Register Date: %s", InsertDateTime(registerdate,0,0));
IRC_DelayedMessage(channel,IRC_LIST_COLOR,string,250);
format(string, sizeof(string), "Last Online: %s", InsertDateTime(LastOnline,0,0));
IRC_DelayedMessage(channel,IRC_LIST_COLOR,string,300);
//....
Functions
Код:
FUNCTION IRC_Message(const channel[],const color[],const message[])
{
	printf("Delayed Message Time Over %s | %s | %s ",channel,color,message);
	new string[256];
	format(string,sizeof(string),"%s%s",color,message);
	IRC_GroupSay(1, channel, string);
	return 1;
}

FUNCTION IRC_DelayedMessage(const channel[],const color[],const message[],delay)
{
	printf("Delayed Message Called %d | %s | %s | %s ",delay,channel,color,message);
	return SetTimerEx("IRC_Message",delay,false,"sss",channel,color,message);
}
Код:
[00:20:40] Delayed Message Called 150 | #MMv13.management | 8,12 | Register Country: Pakistan 
[00:20:40] Delayed Message Called 200 | #MMv13.management | 8,12 | Rank: Player 
[00:20:40] Delayed Message Called 250 | #MMv13.management | 8,12 | Register Date: 2018-05-18 11:49:39 
[00:20:40] Delayed Message Called 300 | #MMv13.management | 8,12 | Last Online: 2018-05-18 11:52:08 
[00:20:40] Delayed Message Called 450 | #MMv13.management | 8,12 | Vip: No 
[00:20:40] Delayed Message Called 600 | #MMv13.management | 8,12 | Timezone: 00:00 
[00:20:40] Delayed Message Called 650 | #MMv13.management | 8,12 | Online: No 
[00:20:40] Delayed Message Time Over Mv13.management | ,12 | Online: No 
[00:20:40] Delayed Message Time Over #MMv13.management | 8,12 | Online: No 
[00:20:40] Delayed Message Time Over t | agement | Online: No 
[00:20:40] Delayed Message Time Over Mv13.management | ,12 | Online: No 
[00:20:40] Delayed Message Time Over F4DD9044DA8F | ment | Online: No 
[00:20:40] Delayed Message Time Over  | t | Online: No 
[00:20:40] Delayed Message Time Over agement | 13.management | Online: No 
[00:20:41] Delayed Message Time Over #MMv13.management | 8,12 | Online: No 
[00:20:41] Delayed Message Time Over 12 | No | Online: No 
[00:20:41] Delayed Message Time Over 3.management |  | Online: No 
[00:20:41] Delayed Message Time Over #MMv13.management | 8,12 | Online: No
Reply
#2

Timers don't work with strings
Reply
#3

Just create a function that adds messages to a queue. This function should then set a timer to display the message automatically if there is more than one message in the queue then a timer should be set again to call the the display function until the last message.
Reply
#4

Quote:
Originally Posted by Pottus
Посмотреть сообщение
This function should then set a timer to display the message automatically
Not being rude, but how to set a timer to display a message, because timers don't work with strings.
Edit: I got it: the timer would only call the function..
Reply
#5

Oh thanks,

Yes, pottus that's something I am gonna try now.

The odd thing... I once tried it back 2 months ago for displaying a list and it worked.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)