SA-MP Forums Archive
can't update the text? - 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: can't update the text? (/showthread.php?tid=263450)



can't update the text? - The Woody - 21.06.2011

Ive been working on this for hours! and i just can't find the problem.
The puclic HouseUpdate does update every 1 sec because it prints the "printf" every seconds.
But when i change the LockStatus it doesn't update the 3D text? why isn't it updating the text?
Ive tryed deleting the text and even use the Update3DText but i can't get it to work can anybody help me?

pawn Код:
new HouseUpdateTimer // on top
 
HouseUpdateTimer = SetTimer( "HouseUpdateM", 1000, true ); // OnGameModeInit
 
forward HouseUpdateM();
public HouseUpdateM()
{
    new string[128];
    for(new h = 0; h < sizeof(Houses); h++)
    {
        if( Houses[h][LockStatus] == 1 )
        {
            format ( string, sizeof( string ), "test 1: %s", Houses[h][hOwner]);
            Create3DTextLabel(string,HOUSETUR, Houses[h][hExteriorX], Houses[h][hExteriorY], Houses[h][hExteriorZ], 10,0,1);
            printf("Text1")
        }
        else
        {
            format ( string, sizeof( string ), "test 2: %s", Houses[h][hOwner]);
            Create3DTextLabel(string,HOUSETUR, Houses[h][hExteriorX], Houses[h][hExteriorY], Houses[h][hExteriorZ], 10,0,1);
            printf("Text2")
        }
    }
    return 1;
}



Re: can't update the text? - Donya - 21.06.2011

maybe for(new h = 0; h < sizeof(Houses); h++) is bad?

or Houses[h][hExteriorX], Houses[h][hExteriorY], Houses[h][hExteriorZ] are bad


Re: can't update the text? - The Woody - 21.06.2011

Quote:
Originally Posted by Donya
Посмотреть сообщение
maybe for(new h = 0; h < sizeof(Houses); h++) is bad?

or Houses[h][hExteriorX], Houses[h][hExteriorY], Houses[h][hExteriorZ] are bad
Well i can't really change that since i need it. do you got any other suggestions how i could make it then?


Re: can't update the text? - Stigg - 22.06.2011

EDIT: read it wrong.


Re: can't update the text? - The Woody - 22.06.2011

Quote:
Originally Posted by Stigg
Посмотреть сообщение
EDIT: read it wrong.
Maybe you did.. But it was the problem well kinda.. When i add the return 1; it shows and updates like its suppose to do but it creates an extra 3D text wich is not suppose to happend.


Re: can't update the text? - Donya - 22.06.2011

for(new h = 0; h < sizeof(Houses) - 1; h++)

then?


Re: can't update the text? - The Woody - 22.06.2011

Quote:
Originally Posted by Donya
Посмотреть сообщение
for(new h = 0; h < sizeof(Houses) - 1; h++)

then?
Nope, doesn't work, hmm..


Re: can't update the text? - Donya - 22.06.2011

maybe your not using id 0.

for(new h = 1; h < sizeof(Houses) - 1; h++)


Re: can't update the text? - The Woody - 22.06.2011

Quote:
Originally Posted by Donya
Посмотреть сообщение
maybe your not using id 0.

for(new h = 1; h < sizeof(Houses) - 1; h++)
Doesn't work either. When i use GameTextForAll it all works thats stupid :S. But i need to use 3D text.

Is there another way to update the text instead of a timer?


Re: can't update the text? - Donya - 22.06.2011

https://sampwiki.blast.hk/wiki/Update3DTextLabelText