31.07.2015, 15:52
How to make a timer with gametext, like 30 sec count down
Then when 30 is up a code should go there
Then when 30 is up a code should go there
//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);
}
//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);
}
"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.
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);
}
}
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;
}