Textdraw problem only updates for id 1
#6

tha't won't work. anyway what I suggest is not to overload your machine by 256 textdraws and do it more like... OnPlayerConnect - create textdraw like: text1[playerid] = TextDrawCreate(..)
and on DIsconnect distroy the text1[playerid]. It won't overload your machine no way, and about updating, I do not know I will check and reply back to this post (edit this)

pawn Код:
//Ontop of the Script
forward text(playerid);
new Text:TD[MAX_PLAYERS];

//On FS Init
SetTimer("text", 300, 1);
for(new a = 0; a < 201; a++)
{
TD[a] = -1;
}


//OnPlayerLogin
format(str2,256,"http://www.pure-everything.co.nr[url=http://] \n Kills: %d Deaths: %d",AccountInfo[playerid][Kills],AccountInfo[playerid][Deaths]);
TextDrawSetString(text1[playerid],str2);
TextDrawColor(text1[playerid],0xFFFFFFFF);
TextDrawSetShadow(text1[playerid],1);
TextDrawShowForPlayer(playerid,text1[playerid]);

//public text
public text()
{
for(new playerid = 0; playerid < MAX_PLAYERS; playerid++)
{
if(TD[playerid] != -1){
if(AccountInfo[playerid][Logged] == 1)
{
new str2[128];
format(str2,256,"http://www.pure-everything.co.nr[url=http://] \n Kills: %d Deaths: %d", AccountInfo[playerid][Kills], AccountInfo[playerid][Deaths]);
TextDrawSetString(text1[playerid],str2);
TextDrawHideForPlayer(playerid,text1[playerid]);
TextDrawShowForPlayer(playerid,text1[playerid]);
}
}
}
return 1;
}

// /resetstats
if(strcmp(cmd, "/resetstats", true) == 0)
{
new str2[128];
AccountInfo[playerid][Kills] = 0;
AccountInfo[playerid][Deaths] = 0;
format(str2,256,"http://www.pure-everything.co.nr[url=http://] \n Kills: %d Deaths: %d Hours: %d", AccountInfo[playerid][Kills], AccountInfo[playerid][Deaths], AccountInfo[playerid][Hours]);
TextDrawSetString(text1[playerid],str2);
TextDrawHideForPlayer(playerid,text1[playerid]);
TextDrawShowForPlayer(playerid,text1[playerid]);
return 1;
}

//OnPlayerDeath
AccountInfo[playerid][Deaths]++;
AccountInfo[killerid][Kills]++;
Reply


Messages In This Thread
Textdraw problem only updates for id 1 - by saiberfun - 30.06.2009, 16:58
Re: Textdraw problem only updates for id 1 - by saiberfun - 30.06.2009, 18:22
Re: Textdraw problem only updates for id 1 - by kaisersouse - 30.06.2009, 18:36
Re: Textdraw problem only updates for id 1 - by saiberfun - 30.06.2009, 18:52
Re: Textdraw problem only updates for id 1 - by dice7 - 30.06.2009, 19:48
Re: Textdraw problem only updates for id 1 - by Ignas1337 - 01.07.2009, 07:44
Re: Textdraw problem only updates for id 1 - by Ignas1337 - 01.07.2009, 07:49

Forum Jump:


Users browsing this thread: 5 Guest(s)