TextDraws as server variable?? How to i change to Player Variable?
#3

on top of script (not in any function, place it between or in front of them):
Code:
new Text:TDStatus[MAX_PLAYERS];
a string for a textdraw must not be initialised empty, so dont forget the "_":
Code:
public OnGameModeInit()
{
	for(new p=0;p<GetMaxPlayers();p++)
	{
		TDStatus[p]=TextDrawCreate(0,421,"_");
		TextDrawLetterSize(TDStatus[p],0.20,0.80);
		TextDrawFont(TDStatus[p],2);
		TextDrawSetProportional(TDStatus[p],0);
		TextDrawSetShadow(TDStatus[p],0);
		TextDrawSetOutline(TDStatus[p],1);
	}
}
to show it up, you 1st need to set a string into it with format(), then show it to the desired player:
Code:
	new TDString[256];//those strings can be very long
	format(TDString,sizeof(TDString),"~b~~h~~h~Title~n~~w~your playerID: %d~n~",playerid);
	TextDrawSetString(TDStatus[playerid],TDString);
	TextDrawShowForPlayer(playerid,TDStatus[playerid]);
	ShowTDStatus(playerid);
i hope i didnt forget something...
Reply


Messages In This Thread
TextDraws as server variable?? How to i change to Player Variable? - by DarrenReeder - 05.04.2010, 17:06
Re: TextDraws as server variable?? How to i change to Player Variable? - by DarrenReeder - 05.04.2010, 18:53
Re: TextDraws as server variable?? How to i change to Player Variable? - by Babul - 06.04.2010, 07:02

Forum Jump:


Users browsing this thread: 1 Guest(s)