60 Second Textdraw countdown. - 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: 60 Second Textdraw countdown. (
/showthread.php?tid=91330)
60 Second Textdraw countdown. -
[mad]MLK - 14.08.2009
Hey there basicaly i have mapped out a go kart track and i want it so that is displays a 60 second countdown with textdraw at the bottom of the screen and also may i ask how i would get "playerid" to work with my timer as it wont work with playerid this is my timer code:
Код:
// this is the forward/ect part
forward karttimer();
// This is the public part
public karttimer()
{
new pname[24], string[128];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "%s Has failed to compleat the kart track within 1 minute.", pname);
SendClientMessageToAll(0x33AA33AA, string);
}
Re: 60 Second Textdraw countdown. -
Weirdosport - 14.08.2009
To get the playerid you need SetTimerEx instead of SetTimer.
Example:
pawn Код:
// this is the forward/ect part
forward karttimer(playerid);
//this goes in your code
SetTimerEx("karttimer", 60000, 0, "i", playerid);
// This is the public part
public karttimer(playerid)
{
new pname[24], string[128];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "%s Has failed to compleat the kart track within 1 minute.", pname);
SendClientMessageToAll(0x33AA33AA, string);
}