Raised This Month: $32 Target: $400
 8% 

Help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Jose Alberto10
Junior Member
Join Date: Dec 2012
Old 09-07-2013 , 19:41   Help
Reply With Quote #1

Hi I put this post because I need to lower the font size


Code:
public Action:Command_Display(client, args)
{
	if(args < 1) // Not enough parameters
	{
		ReplyToCommand(client, "[SM] Utiliza: sm_write tu mensaje");
		return Plugin_Handled;
	}
	
	
	new String:char[128];
	GetCmdArgString(char, 128); 
	
	if(strlen(char) > 32)
	{
		PrintToChat(client, "Tu mensaje es demasiado largo (msg is too long).");
		return Plugin_Handled;
	}
	
	
	new Float:pos[3];
	GetClientEyePosition(client, pos);
	pos[2] -= 23.0; 
	
	new iColours[3];
	for(new i=0;i<strlen(char);++i)
	{
		char[i] = CharToLower(char[i]);
		
		if(char[i]!=' ' &&
			g_fChars[char[i]][0][0][0] == 0.0 && g_fChars[char[i]][0][1][0] == 0.0 &&
			g_fChars[char[i]][0][0][1] == 0.0 && g_fChars[char[i]][0][1][1] == 0.0 &&
			g_fChars[char[i]][0][0][2] == 0.0 && g_fChars[char[i]][0][1][2] == 0.0)
			continue;
	
		if(char[i]!=' ')
		{

			iColours[0] = GetRandomInt(1, 255);
			iColours[1] = GetRandomInt(1, 255);
			iColours[2] = GetRandomInt(1, 255);
			new Handle:data = CreateDataPack();
			WritePackCell(data, char[i]);
			WritePackFloat(data, pos[0]);
			WritePackFloat(data, pos[1]);
			WritePackFloat(data, pos[2]);
			WritePackCell(data, iColours[0]);
			WritePackCell(data, iColours[1]);
			WritePackCell(data, iColours[2]);
			ResetPack(data);
			CreateTimer(0.1, DisplayChar, data, TIMER_DATA_HNDL_CLOSE);
		}
		
		pos[0]+= 20.0;
		
		if(char[i]=='o' || char[i]=='q')
			pos[0]+=18.0;
		else if(char[i]=='m' || char[i]=='u')
			pos[0]+=10.0;
		else if(char[i] == ' ')
			pos[0] +=5.0;
		else if(char[i] == 'j')
			pos[0] += 5.0;
		

	}	
	return Plugin_Handled;
}
public Action:DisplayChar(Handle:timer, any:data)
{
	new char = ReadPackCell(data);
	new Float:origin[3];
	origin[0]=ReadPackFloat(data);
	origin[1]=ReadPackFloat(data);
	origin[2]=ReadPackFloat(data);
	new iColour[4];
	iColour[0] = ReadPackCell(data);
	iColour[1] = ReadPackCell(data);
	iColour[2] = ReadPackCell(data);
	iColour[3] = 255;

	for(new i=0;i<MAX_LINES;++i)
	{
		new Float:temp1[3];
		new Float:temp2[3];
		AddVectors(origin, g_fChars[char][i][0], temp1);
		AddVectors(origin, g_fChars[char][i][1], temp2);
		if(!(g_fChars[char][i][0][0] == 0.0 && g_fChars[char][i][1][0] == 0.0 &&
		g_fChars[char][i][0][1] == 0.0 && g_fChars[char][i][1][1] == 0.0 &&
		g_fChars[char][i][0][2] == 0.0 && g_fChars[char][i][1][2] == 0.0))
		{
			TE_SetupBeamPoints(temp1, temp2, g_iBeamSprite, 0, 0, 30, 60.0, 5.0, 5.0, 2, 0.5, iColour, 0);
			TE_SendToAll();
		}
		else
			break;
	}
	
	return Plugin_Stop;
}

picture: http://cloud-4.steampowered.com/ugc/...BA1BFCCB3E73D/

Last edited by Jose Alberto10; 09-07-2013 at 19:42.
Jose Alberto10 is offline
Doodil
Senior Member
Join Date: Mar 2012
Old 09-07-2013 , 19:54   Re: Help
Reply With Quote #2

try something like this:

Code:
public Action:DisplayChar(Handle:timer, any:data)
{
  new char = ReadPackCell(data);
  new Float:origin[3];
  origin[0]=ReadPackFloat(data);
  origin[1]=ReadPackFloat(data);
  origin[2]=ReadPackFloat(data);
  new iColour[4];
  iColour[0] = ReadPackCell(data);
  iColour[1] = ReadPackCell(data);
  iColour[2] = ReadPackCell(data);
  iColour[3] = 255;

  for(new i=0;i<MAX_LINES;++i)
  {
    new Float:temp1[3];
    new Float:temp2[3];

    new Float:temp3[3] = g_fChars[char][i][0];
    new Float:temp4[3] = g_fChars[char][i][1];

    new Float:multiplier = 0.5;

    for(new j=0;j<3;j++)
    {
      temp3[j] = temp3[j]*multiplier;
      temp4[j] = temp4[j]*multiplier;
    }

    AddVectors(origin, temp3, temp1);
    AddVectors(origin, temp4, temp2);
    if(!(g_fChars[char][i][0][0] == 0.0 && g_fChars[char][i][1][0] == 0.0 &&
    g_fChars[char][i][0][1] == 0.0 && g_fChars[char][i][1][1] == 0.0 &&
    g_fChars[char][i][0][2] == 0.0 && g_fChars[char][i][1][2] == 0.0))
    {
      TE_SetupBeamPoints(temp1, temp2, g_iBeamSprite, 0, 0, 30, 60.0, 5.0, 5.0, 2, 0.5, iColour, 0);
      TE_SendToAll();
    }
    else
      break;
  }
  
  return Plugin_Stop;
}
the multiplier variable defines how big the letter is compared to the original one (so in my case it should be half the size). You might have to change the line "pos[0]+=20.0" to make the letters not stand apart too much.

(There might be syntax errors, but you should get the idea behind the code)
Doodil is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:05.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode