Problem with Textdraw
#1

Hey i have problem in my Textdraw it disappears when player leaves the server and appears again in few seconds idk whats wrong with that, here is the code,

Код:
new Text:ServerMSG;

new RMessages[][] =
{
	"~g~Use /help and /cmds to know more about the server.",
	"~g~Seen any hacker? Use /report [ID][REASON].",
	"~g~Need any help? Feel free to ask any admin online."

};
UNDER ONGAMEMODEINIT ___ IF numbers used needed tell me

Код:
SetTimer("MSG", 8000, true);
	ServerMSG = TextDrawCreate(Removed, Removed, "Server MSG");
	TextDrawColor(ServerMSG, Light_Blue);
	TextDrawFont(ServerMSG, Removed);
	TextDrawLetterSize(ServerMSG, Removed, Removed);
	TextDrawSetProportional(ServerMSG, Removed);
	TextDrawSetOutline(ServerMSG, Removed);
	TextDrawSetShadow(ServerMSG, Removed);
	TextDrawBackgroundColor(ServerMSG, White);
	TextDrawUseBox(ServerMSG, Removed);
	TextDrawBoxColor(ServerMSG, Gray);
	TextDrawTextSize(ServerMSG, Removed, Removed);
UNDER ONPLAYERDISCONNECT

TextDrawHideForPlayer(playerid, ServerMSG);
///////////////////
Код:
public MSG()
{
	TextDrawSetString(ServerMSG, RMessages[random(sizeof(RMessages))]);
	return 1;
}
UNDER ON PLAYER SPAWN
Код:
 TextDrawSetString(ServerMSG, RMessages[random(sizeof(RMessages))]);
	TextDrawShowForPlayer(playerid, ServerMSG);
Reply
#2

I am not pretty sure about the disappearing thing but i am pretty sure you doing it wrong on placing this code OnPlayerSpawn

PHP код:
TextDrawSetString(ServerMSGRMessages[random(sizeof(RMessages))]); 
You already have a timer which does that, why you add this code again on player spawn.

Remove it.
Reply
#3

Ok Jake i'll try that, any other ideas ?
Reply
#4

Not fixed, it now disappears and don't appear
Reply
#5

Anyone ?
Reply
#6

PHP код:
new s[128];
format(s,sizeof(s),"%s",RMessages[random(sizeof(RMessages))]);
TextDrawSetString(ServerMSG,s);
TextDrawShowForPlayer(playeridServerMSG); 
Reply
#7

PHP код:
public MSG()
{
    
TextDrawSetString(ServerMSGRMessages[random(sizeof(RMessages))]);
    
TextDrawShowForAll(ServerMSG);
    return 
1;

and remove these codes from OnPlayerConnect and OnPlayerDisconnect.
Reply
#8

sorry for late respond, The problem is still happening not fixed
Reply
#9

Thats a single textdraw you're using which cannot be modified and set to a new value per player, you need to use PlayerTextDraws instead.
Reply
#10

first make it clear do you want to show different textdraws to different players? or the same textdraws to all players?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)