SA-MP Forums Archive
textdraw problem - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: textdraw problem (/showthread.php?tid=204672)



textdraw problem - [SU]Fnugski - 30.12.2010

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



Re: textdraw problem - Toreno - 30.12.2010

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.


Re: textdraw problem - [L3th4l] - 30.12.2010

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



Re: textdraw problem - [SU]Fnugski - 30.12.2010

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


Re: textdraw problem - [SU]Fnugski - 30.12.2010

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


Re: textdraw problem - [SU]Fnugski - 30.12.2010

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


Re: textdraw problem - _rAped - 30.12.2010

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()


Re: textdraw problem - [SU]Fnugski - 30.12.2010

nah just for 10 secs or something


Re: textdraw problem - [SU]Fnugski - 30.12.2010

nah i want a textdraw


Re: textdraw problem - MadeMan - 30.12.2010

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