13.04.2013, 18:40
How make this http://postimg.org/image/iyyxwpeu1/ in create3dtextlabel ?? Please Help
for(new h = 0; h < sizeof(BizzInfo); h++)
{
if(IsATruck(tmpcar) && PlayerToPoint(10.0, i, BizzInfo[h][bEntranceX], BizzInfo[h][bEntranceY], BizzInfo[h][bEntranceZ]))
{
format(string, sizeof(string), "~w~%s~n~~r~Products Required~w~: %d~n~~y~Price per Product: ~w~: $%d~n~~g~Funds: ~w~: $%d",BizzInfo[h][bMessage],(BizzInfo[h][bMaxProducts]-BizzInfo[h][bProducts]),BizzInfo[h][bPriceProd],BizzInfo[h][bTill]);
GameTextForPlayer(i, string, 5000, 3);
return 1;
}
if(PlayerToPoint(2.0, i, BizzInfo[h][bEntranceX], BizzInfo[h][bEntranceY], BizzInfo[h][bEntranceZ]))
{
if(BizzInfo[h][bOwned] == 1)
{
format(string, sizeof(string), "~w~%s~w~~n~Owner : %s~n~Extortion by : %s~n~Entrance Fee : ~g~$%d ~w~Level : %d ~n~to enter type /enter",BizzInfo[h][bMessage],BizzInfo[h][bOwner],BizzInfo[h][bExtortion],BizzInfo[h][bEntranceCost],BizzInfo[h][bLevelNeeded]);
}
else
{
format(string, sizeof(string), "~w~%s~w~~n~This Business is for sale~n~Cost: ~g~$%d ~w~Level : %d ~n~to buy this Business type /buybiz",BizzInfo[h][bMessage],BizzInfo[h][bBuyPrice],BizzInfo[h][bLevelNeeded]);
}
GameTextForPlayer(i, string, 5000, 3);
return 1;
}
}
//global
new Text3D:bizz3d[5];//replace 5 with your biz number
//ongamemodeinit or with a timer if you use mysql to load data
for(new h = 0; h < sizeof(BizzInfo); h++)
{
if(BizzInfo[h][bOwned] == 0)
{
format(string, sizeof(string), "%s\nThis Business is for sale\nCost: $%d \nLevel : %d \nto buy this Business type /buybiz",BizzInfo[h][bMessage],BizzInfo[h][bBuyPrice],BizzInfo[h][bLevelNeeded]);
bizz3d[h] = Create3DTextLabel(string,0x8361FFFF,BizzInfo[h][bEntranceX], BizzInfo[h][bEntranceY], BizzInfo[h][bEntranceZ]+1,15,0,1);
AddStaticPickup(1274, 1, BizzInfo[h][bEntranceX], BizzInfo[h][bEntranceY], BizzInfo[h][bEntranceZ]);
}
if(BizzInfo[h][bOwned] == 1)
{
format(string, sizeof(string), "%s\nOwner : %s\nExtortion by : %s\nEntrance Fee : $%d \nLevel : %d \nto enter type /enter",BizzInfo[h][bMessage],BizzInfo[h][bOwner],BizzInfo[h][bExtortion],BizzInfo[h][bEntranceCost],BizzInfo[h][bLevelNeeded]);
bizz3d[h] = Create3DTextLabel(string,0x8361FFFF,BizzInfo[h][bEntranceX], BizzInfo[h][bEntranceY], BizzInfo[h][bEntranceZ]+1,15,0,1);
AddStaticPickup(19198, 1, BizzInfo[h][bEntranceX], BizzInfo[h][bEntranceY], BizzInfo[h][bEntranceZ]+0.3);
}
}
public update3d() // use a timer in ongamemodinit to execute this every ... let's say 3 seconds
for(h = 0; h < sizeof(BizzInfo); h++)
{
if(BizzInfo[h][bOwned] == 0)
{
format(string, sizeof(string), "{FC3232}%s\n{1D65DE}This Business is for sale\nCost: {00FF00}$%d \n{1D65DE}Level : {FC3232}%d \n{1D65DE}To buy this Business type {FC3232}/buybiz",BizzInfo[h][bMessage],BizzInfo[h][bBuyPrice],BizzInfo[h][bLevelNeeded]);
Update3DTextLabelText(bizz3d[h],COLOR_1BLUE,string);
}
if(BizzInfo[h][bOwned] == 1)
{
format(string, sizeof(string), "{FC3232}%s\n{1D65DE}Owner : {FC3232}%s\n{1D65DE}Extortion by : {FC3232}%s\n{1D65DE}Entrance Fee : {00FF00}$%d \n{1D65DE}Level : {FC3232}%d \n{1D65DE}To enter type {FC3232}/enter",BizzInfo[h][bMessage],BizzInfo[h][bOwner],BizzInfo[h][bExtortion],BizzInfo[h][bEntranceCost],BizzInfo[h][bLevelNeeded]);
Update3DTextLabelText(bizz3d[h],COLOR_1BLUE,string);
}
}
return 1;
}
and you use bizz3d[h] to update text3d
pawn Код:
|
public OnGameModeInit()
{
SetTimer("update3d",3000,true); //this will make sure that your information is updated every 3 seconds
}
public update3d()
for(h = 0; h < sizeof(BizzInfo); h++)
{
if(BizzInfo[h][bOwned] == 0)
{
format(string, sizeof(string), "{FC3232}%s\n{1D65DE}This Business is for sale\nCost: {00FF00}$%d \n{1D65DE}Level : {FC3232}%d \n{1D65DE}To buy this Business type {FC3232}/buybiz",BizzInfo[h][bMessage],BizzInfo[h][bBuyPrice],BizzInfo[h][bLevelNeeded]);
Update3DTextLabelText(bizz3d[h],COLOR_1BLUE,string);
}
if(BizzInfo[h][bOwned] == 1)
{
format(string, sizeof(string), "{FC3232}%s\n{1D65DE}Owner : {FC3232}%s\n{1D65DE}Extortion by : {FC3232}%s\n{1D65DE}Entrance Fee : {00FF00}$%d \n{1D65DE}Level : {FC3232}%d \n{1D65DE}To enter type {FC3232}/enter",BizzInfo[h][bMessage],BizzInfo[h][bOwner],BizzInfo[h][bExtortion],BizzInfo[h][bEntranceCost],BizzInfo[h][bLevelNeeded]);
Update3DTextLabelText(bizz3d[h],COLOR_1BLUE,string);
}
}
return 1;
}
for(new h = 0; h < sizeof(BizzInfo); h++)
//creating 3DText OnGameModeInit()
for(new h = 0; h < sizeof(SBizzInfo); h++)
{
if(SBizzInfo[h][sbOwned] == 0)
{
format(string, sizeof(string), "%s\nThis Business is for sale\nCost: $%d \nLevel : %d \nto buy this Business type /buybiz",SBizzInfo[h][sbMessage],SBizzInfo[h][sbBuyPrice],SBizzInfo[h][sbLevelNeeded]);
sbizz3d[h] = Create3DTextLabel(string,0x8361FFFF,SBizzInfo[h][sbEntranceX], SBizzInfo[h][sbEntranceY], SBizzInfo[h][sbEntranceZ]+1,15,0,1);
AddStaticPickup(1274, 1, SBizzInfo[h][sbEntranceX], SBizzInfo[h][sbEntranceY], SBizzInfo[h][sbEntranceZ]);
}
if(SBizzInfo[h][sbOwned] == 1)
{
format(string, sizeof(string), "%s\nOwner : %s\nExtortion by : %s\nEntrance Fee : $%d\nLevel : %d \nto enter type /enter",SBizzInfo[h][sbMessage],SBizzInfo[h][sbOwner],SBizzInfo[h][sbExtortion],SBizzInfo[h][sbEntranceCost],SBizzInfo[h][sbLevelNeeded]);
sbizz3d[h] = Create3DTextLabel(string,0x8361FFFF,SBizzInfo[h][sbEntranceX], SBizzInfo[h][sbEntranceY], SBizzInfo[h][sbEntranceZ]+1,15,0,1);
AddStaticPickup(1239, 1, SBizzInfo[h][sbEntranceX], SBizzInfo[h][sbEntranceY], SBizzInfo[h][sbEntranceZ]);
}
}
// updating the 3dtext
for(new h = 0; h < sizeof(SBizzInfo); h++)
{
if(SBizzInfo[h][sbOwned] == 0)
{
format(string, sizeof(string), "%s\nThis Business is for sale\nCost: $%d \nLevel : %d \nTo buy this Business type /buybiz",SBizzInfo[h][sbMessage],SBizzInfo[h][sbBuyPrice],SBizzInfo[h][sbLevelNeeded]);
Update3DTextLabelText(sbizz3d[h],COLOR_1BLUE,string);
}
if(SBizzInfo[h][sbOwned] == 1)
{
format(string, sizeof(string), "%s\nOwner : %s\nExtortion by : %s\nEntrance Fee : $%d\nLevel : %d \nTo enter type /enter",SBizzInfo[h][sbMessage],SBizzInfo[h][sbOwner],SBizzInfo[h][sbExtortion],SBizzInfo[h][sbEntranceCost],SBizzInfo[h][sbLevelNeeded]);
Update3DTextLabelText(sbizz3d[h],COLOR_1BLUE,string);
}
}