Need help on making textdraw appear like announcement - 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: Need help on making textdraw appear like announcement (
/showthread.php?tid=150978)
Need help on making textdraw appear like announcement -
GamerZPro - 28.05.2010
Hi, i need help in creating announcement using textdraw, but it not working.
I want it to appear one after another but not in
random.
Here the code:
Код:
new Msg;
forward MessageTimer();
new aMessage[12][128] =
{
{"Want to go ~b~somewhere cool? ~w~Type ~b~/teles~w~!"},
{"Buy a ~g~VIP ~w~Account ~b~Today! ~w~To access lot of new ~y~features~w~!"},
{"Always Respect ~b~This server ~y~Rules!"},
{"Welcome to ~b~Example!"},
{"Use the new ~y~/carmenu ~w~and ~y~/tunemenu~w~!"},
{"Suspect of ~r~Cheaters? ~w~Use ~y~/report [id] [Reason]"},
{"Want to be an ~r~Admin? ~w~Head ~w~to example!"},
{"Type ~y~/jumps ~w~for a list of Stunts."},
{"Wish to change your ~b~fighting styles? ~w~Type ~y~/fs ~w~for more ~b~Info."},
{"Wish to ~p~Speed up the little engine? ~w~Type ~y~/sb."},
{"Any Things you want to ~p~add ~w~head to our ~r~Website now~w~!"},
{"We Have Added some new ~b~Stunts. Use ~y~/new ~w~to see what new."}
};
public OnPlayerSpawn(playerid)
{
SetTimer("MessageTimer", 4000, true);
return 1;
}
public MessageTimer() //SetTimer OnGameModeInit
{
switch (Msg)
{
case 0: {TextDrawSetString(Text:TMessage, aMessage[0]); Msg++;} // first message
case 1: {TextDrawSetString(Text:TMessage, aMessage[1]); Msg++;}
case 2: {TextDrawSetString(Text:TMessage, aMessage[2]); Msg++;}
case 3: {TextDrawSetString(Text:TMessage, aMessage[3]); Msg++;}
case 4: {TextDrawSetString(Text:TMessage, aMessage[4]); Msg++;}
case 5: {TextDrawSetString(Text:TMessage, aMessage[5]); Msg++;}
case 6: {TextDrawSetString(Text:TMessage, aMessage[6]); Msg++;}
case 7: {TextDrawSetString(Text:TMessage, aMessage[7]); Msg++;}
case 8: {TextDrawSetString(Text:TMessage, aMessage[8]); Msg++;}
case 9: {TextDrawSetString(Text:TMessage, aMessage[9]); Msg++;}
case 10: {TextDrawSetString(Text:TMessage, aMessage[10]); Msg++;}
case 11: {TextDrawSetString(Text:TMessage, aMessage[11]); Msg = 0;}
}
return 1;
}
Please help me to finish this code.
Thanks in advance.
Re: Need help on making textdraw appear like announcement -
MadeMan - 28.05.2010
pawn Код:
public MessageTimer()
{
TextDrawSetString(textdraw, aMessage[Msg]);
Msg++;
if(Msg >= sizeof(aMessage))
{
Msg = 0;
}
}
You need to make the textdraw too.
And also use SetTimer for that function.