make gametextforplayer smaller?
#1

Is there anyway to make GameTextForPlayer smaller from its default?

Код:
GameTextForPlayer(playerid, "Wasted", 5000, 3);
Or the it can only be done by TextDraw?
Reply
#2

I dont think if there is;

But you can read this,

GameTextStyle (GameTextForPlayer) - SA-MP Wiki
GameTextForPlayer - SA-MP Wiki

Parameters :-
Код:
(const string[], time, style)
Код:
const string[] - The text to be displayed.
time - The duration of the text being shown in milliseconds.
style - The style of text to be displayed.

Returns :-
0 - Text failed to be displayed (player not connected).
1 - Text successfully displayed.
Код:
GameTextForPlayer(playerid, const string[], time, style);
Example :-

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    GameTextForPlayer(playerid, "Wasted", 5000, 2);
    return 1;
}

EDIT :-

You can do it by using Textdraw

New Variable,
Код:
new Text:WastedTextDraw;
On OnGameModeInit Callback,
pawn Код:
public OnGameModeInit()
{
    WastedTextDraw = TextDrawCreate(190.0, 190.0, "WASTED");
    return 1;
}
On OnPlayerDeath Callback,
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    TextDrawShowForPlayer(playerid, WastedTextDraw);
    return 1;
}
On OnPlayerSpawn Callback,
pawn Код:
public OnPlayerSpawn(playerid)
{
   TextDrawHideForPlayer(playerid, WastedTextDraw);
   return 1;
}
Reply
#3

Quote:
Originally Posted by SAMProductions
Посмотреть сообщение
None of those. Well I have no choice but to make a Textdraw. I was planning to make a textdraw that will show if player types a command that is invalid it will show like this
"Use /c for server commands" and it will disappear after 3 seconds. I tried to make it on GameTextForPlayer but it covers my screen lol. Can you please help me with this?
Reply
#4

You can do it by using Textdraw

Try This :-

New Variable,
Код:
new Text:WastedTextDraw;
On OnGameModeInit Callback,
pawn Код:
public OnGameModeInit()
{
    WastedTextDraw = TextDrawCreate(190.0, 190.0, "WASTED");
    return 1;
}
On OnPlayerDeath Callback,
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    TextDrawShowForPlayer(playerid, WastedTextDraw);
    return 1;
}
On OnPlayerSpawn Callback,
pawn Код:
public OnPlayerSpawn(playerid)
{
   TextDrawHideForPlayer(playerid, WastedTextDraw);
   return 1;
}

EDIT :-

C for Server Commands Textdraw,

Try This :-

New Variable,
Код:
new Text:CForSCMDs;
Forward and Public Callback for CForSCMDs Textdraw Hide For Player,
pawn Код:
forward HCForSCMDs(playerid);
public HCForSCMDs(playerid)
{
    TextDrawHideForPlayer(playerid, CForSCMDs);
}
On OnPlayerCommandPerformed Callback,
pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    if(!success)
    {
        CForSCMDs = TextDrawCreate(490.000000, 0.000000, "Type /c for Server Commands.");
        return SetTimerEx("HCForSCMDs", 3000, 0, "d", playerid);
    }
    return 1;
}
Reply
#5

Quote:
Originally Posted by SAMProductions
Посмотреть сообщение
You can do it by using Textdraw

Try This :-

New Variable,
Код:
new Text:WastedTextDraw;
On OnGameModeInit Callback,
pawn Код:
public OnGameModeInit()
{
    WastedTextDraw = TextDrawCreate(190.0, 190.0, "WASTED");
    return 1;
}
On OnPlayerDeath Callback,
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    TextDrawShowForPlayer(playerid, WastedTextDraw);
    return 1;
}
On OnPlayerSpawn Callback,
pawn Код:
public OnPlayerSpawn(playerid)
{
   TextDrawHideForPlayer(playerid, WastedTextDraw);
   return 1;
}
Hi I think you didn't noticed my previous post. Please kindly read. Thanks. And also additional, there will be a timer.
Reply
#6

C for Server Commands Textdraw,

