About GameTextForPlayer
#1

I have a problem with GameTextForPlayer, for example when I type /time it show GameTextForPlayer "Nemate sat", what means "You don't have a watch", but it doesn't destroys, this problem happens with all gametextforplayer in script. I don't now how to solve it.


Reply
#2

PHP код:
GameTextForPlayer(playerid, const string[], timestyle
Are you sure are you using it in the right format ?

Example:

PHP код:
new string[64];
format(stringsizeof(string), "~r~You don't have a watch");
GameTextForPlayer(playeridstring50001); 
This will display the You don't have a watch line for 5 seconds.
Reply
#3

This is my code..
Код:
format(string, sizeof(string), "~r~Nemate sat");
The command
Код:
	if(strcmp(cmd, "/time", true) == 0 || strcmp(cmd, "/vrijeme", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
		{
		    new mtext[20];
			new year, month,day;
			getdate(year, month, day);
			if(month == 1) { mtext = "Januar"; }
			else if(month == 2) { mtext = "Februar"; }
			else if(month == 3) { mtext = "Mart"; }
			else if(month == 4) { mtext = "April"; }
			else if(month == 5) { mtext = "Maj"; }
			else if(month == 6) { mtext = "Jun"; }
			else if(month == 7) { mtext = "Jul"; }
			else if(month == 8) { mtext = "Avgust"; }
			else if(month == 9) { mtext = "Septembar"; }
			else if(month == 10) { mtext = "Oktobar"; }
			else if(month == 11) { mtext = "Novembar"; }
			else if(month == 12) { mtext = "Decembar"; }
		    new hour,minuite,second;
			gettime(hour,minuite,second);
			FixHour(hour);
			hour = shifthour;
			if (minuite < 10)
			{
				if (PlayerInfo[playerid][pJailTime] > 0)
				{
				    if(PlayerInfo[playerid][pWatch] == 1)
				    {
						format(string, sizeof(string), "~y~%d %s~n~~g~|~w~%d:0%d~g~|~n~~w~Jail Vremena ostalo: %d sec", day, mtext, hour, minuite, PlayerInfo[playerid][pJailTime]-10);
					}
					else
					{
					    format(string, sizeof(string), "~w~Zatvorska kazna: %d sec", PlayerInfo[playerid][pJailTime]-10);
					}
				}
				else
				{
				    if(PlayerInfo[playerid][pWatch] == 1)
				    {
						format(string, sizeof(string), "~y~%d %s~n~~g~|~w~%d:0%d~g~|", day, mtext, hour, minuite);
					}
					else
					{
					    format(string, sizeof(string), "~r~Nemate sat");
					}
				}
			}
			else
			{
				if (PlayerInfo[playerid][pJailTime] > 0)
				{
				    if(PlayerInfo[playerid][pWatch] == 1)
				    {
						format(string, sizeof(string), "~y~%d %s~n~~g~|~w~%d:%d~g~|~n~~w~Zatvorska kazna: %d sec", day, mtext, hour, minuite, PlayerInfo[playerid][pJailTime]-10);
					}
					else
					{
					    format(string, sizeof(string), "~w~Zatvorska kazna: %d sec", PlayerInfo[playerid][pJailTime]-10);
					}
				}
				else
				{
				    if(PlayerInfo[playerid][pWatch] == 1)
				    {
						format(string, sizeof(string), "~y~%d %s~n~~g~|~w~%d:%d~g~|", day, mtext, hour, minuite);
					}
					else
					{
					    format(string, sizeof(string), "~r~Nemate sat");
					}
				}
			}
			GameTextForPlayer(playerid, string, 5000, 2);
			GetPlayerName(playerid, sendername, sizeof(sendername));
			if(PlayerInfo[playerid][pWatch] == 1)
			{
			    if(PlayerInfo[playerid][pSex] == 1) { format(string, sizeof(string), "* %s podize ruku i gleda koliko je sati.", sendername); }
			    else { format(string, sizeof(string), "* %s podize ruku i gleda koliko je sati.", sendername); }
				ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
			}
			//ApplyAnimation(playerid,"COP_AMBIENT","Coplook_watch",4.1,0,0,0,0,0);
		}
		return 1;
	}
Reply
#4

Well isn't game text style 2 supposed to be bugged and cause problems ? Or is that fixed now ? (Doesn't seem like it)
Reply
#5

Yes it is bugged, I replaced every game style 2 to 1 and it works, thanks anyway
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)