Textdraw Problem - Paying 5$ for a fix. -
-CaRRoT - 01.02.2013
Well - As you see , I am not really experienced with using text-draws.. But ya, I wanted to try my luck.. However - This system works that once you enter a certain pickup - Some TD's appear with a text in it - Anyway - It disappear if you didn't set ANY text inside the board - But when you use the CMD and set a text to the TD - It never appear :/
- Note : I am paying the 5 bucks if you fix the 2 problems. [paypal]
PHP код:
for(new i = 0; i < sizeof(InfoBoardInfo); i++)
{
if(pickupid == InfoBoardInfo[i][InfoBoardPickupID])
{
if(IsPlayerInRangeOfPoint(playerid, 5.0, InfoBoardInfo[i][InfoBoardX], InfoBoardInfo[i][InfoBoardY], InfoBoardInfo[i][InfoBoardZ]))
{
new string[128];
TextDrawShowForPlayer(playerid, IBI0);
TextDrawShowForPlayer(playerid, IBI1);
TextDrawShowForPlayer(playerid, IBI2);
TextDrawShowForPlayer(playerid, IBI3);
format(string, sizeof(string), "%s", InfoBoardInfo[i][InfoBoardTDstring]);
TextDrawSetString(IBITD, string);
TextDrawShowForPlayer(playerid, IBITD);
InfoBoardTimer = SetTimer("HideTDInfo",500,0);
return 1;
}
}
}
PHP код:
public HideTDInfo(playerid)
{
TextDrawHideForPlayer(playerid, IBI0);
TextDrawHideForPlayer(playerid, IBI1);
TextDrawHideForPlayer(playerid, IBI2);
TextDrawHideForPlayer(playerid, IBI3);
TextDrawHideForPlayer(playerid, IBITD);
return 1;
}
- That is the first question.. Also - That system is dynamic , Which means you set the TD String In-Game.. However - Is there anyway to make lines IG ? Like.. "bla bla bla bla \n bla bla bla" - Instead of all going in one line ? Cause when I tried \n IG - It didn't work.
- Something else , once you create the Object , It doesn't get created INFRONT of you - It always faces a default angle - Anyway to fix it ? I want the object to be at the same angle as the player is - Here is the cmd :
PHP код:
dcmd_createInfoBoard(playerid, params[])
{
new Usage[128], string[128];
if( sscanf( params, "s", Usage))
{
if( PlayerInfo[playerid][pAdmin] >= 1337)
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /createInfoBoard [name]" );
SendClientMessage(playerid, COLOR_GREY, "Available Names: Exterior and Complete" );
}
}
else
{
if(PlayerInfo[playerid][pAdmin] >= 1337)
{
if(strcmp(Usage, "exterior", true) == 0)
{
PlayerInfo[playerid][InfoBoardExterior]++;
GetPlayerPos( playerid, PlayerInfo[playerid][dExtX], PlayerInfo[playerid][dExtY], PlayerInfo[playerid][dExtZ]);
GetPlayerFacingAngle(playerid, PlayerInfo[playerid][dAngle]);
format( string, sizeof( string ), "Exterior set! (X: %f, Y: %f, Z: %f, A: %f).", PlayerInfo[playerid][dExtX], PlayerInfo[playerid][dExtY], PlayerInfo[playerid][dExtZ], PlayerInfo[playerid][dAngle]);
SendClientMessage( playerid, COLOR_WHITE, string);
}
if(strcmp(Usage, "complete", true) == 0)
{
if(PlayerInfo[playerid][InfoBoardExterior] > 0)
{
new NewInfoBoardID = SpawnedInfoBoard+1;
if(NewInfoBoardID >= MAX_InfoBoard)
{
SendClientMessage( playerid, COLOR_WHITE, "Too many InfoBoards are currently spawned!");
}
format( string, sizeof( string ), "InfoBoards/InfoBoard_%d.ini", NewInfoBoardID);
if(dini_Exists(string))
{
SpawnedInfoBoard++;
format( string, sizeof( string ), "InfoBoard (ID: %d) already exist!", NewInfoBoardID);
SendClientMessage( playerid, COLOR_GREY, string);
SendClientMessage( playerid, COLOR_YELLOW, "Please try again by typing /createInfoBoard complete" );
}
else
{
InfoBoardInfo[NewInfoBoardID][InfoBoardX] = PlayerInfo[playerid][dExtX];
InfoBoardInfo[NewInfoBoardID][InfoBoardY] = PlayerInfo[playerid][dExtY];
InfoBoardInfo[NewInfoBoardID][InfoBoardZ] = PlayerInfo[playerid][dExtZ];
InfoBoardInfo[NewInfoBoardID][InfoBoardAngle] = PlayerInfo[playerid][dAngle];
dini_Create(string);
dini_FloatSet( string, "X", InfoBoardInfo[NewInfoBoardID][InfoBoardX]);
dini_FloatSet( string, "Y", InfoBoardInfo[NewInfoBoardID][InfoBoardY]);
dini_FloatSet( string, "Z", InfoBoardInfo[NewInfoBoardID][InfoBoardZ]);
dini_FloatSet( string, "Angle", InfoBoardInfo[NewInfoBoardID][InfoBoardAngle]);
PlayerInfo[playerid][InfoBoardExterior]--;
SpawnedInfoBoard++;
InfoBoardInfo[NewInfoBoardID][InfoBoardPickupID] = CreateDynamicPickup(1239, 23,InfoBoardInfo[NewInfoBoardID][InfoBoardX], InfoBoardInfo[NewInfoBoardID][InfoBoardY], InfoBoardInfo[NewInfoBoardID][InfoBoardZ]);
InfoBoardInfo[NewInfoBoardID][InfoBoardObjectID] = CreateDynamicObject(2737, InfoBoardInfo[NewInfoBoardID][InfoBoardX]+0.7, InfoBoardInfo[NewInfoBoardID][InfoBoardY], InfoBoardInfo[NewInfoBoardID][InfoBoardZ]+0.2, 0, 0, InfoBoardInfo[NewInfoBoardID][InfoBoardAngle],0,0,-1,250);
format(string, sizeof(string), "{A90202}Information Board ID : {FFF1AF}%d", NewInfoBoardID);
InfoBoard[NewInfoBoardID] = CreateDynamic3DTextLabel(string, COLOR_DCHAT, InfoBoardInfo[NewInfoBoardID][InfoBoardX],
InfoBoardInfo[NewInfoBoardID][InfoBoardY], InfoBoardInfo[NewInfoBoardID][InfoBoardZ]+0.75,10.0,INVALID_PLAYER_ID,INVALID_VEHICLE_ID,0,0,-1,-1, 100.0);
SendClientMessage( playerid, COLOR_LIGHTBLUE, "Successfully created an Info-Board!" );
format(string, sizeof( string ), "You can now use /deleteInfoBoard in any Case - Information Board ID : %d).", NewInfoBoardID);
SendClientMessage(playerid, COLOR_WHITE, string);
}
}
}
}
else
{
SendClientMessage( playerid, COLOR_GREY, "You are not authorized to use this command!" );
}
}
return 1;
}
And since no body wanna help.. I am offering 5 USD via paypal if you actually fix it :/
Re: Textdraw Problem - Paying 5$ for a fix. -
Apenmeeuw - 01.02.2013
show us the lines where you create the textdraw, probably under ongamemodeinit/onfilterscriptinit
Re: Textdraw Problem - Paying 5$ for a fix. -
-CaRRoT - 01.02.2013
PHP код:
IBI0 = TextDrawCreate(157.000000, 230.000000, "-");
TextDrawBackgroundColor(IBI0, 255);
TextDrawFont(IBI0, 1);
TextDrawLetterSize(IBI0, 0.019999, 16.899999);
TextDrawColor(IBI0, -1);
TextDrawSetOutline(IBI0, 0);
TextDrawSetProportional(IBI0, 1);
TextDrawSetShadow(IBI0, 1);
TextDrawUseBox(IBI0, 1);
TextDrawBoxColor(IBI0, 1852730990);
TextDrawTextSize(IBI0, 470.000000, 50.000000);
IBI1 = TextDrawCreate(135.000000, 220.000000, "-");
TextDrawBackgroundColor(IBI1, 255);
TextDrawFont(IBI1, 1);
TextDrawLetterSize(IBI1, 23.800054, 1.199999);
TextDrawColor(IBI1, 255);
TextDrawSetOutline(IBI1, 0);
TextDrawSetProportional(IBI1, 1);
TextDrawSetShadow(IBI1, 1);
IBI2 = TextDrawCreate(135.000000, 378.000000, "-");
TextDrawBackgroundColor(IBI2, 255);
TextDrawFont(IBI2, 1);
TextDrawLetterSize(IBI2, 23.800054, 1.199999);
TextDrawColor(IBI2, 255);
TextDrawSetOutline(IBI2, 0);
TextDrawSetProportional(IBI2, 1);
TextDrawSetShadow(IBI2, 1);
IBI3 = TextDrawCreate(239.000000, 239.000000, "Information Board");
TextDrawBackgroundColor(IBI3, 255);
TextDrawFont(IBI3, 1);
TextDrawLetterSize(IBI3, 0.500000, 1.000000);
TextDrawColor(IBI3, 65535);
TextDrawSetOutline(IBI3, 0);
TextDrawSetProportional(IBI3, 1);
TextDrawSetShadow(IBI3, 1);
IBITD = TextDrawCreate(164.000000, 267.000000, "Empty Information-Board [No Text]");
TextDrawBackgroundColor(IBITD, 255);
TextDrawFont(IBITD, 1);
TextDrawLetterSize(IBITD, 0.500000, 1.000000);
TextDrawColor(IBITD, -1);
TextDrawSetOutline(IBITD, 0);
TextDrawSetProportional(IBITD, 1);
TextDrawSetShadow(IBITD, 1);
Re: Textdraw Problem - Paying 5$ for a fix. -
LarzI - 01.02.2013
Well first of all, you're running the timer after 500ms (0.5 second). This may cause some problems, as this timer hides the textdraw. You may try increasing this to about 5 seconds (5000 ms) instead, and see if it helps.