TextDraw Headache
#1

Hey, I'm currently trying to improve the GUI of my server, so I've decided to try and keep the chat clearer by sending errors messages via TD rather than SCM. Now I haven't been using Textdraws all to often, and have only really used them for the zones and speedo within the server, so in all honesty I'm a TD n00b.

Now all I want is to be able to create a TD onplayerconnect which is blank, and then the set the string with an error message and showfor a short period of time before hiding it again when an error occurs. At the moment the textdraw correctly shows the error message and disappears but for some reason doesn't create the TD in the correct place on the screen (Bottom centre) but creates it int he middle of the screen and I can't for the life of me understand why, any help would be appreciated.

Код:
 new PlayerText:ErrorMessage[MAX_PLAYERS];


forward ShowErrorMessage(playerid,string[]);
public ShowErrorMessage(playerid, string[])
{
	if(LoggedIn[playerid] == 0) return 1;
	PlayerTextDrawSetString(playerid, ErrorMessage[playerid], string);
	PlayerTextDrawShow(playerid, ErrorMessage[playerid]);
	SetTimerEx("HideErrorMessage",41000, false, "i",playerid);
	PlayerPlaySound(playerid, 1085, 0, 0, 0);
	return 1;
}

forward HideErrorMessage(playerid);
public HideErrorMessage(playerid)
{
	PlayerTextDrawHide(playerid,ErrorMessage[playerid]);
	return 1;
}


public OnPlayerConnect(playerid)
{

	//--Error Message--//
	ErrorMessage[playerid] = CreatePlayerTextDraw(playerid,240.0,400.0,"_");
	PlayerTextDrawAlignment(playerid,ErrorMessage[playerid], 1);
	PlayerTextDrawFont(playerid,ErrorMessage[playerid],1);
	PlayerTextDrawLetterSize(playerid,ErrorMessage[playerid], 0.310, 1.400);
	PlayerTextDrawBoxColor(playerid,ErrorMessage[playerid], 0x99);
	PlayerTextDrawTextSize(playerid,ErrorMessage[playerid], 520.000, 0.000);
	PlayerTextDrawSetShadow(playerid,ErrorMessage[playerid],0);

}

//example of when Error message is used

CMD:me(playerid,params[])// /me command
{
	new string[128], action[128];// Store the intial action
	if(sscanf(params, "s[100]",action)) return ShowErrorMessage(playerid,"Usage: /me [Action]");//Error handling

 	return 1;
}
Any help would be appreciated thank you!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)