Changing 3DTextLable to GameTextForPlayer
#1

Okay, so in the server it was scripted so that every business has a 3DTextLable telling everyone information about the business when you get close to it. I want to change it to a TextDraw (GameTextForPlayer). How would I do that?

Here is the code for the 3DTextLable:

Код:
if(BizInfo[idx][bType]) // If Business is owned
{
	BizInfo[idx][bPickup] = CreateDynamicPickup(1272, 1, BizInfo[idx][bX], BizInfo[idx][bY], BizInfo[idx][bZ], 0);
	if(!strcmp("The State", BizInfo[idx][bOwner])) format(string, sizeof(string), "Owner: %s\nBusiness Type: %s\nStatus: For Sale\nPrice: $%d", BizInfo[idx][bOwner], RBT(idx), BizInfo[idx][bPrice]);
	else format(string, sizeof(string), "Business of %s\nBusiness type: %s\n%s", BizInfo[idx][bOwner], RBT(idx), RBS(idx));
	BizInfo[idx][bText] = CreateDynamic3DTextLabel(string, COLOR_WHITE, BizInfo[idx][bX], BizInfo[idx][bY], BizInfo[idx][bZ]+0.3, 15);
}
And here is the code to see if the player is in range of the business:

Код:
if(IsPlayerInRangeOfPoint(playerid, 2, BizInfo[idx][bX], BizInfo[idx][bY], BizInfo[idx][bZ]))
So, could someone show me how to change it or even just do it and use //'s beside the code to explain what you did. Thanks you in advance.

I'll [REP +] anyone that helps me.
Reply
#2

Try this out

pawn Код:
if(BizInfo[idx][bType]) // If Business is owned
{
    BizInfo[idx][bPickup] = CreateDynamicPickup(1272, 1, BizInfo[idx][bX], BizInfo[idx][bY], BizInfo[idx][bZ], 0);
    if(!strcmp("The State", BizInfo[idx][bOwner])) format(string, sizeof(string), "Owner: %s~n~Business Type: %s~n~Status: For Sale~n~Price: $%d", BizInfo[idx][bOwner], RBT(idx), BizInfo[idx][bPrice]);
    else format(string, sizeof(string), "Business of %s ~n~Business type: %s~n~ %s", BizInfo[idx][bOwner], RBT(idx), RBS(idx));
    BizInfo[idx][bText] = GameTextForPlayer(playerid, string, 5000, 5);
}
Reply
#3

I got this error.
Quote:

C:\Users\Ciaran\Desktop\Bone County Roleplay\gamemodes\BCRP.pwn(3032) : warning 213: tag mismatch
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Warning.

On the line below
Код:
if(BizInfo[idx][bType]) // If Business is owned
{
    BizInfo[idx][bPickup] = CreateDynamicPickup(1272, 1, BizInfo[idx][bX], BizInfo[idx][bY], BizInfo[idx][bZ], 0);
    if(!strcmp("The State", BizInfo[idx][bOwner])) format(string, sizeof(string), "Owner: %s~n~Business Type: %s~n~Status: For Sale~n~Price: $%d", BizInfo[idx][bOwner], RBT(idx), BizInfo[idx][bPrice]);
    else format(string, sizeof(string), "Business of %s ~n~Business type: %s~n~ %s", BizInfo[idx][bOwner], RBT(idx), RBS(idx));
    BizInfo[idx][bText] = GameTextForPlayer(playerid, string, 5000, 5); //This line is the error
}
Reply
#4

show the exact line.
Reply
#5

Quote:
Originally Posted by Bondage
Посмотреть сообщение
show the exact line.
I did, in the code it says "//This line is the error".
Reply
#6

change
BizInfo[idx][bText] = GameTextForPlayer(playerid, string, 5000, 5);

to

GameTextForPlayer(playerid, string, 5000, 5);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)