3D Text Label Help !
#1

Alright i created a 3D Text label above all cars, as their license plate, when i go the vehicle shop and /v buyplate
the plate will appear in /stats buy wont show upon the text draw till next restart, how can i make the text draw update straight away. Im new to text draws so please give me a step by step guide. Thanks
Reply
#2

Use this on /v buyplate

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

Quote:
Originally Posted by MadeMan
Посмотреть сообщение
I tried that but cant get it working, what shall i use from there ?

(CarLabel: i, 0x00FF00FF, "%d", CarInfo[i][cPlate])

Like that ?
Reply
#4

Show your /v buyplate code.
Reply
#5

Код:
            if(strcmp(x_nr,"buyplate",true) == 0)
            {
	            if(IsAtDealership(playerid))
	            {
	                if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey] || GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2] || GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey3])
	                {
	                    GetPlayerName(playerid, sendername, sizeof(sendername));
	                    new ownvehkey;
	                    if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey]) { ownvehkey = PlayerInfo[playerid][pPcarkey]; }
	                    else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2]) { ownvehkey = PlayerInfo[playerid][pPcarkey2]; }
	                    else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey3]) { ownvehkey = PlayerInfo[playerid][pPcarkey3]; }
	                    else { return 1; }
	                    if(strcmp(sendername, CarInfo[ownvehkey][cOwner], true) == 0)
                        {
			            PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
			            SafeGivePlayerMoney(playerid, -3000);
				    new plate = 1000000 + random(8999999);//minimum 1000  max 9999
                                    CarInfo[ownvehkey][cPlate] = plate;
				    format(string, sizeof(string), "[NEW PLATE] : %d",CarInfo[ownvehkey][cPlate]);
				    SendClientMessage(playerid, COLOR_GRAD4, string);
			            SendClientMessage(playerid, COLOR_GRAD5, "You can check this at anytime by typing /stats");
			            SendClientMessage(playerid, COLOR_WHITE, "You have now purchased a new plate");
	                            format(string, sizeof(string), "The plate cost $3000");
				    SendClientMessage(playerid, COLOR_WHITE, string);
		         	    SetTimer("Plate", 2000, 0);
				    }
	                }
	                else
	                {
	                    SendClientMessage(playerid, COLOR_GREY, "  You have to sit in your own car to buy a plate ");
	                    return 1;
	                }
	            }
	            else
	            {
	                SendClientMessage(playerid, COLOR_GREY, "You are not at a dealership");
	                return 1;
          }
Reply
#6

And how you create the 3D Text Label?
Reply
#7

Quote:
Originally Posted by MadeMan
Посмотреть сообщение
And how you create the 3D Text Label?
just a little tip, normally when they stop posting or helping, either they don't care no moar or they don't know how to help
Reply
#8

Quote:
Originally Posted by MadeMan
Посмотреть сообщение
And how you create the 3D Text Label?
for(new i = 0; i < MAX_VEHICLES; i++)
{
if(CarInfo[i][cOwned] == 1)
{
Delete3DTextLabel(CarLabel);
format(PropertyString,sizeof(PropertyString),"%d", CarInfo[i][cPlate]);
CarLabel = Create3DTextLabel(PropertyString ,0x00FF00FF,CarInfo[i][cAngle], CarInfo[i][cPlate],CarInfo[i][cPlate],10, 0);

}
}
Reply
#9

pawn Код:
new Text3D:CarLabels[MAX_VEHICLES];
pawn Код:
for(new i = 0; i < MAX_VEHICLES; i++)
{
    if(CarInfo[i][cOwned] == 1)
    {
        format(PropertyString,sizeof(PropertyString),"%d", CarInfo[i][cPlate]);
        CarLabels[i] = Create3DTextLabel(PropertyString ,0x00FF00FF,CarInfo[i][cAngle], CarInfo[i][cPlate],CarInfo[i][cPlate],10, 0);
    }
}
add to "/v buyplate" command
pawn Код:
format(string, sizeof(string), "%d", CarInfo[ownvehkey][cPlate]);
Update3DTextLabelText(CarLabels[ownvehkey], 0x00FF00FF, string);
Reply
#10

Quote:
Originally Posted by MadeMan
Посмотреть сообщение
And how you create the 3D Text Label?
Quote:
Originally Posted by MadeMan
Посмотреть сообщение
pawn Код:
new Text3D:CarLabels[MAX_VEHICLES];
pawn Код:
for(new i = 0; i < MAX_VEHICLES; i++)
{
    if(CarInfo[i][cOwned] == 1)
    {
        format(PropertyString,sizeof(PropertyString),"%d", CarInfo[i][cPlate]);
        CarLabels[i] = Create3DTextLabel(PropertyString ,0x00FF00FF,CarInfo[i][cAngle], CarInfo[i][cPlate],CarInfo[i][cPlate],10, 0);
    }
}
add to "/v buyplate" command
pawn Код:
format(string, sizeof(string), "%d", CarInfo[ownvehkey][cPlate]);
Update3DTextLabelText(CarLabels[ownvehkey], 0x00FF00FF, string);
It still wont work
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)