SA-MP Forums Archive
3D text label not appearing - 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)
+--- Thread: 3D text label not appearing (/showthread.php?tid=386778)



Data not being split properly - NewerthRoleplay - 21.10.2012

Hey I am making a house system at the moment and here is what happens once the server loads all of the houses:
pawn Код:
public OnHouseLoaded(playerid)
{
    new
        idx,
        result[256];
    mysql_store_result();
    while(mysql_fetch_row_format(result, "|"))
    {
        sscanf(result, "e<is[30]iifffiis[200]>", HouseInfo[idx]);
        new houselabel[200];
        format(houselabel, sizeof(houselabel), "House ID: %i\nHouse Owner: %s\nHouse Price: $%i\nHouseLevel: %i\nUse /buy to buy this house!", HouseInfo[idx][houseid], HouseInfo[idx][howner], HouseInfo[idx][hprice], HouseInfo[idx][hlevel]);
        HouseInfo[idx][hlabel] = Create3DTextLabel(houselabel, COLOR_LIGHTGREEN, HouseInfo[idx][HouseX], HouseInfo[idx][HouseY], HouseInfo[idx][HouseZ], 40.0, 0, 0);
        new string[200], name[MAX_PLAYER_NAME];
        GetPlayerName(playerid, name, sizeof(name));
        format(string, sizeof(string), "Admin: %s has created a new house with the ID: %i", name, HouseInfo[idx][houseid]);
        SendAdminMessage(COLOR_GOLD, string);
        idx++;
    }
    mysql_free_result();
    printf("MySQL: Succesful. Fetched %i rows from the database.", idx+1);
    return 1;
}
However for some reason it does not create the text label, it also does not send the message properly which leads me to think the data is not being split properly, for example when it is supposed to send the above message instead it says: Admin: Connor_Howell has created a new house with the ID: 0 3 times.


Re: 3D text label not appearing - NewerthRoleplay - 22.10.2012

EDIT: Changed post to a bigger problem


Re: 3D text label not appearing - ikbenremco - 22.10.2012

This will fix the 3 times but not the not showing 3d text label :
PHP код:
public OnHouseLoaded(playerid)
{
    new
        
idx,
        
result[256];
    
mysql_store_result();
    while(
mysql_fetch_row_format(result"|"))
    {
        
sscanf(result"e<is[30]iifffiis[200]>"HouseInfo[idx]);
        new 
houselabel[200];
        
format(houselabelsizeof(houselabel), "House ID: %i\nHouse Owner: %s\nHouse Price: $%i\nHouseLevel: %i\nUse /buy to buy this house!"HouseInfo[idx][houseid], HouseInfo[idx][howner], HouseInfo[idx][hprice], HouseInfo[idx][hlevel]);
        
HouseInfo[idx][hlabel] = Create3DTextLabel(houselabelCOLOR_LIGHTGREENHouseInfo[idx][HouseX], HouseInfo[idx][HouseY], HouseInfo[idx][HouseZ], 40.000);
        
idx++;
    }
    
mysql_free_result();
    
printf("MySQL: Succesful. Fetched %i rows from the database."idx+1);
new 
string[200], name[MAX_PLAYER_NAME];
        
GetPlayerName(playeridnamesizeof(name));
        
format(stringsizeof(string), "Admin: %s has created a new house with the ID: %i"nameHouseInfo[idx][houseid]);
        
SendAdminMessage(COLOR_GOLDstring);
    return 
1;

For you're text label look : https://sampwiki.blast.hk/wiki/Create3DTextLabel


Re: 3D text label not appearing - NewerthRoleplay - 22.10.2012

I have an idea about the text label, and I have obviously read the wiki but thank you for the admin message fix. Hopefully I have split the data properly


Re: 3D text label not appearing - ikbenremco - 22.10.2012

Look for maby MAX_LABELS or sumthing?


Re: 3D text label not appearing - WizBoy - 22.10.2012

I think i know the problem...

Maybe your plugin for 3dtext Streaming is not ok or you dont have one!

VISIT THIS LINK! https://sampforum.blast.hk/showthread.php?tid=102865

IF I HELPED GIVE ME Rep++


Re: 3D text label not appearing - NewerthRoleplay - 22.10.2012

Quote:
Originally Posted by WizBoy
Посмотреть сообщение
I think i know the problem...

Maybe your plugin for 3dtext Streaming is not ok or you dont have one!

VISIT THIS LINK! https://sampforum.blast.hk/showthread.php?tid=102865

IF I HELPED GIVE ME Rep++
I have tried the built in SAMP text label as well as the streamer, I think the position is not being set correctly, I will try making a 3d text label in the position of my test house in a bit when the command is processed to assess if it is the splitting of the data which is the problem :S