01.02.2013, 10:51
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]
- 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 :
And since no body wanna help.. I am offering 5 USD via paypal if you actually fix it :/
- 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;
}
- 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;
}