Try This :-

New Variable,
Код:
new Text:CForSCMDs;
Forward and Public Callback for CForSCMDs Textdraw Hide For Player,
pawn Код:
forward HCForSCMDs(playerid);
public HCForSCMDs(playerid)
{
    TextDrawHideForPlayer(playerid, CForSCMDs);
}
On OnPlayerCommandPerformed Callback,
pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    if(!success)
    {
        CForSCMDs = TextDrawCreate(490.000000, 0.000000, "Type /c for Server Commands.");
        return SetTimerEx("HCForSCMDs", 3000, 0, "d", playerid);
    }
    return 1;
}
Reply
#7

Quote:
Originally Posted by SAMProductions
Посмотреть сообщение
C for Server Commands Textdraw,

Try This :-

New Variable,
Код:
new Text:CForSCMDs;
Forward and Public Callback for CForSCMDs Textdraw Hide For Player,
pawn Код:
forward HCForSCMDs(playerid);
public HCForSCMDs(playerid)
{
    TextDrawHideForPlayer(playerid, CForSCMDs);
}
On OnPlayerCommandPerformed Callback,
pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    if(!success)
    {
        CForSCMDs = TextDrawCreate(490.000000, 0.000000, "Type /c for Server Commands.");
        return SetTimerEx("HCForSCMDs", 3000, 0, "d", playerid);
    }
    return 1;
}
Thanks brother I will test this later. And I also want to know if it is possible also to show TextDraw if I do /unmute like the one you made? (example below)

So let say if I do /unmute then hit enter it should show in TextDraw "/unmute <playerid/name>" and it will disappear after 3 seconds.

if this is possible then I will do the rest of the commands


Код:
COMMAND:unmute(playerid,params[])
{
	if(PlayerInfo[playerid][AdminLevel] >= LEVEL_unmute)
	{
 		new player;
		if(sscanf(params, "r", player))
		{
			SendClientMessage(playerid,RED,"Usage: /unmute <playerid/name>");
		    return 1;
		}

		if(PlayerInfo[player][Muted] == false)
		{
			SendClientMessage(playerid,RED,"This player is not muted");
		    return 1;
		}
		if(IsPlayerConnected(player) && player != INVALID_PLAYER_ID && player != playerid)
		{
			PlayerInfo[player][Muted] = false;
			KillTimer(PlayerInfo[player][MuteTimer]);
			SendClientMessage(player, GREEN, "You have been unmuted!");
			SendClientMessage(playerid, RED, "Player has been unmuted.");
		}
		else
		{
            SendClientMessage(playerid, RED, "Player isnґt connected or invalid!");
		}
	}
	else
	{
		SendClientMessage(playerid, RED, NO_PERM);
	}
	return 1;
}
Reply
#8

Quote:
Originally Posted by kbalor
Посмотреть сообщение
Thanks brother I will test this later. And I also want to know if it is possible also to show TextDraw if I do /unmute like the one you made? (example below)

So let say if I do /unmute then hit enter it should show in TextDraw "/unmute <playerid/name>" and it will disappear after 3 seconds.


Код:
COMMAND:unmute(playerid,params[])
{
	if(PlayerInfo[playerid][AdminLevel] >= LEVEL_unmute)
	{
 		new player;
		if(sscanf(params, "r", player))
		{
			SendClientMessage(playerid,RED,"Usage: /unmute <playerid/name>");
		    return 1;
		}

		if(PlayerInfo[player][Muted] == false)
		{
			SendClientMessage(playerid,RED,"This player is not muted");
		    return 1;
		}
		if(IsPlayerConnected(player) && player != INVALID_PLAYER_ID && player != playerid)
		{
			PlayerInfo[player][Muted] = false;
			KillTimer(PlayerInfo[player][MuteTimer]);
			SendClientMessage(player, GREEN, "You have been unmuted!");
			SendClientMessage(playerid, RED, "Player has been unmuted.");
		}
		else
		{
            SendClientMessage(playerid, RED, "Player isnґt connected or invalid!");
		}
	}
	else
	{
		SendClientMessage(playerid, RED, NO_PERM);
	}
	return 1;
}
Try This :-

