can't update the text?
#1

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;
}
Reply
#2

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

or Houses[h][hExteriorX], Houses[h][hExteriorY], Houses[h][hExteriorZ] are bad
Reply
#3

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?
Reply
#4

EDIT: read it wrong.
Reply
#5

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.
Reply
#6

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

then?
Reply
#7

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

then?
Nope, doesn't work, hmm..
Reply
#8

maybe your not using id 0.

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

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?
Reply
#10

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


Forum Jump:


Users browsing this thread: 3 Guest(s)