SA-MP Forums Archive
HELP !! - 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: HELP !! (/showthread.php?tid=347390)



HELP !! - teomakedonija - 01.06.2012

How to create this Textdraw http://zaslike.com/files/8ajbmy95y9cotb2xovr.png for level up 1 minute 1+ EXP 650 EXP for level 2 how to create to switching EXP and Command?


Re: HELP !! - FalconX - 01.06.2012

Quote:
Originally Posted by teomakedonija
Посмотреть сообщение
How to create this Textdraw http://zaslike.com/files/8ajbmy95y9cotb2xovr.png for level up 1 minute 1+ EXP 650 EXP for level 2 how to create to switching EXP and Command?
pawn Код:
// at the top
new F_IsTextDrawShowing[MAX_PLAYERS];//top

new Text:YOURTEXTDRAW; //top

YOURTEXTDRAW = TextDrawCreate(..); // gamemode init

TextDrawHideForAll(YOURTEXTDRAW); // On Gamemode exit
TextDrawDestroy(YOURTEXTDRAW); // on gamemode exit


F_IsTextDrawShowing[playerid] = 0; // OnPlayerConnect

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/yourcommand"))
    {
        if(F_IsTextDrawShowing[playerid] == 1)
        {
            F_IsTextDrawShowing[playerid] = 0;
            TextDrawHideForPlayer(playerid, YOURTEXTDRAW);
        }
        else
        {
            F_IsTextDrawShowing[playerid] = 1;
            TextDrawShowForPlayer(playerid, YOURTEXTDRAW);
        }
    }
    return 1;
}

//if you are using ZCMD:--

CMD:yourcommand( playerid, params[ ] )
{
    if(F_IsTextDrawShowing[playerid] == 1)
    {
        F_IsTextDrawShowing[playerid] = 0;
        TextDrawHideForPlayer(playerid, YOURTEXTDRAW);
    }
    else
    {
        F_IsTextDrawShowing[playerid] = 1;
        TextDrawShowForPlayer(playerid, YOURTEXTDRAW);
    }
    return 1;
}
This is an example of hiding and showing your textdraw with the command.
-FalconX