14.09.2011, 18:52
Hi
Hello everyone, the last hour I have been trying to learn how to make TextDraws and here is how far I've come 'til now.
It almost seem to work as it should but its 1 problem,
The first TextDraw (RTD2) appears just fine but when another one is about to appear it just disappear.
I hope someone can help me with this , I actually want to release it when Im done with it.
(It's very simple but its only my second one!)
Here is the code:
Hello everyone, the last hour I have been trying to learn how to make TextDraws and here is how far I've come 'til now.
It almost seem to work as it should but its 1 problem,
The first TextDraw (RTD2) appears just fine but when another one is about to appear it just disappear.
I hope someone can help me with this , I actually want to release it when Im done with it.
(It's very simple but its only my second one!)
Here is the code:
pawn Code:
// Credits (Do not remove or edit any of the credits!!!)
// fubar - Idea token from fubar's all_in_one filterscript.
// OleKristian95 - Made this filterscript
//---Includes---//
#include <a_samp>
//--------------//
//-------Forwards-------//
forward Random_Messages();
//----------------------//
//-Timer Define-//
new RTDS_Timer;
//--------------//
//--TextDraw Defines--//
new Text:RTD1;
new Text:RTD2;
//--------------------//
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Random TextDraws by OleKristian95");
print("--------------------------------------\n");
//The TextDraw Timer
RTDS_Timer = SetTimerEx("Random_Messages",85000, 1, "i");
//The TextDraw Messages + The TextDraw Boxes
RTD1 = TextDrawCreate(0.000000,437.000000, "If you are new at this server please register, Type /Register [Password]");
TextDrawUseBox(RTD1,1);
TextDrawBoxColor(RTD1,0x00000066);
TextDrawTextSize(RTD1,2000.000000,3600.000000);
TextDrawAlignment(RTD1,1);
TextDrawBackgroundColor(RTD1,0x00000066);
TextDrawFont(RTD1,1);
TextDrawLetterSize(RTD1,0.299999,1.000000);
TextDrawColor(RTD1,0x00ff00cc);
TextDrawSetOutline(RTD1,1);
TextDrawSetProportional(RTD1,1);
TextDrawSetShadow(RTD1,1);
RTD2 = TextDrawCreate(0.000000,437.000000, "To see a list of this server's general commands, Type /Commands");
TextDrawUseBox(RTD2,1);
TextDrawBoxColor(RTD2,0x00000066);
TextDrawTextSize(RTD2,2000.000000,3600.000000);
TextDrawAlignment(RTD2,1);
TextDrawBackgroundColor(RTD2,0x00000066);
TextDrawFont(RTD2,1);
TextDrawLetterSize(RTD2,0.299999,1.000000);
TextDrawColor(RTD2,0x00ff00cc);
TextDrawSetOutline(RTD2,1);
TextDrawSetProportional(RTD2,1);
TextDrawSetShadow(RTD2,1);
return 1;
}
public OnFilterScriptExit(){
KillTimer(RTDS_Timer);
return 1;
}
public Random_Messages()
{
new Random_Message=random(2);
if (Random_Message == 0){
//Hide TextDraws
TextDrawHideForAll(RTD2);
//Show TextDraw
TextDrawShowForAll(RTD1);}
else if (Random_Message == 1){
//Hide TextDraws
TextDrawHideForAll(RTD1);
//Show TextDraw
TextDrawShowForAll(RTD2);}
return 1;
}
/* Copyright © 2011 OleKristian95 */