SA-MP Forums Archive
Noobiest question ever :P - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Noobiest question ever :P (/showthread.php?tid=159265)



Noobiest question ever :P - [L3th4l] - 12.07.2010

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


Re: Noobiest question ever :P - DJDhan - 12.07.2010

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.


Re: Noobiest question ever :P - -Rebel Son- - 13.07.2010

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


Re: Noobiest question ever :P - TheInnocentOne - 13.07.2010

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.


Re: Noobiest question ever :P - -Rebel Son- - 13.07.2010

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