SA-MP Forums Archive
Putting Textdraws on checkpoints - 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: Putting Textdraws on checkpoints (/showthread.php?tid=496050)



Putting Textdraws on checkpoints - ShaneOvSina - 20.02.2014

Could someone give me an example of how to script a textdraw on a checkpoint?
So when i enter it the textdraw will show up


Re: Putting Textdraws on checkpoints - Pottus - 20.02.2014

pawn Код:
#include <a_samp>

// Textdraw
new Text:mytd;

// Create Textdraw
public OnFilterScriptInit()
{
    mytd = TextDrawCreate(320, 320, "Hello World!");
    return 1;
}

// Entered any checkpoint
public OnPlayerEnterCheckpoint(playerid)
{
    ShowDrawTimed(playerid, mytd, 3000);
    return 1;
}

// Show a textdraw for the time delay
stock ShowDrawTimed(playerid, Text:td, time)
{
    TextDrawShowForPlayer(playerid, td);
    return SetTimerEx("DelayTDHide", time, false, "ii", playerid, _:td);
}

// Hide a textdraw after the time delay
forward DelayTDHide(playerid, Text:td);
public DelayTDHide(playerid, Text:td)
{
    TextDrawHideForPlayer(playerid, td);
    return 1;
}