SA-MP Forums Archive
Error message on a textdraw? - 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: Error message on a textdraw? (/showthread.php?tid=336767)



Error message on a textdraw? - BleverCastard - 23.04.2012

Hello,

I wanted to make a textdraw almost under the money bar (about an inch below) and show a syntax message..

and I dunno how, can someone help me please?


Re: Error message on a textdraw? - ViniBorn - 23.04.2012

Zamaroth


Re: Error message on a textdraw? - BleverCastard - 23.04.2012

I have the textdraw ready using that

The problem is showing it for the syntax message!


Re: Error message on a textdraw? - BleverCastard - 23.04.2012

Sorry for double post,
Ok I came up with this stock
Код:
stock ShowErrorMessage( playerid, string[] )
{
	 if( PlayerInfo[playerid][LoggedIn] == 0 ) return 1;
	 PlayerTextDrawShow( playerid, ErrorMessage[playerid] );

	 new strings[128];
	 format( strings, 128, "Error: %s", string );
	 PlayerTextDrawSetString( playerid, ErrorMessage[playerid], strings );

	 SetTimerEx("HideErrorMessage", 3850, false, "d", playerid );
	 PlayerPlaySound(playerid, 1085, 0, 0, 0 );

	return 1;
}
How would I still use the "syntax" message?

EDIT: and the timer?
Код:
SetTimerEx("HideErrorMessage", 3850, false, "d", 1337);



Re: Error message on a textdraw? - ViniBorn - 23.04.2012

pawn Код:
stock ShowErrorMessage( playerid, string[] )
{
    if( PlayerInfo[playerid][LoggedIn] == 0 ) return 1;

    PlayerTextDrawSetString( playerid, ErrorMessage[playerid], string);
    PlayerTextDrawShow( playerid, ErrorMessage[playerid] );

    SetTimerEx("HideErrorMessage", 3850, false, "dd", playerid,ErrorMessage[playerid] );
    PlayerPlaySound(playerid, 1085, 0, 0, 0 );

    return 1;
}



Re: Error message on a textdraw? - BleverCastard - 23.04.2012

So how do I make it show the syntax message?

Like through the textdraw!


Re: Error message on a textdraw? - ViniBorn - 23.04.2012

You looked my last post?

Example:
pawn Код:
ShowErrorMessage( playerid, "You aren't an admin." );



Re: Error message on a textdraw? - BleverCastard - 23.04.2012

Код:
C:\Users\Elmo\Desktop\SAMP Project\gamemodes\Freeroam.pwn(722) : error 017: undefined symbol "ErrorMessage"
C:\Users\Elmo\Desktop\SAMP Project\gamemodes\Freeroam.pwn(722) : warning 215: expression has no effect
C:\Users\Elmo\Desktop\SAMP Project\gamemodes\Freeroam.pwn(722) : error 001: expected token: ";", but found "]"
C:\Users\Elmo\Desktop\SAMP Project\gamemodes\Freeroam.pwn(722) : error 029: invalid expression, assumed zero
C:\Users\Elmo\Desktop\SAMP Project\gamemodes\Freeroam.pwn(722) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.



Re: Error message on a textdraw? - ViniBorn - 23.04.2012

In ErrorMessage [playerid], put the id of your TextDraw ...
If he hasn't been created, use CreatePlayerTextDraw

Example:
pawn Код:
new PlayerText:ErrorMessage[MAX_PLAYERS];

for(new i; i != GetMaxPlayers(); i++)
     ErrorMessage[i] = CreatePlayerTextDraw(i, 320.0, 240.0, "Error Message");



Re: Error message on a textdraw? - BleverCastard - 23.04.2012

I done it, thanks!