SA-MP Forums Archive
About GameTextForPlayer - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: About GameTextForPlayer (/showthread.php?tid=371136)



About GameTextForPlayer - Vegas. - 22.08.2012

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.





Re: About GameTextForPlayer - =WoR=G4M3Ov3r - 22.08.2012

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.


Respuesta: About GameTextForPlayer - Vegas. - 22.08.2012

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;
	}



Re: About GameTextForPlayer - grand.Theft.Otto - 22.08.2012

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


Respuesta: About GameTextForPlayer - Vegas. - 22.08.2012

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