New Variable,
Код:
new Text:UnMuteTCMDs;
Forward and Public Callback for UnMuteTCMDs Textdraw Hide For Player,
Код:
forward HUnMuteTCMDs(playerid);
public HUnMuteTCMDs(playerid)
{
    TextDrawHideForPlayer(playerid, UnMuteTCMDs);
}
Commands Code,
pawn Код:
COMMAND:unmute(playerid,params[])
{
    if(PlayerInfo[playerid][AdminLevel] >= LEVEL_unmute)
    {
        new player;
        if(sscanf(params, "r", player))
        {
            SendClientMessage(playerid,RED,"Usage: /unmute <playerid/part of nick>");
            return 1;
        }

        if(PlayerInfo[player][Muted] == false)
        {
            SendClientMessage(playerid,RED,"This player is not muted");
            return 1;
        }
        if(IsPlayerConnected(player) && player != INVALID_PLAYER_ID && player != playerid)
        {
            PlayerInfo[player][Muted] = false;
            KillTimer(PlayerInfo[player][MuteTimer]);
            SendClientMessage(player, GREEN, "You have been unmuted!");
            SendClientMessage(playerid, RED, "Player has been unmuted.");
            UnMuteTCMDs = TextDrawCreate(190.0, 190.0, "Unmuted !");
            return SetTimerEx("UnMuteTCMDs", 3000, 0, "d", playerid);
        }
        else
        {
            SendClientMessage(playerid, RED, "Player isnґt connected or invalid!");
        }
    }
    else
    {
        SendClientMessage(playerid, RED, NO_PERM);
    }
    return 1;
}
Reply
#9

Quote:
Originally Posted by SAMProductions
Посмотреть сообщение
Try This :-

New Variable,
Код:
new Text:UnMuteTCMDs;
Forward and Public Callback for UnMuteTCMDs Textdraw Hide For Player,
Код:
forward HUnMuteTCMDs(playerid);
public HUnMuteTCMDs(playerid)
{
    TextDrawHideForPlayer(playerid, UnMuteTCMDs);
}
Commands Code,
pawn Код:
COMMAND:unmute(playerid,params[])
{
    if(PlayerInfo[playerid][AdminLevel] >= LEVEL_unmute)
    {
        new player;
        if(sscanf(params, "r", player))
        {
            SendClientMessage(playerid,RED,"Usage: /unmute <playerid/part of nick>");
            return 1;
        }

        if(PlayerInfo[player][Muted] == false)
        {
            SendClientMessage(playerid,RED,"This player is not muted");
            return 1;
        }
        if(IsPlayerConnected(player) && player != INVALID_PLAYER_ID && player != playerid)
        {
            PlayerInfo[player][Muted] = false;
            KillTimer(PlayerInfo[player][MuteTimer]);
            SendClientMessage(player, GREEN, "You have been unmuted!");
            SendClientMessage(playerid, RED, "Player has been unmuted.");
            UnMuteTCMDs = TextDrawCreate(190.0, 190.0, "Unmuted !");
            return SetTimerEx("UnMuteTCMDs", 3000, 0, "d", playerid);
        }
        else
        {
            SendClientMessage(playerid, RED, "Player isnґt connected or invalid!");
        }
    }
    else
    {
        SendClientMessage(playerid, RED, NO_PERM);
    }
    return 1;
}
Dude I want to know where did you make changed?

Edit: I found it. But that's not what I mean.

I want to change this "SendClientMessage(playerid,RED,"Usage: /unmute <playerid/part of nick>");" to TextDraw just what I have mentioned earlier.


@Zex Tan - If you read my first post I want to make GameTextForPlayer to be smaller but it doesn't have an style to make it smaller. So I have no choice but to make it as a TextDraw. And I tried but it covers the center of the screen. I hope you get it.
Reply
#10

For that:
pawn Код:
if(sscanf(params, "r", player))
        {
            GameTextForPlayer(playerid, "/unmute <playerid/name", 3000, 3);
            return 1;
        }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)