textdraw problem
#1

Hello forums


i got this code but it wont show a textdraw when i write ex /test (its not a command in my script)

pawn Код:
public OnPlayerCommandPerformed(playerid,cmdtext[],success)
{
    new Text:invalidText;
    invalidText = TextDrawCreate(240.0,580.0,"~r~Invalid Command.");
    TextDrawShowForPlayer(playerid,invalidText);
    return 1;
}
Reply
#2

Give more.. information, and you should change:
pawn Код:
public OnPlayerCommandPerformed(playerid,cmdtext[],success)
{
    new Text:invalidText[MAX_PLAYERS];
    invalidText[playerid] = TextDrawCreate(240.0,580.0,"~r~Invalid Command.");
    TextDrawShowForPlayer(playerid, invalidText[playerid]);
    return 1;
}
That should work if each player does this command, it will only show for himself.
Reply
#3

pawn Код:
public OnPlayerCommandPerformed(playerid,cmdtext[],success)
{
    if(!success)
    {
        new Text:invalidText[MAX_PLAYERS];
        invalidText[playerid] = TextDrawCreate(240.0,580.0,"~r~Invalid Command.");
        TextDrawShowForPlayer(playerid, invalidText[playerid]);
        return 1;
    }
}
Reply
#4

Quote:
Originally Posted by [L3th4l]
Посмотреть сообщение
pawn Код:
public OnPlayerCommandPerformed(playerid,cmdtext[],success)
{
    if(!success)
    {
        new Text:invalidText[MAX_PLAYERS];
        invalidText[playerid] = TextDrawCreate(240.0,580.0,"~r~Invalid Command.");
        TextDrawShowForPlayer(playerid, invalidText[playerid]);
        return 1;
    }
}
this still dont work. It shows nothing
Reply
#5

Quote:
Originally Posted by EliranPesahov
Посмотреть сообщение
Give more.. information, and you should change:
pawn Код:
public OnPlayerCommandPerformed(playerid,cmdtext[],success)
{
    new Text:invalidText[MAX_PLAYERS];
    invalidText[playerid] = TextDrawCreate(240.0,580.0,"~r~Invalid Command.");
    TextDrawShowForPlayer(playerid, invalidText[playerid]);
    return 1;
}
That should work if each player does this command, it will only show for himself.
this dosent work eather
Reply
#6

i want it so if you type a invalid command or a non-existing cmd then it shows the textdraw :O but it wont work
Reply
#7

Quote:
Originally Posted by [SU]Fnugski
Посмотреть сообщение
i want it so if you type a invalid command or a non-existing cmd then it shows the textdraw :O but it wont work
How long is this textdraw going to be displayed, forever? You can use GameTextForPlayer()
Reply
#8

nah just for 10 secs or something
Reply
#9

nah i want a textdraw
Reply
#10

Change coords

pawn Код:
public OnPlayerCommandPerformed(playerid,cmdtext[],success)
{
    new Text:invalidText;
    invalidText = TextDrawCreate(240.0,280.0,"~r~Invalid Command.");
    TextDrawShowForPlayer(playerid,invalidText);
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)