Noobiest question ever :P
#1

Hey guys, lol I need help here.

pawn Код:
new Texts;
pawn Код:
foreach(Player,i)
{
    switch(Texts)
    {
        case 1: { SetTimerEx("SendTxtMsgD",10000,0,"i",i); Texts=1;}
        case 2: { SetTimerEx("SendTxtMsgD",5000,0,"i",i); Texts=2;}
        case 3: { SetTimerEx("SendTxtMsgD",5000,0,"i",i); Texts=3;}
        case 4: { SetTimerEx("SendTxtMsgD",5000,0,"i",i); Texts=4;}
        case 5: { SetTimerEx("SendTxtMsgD",5000,0,"i",i); Texts=5;}
    }
}
pawn Код:
forward SendTxtMsgD();
public SendTxtMsgD()
{
    switch(Texts)
    {
        case 1: { TextDrawHideForAll(TextMessage[0]); }
        case 2: { TextDrawHideForAll(TextMessage[1]); }
        case 3: { TextDrawHideForAll(TextMessage[2]); }
        case 4: { TextDrawHideForAll(TextMessage[3]); }
        case 5: { TextDrawHideForAll(TextMessage[4]); }
    }
}
Ok, as you see, on the first code, i have that under a function, what i like to do is when the timers on the first code go off, it triggers the textdraws to hide as shown on second code.

LoL, umm yeah, i want the textdraws to destroy 1 by 1, but the first textdraw(which is [0]) has like 10 seconds before hiding, then the rest hides at 5 second

also, those are too many timers and i don't know if it will cause lag, is there another way to use less or is that about it?

Thanx
Reply
#2

I don't really understand what you are trying to do with that code but I do understand that if you replace:
Код:
foreach(Player,i)
{    
	switch(Texts)    
	{        
		case 1: 
		{ 
			SetTimerEx("SendTxtMsgD",10000,0,"i",i); Texts=1;
		}        
		case 2: 
		{ 
			SetTimerEx("SendTxtMsgD",5000,0,"i",i); Texts=2;
		}        
		case 3: 
		{ 
			SetTimerEx("SendTxtMsgD",5000,0,"i",i); Texts=3;
		}        
		case 4: 
		{ 
			SetTimerEx("SendTxtMsgD",5000,0,"i",i); Texts=4;
		}       
		case 5: 
		{ 
			SetTimerEx("SendTxtMsgD",5000,0,"i",i); Texts=5;
		}    
	}
}
with :

Код:
foreach(Player,i)
{    
	switch(Texts)    
	{        
		case 1: 
		{ 
			SetTimerEx("SendTxtMsgD",500,0,"i",i); Texts=1;
		}        
		case 2: 
		{ 
			SetTimerEx("SendTxtMsgD",500,0,"i",i); Texts=2;
		}        
		case 3: 
		{ 
			SetTimerEx("SendTxtMsgD",500,0,"i",i); Texts=3;
		}        
		case 4: 
		{ 
			SetTimerEx("SendTxtMsgD",500,0,"i",i); Texts=4;
		}       
		case 5: 
		{ 
			SetTimerEx("SendTxtMsgD",500,0,"i",i); Texts=5;
		}    
	}
}
The textdraws will hide after 500 milliseconds and I guess that's what you wanted to do?

Note: I have done nothing but change the time you set. If you have any problem or want something else, let me know.
Reply
#3

Wow! to many timers! lagfest? Anyways. are you trying to make random messages?
Reply
#4

Quote:
Originally Posted by -Rebel Son-
Посмотреть сообщение
Wow! to many timers! lagfest? Anyways. are you trying to make random messages?
1. Not all those timers will go at once.
2. One timer will not "lag" the server.
Reply
#5

But basicly, your running a timer 24/7. But anyways, are you trying to make a random message?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)