Error message on a textdraw?
#1

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?
Reply
#2

Zamaroth
Reply
#3

I have the textdraw ready using that

The problem is showing it for the syntax message!
Reply
#4

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);
Reply
#5

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;
}
Reply
#6

So how do I make it show the syntax message?

Like through the textdraw!
Reply
#7

You looked my last post?

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

Код:
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.
Reply
#9

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");
Reply
#10

I done it, thanks!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)