GameText -
DerickClark - 31.07.2015
How to make a timer with gametext, like 30 sec count down
Then when 30 is up a code should go there
AW: GameText -
Kaliber - 31.07.2015
It's better to use a TextDraw
Like this:
PHP код:
//In the script:
const time = 10; //This would be 10sec
TextDrawShowForPlayer(playerid,txtid); //The countdown starts
@countdown(playerid,time);
//at the end of the script:
@countdown(playerid,x);@countdown(playerid,x) {
if(--x == 0)
{
TextDrawHideForPlayer(playerid,txtid); //Here the countdown ends!
return 1;
}
new str[8];
valstr(str,x);
TextDrawSetString(txtid, str);
TextDrawShowForPlayer(playerid, txtid);
return SetTimerEx(!"@countdown",999,0,!"ii",playerid,x);
}
Re: GameText -
DerickClark - 31.07.2015
i know, but there anyway using gametext
AW: GameText -
Kaliber - 31.07.2015
Then do the same with gametexts:
PHP код:
//In the script:
const time = 10; //This would be 10sec
GameTextForPlayer(playerid,!"10",1000,5);
@countdown(playerid,time);
//at the end of the script:
@countdown(playerid,x);@countdown(playerid,x) {
if(--x == 0) return GameTextForPlayer(playerid,!"Los Los Los!",1000,5);
new str[8];
valstr(str,x);
GameTextForPlayer(playerid,str,1000,5);
return SetTimerEx(!"@countdown",999,0,!"ii",playerid,x);
}
Re: GameText -
DerickClark - 31.07.2015
i don't get that function
pawn Код:
"GameTextForPlayer"
(2619) : error 025: function heading differs from prototype
(2619) : error 025: function heading differs from prototype
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
3 Errors.
is it like this one?
pawn Код:
if(GetPlayerTeam(playerid) == 1)
{
if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)) == 0)
{
if(gMissionInt[playerid] == 1)
{
GameTextForPlayer(playerid, "Reattach your trailer!", 1500, 4);
}
return 1;
}
}
if(IsPlayerInAnyVehicle(playerid) == 0)
{
if(gMissionInt[playerid] == 1)
{
GameTextForPlayer(playerid, "Get back in you're vehicle!", 1500, 4);
}
}
Re: GameText -
DerickClark - 31.07.2015
anyone? i'm trying and trying to get 30 sec count down then failed mission.
i think this the code.
pawn Код:
forward TruckCheck(playerid);
public TruckCheck(playerid)
{
if (IsPlayerInAnyVehicle(playerid) == 0)
{
GameTextForPlayer(playerid, "Get back in your TRUCK!", 1000, 5);
return 1;
}
else if (IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)) == 0)
{
GameTextForPlayer(playerid, "Reconnect your trailer!", 1000, 5);
return 1;
}
return 0;
}
Re: GameText -
SpikeSpigel - 01.08.2015
Kid, if you don't know anything about scripting at all don't make a server. Modify 1000 with the amount of miliseconds you want
Re: GameText -
DerickClark - 01.08.2015
I'm not a kid. i don't how they don't display in Gametext, last time i tired, didnt show up with the numbers. im seeing if someone know how to do it in way that works.
AW: GameText -
Kaliber - 01.08.2015
I can help you with TeamViewer if you want
![Smiley](images/smilies/smile.png)
Send me your data with PM